mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			470 B
		
	
	
	
		
			Plaintext
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			470 B
		
	
	
	
		
			Plaintext
		
	
	
		
			Executable File
		
	
	
	
	
#!/command/with-contenv /usr/bin/bash
 | 
						|
# shellcheck shell=bash
 | 
						|
 | 
						|
declare -r log_prefix="[init-superuser]"
 | 
						|
 | 
						|
if [[ -n "${PAPERLESS_ADMIN_USER}" ]]; then
 | 
						|
	echo "${log_prefix} Creating superuser..."
 | 
						|
	cd "${PAPERLESS_SRC_DIR}"
 | 
						|
 | 
						|
	if [[ -n "${USER_IS_NON_ROOT}" ]]; then
 | 
						|
		python3 manage.py manage_superuser
 | 
						|
	else
 | 
						|
		s6-setuidgid paperless python3 manage.py manage_superuser
 | 
						|
	fi
 | 
						|
 | 
						|
	echo "${log_prefix} Superuser creation done"
 | 
						|
 | 
						|
else
 | 
						|
	echo "${log_prefix} Not creating superuser"
 | 
						|
fi
 |