mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	Docker: review refacorting for export directory preparation
This commit is contained in:
		@@ -16,20 +16,21 @@ map_uidgid() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
set_permissions() {
 | 
					set_permissions() {
 | 
				
			||||||
    # Set permissions for consumption and export directory
 | 
					    # Set permissions for consumption and export directory
 | 
				
			||||||
    for i in PAPERLESS_CONSUMPTION_DIR PAPERLESS_EXPORT_DIR; do
 | 
					    for dir in PAPERLESS_CONSUMPTION_DIR PAPERLESS_EXPORT_DIR; do
 | 
				
			||||||
      cur_dir_name=$(sed -e's/PAPERLESS_//; s/_DIR//' <<< $i | tr '[:upper:]' '[:lower:]')
 | 
					      # Extract the name of the current directory from $dir for the error message
 | 
				
			||||||
      chgrp paperless "${!i}" || {
 | 
					      cur_dir_name=$(echo "$dir" | awk -F'_' '{ print tolower($2); }')
 | 
				
			||||||
 | 
					      chgrp paperless "${!dir}" || {
 | 
				
			||||||
          echo "Changing group of ${cur_dir_name} directory:"
 | 
					          echo "Changing group of ${cur_dir_name} directory:"
 | 
				
			||||||
          echo "  ${!i}"
 | 
					          echo "  ${!dir}"
 | 
				
			||||||
          echo "failed."
 | 
					          echo "failed."
 | 
				
			||||||
          echo ""
 | 
					          echo ""
 | 
				
			||||||
          echo "Either try to set it on your host-mounted directory"
 | 
					          echo "Either try to set it on your host-mounted directory"
 | 
				
			||||||
          echo "directly, or make sure that the directory has \`o+x\`"
 | 
					          echo "directly, or make sure that the directory has \`o+x\`"
 | 
				
			||||||
          echo "permissions and the files in it at least \`o+r\`."
 | 
					          echo "permissions and the files in it at least \`o+r\`."
 | 
				
			||||||
      } >&2
 | 
					      } >&2
 | 
				
			||||||
      chmod g+x "${!i}" || {
 | 
					      chmod g+x "${!dir}" || {
 | 
				
			||||||
          echo "Changing group permissions of ${cur_dir_name} directory:"
 | 
					          echo "Changing group permissions of ${cur_dir_name} directory:"
 | 
				
			||||||
          echo "  ${!i}"
 | 
					          echo "  ${!dir}"
 | 
				
			||||||
          echo "failed."
 | 
					          echo "failed."
 | 
				
			||||||
          echo ""
 | 
					          echo ""
 | 
				
			||||||
          echo "Either try to set it on your host-mounted directory"
 | 
					          echo "Either try to set it on your host-mounted directory"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user