Refactor var generation and update service configs
- Refactor var generation scripts to use _rotate helper - Update Glance service URLs to use configured ports - Set static password hash for qBittorrent in Servarr config - Update Caddy plugin hash - Remove oauth_auto_login from Grafana config - Add shared pwgen script for password generation
This commit is contained in:
parent
df41d59ae1
commit
793866e621
6 changed files with 25 additions and 15 deletions
|
|
@ -36,20 +36,25 @@ remove machine key:
|
|||
|
||||
echo "Done"
|
||||
|
||||
[doc('Remove var by {key} for {machine}')]
|
||||
[doc('Generate var values for {machine}')]
|
||||
[script]
|
||||
generate machine:
|
||||
for key in $(nix eval --apply 'builtins.attrNames' --json ..#nixosConfigurations.{{ machine }}.config.sops.secrets | jq -r '.[]'); do
|
||||
# Skip if there's no script
|
||||
[ -f "{{ justfile_directory() }}/script/$key" ] || continue
|
||||
|
||||
# Skip if we already have a value
|
||||
[ $(just vars get {{ machine }} "$key" | jq -r) ] && continue
|
||||
[ $(just vars get "{{ machine }}" "$key" | jq -r) ] && continue
|
||||
|
||||
echo "Executing script for $key"
|
||||
just vars set {{ machine }} "$key" "$(cd -- "$(dirname "{{ justfile_directory() }}/script/$key")" && source "./$(basename $key)")"
|
||||
just _rotate "{{ machine }}" "$key"
|
||||
done
|
||||
|
||||
[doc('Regenerate var values for {machine}')]
|
||||
[script]
|
||||
_rotate machine key:
|
||||
# Exit if there's no script
|
||||
[ -f "{{ justfile_directory() }}/script/{{ key }}" ] || exit
|
||||
|
||||
echo "Executing script for {{ key }}"
|
||||
just vars set "{{ machine }}" "{{ key }}" "$(cd -- "$(dirname "{{ justfile_directory() }}/script/{{ key }}")" && source "./$(basename "{{ key }}")")"
|
||||
|
||||
[script]
|
||||
check:
|
||||
cd ..
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue