mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-25 03:22:36 +00:00 
			
		
		
		
	Fix #25726 #17846 chose an incorrect WORK_DIR path for docker root image. Gitea's work-path was already used as the base path for various paths (like AppDataPath), so, the work-path should be mounted to a volume in a docker image. Now, for docker root image, it's unavoidable to mix the WorkPath/CustomPath/AppDataPath in the same directory ("/data/gitea"), because some of them have already been mixed. Some directories in the screenshot are for "CustomPath" , while others are for "AppDataPath", due to the technical debts in old code: ``` CUSTOM_PATH="/data/gitea" APP_DATA_PATH = /data/gitea ``` <details>  </details> This PR is breaking but this is the only way at the moment to avoid users losing their data accidently Co-authored-by: Giteabot <teabot@gitea.io>
		
			
				
	
	
		
			15 lines
		
	
	
	
		
			581 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
	
		
			581 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
| #!/bin/bash
 | |
| 
 | |
| ###############################################################
 | |
| # This script sets defaults for gitea to run in the container #
 | |
| ###############################################################
 | |
| 
 | |
| # It assumes that you place this script as gitea in /usr/local/bin
 | |
| #
 | |
| # And place the original in /usr/lib/gitea with working files in /data/gitea
 | |
| GITEA="/app/gitea/gitea"
 | |
| WORK_DIR="/data/gitea"
 | |
| CUSTOM_PATH="/data/gitea"
 | |
| 
 | |
| # Provide docker defaults
 | |
| GITEA_WORK_DIR="${GITEA_WORK_DIR:-$WORK_DIR}" GITEA_CUSTOM="${GITEA_CUSTOM:-$CUSTOM_PATH}" exec -a "$0" "$GITEA" $CONF_ARG "$@"
 |