mirror of
				https://github.com/zulip/docker-zulip.git
				synced 2025-10-31 20:13:37 +00:00 
			
		
		
		
	This should fix the problems with the automatic user creation
This commit is contained in:
		
							
								
								
									
										12
									
								
								includes/zulip-puppet/files/setupZulipUser.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								includes/zulip-puppet/files/setupZulipUser.sh
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| /home/zulip/deployments/current/manage.py create_user --this-user-has-accepted-the-tos "$ZULIP_USER_EMAIL" "$ZULIP_USER_FULLNAME" --domain "$ZULIP_USER_DOMAIN" || : | ||||
| /home/zulip/deployments/current/manage.py knight "$ZULIP_USER_EMAIL" -f || : | ||||
| /home/zulip/deployments/current/manage.py shell <<EOF | ||||
| from zerver.decorator import get_user_profile_by_email | ||||
| User = get_user_profile_by_email('atrost@zerbytes.net') | ||||
| User.set_password('$ZULIP_USER_PASSWORD') | ||||
| User.save() | ||||
| EOF | ||||
| rm -rf /etc/supervisor/conf.d/zulip_postsetup.conf | ||||
| exit 0 | ||||
| @@ -1,5 +1,6 @@ | ||||
| [program:zulip-postsetup] | ||||
| command = bash -c "/usr/local/bin/zulipCreateUser.sh" | ||||
| [program:zulip-postsetup-create_user] | ||||
| command = bash -c "sleep 8;/opt/setupZulipUser.sh" | ||||
| user=zulip | ||||
| stdout_events_enabled=true | ||||
| stderr_events_enabled=true | ||||
| autorestart = false | ||||
|   | ||||
| @@ -1,16 +0,0 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| sleep 5 | ||||
| /home/zulip/deployments/current/manage.py create_user --this-user-has-accepted-the-tos "$ZULIP_USER_EMAIL" "$ZULIP_USER_FULLNAME" --domain "$ZULIP_USER_DOMAIN" || : | ||||
| /home/zulip/deployments/current/manage.py knight "$ZULIP_USER_EMAIL" -f || : | ||||
| exec expect <<EOF | ||||
| spawn su zulip -c "/home/zulip/deployments/current/manage.py changepassword $ZULIP_USER_EMAIL" | ||||
| expect "Password: " | ||||
| send "$ZULIP_USER_PASSWORD" | ||||
| send "\n" | ||||
| expect "Password (again): " | ||||
| send "$ZULIP_USER_PASSWORD" | ||||
| send "\n" | ||||
| send "\n" | ||||
| exit | ||||
| EOF | ||||
| @@ -44,11 +44,11 @@ class zulip::voyager { | ||||
|     mode => 644, | ||||
|     source => "puppet:///modules/zulip/supervisor/conf.d/zulip_postsetup.conf", | ||||
|   } | ||||
|   file { "/usr/local/bin/zulipPostSetup.sh": | ||||
|   file { "/opt/setupZulipUser.sh": | ||||
|     ensure => file, | ||||
|     owner  => "root", | ||||
|     group  => "root", | ||||
|     mode => 755, | ||||
|     source => "puppet:///modules/zulip/zulipPostSetup.sh", | ||||
|     source => "puppet:///modules/zulip/setupZulipUser.sh", | ||||
|   } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user