|  | @@ -199,6 +199,7 @@ function pleroma_create_database {
 | 
	
		
			
			| 199 | 199 |          return
 | 
	
		
			
			| 200 | 200 |      fi
 | 
	
		
			
			| 201 | 201 |  
 | 
	
		
			
			|  | 202 | +    systemctl restart postgresql
 | 
	
		
			
			| 202 | 203 |      add_postgresql_user pleroma "$PLEROMA_ADMIN_PASSWORD" encrypted
 | 
	
		
			
			| 203 | 204 |      run_system_query_postgresql "create database pleroma;"
 | 
	
		
			
			| 204 | 205 |      # temporarily allow the user to create databases
 | 
	
	
		
			
			|  | @@ -207,11 +208,12 @@ function pleroma_create_database {
 | 
	
		
			
			| 207 | 208 |      run_system_query_postgresql "GRANT ALL ON ALL tables IN SCHEMA public TO pleroma;"
 | 
	
		
			
			| 208 | 209 |      run_system_query_postgresql "GRANT ALL ON ALL sequences IN SCHEMA public TO pleroma;"
 | 
	
		
			
			| 209 | 210 |      run_system_query_postgresql "CREATE EXTENSION citext;"
 | 
	
		
			
			|  | 211 | +    run_system_query_postgresql "set statement_timeout to 20000;"
 | 
	
		
			
			| 210 | 212 |  
 | 
	
		
			
			| 211 | 213 |      read_config_param "PLEROMA_SECRET_KEY"
 | 
	
		
			
			| 212 |  | -    if [ ${#PLEROMA_SECRET_KEY} -lt 50 ]; then
 | 
	
		
			
			| 213 |  | -        PLEROMA_SECRET_KEY="$(create_password 30)$(create_password 30)"
 | 
	
		
			
			| 214 |  | -        if [ ${#PLEROMA_SECRET_KEY} -lt 50 ]; then
 | 
	
		
			
			|  | 214 | +    if [ ${#PLEROMA_SECRET_KEY} -lt 64 ]; then
 | 
	
		
			
			|  | 215 | +        PLEROMA_SECRET_KEY="$(create_password 30)$(create_password 30)$(create_password 30)"
 | 
	
		
			
			|  | 216 | +        if [ ${#PLEROMA_SECRET_KEY} -lt 64 ]; then
 | 
	
		
			
			| 215 | 217 |              run_system_query_postgresql "ALTER USER pleroma NOSUPERUSER;"
 | 
	
		
			
			| 216 | 218 |              run_system_query_postgresql "ALTER USER pleroma NOCREATEDB;"
 | 
	
		
			
			| 217 | 219 |              echo $'Pleroma secret key not created'
 | 
	
	
		
			
			|  | @@ -244,6 +246,7 @@ function pleroma_create_database {
 | 
	
		
			
			| 244 | 246 |      fi
 | 
	
		
			
			| 245 | 247 |      sudo -u pleroma mix local.hex --force
 | 
	
		
			
			| 246 | 248 |      sudo -u pleroma mix deps.compile mimerl
 | 
	
		
			
			|  | 249 | +    systemctl restart postgresql
 | 
	
		
			
			| 247 | 250 |      sudo -u pleroma mix ecto.create --force
 | 
	
		
			
			| 248 | 251 |      if [ ! "$?" = "0" ]; then
 | 
	
		
			
			| 249 | 252 |          run_system_query_postgresql "ALTER USER pleroma NOSUPERUSER;"
 |