# docker-compose.yml — run from the root of this cloned repository services: sftp: # Build from the cloned repository with: docker compose up -d --build # To pull the published image instead, remove/comment build: and run docker compose pull build: . image: bmmbmm01/sftp2:latest container_name: sftp-fail2ban hostname: SFTP environment: - TZ=America/Chicago # Update policy: none(false,off,0, no) | suite(true, on, 1, yes) | custom - AUTO_UPDATE=suite # If unset, the Dockerfile defaults to suite; use none to disable startup updates. # Timed unattended apt updates: 0 disables; 24 checks approximately daily. - AUTO_UPDATE_INTERVAL_HOURS=0 # - AUTO_UPDATE_INTERVAL_HOURS=24 # optional Unraid template setting; restart required after OpenSSH upgrades # Fail2Ban config wiring (symlink | overlay | noclobber | replace) - F2B_CONFIG_MODE=symlink #How /etc/fail2ban is populated from /config/fail2ban: symlink (source of truth = /config), overlay (defaults + then /config over), noclobber (defaults + non-clobber copy from /config), replace (use /config only). # Docker log mirroring - CLEAR_LOGS=true #When true, archives previous run logs to `/config/log/archive/..log` and truncates current logs on boot. - TAIL_LOGS=true # mirror selected logs to `docker logs` to turn off docker log to sdtout. (logs will still ppopulate in log folder - LOG_STREAMS=auth,fail2ban # valid: auth,fail2ban,whois (must be comma seperated list tels the docker sdtou logs which log file to view in docker log) #End users are now responsible for log rotation and monitoring! old system erased logs at boot now its end users. # /config/sshd/users.conf is the persistent source of truth. # Password changes in users.conf take effect after a container restart. # username:password:uid:gid[:dir1,dir2,...] # username:encrypted_password:e:uid:gid[:dir1,dir2,...] # Example: admin:REPLACE_WITH_A_STRONG_PASSWORD:1000:100:sftp # # Existing Unraid WebUI admin variables are supported: # - DEFAULT_ADMIN=true # set false to disable environment synchronization # - ADMIN_USER=admin # optional; omit if managing users.conf only # - ADMIN_PASS=USE_A_UNIQUE_PASSWORD # optional; do not use "password" # A changed ADMIN_USER / ADMIN_PASS updates users.conf at next launch. # An unchanged environment value does not undo manual users.conf edits. # - SFTP_USERS=alice:secret:1001:100:uploads # optional; updates users.conf on changes # SSHD hardening toggles (optional) #- PASSWORD_AUTH=no # force keys-only login. must have ssh keys in folder #- ALLOW_USERS=admin alice # restrict who can log in # rsyslog imklog off in containers (no /proc/kmsg) #- DISABLE_IMKLOG=true (on by default to fix a small log spam ignore issue) # Preflight checks (writes to /config/debug when true) false by default #- DEBUG_TESTING=false # Start mode: start (normal) | seed (prepare config then exit) #- MODE=start (testing debug) # Allow mail actions (removes no-mail overrides) *False by default for folder and docker login. advance users option for sidlaoding a smtp sever and send reports... #- MAIL_SERVER=false # recommended: rotate container stdout logs logging: driver: json-file options: max-size: "10m" max-file: "3" cap_add: - NET_ADMIN - NET_RAW volumes: # App data: supply your custom fail2ban/sshd/users/etc. - /mnt/user/appdata/sftp-fail2ban:/config # Example: user home content to share via SFTP # On Unraid, a host share may be nobody:users (65534:100); # keep chroot /home/admin root:root and mount the data below it. # Configure the admin account in users.conf first (e.g., UID 1000, GID 100). - /data-to-share:/home/admin/sftp ports: - "22:22" # expose if not using macvlan/ipvlan restart: unless-stopped #Optional Unriad Macvlan/IpVlan example # networks: # br0: # ipv4_address: 192.168.1.254 # mac_address: "8a:ad:35:ea:d3:00" # dns: # - 1.1.1.1 # - 208.67.222.222 #Compose connect to Unraid ipvlan/macvlan network... #networks: # br0: # external: true