mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	Only enable analytics and dropbox on non-LOCAL_SERVER
(imported from commit 1ba877550b3afde51bec6f344762ea998800c5b6)
This commit is contained in:
		@@ -20,7 +20,8 @@
 | 
				
			|||||||
    <![endif]-->
 | 
					    <![endif]-->
 | 
				
			||||||
    <link href="/static/favicon.ico?v=2" rel="shortcut icon">
 | 
					    <link href="/static/favicon.ico?v=2" rel="shortcut icon">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <script type="text/javascript">var dropboxAppKey = "xxxxxxxxxxxxxxx";</script>
 | 
					    {% if not local_server %}
 | 
				
			||||||
 | 
					    <script type="text/javascript">var dropboxAppKey = "{{ dropboxAppKey }}";</script>
 | 
				
			||||||
    {# mixpanel #}
 | 
					    {# mixpanel #}
 | 
				
			||||||
    <script type="text/javascript">
 | 
					    <script type="text/javascript">
 | 
				
			||||||
(function(e,b){if(!b.__SV){var a,f,i,g;window.mixpanel=b;a=e.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"===e.location.protocol?"https:":"http:")+'//cdn.mxpnl.com/libs/mixpanel-2.2.min.js';f=e.getElementsByTagName("script")[0];f.parentNode.insertBefore(a,f);b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==
 | 
					(function(e,b){if(!b.__SV){var a,f,i,g;window.mixpanel=b;a=e.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"===e.location.protocol?"https:":"http:")+'//cdn.mxpnl.com/libs/mixpanel-2.2.min.js';f=e.getElementsByTagName("script")[0];f.parentNode.insertBefore(a,f);b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==
 | 
				
			||||||
@@ -31,6 +32,7 @@ b._i.push([a,e,d])};b.__SV=1.2}})(document,window.mixpanel||[]);
 | 
				
			|||||||
{# mixpanel.init to get additional debugging information from it. #}
 | 
					{# mixpanel.init to get additional debugging information from it. #}
 | 
				
			||||||
mixpanel.init("{{ mixpanel_token }}", {track_pageview: {{ enable_metrics }}});
 | 
					mixpanel.init("{{ mixpanel_token }}", {track_pageview: {{ enable_metrics }}});
 | 
				
			||||||
    </script>
 | 
					    </script>
 | 
				
			||||||
 | 
					    {% endif %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    {# We need to import jQuery before Bootstrap #}
 | 
					    {# We need to import jQuery before Bootstrap #}
 | 
				
			||||||
    {% compressed_css 'common' %}
 | 
					    {% compressed_css 'common' %}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,4 +13,5 @@ def add_metrics(request):
 | 
				
			|||||||
    return {
 | 
					    return {
 | 
				
			||||||
        'mixpanel_token': settings.MIXPANEL_TOKEN,
 | 
					        'mixpanel_token': settings.MIXPANEL_TOKEN,
 | 
				
			||||||
        'enable_metrics': ujson.dumps(settings.DEPLOYED),
 | 
					        'enable_metrics': ujson.dumps(settings.DEPLOYED),
 | 
				
			||||||
 | 
					        'dropboxAppKey': settings.DROPBOX_APP_KEY
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -141,3 +141,6 @@ EMAIL_GATEWAY_IMAP_FOLDER = "INBOX"
 | 
				
			|||||||
# The %s will be replaced with a unique token, and the resulting email
 | 
					# The %s will be replaced with a unique token, and the resulting email
 | 
				
			||||||
# must be delivered to the Inbox of the EMAIL_GATEWAY_LOGIN account above
 | 
					# must be delivered to the Inbox of the EMAIL_GATEWAY_LOGIN account above
 | 
				
			||||||
EMAIL_GATEWAY_PATTERN = "%s@streams.zulip.com"
 | 
					EMAIL_GATEWAY_PATTERN = "%s@streams.zulip.com"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					DROPBOX_APP_KEY = "xxxxxxxxxxxxxxx"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -237,6 +237,7 @@ DEFAULT_SETTINGS = {'TWITTER_CONSUMER_KEY': '',
 | 
				
			|||||||
                    'MIXPANEL_TOKEN': '',
 | 
					                    'MIXPANEL_TOKEN': '',
 | 
				
			||||||
                    'MAILCHIMP_API_KEY': '',
 | 
					                    'MAILCHIMP_API_KEY': '',
 | 
				
			||||||
                    'LOCAL_UPLOADS_DIR': None,
 | 
					                    'LOCAL_UPLOADS_DIR': None,
 | 
				
			||||||
 | 
					                    'DROPBOX_APP_KEY': ''
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
for setting_name, setting_val in DEFAULT_SETTINGS.iteritems():
 | 
					for setting_name, setting_val in DEFAULT_SETTINGS.iteritems():
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user