From aa16af40fcfb519ec46f4e0bab4923cb9cd15b36 Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Mon, 2 Mar 2020 18:48:48 -0500 Subject: [PATCH] add postgres This adds a postgres egg. Needs heavy testing. resolves #447 --- database/postgres/egg-postgres.json | 63 +++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 database/postgres/egg-postgres.json diff --git a/database/postgres/egg-postgres.json b/database/postgres/egg-postgres.json new file mode 100644 index 00000000..bf68fbe4 --- /dev/null +++ b/database/postgres/egg-postgres.json @@ -0,0 +1,63 @@ +{ + "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO", + "meta": { + "version": "PTDL_v1" + }, + "exported_at": "2020-03-02T18:46:11-05:00", + "name": "Postgres", + "author": "parker@parkervcp.com", + "description": "A default Postgres install that is not really editable.", + "image": "quay.io\/parkervcp\/pterodactyl-images:db_postgres", + "startup": "postgres -D \/home\/container\/postgres_db\/", + "config": { + "files": "{\r\n \"postgres_db\/postgresql.conf\": {\r\n \"parser\": \"file\",\r\n \"find\": {\r\n\t\t \"#port =\": \"port = {{server.build.default.port}}\",\r\n \"#external_pid_file =\": \"external_pid_file = '\/home\/container\/postgres_db\/run\/postgres.pid'\",\r\n \"#unix_socket_directories =\": \"unix_socket_directories = '\/home\/container\/postgres_db\/run\/'\"\r\n }\r\n }\r\n}", + "startup": "{\r\n \"done\": \"database system is ready to accept connections\"\r\n}", + "logs": "{}", + "stop": "^C" + }, + "scripts": { + "installation": { + "script": "#! \/bin\/ash\r\nadduser -D -h \/home\/container container\r\n\r\necho $POSTGRES_PASSWORD > .passwd\r\n\r\nchown -R container: \/mnt\/server\/\r\n\r\ncat .passwd\r\n\r\nsu container -c 'initdb -D \/mnt\/server\/postgres_db\/ -A md5 -U container --pwfile .passwd'\r\n\r\nmkdir -p \/mnt\/server\/postgres_db\/run\/\r\n\r\necho -e \"Done\"", + "container": "postgres:11-alpine", + "entrypoint": "ash" + } + }, + "variables": [ + { + "name": "Database Password", + "description": "The Postgres user password that can be changed and should change on server restart.", + "env_variable": "PGPASSWORD", + "default_value": "P@55word", + "user_viewable": 1, + "user_editable": 1, + "rules": "required|string|max:20" + }, + { + "name": "SuperUser Password", + "description": "The postgres super user password with a strong default.\r\nYou should be generating new ones for each server.\r\nIf you don't then users can hit other users DB's", + "env_variable": "PGROOT", + "default_value": "ZPWgpMN4hETqjXAV", + "user_viewable": 1, + "user_editable": 0, + "rules": "required|string|max:20" + }, + { + "name": "Postgres User", + "description": "The user for the postgres database", + "env_variable": "PGUSER", + "default_value": "pterodactyl", + "user_viewable": 1, + "user_editable": 0, + "rules": "required|string|max:20" + }, + { + "name": "Postgres Database", + "description": "The postgres databas the user will have access too.", + "env_variable": "PGDATABASE", + "default_value": "pterodactyl", + "user_viewable": 1, + "user_editable": 0, + "rules": "required|string|max:20" + } + ] +} \ No newline at end of file