make sure to set all necessary permissions for public table

This commit is contained in:
Luis Guzmán 2025-01-21 02:31:30 -06:00
parent 79fc0de403
commit ab5a180fd6
1 changed files with 7 additions and 1 deletions

View File

@ -86,13 +86,19 @@ sudo -u postgres psql <<DB
CREATE DATABASE ${ETHERPAD_DB_NAME}; CREATE DATABASE ${ETHERPAD_DB_NAME};
CREATE USER ${ETHERPAD_DB_USER} WITH ENCRYPTED PASSWORD '${ETHERPAD_DB_PASS}'; CREATE USER ${ETHERPAD_DB_USER} WITH ENCRYPTED PASSWORD '${ETHERPAD_DB_PASS}';
GRANT ALL PRIVILEGES ON DATABASE ${ETHERPAD_DB_NAME} TO ${ETHERPAD_DB_USER}; GRANT ALL PRIVILEGES ON DATABASE ${ETHERPAD_DB_NAME} TO ${ETHERPAD_DB_USER};
\c ${ETHERPAD_DB_NAME}
ALTER SCHEMA public OWNER TO ${ETHERPAD_DB_USER};
GRANT USAGE ON SCHEMA public TO ${ETHERPAD_DB_USER};
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO ${ETHERPAD_DB_USER};
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO ${ETHERPAD_DB_USER};
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO ${ETHERPAD_DB_USER};
DB DB
# Check fot docker if not running then execute # Check fot docker if not running then execute
if [ ! "$(docker ps -q -f name=etherpad)" ]; then if [ ! "$(docker ps -q -f name=etherpad)" ]; then
if [ "$(docker ps -aq -f status=exited -f name=etherpad)" ]; then if [ "$(docker ps -aq -f status=exited -f name=etherpad)" ]; then
# cleanup # cleanup
docker rm etherpad docker rm -f etherpad
fi fi
# run your container # run your container
docker run -d --restart always \ docker run -d --restart always \