mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 01:16:23 +00:00
feat: database
This commit is contained in:
parent
49e97ca7b0
commit
27f3aff403
2 changed files with 23 additions and 0 deletions
|
@ -38,3 +38,5 @@ AIRBRAKE_API_KEY=
|
||||||
GITLAB_URI=https://0xacab.org
|
GITLAB_URI=https://0xacab.org
|
||||||
GITLAB_PROJECT=
|
GITLAB_PROJECT=
|
||||||
GITLAB_TOKEN=
|
GITLAB_TOKEN=
|
||||||
|
PGVER=15
|
||||||
|
PGPID=/run/postgresql.pid
|
||||||
|
|
|
@ -76,3 +76,24 @@ tasks:
|
||||||
- "echo -e \"::1 panel.{{.SUTTY}} api.{{.SUTTY}} postgresql.{{.SUTTY}}\" | sudo tee -a /etc/hosts"
|
- "echo -e \"::1 panel.{{.SUTTY}} api.{{.SUTTY}} postgresql.{{.SUTTY}}\" | sudo tee -a /etc/hosts"
|
||||||
status:
|
status:
|
||||||
- "grep -q \" panel.{{.SUTTY}} \" /etc/hosts"
|
- "grep -q \" panel.{{.SUTTY}} \" /etc/hosts"
|
||||||
|
database-init:
|
||||||
|
desc: "Database install"
|
||||||
|
deps:
|
||||||
|
- "env"
|
||||||
|
cmds:
|
||||||
|
- "{{.HAINISH}} /usr/bin/initdb --locale en_US.utf8 -E UTF8 -D /var/lib/postgresql/{{.PGVER}}/data"
|
||||||
|
- "echo \"host all all samenet trust\" >> ../hain/var/lib/postgresql/{{.PGVER}}/data/pg_hba.conf"
|
||||||
|
- "echo \"listen_addresses = '*'\" >> ../hain/var/lib/postgresql/{{.PGVER}}/data/postgresql.conf"
|
||||||
|
- "echo \"external_pid_file = '{{.PGPID}}'\" >> ../hain/var/lib/postgresql/{{.PGVER}}/data/postgresql.conf"
|
||||||
|
status:
|
||||||
|
- "test -d ../hain/var/lib/postgresql/{{.PGVER}}/data"
|
||||||
|
- "test -f ../hain/var/lib/postgresql/{{.PGVER}}/data/postgresql.conf"
|
||||||
|
database:
|
||||||
|
desc: "Database"
|
||||||
|
deps:
|
||||||
|
- "database-init"
|
||||||
|
cmds:
|
||||||
|
- "{{.HAINISH}} daemonize -c /var/lib/postgresql/{{.PGVER}}/data /usr/bin/postgres -D /var/lib/postgresql/{{.PGVER}}/data"
|
||||||
|
status:
|
||||||
|
- "test -f ../hain{{.PGPID}}"
|
||||||
|
- "pgrep -F ../hain{{.PGPID}}"
|
||||||
|
|
Loading…
Reference in a new issue