mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	apple_auth: Change where private key is stored.
Changes to a better name apple-auth-key.p8 and removes the extra directory apple.
This commit is contained in:
		@@ -588,12 +588,12 @@ domain for your server).
 | 
			
		||||
1. Create a [Sign in with Apple private key][apple-create-private-key].
 | 
			
		||||
 | 
			
		||||
1. Store the resulting private key at
 | 
			
		||||
   `/etc/zulip/apple/zulip-private-key.key`.  Be sure to set
 | 
			
		||||
   `/etc/zulip/apple-auth-key.p8`.  Be sure to set
 | 
			
		||||
   permissions correctly:
 | 
			
		||||
 | 
			
		||||
   ```
 | 
			
		||||
   chown -R zulip:zulip /etc/zulip/apple/
 | 
			
		||||
   chmod 640 /etc/zulip/apple/zulip-private-key.key
 | 
			
		||||
   chown zulip:zulip /etc/zulip/apple-auth-key.p8
 | 
			
		||||
   chmod 640 /etc/zulip/apple-auth-key.p8
 | 
			
		||||
   ```
 | 
			
		||||
 | 
			
		||||
1. Configure Apple authentication in `/etc/zulip/settings.py`:
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@ properly configured. Please check the following:
 | 
			
		||||
  `SOCIAL_AUTH_APPLE_BUNDLE_ID`, `SOCIAL_AUTH_APPLE_TEAM`,
 | 
			
		||||
  `SOCIAL_AUTH_APPLE_KEY` and `SOCIAL_AUTH_APPLE_TEAM` in `{{
 | 
			
		||||
  settings_path }}` and stored the private key provided by Apple at
 | 
			
		||||
  `/etc/zulip/apple/zulip-private-key.key` on the Zulip server, with
 | 
			
		||||
  `/etc/zulip/apple-auth-key.p8` on the Zulip server, with
 | 
			
		||||
  proper permissions set.
 | 
			
		||||
 | 
			
		||||
* Navigate back to the login page and attempt the "Sign in with Apple"
 | 
			
		||||
 
 | 
			
		||||
@@ -1032,7 +1032,7 @@ SOCIAL_AUTH_APPLE_CLIENT = SOCIAL_AUTH_APPLE_SERVICES_ID
 | 
			
		||||
SOCIAL_AUTH_APPLE_AUDIENCE = [id for id in [SOCIAL_AUTH_APPLE_CLIENT, SOCIAL_AUTH_APPLE_BUNDLE_ID] if id is not None]
 | 
			
		||||
 | 
			
		||||
if PRODUCTION:
 | 
			
		||||
    SOCIAL_AUTH_APPLE_SECRET = get_from_file_if_exists("/etc/zulip/apple/zulip-private-key.key")
 | 
			
		||||
    SOCIAL_AUTH_APPLE_SECRET = get_from_file_if_exists("/etc/zulip/apple-auth-key.p8")
 | 
			
		||||
else:
 | 
			
		||||
    SOCIAL_AUTH_APPLE_SECRET = get_from_file_if_exists("zproject/dev_apple.key")
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user