services:
  swag:
    image: lscr.io/linuxserver/swag:latest
    container_name: swag
    cap_add:
      - NET_ADMIN
    environment:
      - PUID=1000
      - PGID=100
      - TZ=Etc/UTC
      - URL=mitscherlich.nl
      - VALIDATION=http
      - SUBDOMAINS=nc,esp,git,jenkins,registry,registrybrowser,svn,vpn,vaultwarden,collabora,ssh
#      - EMAIL= matthias@mitscherlich.nl
      - ONLY_SUBDOMAINS=true
      - EXTRA_DOMAINS=nc.vbchaos.nl,vaultwarden.vbchaos.nl,vpn.vbchaos.nl,registry.vbchaos.nl,git.vbchaos.nl #optional
    volumes:
      - /docker_config/swag:/config
    ports:
      - 443:443
      - 81:80 #optional
    restart: unless-stopped

  vaultwarden:
    container_name: vaultwarden
    image: vaultwarden/server:latest
    restart: unless-stopped
    volumes:
      - /docker_config/vaultwarden:/data/
    ports:
      - 5555:80
    environment:
      - DOMAIN=https://vaultwarden.mitscherlich.nl
      - LOGIN_RATELIMIT_MAX_BURST=10
      - LOGIN_RATELIMIT_SECONDS=60
      - ADMIN_RATELIMIT_MAX_BURST=10
      - ADMIN_RATELIMIT_SECONDS=2
      - ADMIN_TOKEN=$$argon2id$$v=19$$m=65540,t=3,p=4$$Vv4wT0EpGslsEAHpgw+U1FwxUQjguK9qkwJQB7WLP+k$$7lBaj+G9jLyXj5MxC2RqNGyGw0/vjOzcgwk4ArN6BVM
      - SENDS_ALLOWED=true
      - EMERGENCY_ACCESS_ALLOWED=true
      - WEB_VAULT_ENABLED=true
      - SIGNUPS_ALLOWED=false
      - SIGNUPS_VERIFY=true
      - SIGNUPS_VERIFY_RESEND_TIME=3600
      - SIGNUPS_VERIFY_RESEND_LIMIT=5
      - SIGNUPS_DOMAINS_WHITELIST=vbchaos.nl,mitscherlich.nl
      - SMTP_HOST=smtp.gmail.com
      - SMTP_FROM=vaultwarden@vbchaos.nl
      - SMTP_FROM_NAME=Vaultwarden
      - SMTP_SECURITY=starttls
      - SMTP_PORT=587
      - SMTP_USERNAME=matthias.mitscherlich@gmail.com
      - SMTP_PASSWORD=oomgyoiqepsqaikn
      - SMTP_AUTH_MECHANISM="Login"

  openvpn:
    image: mjenz/rpi-openvpn
    container_name: openvpn
    volumes:
      - /docker_config/openvpn:/etc/openvpn
    ports:
      - 1194:1194/udp
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun
    restart: always
    privileged: true

  ddns:
    container_name: ddns
    image: registry.mitscherlich.nl/dynu-updater:1.0
    environment:
      - DYN_HOSTNAME=vbchaos.ddnsfree.com
      - DYN_USER=vbchaos
      - DYN_PASS=ce24e30b0841b43e983bff62228a97fee34a57c03d76a10f4633a4b8432f25fb #SHA256 hash of original password -> https://www.dynu.com/NetworkTools/Hash
    restart: always

  go-transip-dyndns:
    build:
      context: ./transip
    container_name: transip-dyndns
    volumes:
      - ./go-transip-dyndns.toml:/etc/go-transip-dyndns.toml
    restart: unless-stopped

