69 lines
2.0 KiB
Bash
69 lines
2.0 KiB
Bash
|
#!/bin/bash
|
||
|
|
||
|
set -e
|
||
|
|
||
|
up () {
|
||
|
loginctl enable-linger $USER
|
||
|
podman network create pew-net || true
|
||
|
|
||
|
# Exposed on port 8080 in pew-net
|
||
|
# env options: https://raw.githubusercontent.com/firefly-iii/firefly-iii/main/.env.example
|
||
|
# Create firefly.env with APP_KEY
|
||
|
podman create \
|
||
|
--name firefly \
|
||
|
--env-file=firefly.env \
|
||
|
--env SITE_OWNER=paulsw.pw@gmail.com \
|
||
|
--env TZ=US/Eastern \
|
||
|
--env TRUSTED_PROXIES=** \
|
||
|
--env DB_CONNECTION=mysql \
|
||
|
--env DB_HOST=firefly-mariadb \
|
||
|
--env DB_PORT=3306 \
|
||
|
--env DB_DATABASE=firefly \
|
||
|
--env DB_USERNAME=firefly \
|
||
|
--env DB_PASSWORD=firefly \
|
||
|
--env APP_URL=https://ff.seaturtle.pw \
|
||
|
--volume /bigdata/k8s-config/firefly/data:/var/www/html/storage/upload:rw \
|
||
|
--network pew-net \
|
||
|
jc5x/firefly-iii:version-5.4.6
|
||
|
|
||
|
podman generate systemd firefly --restart-policy=always --name > $HOME/.config/systemd/user/firefly.service
|
||
|
systemctl --user daemon-reload
|
||
|
systemctl start --user firefly || systemctl restart --user firefly
|
||
|
systemctl enable --user firefly
|
||
|
|
||
|
# Exposed on port 3306 in pew-net
|
||
|
podman create \
|
||
|
--name firefly-mariadb \
|
||
|
--env MYSQL_RANDOM_ROOT_PASSWORD=notnullvalue \
|
||
|
--env MYSQL_PASSWORD=firefly \
|
||
|
--env MYSQL_DATABASE=firefly \
|
||
|
--env MYSQL_USER=firefly \
|
||
|
--volume /bigdata/k8s-config/firefly/mariadb:/var/lib/mysql:rw \
|
||
|
--network pew-net \
|
||
|
mariadb:10.5.6
|
||
|
|
||
|
podman generate systemd firefly-mariadb --restart-policy=always --name > $HOME/.config/systemd/user/firefly-mariadb.service
|
||
|
systemctl --user daemon-reload
|
||
|
systemctl start --user firefly-mariadb || systemctl restart --user firefly-mariadb
|
||
|
systemctl enable --user firefly-mariadb
|
||
|
}
|
||
|
|
||
|
down () {
|
||
|
systemctl stop --user firefly || true
|
||
|
systemctl disable --user firefly || true
|
||
|
podman rm firefly || true
|
||
|
systemctl stop --user firefly-mariadb || true
|
||
|
systemctl disable --user firefly-mariadb || true
|
||
|
podman rm firefly-mariadb || true
|
||
|
}
|
||
|
|
||
|
logs () {
|
||
|
podman logs -f firefly
|
||
|
}
|
||
|
|
||
|
logsm () {
|
||
|
podman logs -f firefly-mariadb
|
||
|
}
|
||
|
|
||
|
$@
|