forked from kelseyhightower/confd
-
Notifications
You must be signed in to change notification settings - Fork 12
feat(packaging): add RPM and DEB package support via nFPM #520
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # confd environment configuration | ||
| # This file is sourced by the confd systemd service. | ||
| # | ||
| # Documentation: https://github.com/abtreece/confd/blob/main/docs/ | ||
| # Quick start: https://github.com/abtreece/confd/blob/main/docs/quick-start-guide.md | ||
|
|
||
| # Backend to use (required) | ||
| # Options: etcd, consul, vault, redis, zookeeper, dynamodb, ssm, acm, | ||
| # secretsmanager, env, file, imds | ||
| CONFD_BACKEND="etcd" | ||
|
|
||
| # Command-line options passed to confd | ||
| # Common options: | ||
| # --watch Enable watch mode (real-time updates) | ||
| # --interval N Polling interval in seconds (default: 600) | ||
| # --onetime Run once and exit | ||
| # --node URL Backend node address (can specify multiple times) | ||
| # --prefix PATH Key prefix | ||
| # --log-level LEVEL Log level: debug, info, warn, error | ||
| # --config-file PATH Path to confd.toml config file | ||
| # --confdir PATH Path to conf.d directory | ||
| # --systemd-notify Enable systemd sd_notify support | ||
| # --watchdog-interval D Systemd watchdog ping interval (e.g., 30s) | ||
| # | ||
| # Backend-specific options vary. Run 'confd <backend> --help' for details. | ||
|
|
||
| CONFD_OPTS="--watch --systemd-notify --watchdog-interval 30s --log-level info" | ||
|
|
||
| # Examples: | ||
| # | ||
| # etcd with watch mode: | ||
| # CONFD_BACKEND="etcd" | ||
| # CONFD_OPTS="--watch --node http://127.0.0.1:2379 --systemd-notify" | ||
| # | ||
| # Consul with watch mode: | ||
| # CONFD_BACKEND="consul" | ||
| # CONFD_OPTS="--watch --node 127.0.0.1:8500 --systemd-notify" | ||
| # | ||
| # Vault with polling: | ||
| # CONFD_BACKEND="vault" | ||
| # CONFD_OPTS="--interval 60 --node https://vault.example.com:8200 --auth-type approle" | ||
| # | ||
| # File backend with watch mode: | ||
| # CONFD_BACKEND="file" | ||
| # CONFD_OPTS="--watch --file /etc/myapp/config.yaml --systemd-notify" | ||
| # | ||
| # AWS SSM Parameter Store: | ||
| # CONFD_BACKEND="ssm" | ||
| # CONFD_OPTS="--interval 300 --prefix /myapp/production" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| [Unit] | ||
| Description=confd configuration management | ||
| Documentation=https://github.com/abtreece/confd | ||
| After=network-online.target | ||
| Wants=network-online.target | ||
|
|
||
| [Service] | ||
| Type=notify | ||
| EnvironmentFile=-/etc/default/confd | ||
| EnvironmentFile=-/etc/sysconfig/confd | ||
| ExecStart=/usr/bin/confd $CONFD_BACKEND $CONFD_OPTS | ||
| ExecReload=/bin/kill -HUP $MAINPID | ||
|
|
||
| # Restart behavior | ||
| Restart=on-failure | ||
| RestartSec=5s | ||
| WatchdogSec=60s | ||
|
|
||
| # Graceful shutdown | ||
| KillMode=mixed | ||
| KillSignal=SIGTERM | ||
| TimeoutStopSec=30 | ||
|
|
||
| # Security hardening - run as root but with restrictions | ||
| CapabilityBoundingSet=CAP_DAC_OVERRIDE CAP_KILL CAP_CHOWN CAP_FOWNER CAP_DAC_READ_SEARCH | ||
| NoNewPrivileges=true | ||
| ProtectSystem=strict | ||
| ProtectHome=true | ||
| PrivateTmp=true | ||
| PrivateDevices=true | ||
| ProtectKernelTunables=true | ||
| ProtectKernelModules=true | ||
| ProtectControlGroups=true | ||
| RestrictSUIDSGID=true | ||
| RestrictRealtime=true | ||
| LockPersonality=true | ||
| MemoryDenyWriteExecute=true | ||
|
|
||
| # Allow writes to config directories and common application paths | ||
| # Note: /etc is required because confd writes to arbitrary config locations | ||
| # (e.g., /etc/nginx/nginx.conf, /etc/myapp/config.yaml). To restrict further, | ||
| # replace /etc with specific paths your templates write to: | ||
| # ReadWritePaths=/etc/nginx /etc/myapp /etc/confd /var/lib/confd /var/run | ||
| ReadWritePaths=/etc /var/lib/confd /var/run | ||
|
|
||
| # Restrict system calls | ||
| SystemCallFilter=@system-service | ||
| SystemCallArchitectures=native | ||
|
|
||
| # Resource limits | ||
| LimitNOFILE=65536 | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| # confd configuration file | ||
| # Documentation: https://github.com/abtreece/confd/blob/main/docs/configuration-guide.md | ||
| # CLI reference: https://github.com/abtreece/confd/blob/main/docs/command-line-flags.md | ||
| # | ||
| # This file provides default values. Command-line flags and environment | ||
| # variables (CONFD_*) override these settings. | ||
| # | ||
| # Note: The backend and connection settings are typically specified via | ||
| # command-line in /etc/default/confd (or /etc/sysconfig/confd on RHEL). | ||
|
|
||
| # Configuration directories | ||
| # confdir = "/etc/confd" | ||
|
|
||
| # Global key prefix applied to all template resources | ||
| # prefix = "" | ||
|
|
||
| # Polling interval in seconds (used when watch mode is disabled) | ||
| # interval = 600 | ||
|
|
||
| # Error handling mode: | ||
| # "best-effort" - Continue processing remaining templates when one fails | ||
| # "fail-fast" - Stop all processing on first template error | ||
| # failure_mode = "best-effort" | ||
|
|
||
| # Logging | ||
| # log-level = "info" | ||
| # log-format = "text" | ||
|
|
||
| # Backend connection (typically set via CLI in /etc/default/confd) | ||
| # nodes = ["http://127.0.0.1:2379"] | ||
| # scheme = "http" | ||
|
|
||
| # Authentication (if required by backend) | ||
| # basic_auth = false | ||
| # username = "" | ||
| # password = "" | ||
| # auth_token = "" | ||
|
|
||
| # TLS configuration | ||
| # client_cert = "" | ||
| # client_key = "" | ||
| # client_cakeys = "" | ||
| # client_insecure = false | ||
|
|
||
| # Timeouts | ||
| # dial_timeout = "5s" | ||
| # read_timeout = "1s" | ||
| # write_timeout = "1s" | ||
| # backend_timeout = "30s" | ||
| # check_cmd_timeout = "30s" | ||
| # reload_cmd_timeout = "60s" | ||
|
|
||
| # Retry configuration | ||
| # retry_max_attempts = 3 | ||
| # retry_base_delay = "100ms" | ||
| # retry_max_delay = "5s" | ||
|
|
||
| # Watch mode settings | ||
| # watch_error_backoff = "2s" | ||
| # debounce = "" | ||
| # batch_interval = "" | ||
|
|
||
| # Performance | ||
| # template_cache = true | ||
| # stat_cache_ttl = "1s" | ||
|
|
||
| # Metrics endpoint (disabled if empty) | ||
| # Exposes /metrics, /health, /ready, /ready/detailed | ||
| # metrics_addr = ":9100" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Granting write access to the entire /etc directory is overly permissive and undermines the ProtectSystem=strict hardening. This allows confd to modify any system configuration file. Consider restricting this to only the specific paths confd needs to write to, such as /etc/confd or specific application configuration directories that confd manages.