added rclone export letsencrypt to s3

This commit is contained in:
2024-11-17 17:11:38 +00:00
parent e88662a0b6
commit 0a29b84c17

View File

@@ -26,7 +26,43 @@ services:
- certbot-www:/var/www/certbot - certbot-www:/var/www/certbot
- certbot-scripts:/scripts - certbot-scripts:/scripts
restart: unless-stopped restart: unless-stopped
rclone:
image: rclone/rclone
volumes:
- letsencrypt-conf:/etc/letsencrypt #must be on same place as cerbot container for symbolic links work
environment:
- SLEEP=1d
- RCLONE_CONFIG_HOT_LIMBOSOLUTIONS_TYPE=s3
- RCLONE_CONFIG_HOT_LIMBOSOLUTIONS_PROVIDER=Minio
- RCLONE_CONFIG_HOT_LIMBOSOLUTIONS_ENDPOINT=${RCLONE_CONFIG_HOT_LIMBOSOLUTIONS_ENDPOINT}
- RCLONE_CONFIG_HOT_LIMBOSOLUTIONS_ACCESS_KEY_ID=${RCLONE_CONFIG_HOT_LIMBOSOLUTIONS_ACCESS_KEY_ID}
- RCLONE_CONFIG_HOT_LIMBOSOLUTIONS_SECRET_ACCESS_KEY=${RCLONE_CONFIG_HOT_LIMBOSOLUTIONS_SECRET_ACCESS_KEY}
- RCLONE_CONFIG_ENCRYPTED_TYPE=crypt
- RCLONE_CONFIG_ENCRYPTED_REMOTE=${RCLONE_CONFIG_ENCRYPTED_REMOTE}
- RCLONE_CONFIG_ENCRYPTED_PASSWORD=${RCLONE_CONFIG_ENCRYPTED_PASSWORD}
entrypoint: /bin/sh
command: |
-c
'
echo "$$(date "'"+%Y-%m-%d %H:%M:%S"'") INFO : Container started!"
export RCLONE_CONFIG_ENCRYPTED_PASSWORD=`rclone obscure "$${RCLONE_CONFIG_ENCRYPTED_PASSWORD}"`
while :;
do
echo "$$(date "'"+%Y-%m-%d %H:%M:%S"'") INFO : Doing Work!"
rclone copy /etc/letsencrypt/live encrypted:letsencrypt_live --copy-links -v
echo "$$(date "'"+%Y-%m-%d %H:%M:%S"'") INFO : Work ended."
echo "$$(date "'"+%Y-%m-%d %H:%M:%S"'") INFO : Going to sleep for $${SLEEP}."
sleep $${SLEEP} & wait $${!}
echo "$$(date "'"+%Y-%m-%d %H:%M:%S"'") INFO : Wake from sleep!"
done
'
restart: unless-stopped
promtail: promtail:
image: grafana/promtail image: grafana/promtail
volumes: volumes: