2022-11-26 22:00:34 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
|
|
|
|
source ${ABSDIR}/../functions.sh
|
|
|
|
source ${ABSDIR}/vars.sh
|
|
|
|
|
|
|
|
ensure_pwd_is_scriptdir
|
|
|
|
ensure_not_root
|
|
|
|
|
|
|
|
ensure_pod_not_exists ${pod_name}
|
|
|
|
ensure_variables_are_defined "$envvars"
|
|
|
|
|
|
|
|
if ! podman volume exists ${datavolume} ; then
|
|
|
|
echo "Error : DATA volume ${datavolume} does not exists. Consider running 05_freshinstall.sh if this is the first install."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
cat <<EOT > .env
|
|
|
|
# vaultwarden
|
2023-04-18 19:43:09 +00:00
|
|
|
ADMIN_TOKEN=${GARBAYE_VAULTWARDEN_ADMIN_PASSWORD}
|
|
|
|
DOMAIN=${GARBAYE_VAULTWARDEN_DOMAIN}
|
2024-04-09 22:08:23 +00:00
|
|
|
SENDS_ALLOWED=false
|
2023-04-18 19:43:09 +00:00
|
|
|
# Signups
|
2024-04-09 22:08:23 +00:00
|
|
|
SIGNUPS_ALLOWED=true
|
2023-04-18 19:43:09 +00:00
|
|
|
SIGNUPS_VERIFY=true
|
|
|
|
# SMTP
|
2024-06-10 17:55:46 +00:00
|
|
|
SMTP_HOST=${GARBAYE_SMTP_SERVER}
|
2023-04-18 19:43:09 +00:00
|
|
|
SMTP_FROM=vaultwarden@garbaye.fr
|
|
|
|
SMTP_FROM_NAME=Vaultwarden
|
|
|
|
SMTP_SECURITY=off
|
|
|
|
SMTP_PORT=25
|
2022-11-26 22:00:34 +00:00
|
|
|
EOT
|
|
|
|
|
2023-08-18 16:14:05 +00:00
|
|
|
export service_image
|
|
|
|
export service_version
|
2022-11-26 22:00:34 +00:00
|
|
|
export container_name
|
2023-10-21 12:09:29 +00:00
|
|
|
export listen_if
|
|
|
|
export listen_port
|
2022-11-26 22:00:34 +00:00
|
|
|
|
2023-08-18 16:14:05 +00:00
|
|
|
if ! podman image exists ${service_image}:${service_version}; then
|
|
|
|
podman image pull ${service_image}:${service_version} || exit 1
|
2022-11-26 22:00:34 +00:00
|
|
|
fi
|
|
|
|
podman-compose --pod-args="--infra=true --infra-name=${project_name}_infra --share=" --podman-run-args "--requires=${project_name}_infra --env-file .env" up -d &&
|
|
|
|
echo -n "Waiting for vaultwarden to finish starting " &&
|
2023-04-21 11:53:55 +00:00
|
|
|
( podman container logs -f ${container_name} 2>&1 & ) | grep -q 'Rocket has launched from ' &&
|
2022-11-26 22:00:34 +00:00
|
|
|
echo "OK" &&
|
|
|
|
podman pod stop ${pod_name} &&
|
|
|
|
echo Pod built and stopped. &&
|
|
|
|
shred -u .env
|