mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	Add dummy secrets for use in development.
We also reference these secrets from zproject/local_settings.py, keying off IS_DEPLOYED. (imported from commit eb83310e219616ed1c6c253f0d6893134bbe3517)
This commit is contained in:
		@@ -6,11 +6,6 @@ from base64 import b64decode
 | 
			
		||||
config_file = ConfigParser.RawConfigParser()
 | 
			
		||||
config_file.read("/etc/zulip/zulip.conf")
 | 
			
		||||
 | 
			
		||||
secrets_file = ConfigParser.RawConfigParser()
 | 
			
		||||
secrets_file.read("/etc/zulip/zulip-secrets.conf")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
getsecret = lambda x: secrets_file.get('secrets', x)
 | 
			
		||||
# Whether we're running in a production environment. Note that DEPLOYED does
 | 
			
		||||
# **not** mean hosted by us; customer sites are DEPLOYED and ENTERPRISE
 | 
			
		||||
# and as such should not for example assume they are the main Zulip site.
 | 
			
		||||
@@ -20,6 +15,14 @@ TESTING_DEPLOYED = DEPLOYED and config_file.get('machine', 'deploy_type') == 'te
 | 
			
		||||
 | 
			
		||||
ENTERPRISE = DEPLOYED and config_file.get('machine', 'deploy_type') == 'enterprise'
 | 
			
		||||
 | 
			
		||||
secrets_file = ConfigParser.RawConfigParser()
 | 
			
		||||
if DEPLOYED:
 | 
			
		||||
    secrets_file.read("/etc/zulip/zulip-secrets.conf")
 | 
			
		||||
else:
 | 
			
		||||
    secrets_file.read("zproject/dev-secrets.conf")
 | 
			
		||||
 | 
			
		||||
getsecret = lambda x: secrets_file.get('secrets', x)
 | 
			
		||||
 | 
			
		||||
# Make this unique, and don't share it with anybody.
 | 
			
		||||
SECRET_KEY = getsecret("secret_key") if DEPLOYED else "foobar"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user