mirror of
https://github.com/jmcorgan/fips.git
synced 2026-07-30 19:46:15 +00:00
packaging: ship fips.yaml as an example, not a dpkg conf-file
Installing /etc/fips/fips.yaml as a live dpkg conf-file collides with a configuration-management-rendered or operator-edited config on upgrade: dpkg either prompts interactively (keep/replace), stalling unattended upgrades, or clobbers the local file. Ship the default config as /usr/share/doc/fips/fips.yaml.example (mode 644) and drop it from conf-files. postinst now seeds /etc/fips/fips.yaml from the example only when it does not already exist (mode 600), yielding to any existing config without a prompt or clobber. Add ConditionPathExists for the config to the service unit so a missing config skips the unit cleanly rather than crash-looping.
This commit is contained in:
+2
-2
@@ -71,7 +71,7 @@ assets = [
|
||||
["target/release/fips", "/usr/bin/", "755"],
|
||||
["target/release/fipsctl", "/usr/bin/", "755"],
|
||||
["target/release/fipstop", "/usr/bin/", "755"],
|
||||
["packaging/common/fips.yaml", "/etc/fips/fips.yaml", "600"],
|
||||
["packaging/common/fips.yaml", "/usr/share/fips/fips.yaml.example", "644"],
|
||||
["packaging/common/hosts", "/etc/fips/hosts", "644"],
|
||||
["packaging/common/fips.nft", "/etc/fips/fips.nft", "644"],
|
||||
["packaging/debian/fips.service", "/lib/systemd/system/fips.service", "644"],
|
||||
@@ -84,7 +84,7 @@ assets = [
|
||||
["packaging/debian/fips-gateway.service", "/lib/systemd/system/fips-gateway.service", "644"],
|
||||
["docs/design/fips-security.md", "/usr/share/doc/fips/fips-security.md", "644"],
|
||||
]
|
||||
conf-files = ["/etc/fips/fips.yaml", "/etc/fips/hosts", "/etc/fips/fips.nft"]
|
||||
conf-files = ["/etc/fips/hosts", "/etc/fips/fips.nft"]
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = "3.15"
|
||||
|
||||
Reference in New Issue
Block a user