#
#
# Glewlwyd SSO Authorization Server
#
# Copyright 2016-2019 Nicolas Mora <mail@babelouest.org>
# Gnu Public License V3 <http://fsf.org/>
#
#

# port to open for remote commands
port=4593

# bind to IPV4 address
#bind_address="127.0.0.1"

# external url to access to this instance
external_url="http://localhost:4593"

# login url relative to external url
login_url="login.html"

# api prefix
api_prefix="api"

# path to static files for /webapp url
static_files_path="/usr/share/glewlwyd/webapp/"

# access-control-allow-origin value
allow_origin="*"

# log mode (console, syslog, journald, file)
log_mode="console"

# log level: NONE, ERROR, WARNING, INFO, DEBUG
log_level="INFO"

# output to log file (required if log_mode is file)
log_file="/var/log/glewlwyd.log"

# cookie domain
cookie_domain="localhost"

# cookie_secure, this options SHOULD be set to 1, set this to 0 to test glewlwyd on insecure connection http instead of https
cookie_secure=0

# session expiration, default is 4 weeks
session_expiration=2419200

# session key
session_key="GLEWLWYD2_SESSION_ID"

# add http header X-Frame-Options: deny, default true
add_x_frame_option_header_deny=true

# admin scope name
admin_scope="g_admin"

# profile scope name
profile_scope="g_profile"

# user_module path
user_module_path="/usr/lib/glewlwyd/user"

# user_middleware_module path
user_middleware_module_path="/usr/lib/glewlwyd/user_middleware"

# client_module path
client_module_path="/usr/lib/glewlwyd/client"

# user_auth_scheme_module path
user_auth_scheme_module_path="/usr/lib/glewlwyd/scheme"

# plugin_module path
plugin_module_path="/usr/lib/glewlwyd/plugin"

# can a user delete its account. Values available are "no", "delete" or "disable"
#delete_profile="delete"

# TLS/SSL configuration values
use_secure_connection=false
secure_connection_key_file="/etc/ssl/certs/cert.key"
secure_connection_pem_file="/etc/ssl/certs/cert.pem"
secure_connection_ca_file="/etc/ssl/certs/ca.crt"

# Algorithms available are SHA1, SHA256, SHA512, MD5, default is SHA256
hash_algorithm = "SHA512"

# MariaDB/Mysql database connection
#database =
#{
#  type     = "mariadb"
#  host     = "localhost"
#  user     = "glewlwyd"
#  password = "glewlwyd"
#  dbname   = "glewlwyd"
#  port     = 0
#}

# SQLite database connection
database =
{
  type = "sqlite3"
  path = "/var/cache/glewlwyd/glewlwyd.db"
};

# PostgreSQL database connection
#database =
#{
#  type = "postgre"
#  conninfo = "dbname = glewlwyd"
#}

# Prometheus metrics parameters
#metrics_endpoint = false
#metrics_bind_address = "127.0.0.1"
#metrics_endpoint_port = 4594
#metrics_endpoint_admin_session = false

# mime types for webapp files
static_files_mime_types =
(
  {
    extension = ".html"
    mime_type = "text/html"
    compress = 1
  },
  {
    extension = ".css"
    mime_type = "text/css"
    compress = 1
  },
  {
    extension = ".js"
    mime_type = "application/javascript"
    compress = 1
  },
  {
    extension = ".json"
    mime_type = "application/json"
    compress = 1
  },
  {
    extension = ".txt"
    mime_type = "text/plain"
    compress = 1
  },
  {
    extension = ".png"
    mime_type = "image/png"
    compress = 0
  },
  {
    extension = ".jpg"
    mime_type = "image/jpeg"
    compress = 0
  },
  {
    extension = ".jpeg"
    mime_type = "image/jpeg"
    compress = 0
  },
  {
    extension = ".ttf"
    mime_type = "font/ttf"
    compress = 0
  },
  {
    extension = ".woff"
    mime_type = "font/woff"
    compress = 0
  },
  {
    extension = ".woff2"
    mime_type = "font/woff2"
    compress = 0
  },
  {
    extension = ".otf"
    mime_type = "font/otf"
    compress = 0
  },
  {
    extension = ".eot"
    mime_type = "application/vnd.ms-fontobject"
    compress = 0
  },
  {
    extension = ".map"
    mime_type = "application/octet-stream"
    compress = 0
  },
  {
    extension = ".ico"
    mime_type = "image/x-icon"
    compress = 0
  }
)
