# Human readable description of the algorithm store instance. This is to help
# your peers to identify the store
description: Test

# IP address to which the algorithm store server binds. In case you specify 0.0.0.0
# the server listens on all interfaces
ip: 0.0.0.0

# Port to which the algorithm store binds
port: 7602

# API path prefix. Server may be reached at https://domain.org/<api_path>/<endpoint>.
# In case you use a reverse proxy and use a subpath, make sure to set this option.
api_path: /api

# The URI to the algorithm store database. This should be a valid SQLAlchemy URI,
# e.g. for a SQLite database: sqlite:///database-name.sqlite,
# or Postgres: postgresql://username:password@172.17.0.1/database).
# Note that SQLite is not recommended for production use.
uri: sqlite:///test.sqlite

# This should be set to false in production as this allows to completely
# wipe the database in a single command. Useful to set to true when
# testing/developing.
allow_drop_all: true

# Settings for the logger
logging:
  # Controls the logging output level. Could be one of the following
  # levels: CRITICAL, ERROR, WARNING, INFO, DEBUG, NOTSET
  level: DEBUG

  # Filename of the log-file, used by RotatingFileHandler
  file: test.log

  # Whether the output is shown in the console or not
  use_console: true

  # The number of log files that are kept, used by RotatingFileHandler
  backup_count: 5

  # Size in kB of a single log file, used by RotatingFileHandler
  max_size: 1024

  # format: input for logging.Formatter,
  format: "%(asctime)s - %(name)-14s - %(levelname)-8s - %(message)s"
  datefmt: "%Y-%m-%d %H:%M:%S"

  # (optional) set the individual log levels per logger name, for example
  # mute some loggers that are too verbose.
  loggers:
    - name: urllib3
      level: warning
    - name: sqlalchemy.engine
      level: warning

# Additional debug flags
debug:
  # Set to `true` to enable debug mode in the Flask app
  flask: false

# Settings for the algorithm store's policies
policies:
  # Set who is allowed to view the algorithms in the store. Possible values are:
  # - "public": everyone can view the algorithms
  # - "whitelisted": only users from whitelisted servers can view the algorithms
  # - "private": only users with explicit permission in the algorithm store can view the
  #   algorithms
  algorithm_view: "public"

  # List of servers for which users are allowed to modify algorithms or other resources
  # in the algorithm store. If used together with "whitelisted" algorithm_view policy,
  # any user from these servers will be able to use the algorithms from the store.
  allowed_servers:
    - "https://cotopaxi.vantage6.ai"
    - "http://localhost:7601/api"

  # Localhost servers are by default never allowed to connect to the algorithm store,
  # even if no allowed servers lists are given. This setting can be used to allow
  # localhost servers to connect.
  allow_localhost: false

  # Set the minimum number of reviewers that need to approve an algorithm before it
  # is available in the store. In case this number is lower than min_reviewing_organizations,
  # the min_reviewing_organizations still has to be met to proceed with the review process.
  min_reviewers: 2

  # Define whether or not developers are able to assign reviewers to their own algorithms.
  assign_review_own_algorithm: false

  # Define the minimum amount of organizations that must be involved in the review process.
  min_reviewing_organizations: 2

  # Specify the users that are allowed to review algorithms. This is a list of usernames and servers
  # that identify unique users. This works in combination with the permission system. If this policy
  # is not set, all users with the right permissions are allowed to review algorithms.
  allowed_reviewers:
    - username: "username"
      server: "http://localhost:7601/api"

  # Specify the users that are allowed to assign reviews. This is a list of usernames and servers
  # that identify unique users. This works in combination with the permission system. If this policy
  # is not set, all users with the right permissions are allowed to assign reviews.
  allowed_review_assigners:
    - username: "username"
      server: "http://localhost:7601/api"

# Credentials used to login to private Docker registries. These credentials are used
# to e.g. find the digests of the algorithm.
docker_registries:
  - registry: docker-registry.org
    username: docker-registry-user
    password: docker-registry-password

# development mode settings. Only use when running both the algorithm store and
# the server that it communicates with locally
dev:
  # Specify the URI to the host. This is used to generate the correct URIs to
  # communicate with the server. On Windows and Mac, you can use the special
  # hostname `host.docker.internal` to refer to the host machine. On Linux, you
  # should normally use http://172.17.0.1.
  host_uri: http://host.docker.internal

  # disable review process - all submitted algorithms are automatically accepted, which
  # can be useful while developing algorithms locally. By default, the review process
  # is enabled.
  disable_review: false

  # Define whether or not developers are able to review their own algorithms. For
  # production, this is not recommended, but it can facilitate development. By default,
  # this is disabled.
  review_own_algorithm: false

# Provide an initial root user for the algorithm store. This user will be created
# when the store is started for the first time. The root user has full access to
# the store and can create other users. The root user should be a reference to an
# existing user in a vantage6 server.
root_user:
  # URI to the vantage6 server
  v6_server_uri: http://localhost:7601/api
  # username of the vantage6 server's user you want to make root in the algorithm store
  username: root
  # email of the vantage6 server's user you want to make root in the algorithm store
  email: root@organization.com
  # id of the organization the user belongs to
  organization_id: 1

# Configure a smtp mail server for the store to use for administrative
# purposes, e.g. to alert users that they have been assigned to review an algorithm,
# that their algorithm has been approved, etc.
# OPTIONAL
smtp:
  port: 587
  server: smtp.yourmailserver.example.com
  # credentials for authenticating with the SMTP server
  username: your-username
  password: super-secret-password
  # email address to send emails from (header)
  # (defaults to noreply@vantage6.ai)
  email_from: noreply@example.com

# Set an email address you want to direct your users to for support
# (defaults to support@vantage6.ai)
support_email: your-support@example.com

# Let the algorithm store know where it is hosted. This is used as a setting to
# communicate back and forth with other vantage6 components such as the server.
# Example for the cotopaxi server
server_url: https://store.cotopaxi.vantage6.ai
# Example for running the store locally with default settings:
# server_url: http://localhost:7602

# set up with which origins the server should allow CORS requests. The default
# is to allow all origins. If you want to restrict this, you can specify a list
# of origins here. Below are examples to allow requests from the Cotopaxi UI, and
# port 7600 on localhost. Usually, only the UI needs to access the store.
cors_allowed_origins:
  - https://portal.cotopaxi.vantage6.ai
  - http://localhost:7600
