Skip to content
Snippets Groups Projects
Commit 1ab966a6 authored by Bob Mottram's avatar Bob Mottram
Browse files

Peertube database creation

parent deefdf38
No related branches found
No related tags found
No related merge requests found
......@@ -62,14 +62,9 @@ function peertube_create_database {
fi
systemctl restart postgresql
add_postgresql_user peertube "$PEERTUBE_ADMIN_PASSWORD" encrypted
run_system_query_postgresql "create database peertube;"
# temporarily allow the user to create databases
run_system_query_postgresql "ALTER USER peertube CREATEDB;"
run_system_query_postgresql "ALTER USER peertube SUPERUSER;"
run_system_query_postgresql "GRANT ALL ON ALL tables IN SCHEMA public TO peertube;"
run_system_query_postgresql "GRANT ALL ON ALL sequences IN SCHEMA public TO peertube;"
run_system_query_postgresql "CREATE EXTENSION citext;"
run_system_query_postgresql "CREATE USER peertube WITH PASSWORD '$PEERTUBE_ADMIN_PASSWORD';"
run_system_query_postgresql "CREATE DATABASE peertube OWNER peertube;"
run_system_query_postgresql "GRANT ALL PRIVILEGES ON DATABASE peertube to peertube;"
run_system_query_postgresql "set statement_timeout to 40000;"
}
......@@ -545,10 +540,6 @@ function install_peertube {
exit 5293593
fi
# revoke the ability to create databases for this user
run_system_query_postgresql "ALTER USER peertube NOSUPERUSER;"
run_system_query_postgresql "ALTER USER peertube NOCREATEDB;"
PEERTUBE_ONION_HOSTNAME=$(add_onion_service peertube 80 ${PEERTUBE_ONION_PORT})
echo '[Unit]' > /etc/systemd/system/peertube.service
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment