From 06ed6c56077fca32877cc11253173e1ac60534dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20GUEZO?= Date: Thu, 31 Jul 2025 15:11:06 +0200 Subject: [PATCH] feat(docker-compose.sh): add --install statement --- config/docker-compose.yml | 17 +++++++++++++++++ requirements.txt | 3 ++- scripts/aws-backup.sh | 2 +- scripts/sshd-login.sh | 4 ++-- scripts/wireguard.sh | 16 +++++++++++++++- 5 files changed, 37 insertions(+), 5 deletions(-) diff --git a/config/docker-compose.yml b/config/docker-compose.yml index 7d64862..4999bba 100644 --- a/config/docker-compose.yml +++ b/config/docker-compose.yml @@ -68,6 +68,23 @@ services: networks: - network-container +# synapse: +# image: matrixdotorg/synapse:latest +# container_name: synapse +# restart: unless-stopped +# networks: +# - network-container +# volumes: +# - ./data:/data +# environment: +# - SYNAPSE_CONFIG_PATH=/data/homeserver.yaml +# - VIRTUAL_HOST=notify.guezoloic.com +# - LETSENCRYPT_HOST=notify.guezoloic.com +# - LETSENCRYPT_EMAIL=${EMAIL} +# - VIRTUAL_PORT=8008 +# expose: +# - "8008" + networks: network-container: diff --git a/requirements.txt b/requirements.txt index 97886eb..d7096dc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ curl -aws \ No newline at end of file +aws +docker \ No newline at end of file diff --git a/scripts/aws-backup.sh b/scripts/aws-backup.sh index fd571fe..c8ace2c 100644 --- a/scripts/aws-backup.sh +++ b/scripts/aws-backup.sh @@ -17,7 +17,7 @@ if [[ "--install" == $INSTALLED ]]; then create_env_variable "AWS" "$AWS_client" read -p "Enter endpoint server (leave empty to not define it): " ENDPOINT_server - [[ ! -n $ENDPOINT_server ]] && create_env_variable "ENDPOINT" "$ENDPOINT_server" + [[ -n $ENDPOINT_server ]] && create_env_variable "ENDPOINT" "$ENDPOINT_server" info_print "AWS configuration." aws configure diff --git a/scripts/sshd-login.sh b/scripts/sshd-login.sh index a4b9d3f..60ac96e 100644 --- a/scripts/sshd-login.sh +++ b/scripts/sshd-login.sh @@ -31,10 +31,10 @@ source /usr/local/bin/libs/notifications.sh case "$PAM_TYPE" in open_session) - PAYLOAD=" { \"text\": \"$PAM_USER logged in (remote host: $PAM_RHOST) at $(date).\" }" + PAYLOAD="$PAM_USER logged in (remote host: $PAM_RHOST) at $(date)." ;; close_session) - PAYLOAD=" { \"text\": \"$PAM_USER logged out (remote host: $PAM_RHOST) at $(date).\" }" + PAYLOAD="$PAM_USER logged out (remote host: $PAM_RHOST) at $(date)." ;; esac diff --git a/scripts/wireguard.sh b/scripts/wireguard.sh index 53b31ad..5eafc8e 100644 --- a/scripts/wireguard.sh +++ b/scripts/wireguard.sh @@ -1,4 +1,18 @@ #!/bin/bash INSTALLED=$1 -if [[ "--install" == $INSTALLED ]]; then exit 0; fi \ No newline at end of file +if [[ "--install" == $INSTALLED ]]; then + info_print "\n\ +==================================================\n\ + wireguard Installation\n\ +--------------------------------------------------" + source /usr/local/bin/libs/common.sh + + if [[ -f "$ETC_DIR/docker-compose.yml" ]]; then + docker compose up -d -f $ETC_DIR/docker-compose.yml && \ + info_print "$ETC_DIR/docker-compose.yml is running." 2; + + else info_print "no docker-compose.yml found at $ETC_DIR" 6; + fi + exit 0; +fi \ No newline at end of file