tinoilcotechino 394d84b0a5
settings.toml: Move secrets to dedicated file. (#60)
Configuration files are checked in this order:

      1. CLI argument
      2. `$MOBILIZION_RESHARE_SETTINGS_FILE` environment variable;
      3. User configuration directory. On Linux that's `$XDG_CONFIG_HOME/mobilizon_reshare/<mobilizon-reshare-version>`;
      4. System configuration directory. On Linux that's the first element in `$XDG_CONFIG_DIRS` + `/mobilizon_reshare/<mobilizon-reshare-version>`.
      5. The default configuration distributed with the package.

The first available configuration file will be loaded. Secrets can be set either
via environment variables (such as `export MOBILIZON_RESHARE_PUBLISHER_TELEGRAM_TOKEN="my-telegram-token"` )
or by setting the `$SECRETS_FOR_DYNACONF` environment variable to a `secrets.(toml|yaml|ini|json)` file.

Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>
2021-09-07 23:39:58 +02:00

48 lines
1.0 KiB
TOML

[default]
debug = true
default = true
local_state_dir = "/var/mobilizon_reshare"
log_dir = "/var/log/mobilizon_reshare"
db_name = "events.db"
db_path = "@format {this.local_state_dir}/{this.db_name}"
[default.source.mobilizon]
url="https://some_mobilizon"
group="my_group"
[default.selection]
strategy = "next_event"
[default.publishing.window]
begin=12
end=18
[default.selection.strategy_options]
break_between_events_in_minutes =60
[default.logging]
version = 1
disable_existing_loggers = false
[default.logging.formatters.standard]
format = '[%(asctime)s] [%(levelno)s] [%(levelname)s] %(message)s'
[default.logging.handlers.console]
level = "INFO"
class = "logging.StreamHandler"
formatter = "standard"
stream = "ext://sys.stderr"
[default.logging.handlers.file]
level = "DEBUG"
class = "logging.handlers.RotatingFileHandler"
formatter = "standard"
filename = "@format {this.log_dir}/mobilizon_reshare.log"
maxBytes = 52428800
backupCount = 500
encoding = "utf8"
[default.logging.root]
level = "DEBUG"
handlers = ['console', 'file']