captainVersion: 4
services:
    $$cap_appname:
        image: vaultwarden/server:$$cap_bitwardenrs_version
        environment:
            DOMAIN: https://$$cap_appname.$$cap_root_domain
            WEBSOCKET_ENABLED: true
            SIGNUPS_ALLOWED: $$cap_register_enabled
            ADMIN_TOKEN: $$cap_admin_token
        ports:
            - 3012:3012
        volumes:
            - $$cap_appname-data:/data
        restart: unless-stopped
caproverOneClickApp:
    variables:
        - id: $$cap_bitwardenrs_version
          label: vaultwarden Version
          defaultValue: 1.21.0
          description: Check out their Docker page for the valid tags https://hub.docker.com/r/vaultwarden/server/tags
          validRegex: /^([^\s^\/])+$/
        - id: $$cap_register_enabled
          label: enabled open registration
          defaultValue: true
          description: If field is true, all visitors can create an account. If false, only the administrator can invite other users.
          validRegex: /^(true|false)$/
        - id: $$cap_admin_token
          label: admin password
          defaultValue:
          description: this password enables the admin zone on /admin. If you let this password empty, the admin interface will be disabled and it will be the best safety option.
    instructions:
        start: >-
            This is a Bitwarden server API implementation written in Rust compatible with upstream Bitwarden clients, perfect for self-hosted deployment where running the official resource-heavy service might not be ideal.

            This project is not associated with the Bitwarden project nor 8bit Solutions LLC.

            if you want more details please go to https://www.reddit.com/r/selfhosted/comments/fvld0n/bitwarden_vs_bitwarden_rs/
        end: >-
            Bitwarden_rs is deployed and available as $$cap_appname. Please give it a few minutes to boot, otherwise you will see a 502 error (even if the logs say it's working).

            Please activate https and https redirect otherwise you will have an error on account creation. You need to enable websocket too.

            If you enabled the admin token please go to https://$$cap_appname.$$cap_root_domain/admin to begin
    displayName: vaultwarden
    isOfficial: true
    description: Lightweight fully featured Rust implementation of Bitwarden.
    documentation: Taken from https://hub.docker.com/r/vaultwarden/server
