feat: allow configuring settings #6

Merged
thubrecht merged 1 commit from lukegb/stateless-uptime-kuma:settings into master 2024-10-06 21:31:10 +02:00
Contributor

This allows setting a settings attrset in the module, which will then
change that setting to the specified value. This is particularly useful
for e.g. the entryPage setting, which you can then make set to a
particular value.

There's an escape hatch for string-valued secrets which live in the
settings, like the Steam API key: string-valued settings can be
specified by using the __FILE suffix on the setting name (e.g.
steamAPIKey__FILE) and then specifying the path to a file instead.
The content of that file will be used as the setting instead.

This allows setting a settings attrset in the module, which will then change that setting to the specified value. This is particularly useful for e.g. the `entryPage` setting, which you can then make set to a particular value. There's an escape hatch for string-valued secrets which live in the settings, like the Steam API key: string-valued settings can be specified by using the __FILE suffix on the setting name (e.g. steamAPIKey__FILE) and then specifying the path to a file instead. The content of that file will be used as the setting instead.
lukegb added 1 commit 2024-10-06 21:16:16 +02:00
This allows setting a settings attrset in the module, which will then
change that setting to the specified value. This is particularly useful
for e.g. the `entryPage` setting, which you can then make set to a
particular value.

There's an escape hatch for string-valued secrets which live in the
settings, like the Steam API key: string-valued settings can be
specified by using the __FILE suffix on the setting name (e.g.
steamAPIKey__FILE) and then specifying the path to a file instead.
The content of that file will be used as the setting instead.
Owner

Looks good to me !

Looks good to me !
mdebray approved these changes 2024-10-06 21:30:48 +02:00
thubrecht approved these changes 2024-10-06 21:30:49 +02:00
@ -49,0 +55,4 @@
# We need all of the arguments; settings are saved all at once.
# We take any settings that are not explicitly set back from the server.
for k, v in old.items():
if k not in new.kwargs:
Owner

nitpick(non blocking): new.kwargs.setdefault(k, v)
But I want to rewrite this file anyway

nitpick(non blocking): `new.kwargs.setdefault(k, v)` But I want to rewrite this file anyway
thubrecht merged commit 880f444ff7 into master 2024-10-06 21:31:10 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: DGNum/stateless-uptime-kuma#6
No description provided.