services:
  tinyauth:
    image: ghcr.io/steveiliop56/tinyauth:v5.0.3
    container_name: ${CONTAINER_NAME}
    environment:
      # ---- 通用配置 ----
      - APP_URL=${PANEL_TINYAUTH_APP_URL}
      - SECRET=${PANEL_TINYAUTH_SECRET}
      - SESSION_EXPIRY=${PANEL_TINYAUTH_SESSION_EXPIRY}
      - APP_TITLE=${PANEL_TINYAUTH_APP_TITLE}
      - OAUTH_AUTO_REDIRECT=${PANEL_TINYAUTH_OAUTH_AUTO_REDIRECT}
      - BACKGROUND_IMAGE=${PANEL_TINYAUTH_BACKGROUND_IMAGE}

      # ---- Generic (示例 Linux.Do) ----
      - PROVIDERS_PLACEHOLDER_CLIENT_ID=${PANEL_TINYAUTH_GENERIC_CLIENT_ID}
      - PROVIDERS_PLACEHOLDER_CLIENT_SECRET=${PANEL_TINYAUTH_GENERIC_CLIENT_SECRET}
      - PROVIDERS_PLACEHOLDER_NAME=${PANEL_TINYAUTH_GENERIC_NAME}
      - PROVIDERS_PLACEHOLDER_AUTH_URL=${PANEL_TINYAUTH_GENERIC_AUTH_URL}
      - PROVIDERS_PLACEHOLDER_TOKEN_URL=${PANEL_TINYAUTH_GENERIC_TOKEN_URL}
      - PROVIDERS_PLACEHOLDER_USER_INFO_URL=${PANEL_TINYAUTH_GENERIC_USER_INFO_URL}
      - PROVIDERS_PLACEHOLDER_REDIRECT_URL=${PANEL_TINYAUTH_APP_URL}/api/oauth/callback/${PANEL_TINYAUTH_PROVIDER_ID}
      - PROVIDERS_PLACEHOLDER_SCOPES=${PANEL_TINYAUTH_GENERIC_SCOPES}

    ports:
      - "${PANEL_APP_PORT_HTTP}:3000"
    labels:
      createdBy: "Apps"
    networks:
      - 1panel-network
    restart: always
    volumes:
      - ./data:/data

networks:
  1panel-network:
    external: true
