# Include{groups}
portals:
  open:
# Include{portalLink}
questions:
# Include{global}
# Include{workload}
# Include{workloadDeployment}

# Include{replicas1}
# Include{podSpec}
# Include{containerMain}
# Include{containerBasic}
# Include{containerAdvanced}

  - variable: dsc
    group: App Configuration
    label: DSC Configuration
    schema:
      additional_attrs: true
      type: dict
      attrs:
        - variable: enabled
          label: Enable DSC (Document Importer)
          description: You need to enable integration endpoint with HTTP header as well in Rest Server configuration
          schema:
            type: boolean
            default: false
            show_subquestions_if: true
            subquestions:
              - variable: imported_action
                label: Action to perform on imported documents
                schema:
                  type: string
                  default: move
                  enum:
                    - value: move
                      description: move
                    - value: delete
                      description: delete
              - variable: not_match_glob
                label: Not match glob pattern
                schema:
                  type: string
                  default: "**/.*"
              - variable: match_glob
                label: Match glob pattern
                schema:
                  type: string
                  default: ""
              - variable: language
                label: Language
                schema:
                  type: string
                  default: ""
              - variable: tag
                label: Tag
                schema:
                  type: string
                  default: ""
  - variable: rest_server
    group: App Configuration
    label: Rest Server Configuration
    schema:
      additional_attrs: true
      type: dict
      attrs:
        - variable: app_name
          label: App Name
          description: App name, shows on the top right corner
          schema:
            type: string
            default: Docspell
        - variable: base_url
          label: Base URL
          description: This is the base URL this application is deployed to.
          schema:
            type: string
            default: ""
        - variable: server_opts
          label: Server Options
          schema:
            additional_attrs: true
            type: dict
            attrs:
              - variable: enable_http2
                label: Enable HTTP2
                schema:
                  type: boolean
                  default: false
              - variable: max_connections
                label: Max Connections
                schema:
                  type: int
                  default: 1024
              - variable: response_timeout
                label: Response Timeout
                schema:
                  type: string
                  default: 45s
        - variable: max_item_page_size
          label: Max Item Page Size
          description: This is a hard limit to restrict the size of a batch that is returned when searching for items.
          schema:
            type: int
            default: 200
        - variable: max_note_length
          label: Max Note Length
          description: The number of characters to return for each item notes when searching.
          schema:
            type: int
            default: 180
        - variable: show_classification_settings
          label: Show Classification Settings
          description: This defines whether the classification form in the collective settings is displayed or not.
          schema:
            type: boolean
            default: true
        - variable: auth
          label: Auth
          schema:
            additional_attrs: true
            type: dict
            attrs:
              - variable: session_valid
                label: Session Valid
                description: How long a authentication token is valid
                schema:
                  type: string
                  default: 5 minutes
              - variable: remember_me
                label: Remember Me
                schema:
                  additional_attrs: true
                  type: dict
                  attrs:
                    - variable: enabled
                      label: Enable Remember Me
                      schema:
                        type: boolean
                        default: true
                    - variable: valid
                      label: Valid
                      description: How long the remember me cookie/token is valid.
                      schema:
                        type: string
                        default: 30 days
        - variable: download_all
          label: Download
          schema:
            additional_attrs: true
            type: dict
            attrs:
              - variable: max_files
                label: Max Files
                description: How many files to allow in a zip
                schema:
                  type: int
                  default: 500
              - variable: max_size
                label: Max Size
                description: The maximum (uncompressed) size of the zip file contents.
                schema:
                  type: string
                  default: 1400M
        - variable: integration_endpoint
          label: Integration Endpoint
          schema:
            additional_attrs: true
            type: dict
            attrs:
              - variable: enabled
                label: Enable Integration Endpoint
                schema:
                  type: boolean
                  default: false
              - variable: priority
                label: Priority
                description: The priority to use when submitting files through this endpoint.
                schema:
                  type: string
                  default: low
                  enum:
                    - value: low
                      description: low
                    - value: high
                      description: high
              - variable: source_name
                label: Source Name
                description: The name used for the item "source" property when uploaded through this endpoint.
                schema:
                  type: string
                  default: integration
              - variable: allowed_ips
                label: Allowed IPS
                schema:
                  additional_attrs: true
                  type: dict
                  attrs:
                    - variable: enabled
                      label: Enable Allowed IPs
                      schema:
                        type: boolean
                        default: false
                    - variable: ips
                      label: IPs
                      schema:
                        type: list
                        # TODO: Check how it's rendered on GUI
                        default: ["127.0.0.1"]
                        items:
                          - variable: ipEntry
                            label: IP Entry
                            schema:
                              type: string
                              required: true
                              default: ""
              - variable: http_basic_auth
                label: HTTP Basic Auth
                schema:
                  additional_attrs: true
                  type: dict
                  attrs:
                    - variable: enabled
                      label: Enable HTTP Basic Auth
                      schema:
                        type: boolean
                        default: false
                    - variable: realm
                      label: Realm
                      schema:
                        type: string
                        default: ""
                    - variable: user
                      label: User
                      schema:
                        type: string
                        default: ""
                    - variable: password
                      label: Password
                      schema:
                        type: string
                        private: true
                        default: ""
              - variable: http_header
                label: HTTP Header
                schema:
                  additional_attrs: true
                  type: dict
                  attrs:
                    - variable: enabled
                      label: Enable HTTP Header
                      schema:
                        type: boolean
                        default: false
                    - variable: header_name
                      label: Header Name
                      schema:
                        type: string
                        default: Docspell-Integration
                    - variable: header_value
                      label: Header Value
                      schema:
                        type: string
                        private: true
                        default: some-secret
        - variable: admin_endpoint
          label: Admin Endpoint
          schema:
            additional_attrs: true
            type: dict
            attrs:
              - variable: secret
                label: Secret
                description: Disables endpoint if empty
                schema:
                  type: string
                  private: true
                  default: ""
        - variable: backend
          label: Backend
          schema:
            additional_attrs: true
            type: dict
            attrs:
              - variable: mail_debug
                label: Mail Debug
                description: Enable or disable debugging for e-mail related functionality
                schema:
                  type: boolean
                  default: false
              - variable: database_schema
                label: Database Schema
                schema:
                  additional_attrs: true
                  type: dict
                  attrs:
                    - variable: run_main_migrations
                      label: Run Main Migrations
                      description: Whether to run main database migrations.
                      schema:
                        type: boolean
                        default: true
                    - variable: run_fixup_migrations
                      label: Run Fixup Migrations
                      description: Whether to run fixup database migrations.
                      schema:
                        type: boolean
                        default: true
                    - variable: repair_schema
                      label: Repair Schema
                      description: Use with care. This repairs all migrations in the database by updating their checksums and removing failed migrations.
                      schema:
                        type: boolean
                        default: false
              - variable: signup
                label: Signup
                schema:
                  additional_attrs: true
                  type: dict
                  attrs:
                    - variable: mode
                      label: Mode
                      description: The mode defines if new users can signup or not.
                      schema:
                        type: string
                        default: open
                        enum:
                          - value: open
                            description: open
                          - value: invite
                            description: invite
                          - value: closed
                            description: closed
                    - variable: invite_time
                      label: Invite Time
                      description: This is the period an invitation token is considered valid.
                      schema:
                        type: string
                        default: 3 days
  - variable: joex
    group: App Configuration
    label: Job Executor Configuration
    schema:
      additional_attrs: true
      type: dict
      attrs:
        - variable: database_schema
          label: Database Schema
          schema:
            additional_attrs: true
            type: dict
            attrs:
              - variable: run_main_migrations
                label: Run Main Migrations
                description: Whether to run main database migrations.
                schema:
                  type: boolean
                  default: true
              - variable: run_fixup_migrations
                label: Run Fixup Migrations
                description: Whether to run fixup database migrations.
                schema:
                  type: boolean
                  default: true
              - variable: repair_schema
                label: Repair Schema
                description: Use with care. This repairs all migrations in the database by updating their checksums and removing failed migrations.
                schema:
                  type: boolean
                  default: false
        - variable: mail_debug
          label: Mail Debug
          description: Enable or disable debugging for e-mail related functionality. This applies to both sending and receiving mails.
          schema:
            type: boolean
            default: false
        - variable: send_mail
          label: Send Mail
          schema:
            additional_attrs: true
            type: dict
            attrs:
              - variable: list_id
                label: List ID
                description: Enable or disable debugging for e-mail related functionality. This applies to both sending and receiving mails.
                schema:
                  type: string
                  default: ""
        - variable: scheduler
          label: Scheduler
          schema:
            additional_attrs: true
            type: dict
            attrs:
              - variable: pool_size
                label: Pool Size
                description: Number of processing allowed in parallel.
                schema:
                  type: int
                  default: 1
              - variable: counting_scheme
                label: Counting Scheme
                description: A counting scheme determines the ratio of how high and low priority jobs are run.
                schema:
                  type: string
                  default: 4,1
              - variable: retries
                label: Retries
                description: How many times a failed job should be retried until it enters failed state.
                schema:
                  type: int
                  default: 2
              - variable: retry_delay
                label: Retry Delay
                description: The delay until the next try is performed for a failed job.
                schema:
                  type: string
                  default: 1 minute
              - variable: log_buffer_size
                label: Log Buffer Size
                description: The queue size of log statements from a job.
                schema:
                  type: int
                  default: 500
              - variable: wakeup_period
                label: Wakeup Period
                description: If no job is left in the queue, the scheduler will wait until a notify is requested.
                schema:
                  type: string
                  default: 30 minutes
        - variable: periodic_scheduler
          label: Periodic Scheduler
          schema:
            additional_attrs: true
            type: dict
            attrs:
              - variable: wakeup_period
                label: Wakeup Period
                description: A fallback to start looking for due periodic tasks regularly.
                schema:
                  type: string
                  default: 10 minutes
        - variable: user_tasks
          label: User Tasks
          schema:
            additional_attrs: true
            type: dict
            attrs:
              - variable: scan_mailbox
                label: Scan Mailbox
                schema:
                  additional_attrs: true
                  type: dict
                  attrs:
                    - variable: max_folders
                      label: Max Folders
                      description: A limit of how many folders to scan through.
                      schema:
                        type: int
                        default: 50
                    - variable: mail_chunk_size
                      label: Mail Chunk Size
                      description: How many mails (headers only) to retrieve in one chunk.
                      schema:
                        type: int
                        default: 50
                    - variable: max_mails
                      label: Max Mails
                      description: A limit on how many mails to process in one job run.
                      schema:
                        type: int
                        default: 500
        - variable: house_keeping
          label: House Keeping
          schema:
            additional_attrs: true
            type: dict
            attrs:
              - variable: schedule
                label: Schedule
                description: When the house keeping tasks execute.
                schema:
                  type: string
                  default: Sun *-*-* 00:00:00 UTC
              - variable: cleanup_invites
                label: Cleanup Invites
                schema:
                  additional_attrs: true
                  type: dict
                  attrs:
                    - variable: enabled
                      label: Enable Invite Cleanup
                      schema:
                        type: boolean
                        default: true
                    - variable: older_than
                      label: Older Than
                      description: The minimum age of invites to be deleted.
                      schema:
                        type: string
                        default: 30 days
              - variable: cleanup_remember_me
                label: Cleanup Remember Me
                schema:
                  additional_attrs: true
                  type: dict
                  attrs:
                    - variable: enabled
                      label: Enable Remember Me Cleanup
                      schema:
                        type: boolean
                        default: true
                    - variable: older_than
                      label: Older Than
                      description: The minimum age of tokens to be deleted.
                      schema:
                        type: string
                        default: 30 days
              - variable: cleanup_jobs
                label: Cleanup Jobs
                schema:
                  additional_attrs: true
                  type: dict
                  attrs:
                    - variable: enabled
                      label: Enable Jobs Cleanup
                      schema:
                        type: boolean
                        default: true
                    - variable: older_than
                      label: Older Than
                      description: The minimum age of jobs to delete.
                      schema:
                        type: string
                        default: 30 days
                    - variable: delete_batch
                      label: Delete Batch
                      description: This defines how many jobs are deleted in one transaction.
                      schema:
                        type: int
                        default: 100
              - variable: cleanup_downloads
                label: Cleanup Downloads
                schema:
                  additional_attrs: true
                  type: dict
                  attrs:
                    - variable: enabled
                      label: Enable Downloads Cleanup
                      schema:
                        type: boolean
                        default: true
                    - variable: older_than
                      label: Older Than
                      description: The minimum age of a download file to be deleted.
                      schema:
                        type: string
                        default: 14 days
              - variable: check_nodes
                label: Check Nodes
                schema:
                  additional_attrs: true
                  type: dict
                  attrs:
                    - variable: enabled
                      label: Enable Check Nodes
                      schema:
                        type: boolean
                        default: true
                    - variable: min_not_found
                      label: Min Not Found
                      description: How often the node must be unreachable, before it is removed.
                      schema:
                        type: int
                        default: 2
              - variable: integrity_check
                label: Integrity Check
                schema:
                  additional_attrs: true
                  type: dict
                  attrs:
                    - variable: enabled
                      label: Enable Integrity Check
                      schema:
                        type: boolean
                        default: true
# Include{containerConfig}
# Include{serviceRoot}
        - variable: main
          label: Main Service
          description: The Primary service on which the healthcheck runs, often the webUI
          schema:
            additional_attrs: true
            type: dict
            attrs:
# Include{serviceSelectorLoadBalancer}
# Include{serviceSelectorExtras}
                    - variable: main
                      label: Main Service Port Configuration
                      schema:
                        additional_attrs: true
                        type: dict
                        attrs:
                          - variable: port
                            label: Port
                            description: This port exposes the container port on the service
                            schema:
                              type: int
                              default: 10320
                              required: true
        - variable: joex
          label: Joex Service
          description: Joex Service
          schema:
            additional_attrs: true
            type: dict
            attrs:
# Include{serviceSelectorClusterIP}
# Include{serviceSelectorExtras}
                    - variable: joex
                      label: Joex Service Port Configuration
                      schema:
                        additional_attrs: true
                        type: dict
                        attrs:
                          - variable: port
                            label: Port
                            description: This port exposes the container port on the service
                            schema:
                              type: int
                              default: 10321
                              required: true
# Include{serviceExpertRoot}
# Include{serviceExpert}
# Include{serviceList}
        - variable: import
          label: Import Storage
          description: Mounted to DSC container at /import
          schema:
            additional_attrs: true
            type: dict
            attrs:
# Include{persistenceBasic}
# Include{persistenceList}
# Include{ingressRoot}
        - variable: main
          label: Main Ingress
          schema:
            additional_attrs: true
            type: dict
            attrs:
# Include{ingressDefault}
# Include{ingressTLS}
# Include{ingressTraefik}
# Include{ingressAdvanced}
# Include{ingressList}

# Include{podSecurityContextRoot}
        - variable: runAsUser
          label: runAsUser
          description: The UserID of the user running the application
          schema:
            type: int
            default: 0
        - variable: runAsGroup
          label: runAsGroup
          description: The groupID this App of the user running the application
          schema:
            type: int
            default: 0
# Include{securityContextContainer}
# Include{securityContextAdvanced}
# Include{securityContextPod}
        - variable: fsGroup
          label: fsGroup
          description: The group that should own ALL storage.
          schema:
            type: int
            default: 568

# Include{resources}
# Include{advanced}
# Include{addons}
# Include{codeserver}
# Include{netshoot}
# Include{vpn}
# Include{documentation}
