# CasaDrop — self-hosted file sharing for ZimaOS.
#
# Before you install, two values are worth a look:
#   TZ                    the timezone used for share expiry times
#   SHARE_ALLOWED_PATHS   which host folders "share from host" may browse
#
# /DATA/AppData is deliberately NOT mounted. It holds every other app's
# database and secrets, and CasaDrop is an app you may expose to the internet.
#
# No dollar sign appears in this file on purpose: ZimaOS reduces the compose
# escape form when it saves, and docker compose then substitutes the empty
# string. See ZIMAOS-KNOWLEDGE.md section 27.11.

name: casadrop

services:
  casadrop:
    image: chicohaager/casadrop:2.5.4
    container_name: casadrop
    hostname: casadrop
    restart: unless-stopped
    ports:
      - mode: ingress
        target: 8080
        published: "8086"
        protocol: tcp
    environment:
      PORT: "8080"
      EXTERNAL_PORT: "8086"
      DATA_DIR: /data
      TZ: Europe/Berlin
      # "Share from host" browses the container filesystem. Only the folders
      # bind-mounted below are reachable, and this list gates them again.
      SHARE_ALLOWED_PATHS: /DATA/Media,/DATA/Documents,/DATA/Downloads,/DATA/Gallery,/DATA/Backup
      # Unset means forwarded headers are ignored, which is the safe default.
      # Set to your reverse proxy's IP or CIDR to recover the real client IP.
      TRUSTED_PROXY: ""
      # Refuse webhook deliveries to private and loopback targets. Set to
      # "false" only if your webhook receiver lives on the LAN.
      WEBHOOK_STRICT_SSRF: "true"
    volumes:
      - /DATA/AppData/casadrop/data:/data
      # Host content, read-only, for "share from host".
      - /DATA/Media:/DATA/Media:ro
      - /DATA/Documents:/DATA/Documents:ro
      - /DATA/Downloads:/DATA/Downloads:ro
      - /DATA/Gallery:/DATA/Gallery:ro
      - /DATA/Backup:/DATA/Backup:ro
    security_opt:
      - no-new-privileges:true
    cap_drop:
      - ALL
    cap_add:
      # The entrypoint chowns the data directory and drops to an unprivileged
      # uid; these are the capabilities it needs to do that, and no more.
      - CHOWN
      - SETUID
      - SETGID
      - DAC_OVERRIDE
      - FOWNER
    read_only: true
    tmpfs:
      - /tmp
    healthcheck:
      # GET, not --spider: the runtime image ships GNU wget, whose --spider
      # issues a HEAD request. Keep this a plain GET.
      test: ["CMD-SHELL", "wget -qO- http://localhost:8080/healthz >/dev/null 2>&1 || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s
x-casaos:
  main: casadrop
  id: io.github.chicohaager.casadrop
  version: 2.5.4
  icon: https://chicohaager.github.io/zima-appstore/apps/io.github.chicohaager.casadrop/assets/icon.png
  index: /
  port_map: "8086"
  scheme: http
  title:
    custom: CasaDrop
    en_US: CasaDrop
