ansible-base/ansible/roles/hedgedoc/templates/config.json.j2

63 lines
2 KiB
Django/Jinja

{
"production": {
"loglevel": "error",
{% if var_hedgedoc_database_kind == 'sqlite' %}
"db": {
"dialect": "sqlite",
"storage": "{{var_hedgedoc_database_path}}"
},
{% endif %}
{% if var_hedgedoc_database_kind == 'postgresql' %}
"db": {
"dialect": "postgres",
"host": "{{var_hedgedoc_database_data_postgresql_host}}",
"port": {{var_hedgedoc_database_data_postgresql_port | to_json}},
"username": "{{var_hedgedoc_database_data_postgresql_username}}",
"password": "{{var_hedgedoc_database_data_postgresql_password}}",
"database": "{{var_hedgedoc_database_data_postgresql_schema}}"
},
{% endif %}
"sessionSecret": "{{var_hedgedoc_session_secret}}",
"host": "localhost",
"allowOrigin": [
"localhost"
],
"domain": "{{var_hedgedoc_domain}}",
"urlAddPort": false,
"protocolUseSSL": true,
{% if var_hedgedoc_oauth2_enable %}
"oauth2": {
"providerName": "{{var_hedgedoc_oauth2_provider_name}}",
"clientID": "{{var_hedgedoc_oauth2_client_id}}",
"clientSecret": "{{var_hedgedoc_oauth2_client_secret}}",
"scope": "openid email profile",
"userProfileUsernameAttr": "sub",
"userProfileDisplayNameAttr": "name",
"userProfileEmailAttr": "email",
"userProfileURL": "{{var_hedgedoc_oauth2_user_profile_url}}",
"tokenURL": "{{var_hedgedoc_oauth2_token_url}}",
"authorizationURL": "{{var_hedgedoc_oauth2_authorization_url}}"
},
"email": false,
"allowEmailRegister": false,
{% else %}
"email": true,
"allowEmailRegister": true,
{% endif %}
"allowAnonymous": {{var_hedgedoc_guest_allow_create | to_json}},
"allowAnonymousEdits": {{var_hedgedoc_guest_allow_edit | to_json}},
{% if var_hedgedoc_free_names_mode == 'never' %}
"allowFreeURL": false,
"requireFreeURLAuthentication": false,
{% endif %}
{% if var_hedgedoc_free_names_mode == 'authed' %}
"allowFreeURL": true,
"requireFreeURLAuthentication": true,
{% endif %}
{% if var_hedgedoc_free_names_mode == 'always' %}
"allowFreeURL": true,
"requireFreeURLAuthentication": false,
{% endif %}
"defaultPermission": "editable"
}
}