Skip to content

Commit 811de25

Browse files
committed
refactor: move server settings from rc.conf to config file
Remove ca-key and listen tunables from rc.d script and add them to the sample YAML config instead. The rc.d script now only handles process management (config path, user, logfile). Server behavior is configured in one place.
1 parent b791361 commit 811de25

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

contrib/freebsd/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ pkg add ./epithet-*.pkg
5656
| `epithet_server_enable` | `NO` | Enable the server service |
5757
| `epithet_server_config` | `/usr/local/etc/epithet/server.yaml` | Config file path |
5858
| `epithet_server_user` | `epithet` | User to run as |
59-
| `epithet_server_cakey` | `/usr/local/etc/epithet/ca.key` | CA private key path |
60-
| `epithet_server_listen` | `127.0.0.1:8080` | Listen address |
6159
| `epithet_server_logfile` | `/var/log/epithet_server.log` | Log file path |
6260

61+
Server settings like `listen` and `ca-key` are configured in the YAML config file, not in `rc.conf`.
62+
6363
## Troubleshooting
6464

6565
Check if the service is running:

contrib/freebsd/rc.d/epithet_server

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
# Default: /usr/local/etc/epithet/server.yaml
1313
# epithet_server_user (str): User to run as.
1414
# Default: epithet
15-
# epithet_server_cakey (path): Path to CA private key.
16-
# Default: /usr/local/etc/epithet/ca.key
17-
# epithet_server_listen (str): Listen address.
18-
# Default: :8080
1915
# epithet_server_logfile (path): Path to log file.
2016
# Default: /var/log/epithet_server.log
2117

@@ -29,13 +25,11 @@ load_rc_config $name
2925
: ${epithet_server_enable:="NO"}
3026
: ${epithet_server_config:="/usr/local/etc/epithet/server.yaml"}
3127
: ${epithet_server_user:="epithet"}
32-
: ${epithet_server_cakey:="/usr/local/etc/epithet/ca.key"}
33-
: ${epithet_server_listen:="127.0.0.1:8080"}
3428
: ${epithet_server_logfile:="/var/log/epithet_server.log"}
3529

3630
pidfile="/var/run/${name}.pid"
3731
procname="/usr/local/bin/epithet"
3832
command="/usr/sbin/daemon"
39-
command_args="-f -P ${pidfile} -u ${epithet_server_user} ${procname} --config ${epithet_server_config} --log-file ${epithet_server_logfile} server --ca-key ${epithet_server_cakey} --listen ${epithet_server_listen}"
33+
command_args="-f -P ${pidfile} -u ${epithet_server_user} ${procname} --config ${epithet_server_config} --log-file ${epithet_server_logfile} server"
4034

4135
run_rc_command "$1"

contrib/freebsd/server.yaml.sample

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
# The 'epithet server' command runs both CA and policy as supervised
66
# subprocesses behind a single port.
77

8+
# Server settings
9+
server:
10+
listen: "127.0.0.1:8080"
11+
ca-key: "/usr/local/etc/epithet/ca.key"
12+
813
# Policy server configuration
914
policy:
1015
oidc:

0 commit comments

Comments
 (0)