services:
  2fauth:
    image: "2fauth/2fauth:latest"
    container_name: ${CONTAINER_NAME}
    restart: always
    networks:
      - 1panel-network
    ports:
      - ${PANEL_APP_PORT_HTTP}:8000/tcp
    volumes:
      - ./data:/2fauth
    environment:
      - APP_NAME=${APP_NAME}
      - APP_ENV=${APP_ENV}
      - APP_TIMEZONE=${APP_TIMEZONE}
      - APP_DEBUG=${APP_DEBUG}
      - SITE_OWNER=${SITE_OWNER}
      - APP_KEY=${APP_KEY}
      - APP_URL=${APP_URL}
      - IS_DEMO_APP=${IS_DEMO_APP}
      - LOG_CHANNEL=${LOG_CHANNEL}
      - LOG_LEVEL=${LOG_LEVEL}
      - DB_DATABASE=${DB_DATABASE}
      - CACHE_DRIVER=${CACHE_DRIVER}
      - SESSION_DRIVER=${SESSION_DRIVER}
      - MAIL_MAILER=${MAIL_MAILER}
      - MAIL_HOST=${MAIL_HOST}
      - MAIL_PORT=${MAIL_PORT}
      - MAIL_USERNAME=${MAIL_USERNAME}
      - MAIL_PASSWORD=${MAIL_PASSWORD}
      - MAIL_ENCRYPTION=${MAIL_ENCRYPTION}
      - MAIL_FROM_NAME=${MAIL_FROM_NAME}
      - MAIL_FROM_ADDRESS=${MAIL_FROM_ADDRESS}
      - MAIL_VERIFY_SSL_PEER=${MAIL_VERIFY_SSL_PEER}
      - THROTTLE_API=${THROTTLE_API}
      - LOGIN_THROTTLE=${LOGIN_THROTTLE}
      - AUTHENTICATION_GUARD=${AUTHENTICATION_GUARD}
      - AUTHENTICATION_LOG_RETENTION=${AUTHENTICATION_LOG_RETENTION}
      - AUTH_PROXY_HEADER_FOR_USER=${AUTH_PROXY_HEADER_FOR_USER}
      - AUTH_PROXY_HEADER_FOR_EMAIL=${AUTH_PROXY_HEADER_FOR_EMAIL}
      - PROXY_LOGOUT_URL=${PROXY_LOGOUT_URL}
      - WEBAUTHN_NAME=${WEBAUTHN_NAME}
      - WEBAUTHN_ID=${WEBAUTHN_ID}
      - WEBAUTHN_USER_VERIFICATION=${WEBAUTHN_USER_VERIFICATION}
      - TRUSTED_PROXIES=${TRUSTED_PROXIES}
      - PROXY_FOR_OUTGOING_REQUESTS=${PROXY_FOR_OUTGOING_REQUESTS}
      - BROADCAST_DRIVER=${BROADCAST_DRIVER}
      - QUEUE_DRIVER=${QUEUE_DRIVER}
      - SESSION_LIFETIME=${SESSION_LIFETIME}
      - REDIS_HOST=${REDIS_HOST}
      - REDIS_PASSWORD=${PANEL_REDIS_ROOT_PASSWORD}
      - REDIS_PORT=${REDIS_PORT}
      - PUSHER_APP_ID=${PUSHER_APP_ID}
      - PUSHER_APP_KEY=${PUSHER_APP_KEY}
      - PUSHER_APP_SECRET=${PUSHER_APP_SECRET}
      - PUSHER_APP_CLUSTER=${PUSHER_APP_CLUSTER}
      - VITE_PUSHER_APP_KEY=${PUSHER_APP_KEY}
      - VITE_PUSHER_APP_CLUSTER=${PUSHER_APP_CLUSTER}
      - MIX_ENV=${MIX_ENV}
      # 删除以下行前的#号表示启用
      #- OPENID_AUTHORIZE_URL=${OPENID_AUTHORIZE_URL}
      #- OPENID_TOKEN_URL=${OPENID_TOKEN_URL}
      #- OPENID_USERINFO_URL=${OPENID_USERINFO_URL}
      #- OPENID_CLIENT_ID=${OPENID_CLIENT_ID}
      #- OPENID_CLIENT_SECRET=${OPENID_CLIENT_SECRET}
      #- GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}
      #- GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET}
    labels:
      createdBy: "Apps"

networks:
  1panel-network:
    external: true