mirror of
				https://github.com/nextcloud/all-in-one.git
				synced 2025-10-31 19:16:20 +08:00 
			
		
		
		
	fix writing to the caddyfile
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
		
							parent
							
								
									7ba10559fd
								
							
						
					
					
						commit
						1f6b8d48a9
					
				
					 2 changed files with 5 additions and 4 deletions
				
			
		|  | @ -65,8 +65,7 @@ COPY start.sh /usr/bin/ | |||
| COPY supervisord.conf / | ||||
| RUN chmod +x /usr/bin/start.sh; \ | ||||
|     chmod +r /supervisord.conf; \ | ||||
|     chmod a+w /Caddyfile; \ | ||||
|     chmod 777 /; \ | ||||
|     chown www-data:www-data /Caddyfile; \ | ||||
|     chmod +r -R /etc/apache2 | ||||
| 
 | ||||
| # Give root a random password | ||||
|  |  | |||
|  | @ -21,14 +21,16 @@ if [ -z "$APACHE_PORT" ]; then | |||
|     export APACHE_PORT="443" | ||||
| fi | ||||
| 
 | ||||
| # Change the Caddyfile | ||||
| if [ "$APACHE_PORT" != '443' ]; then | ||||
|     export PROTOCOL="http" | ||||
|     export NC_DOMAIN="" | ||||
|     sed -i 's|auto_https.*|auto_https off|' /Caddyfile | ||||
|     CADDYFILE="$(sed 's|auto_https.*|auto_https off|' /Caddyfile)" | ||||
| else | ||||
|     export PROTOCOL="https" | ||||
|     sed -i 's|auto_https.*|auto_https disable_redirects|' /Caddyfile | ||||
|     CADDYFILE="$(sed 's|auto_https.*|auto_https disable_redirects|' /Caddyfile)" | ||||
| fi | ||||
| echo "$CADDYFILE" > /Caddyfile | ||||
| 
 | ||||
| # Add caddy path | ||||
| mkdir -p /mnt/data/caddy/ | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue