Skip to content

Commit 0963385

Browse files
committed
Remove automatic PostgreSQL permission fix from update script
Automatic database permission changes during unattended updates is risky business. Keep only the fresh installation fix in nextcloud_install_production.sh where it's done during initial setup. Users with existing installations who need the fix can apply it manually if they encounter permission errors during NC 30+ upgrade.
1 parent 2413b07 commit 0963385

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

nextcloud_update.sh

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -84,34 +84,6 @@ then
8484
fi
8585
fi
8686

87-
# Fix PostgreSQL schema permissions for Nextcloud 30+ (if PostgreSQL is installed)
88-
# PostgreSQL 15+ requires explicit schema permissions that weren't needed before
89-
if is_this_installed postgresql-common
90-
then
91-
# Get database info
92-
ncdb
93-
94-
# Check if we need to apply the fix (test if user can create tables)
95-
if sudo -u postgres psql -d "$NCDB" -c "SELECT has_schema_privilege('$NCDBUSER', 'public', 'CREATE');" 2>/dev/null | grep -q "f"
96-
then
97-
print_text_in_color "$ICyan" "Applying PostgreSQL schema permission fix for Nextcloud 30+..."
98-
99-
# Apply the fix
100-
if sudo -u postgres psql -d "$NCDB" <<END
101-
GRANT CREATE ON SCHEMA public TO $NCDBUSER;
102-
GRANT ALL ON SCHEMA public TO $NCDBUSER;
103-
END
104-
then
105-
print_text_in_color "$IGreen" "PostgreSQL schema permissions updated successfully!"
106-
else
107-
print_text_in_color "$IYellow" "Warning: Could not update PostgreSQL schema permissions."
108-
print_text_in_color "$IYellow" "This may cause issues with Nextcloud 30+ upgrades."
109-
print_text_in_color "$ICyan" "You can try to fix this manually by running:"
110-
print_text_in_color "$ICyan" "sudo -u postgres psql -d $NCDB -c 'GRANT CREATE ON SCHEMA public TO $NCDBUSER;'"
111-
fi
112-
fi
113-
fi
114-
11587
# Set product name
11688
if home_sme_server
11789
then

0 commit comments

Comments
 (0)