Add a script for installing gotify
This commit is contained in:
parent
5c191a3a43
commit
2cb0f752d9
3 changed files with 18 additions and 7 deletions
|
@ -2,6 +2,8 @@ services:
|
||||||
gotify:
|
gotify:
|
||||||
image: gotify/server
|
image: gotify/server
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- ./data/gotify:/app/data
|
||||||
environment:
|
environment:
|
||||||
GOTIFY_DATABASE_DIALECT: mysql
|
GOTIFY_DATABASE_DIALECT: mysql
|
||||||
db:
|
db:
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
services:
|
services:
|
||||||
vaultwarden:
|
gotify:
|
||||||
environment:
|
environment:
|
||||||
GOTIFY_DEFAULTUSER_PASS: null
|
GOTIFY_DEFAULTUSER_PASS: null
|
||||||
DATABASE_URL: gotify:pw@tcp(db:3306)/Gotify?charset=utf8&parseTime=true&loc=Local
|
GOTIFY_DATABASE_CONNECTION: gotify:pw@tcp(db:3306)/Gotify?charset=utf8&parseTime=true&loc=Local
|
||||||
ports:
|
ports:
|
||||||
- 127.0.0.1:1337:80
|
- 127.0.0.1:1337:80
|
||||||
db:
|
db:
|
||||||
|
|
|
@ -4,17 +4,18 @@ begin
|
||||||
set -l source "$dir/docker-compose.overrides.yml"
|
set -l source "$dir/docker-compose.overrides.yml"
|
||||||
source "$dir/../service.fish"
|
source "$dir/../service.fish"
|
||||||
|
|
||||||
function installSW -V dir -V domain -V source
|
function installSW -V dir -V source
|
||||||
set -l file "$dir/docker-compose.base.yml"
|
set -l file "$dir/docker-compose.base.yml"
|
||||||
set -l pw (nix-shell -p keepassxc --run "keepassxc-cli generate --length 32")
|
set -l pw (nix-shell -p keepassxc --run "keepassxc-cli generate --length 32")
|
||||||
set -l dbPw (nix-shell -p keepassxc --run "keepassxc-cli generate --length 32")
|
set -l dbPw (nix-shell -p keepassxc --run "keepassxc-cli generate --length 32")
|
||||||
set -l envKey ".services.gotify.environment"
|
set -l envKey ".services.gotify.environment"
|
||||||
set -l dbKey "$envKey.GOTIFY_DATABASE_CONNECTION"
|
set -l dbKey "$envKey.GOTIFY_DATABASE_CONNECTION"
|
||||||
set -l dbUrl (yq "$dbKey" "$source" | sed "s/^\(.*:).*@/\1$dbPw/")
|
set -l db (yq "$dbKey" "$source" | sed "s/^\(.*:\).*\(@.*\)\$/\1$dbPw\2/")
|
||||||
|
echo "db: $db"
|
||||||
initializeServiceInstallation $argv
|
initializeServiceInstallation $argv
|
||||||
sudo cp "$dir/docker-compose.base.yml" (getServiceRoot $argv)
|
sudo cp "$dir/docker-compose.base.yml" (getServiceRoot $argv)
|
||||||
|
|
||||||
URL=$dbUrl yq "$dbKey = env(URL)" |
|
DB=$db yq "$dbKey = env(DB)" "$source" |
|
||||||
PW=$pw yq "$envKey.GOTIFY_DEFAULTUSER_PASS = env(PW)" |
|
PW=$pw yq "$envKey.GOTIFY_DEFAULTUSER_PASS = env(PW)" |
|
||||||
PW=$dbPw yq ".services.db.environment.MARIADB_PASSWORD = env(PW)" |
|
PW=$dbPw yq ".services.db.environment.MARIADB_PASSWORD = env(PW)" |
|
||||||
sudo tee (getServiceOverrides $argv) >/dev/null
|
sudo tee (getServiceOverrides $argv) >/dev/null
|
||||||
|
@ -26,8 +27,8 @@ begin
|
||||||
configureDockerService $argv
|
configureDockerService $argv
|
||||||
end
|
end
|
||||||
|
|
||||||
function getServiceServers -V domain
|
function getServiceServers
|
||||||
printf "%s\0" "$domain" ""
|
printf "%s\0" "push" ""
|
||||||
end
|
end
|
||||||
|
|
||||||
function getServiceLocations
|
function getServiceLocations
|
||||||
|
@ -35,5 +36,13 @@ begin
|
||||||
printf "%s\0" "$_flag_name" /
|
printf "%s\0" "$_flag_name" /
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function getExtraLocationSettings
|
||||||
|
printf "%s\n" \
|
||||||
|
'# Websocket' \
|
||||||
|
"proxy_http_version 1.1;" \
|
||||||
|
'proxy_set_header Upgrade $http_upgrade;' \
|
||||||
|
'proxy_set_header Connection "upgrade";'
|
||||||
|
end
|
||||||
|
|
||||||
runInstaller --force $argv
|
runInstaller --force $argv
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue