move acme out, change vw deploy

This commit is contained in:
2025-05-02 20:39:28 +02:00
parent 0a60e11426
commit 0169227af6
3 changed files with 19 additions and 11 deletions

7
acme/env.sh Normal file
View File

@@ -0,0 +1,7 @@
export NAMECHEAP_USERNAME=""
export NAMECHEAP_API_KEY=""
export NAMECHEAP_SOURCEIP=""
export EMAIL=""
export DOMAIN=""
export SSL_PATH=$HOME/.config/ssl/$DOMAIN

View File

@@ -5,17 +5,17 @@ set -e
mkdir -p $DATA_FOLDER
if systemctl --user list-units --full --all | grep -q "container-${CONTAINER_NAME}.service"; then
systemctl --user stop container-${CONTAINER_NAME}.service
if systemctl --user list-units --full --all | grep -q "vaultwarden-${CONTAINER_NAME}.service"; then
systemctl --user stop vaultwarden-${CONTAINER_NAME}.service
fi
# if podman container exists "$CONTAINER_NAME"; then
# echo "Stop and delete existing container $CONTAINER_NAME"
# if podman inspect -f '{{.State.Running}}' "$CONTAINER_NAME" | grep -q true; then
# podman stop "$CONTAINER_NAME"
# fi
# podman rm "$CONTAINER_NAME"
# fi
if podman container exists "$CONTAINER_NAME"; then
echo "Stop and delete existing container $CONTAINER_NAME"
if podman inspect -f '{{.State.Running}}' "$CONTAINER_NAME" | grep -q true; then
podman stop "$CONTAINER_NAME"
fi
podman rm "$CONTAINER_NAME"
fi
podman create \
--name vaultwarden \
@@ -30,13 +30,14 @@ podman generate systemd \
--new \
--name $CONTAINER_NAME \
--files \
--container-prefix=vaultwarden \
--restart-policy=always
USER_SYSTEMD="$HOME/.config/systemd/user"
mkdir -p $USER_SYSTEMD
cp container-$CONTAINER_NAME.service $USER_SYSTEMD
cp vaultwarden-$CONTAINER_NAME.service $USER_SYSTEMD
systemctl --user daemon-reload
systemctl --user enable --now container-$CONTAINER_NAME.service
systemctl --user enable --now vaultwarden-$CONTAINER_NAME.service
sudo loginctl enable-linger $USER