From aa16af40fcfb519ec46f4e0bab4923cb9cd15b36 Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Mon, 2 Mar 2020 18:48:48 -0500 Subject: [PATCH 1/3] 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 From 5d71f035f999d633f2f07634794bdb671ad4cbf5 Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Mon, 2 Mar 2020 18:55:41 -0500 Subject: [PATCH 2/3] update readme files adds postgres readme --- README.md | 1 + database/postgres/README.md | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 database/postgres/README.md diff --git a/README.md b/README.md index d5d9d4b7..e22f5f51 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ If you are reading this it looks like you are looking to add an egg to your serv ## Database Eggs [MariaDB](/database/mariadb/) +[PostgreSQL](/database/postgres/) ## Game Eggs diff --git a/database/postgres/README.md b/database/postgres/README.md new file mode 100644 index 00000000..68feb186 --- /dev/null +++ b/database/postgres/README.md @@ -0,0 +1,16 @@ +# PostgreSQL +### From their [Website](https://www.postgresql.org/) +The World's Most Advanced Open Source Relational Database + +### Minimum RAM warning +2 Gigabytes minimum recommended + +See here https://www.commandprompt.com/blog/postgresql_mininum_requirements/ + + +### Server Ports +Ports required to run the server in a table format. + +| Port | default | +|---------|---------| +| Server | 5432 | From c8f2b3a73ceca93db98d3d9372b77722f0c64fc7 Mon Sep 17 00:00:00 2001 From: "Michael (Parker) Parker" Date: Wed, 4 Mar 2020 09:54:41 -0500 Subject: [PATCH 3/3] update installer version to postgres 12.2 --- database/postgres/egg-postgres.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/postgres/egg-postgres.json b/database/postgres/egg-postgres.json index bf68fbe4..59368cf9 100644 --- a/database/postgres/egg-postgres.json +++ b/database/postgres/egg-postgres.json @@ -3,7 +3,7 @@ "meta": { "version": "PTDL_v1" }, - "exported_at": "2020-03-02T18:46:11-05:00", + "exported_at": "2020-03-04T09:53:34-05:00", "name": "Postgres", "author": "parker@parkervcp.com", "description": "A default Postgres install that is not really editable.", @@ -18,7 +18,7 @@ "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", + "container": "postgres:12.2-alpine", "entrypoint": "ash" } },