From 770ef4932aba757522c5ee453381704e23544613 Mon Sep 17 00:00:00 2001 From: Moritz Date: Wed, 24 Jan 2024 13:41:05 +0100 Subject: [PATCH] Add FTP Access --- .env.sample | 6 ++++++ compose.ftp.yml | 26 ++++++++++++++++++++++++++ users.conf.tmpl | 1 + 3 files changed, 33 insertions(+) create mode 100644 compose.ftp.yml create mode 100644 users.conf.tmpl diff --git a/.env.sample b/.env.sample index 369e6d3..b0bc537 100644 --- a/.env.sample +++ b/.env.sample @@ -67,3 +67,9 @@ SECRET_DB_PASSWORD_VERSION=v1 # Wide-open CORS # 🚩🚩 dangerous, use only for development sites! #CORS_ALLOW_ALL=1 + + +# FTP +#COMPOSE_FILE="$COMPOSE_FILE:compose.ftp.yml" +#SECRET_FTP_PASS_VERSION=v1 +#USERS_CONF_VERSION=v1 diff --git a/compose.ftp.yml b/compose.ftp.yml new file mode 100644 index 0000000..bbff6a2 --- /dev/null +++ b/compose.ftp.yml @@ -0,0 +1,26 @@ +--- +version: "3.8" + +services: + ftp: + image: atmoz/sftp + secrets: + - ftp_pass + ports: + - 2222:22 + volumes: + - "wordpress_content:/home/ftp_user/wp-content" + configs: + - source: users_conf + target: /etc/sftp/users.conf + +secrets: + ftp_pass: + name: ${STACK_NAME}_ftp_pass_${SECRET_FTP_PASS_VERSION} + external: true + +configs: + users_conf: + name: ${STACK_NAME}_users_conf_${USERS_CONF_VERSION} + file: users.conf.tmpl + template_driver: golang diff --git a/users.conf.tmpl b/users.conf.tmpl new file mode 100644 index 0000000..b62cc93 --- /dev/null +++ b/users.conf.tmpl @@ -0,0 +1 @@ +ftp_user:{{ secret "ftp_pass" }}:33:33