captainVersion: 4
services:
    $$cap_appname:
        image: ghcr.io/byo-software/steam-openid-connect-provider:sha-c8305ce
        restart: always
        environment:
            OpenID__RedirectUri: $$cap_redirect_uri
            OpenID__ClientID: $$cap_client_id
            OpenID__ClientSecret: $$cap_client_secret
            Hosting__PublicOrigin: $$cap_origin
            Steam__ApplicationKey: $$cap_api_key
        caproverExtra:
            containerHttpPort: '80'
caproverOneClickApp:
    variables:
        - id: $$cap_client_id
          label: OAuth Client ID
          defaultValue: 'steamidp'
          validRegex: /^[a-zA-Z]{1,20}$/
          description: OpenID ClientID used to initiate authorization.

        - id: $$cap_client_secret
          label: OpenID Client Secret
          defaultValue: $$cap_gen_random_hex(16)
          description: OpenID Client Secret used to initiate authorization.

        - id: $$cap_origin
          label: OpenID Origin URL
          defaultValue: 'http://openid.example.com'
          description: 'The base URL of where this app is hosted. Eg: https://openid.example.com or https://example.org. If left blank, it will be inferred.'

        - id: $$cap_api_key
          label: Steam API Key
          description: A working Steam API Key for this app. (https://steamcommunity.com/dev/apikey)

        - id: $$cap_redirect_uri
          label: Post login redirect URL
          description: URL the user will be redirected after login is authorized through Steam.
          defaultValue: 'http://example.com/callback'

    instructions:
        start: >-
            Steam OpenID 2.0 -> OpenID Connect Provider Proxy
            This server allows you to use Steam as an OpenID Connect Identity
            provider (OIDC IDP). This way you can use Steam logins in KeyCloak or
            any other OpenID Connect based authentication client.
        end: >-
            Your service is available at http://$$cap_appname.$$cap_root_domain

            Check its health with:

            curl -X GET 'http://$$cap_appname.$$cap_root_domain/health'
    displayName: 'Steam OpenID Connect Provider'
    isOfficial: true
    description: This server allows you to use Steam as an OpenID Connect Identity provider (OIDC IDP). This way you can use Steam logins in KeyCloak or any other OpenID Connect based authentication client.
    documentation: https://github.com/byo-software/steam-openid-connect-provider
