Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: combine settings files #42

Merged
merged 2 commits into from
Aug 2, 2024
Merged

refactor: combine settings files #42

merged 2 commits into from
Aug 2, 2024

Conversation

b-rowan
Copy link
Collaborator

@b-rowan b-rowan commented Aug 1, 2024

An alternative to #39 which combines logging and settings configuration into settings.yaml. Closes #39.

@tsagadar
Copy link
Collaborator

tsagadar commented Aug 2, 2024

Personally I prefer this version: all in one place.

The file could be split (by comments) into two parts to show configs that should be reviewed for each installation and more internal settings that usually are ok to leave as is. Here an example (note: permissions of "ops" user won't work - seem to have a bug)

## Settings to adjust for each installation

# Database to be used
db_location: db.sqlite3

# Frequency that devices should check for available updates.
poll_time_default: 00:01:00

# Frequency to log information during an update. Defines how often download progress
# and device logs get updated.
poll_time_updating: 00:00:05

# User account for the frontend. Available permissions:
# "firmware.read", "firmware.write", "firmware.delete"
# "devices.read", "devices.write", "devices.delete"
# "rollouts.read", "rollouts.write", "rollouts.delete"
# "home.read"
users:
  - email: admin@goosebit.local
    password: admin
    permissions:
      - "*"
  - email: ops@goosebit.local
    password: ops
    permissions:
      - "home.read"

## Internal settings that usually don't need to be modified
poll_time_registration: 00:00:10
tenant: DEFAULT
metrics:
  prometheus:
    port: 9090
logging:
  version: 1
  formatters:
    simple:
      format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
  handlers:
    console:
      class: logging.StreamHandler
      formatter: simple
      level: DEBUG
  loggers:
    tortoise:
      handlers: [ console ]
      level: WARNING
      propagate: yes
    aiosqlite:
      handlers: [ console ]
      level: WARNING
      propagate: yes
    multipart:
      handlers: [ console ]
      level: INFO
      propagate: yes
  root:
    level: INFO
    handlers: [ console ]

@b-rowan
Copy link
Collaborator Author

b-rowan commented Aug 2, 2024

(note: permissions of "ops" user won't work - seem to have a bug)

Let me look into this. I'll add comments as suggested.

@b-rowan b-rowan merged commit cfe3fdb into master Aug 2, 2024
@b-rowan b-rowan deleted the dev_combine_settings branch August 2, 2024 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants