-
Notifications
You must be signed in to change notification settings - Fork 15
chore: update packaging to use config files #119
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
base: main
Are you sure you want to change the base?
Changes from all commits
d8726fb
132b24c
3a3930b
9a27d09
507dc32
990c83f
6eb6478
5049ad0
d4df0e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,22 +52,27 @@ export LDFLAGS="-X %{goipath}/internal/version.VERSION=%{commit}" | |
| %install | ||
| install -m 0755 -vd %{buildroot}%{_bindir} | ||
| install -m 0755 -vp -s %{gobuilddir}/bin/* %{buildroot}%{_bindir} | ||
| # Configuration dir | ||
| install -m 0755 -vd %{buildroot}%{_sysconfdir}/%{name} | ||
| # Configuration | ||
| install -m 0750 -vd %{buildroot}%{_sysconfdir}/%{name} | ||
| install -m 0644 -vp configs/manufacturing.yaml %{buildroot}%{_sysconfdir}/%{name} | ||
| install -m 0644 -vp configs/owner.yaml %{buildroot}%{_sysconfdir}/%{name} | ||
| install -m 0644 -vp configs/rendezvous.yaml %{buildroot}%{_sysconfdir}/%{name} | ||
| # Certificates | ||
| install -m 0750 -vd %{buildroot}%{_sysconfdir}/pki/%{name} | ||
| # Sysusers | ||
| install -m 0644 -vp -D %{SOURCE3} %{buildroot}/%{_sysusersdir}/go-fdo-server.conf | ||
| install -m 0644 -vp -D %{SOURCE4} %{buildroot}/%{_sysusersdir}/go-fdo-server-manufacturer.conf | ||
| install -m 0644 -vp -D %{SOURCE5} %{buildroot}/%{_sysusersdir}/go-fdo-server-rendezvous.conf | ||
| install -m 0644 -vp -D %{SOURCE6} %{buildroot}/%{_sysusersdir}/go-fdo-server-owner.conf | ||
| # Sysconfig files | ||
| install -m 0755 -vd %{buildroot}%{_sysconfdir}/sysconfig | ||
| install -m 0644 -vp -D configs/sysconfig/* %{buildroot}%{_sysconfdir}/sysconfig/ | ||
| # Systemd units | ||
| install -m 0755 -vd %{buildroot}%{_unitdir} | ||
| install -m 0644 -vp -D init/systemd/* %{buildroot}%{_unitdir} | ||
| # Helpers | ||
| install -m 0755 -vd %{buildroot}%{_datadir}/%{name} | ||
| install -m 0755 -vp -D scripts/* %{buildroot}%{_datadir}/%{name} | ||
| install -m 0755 -vd %{buildroot}%{_libexecdir}/%{name} | ||
| install -m 0755 -vp scripts/cert-utils.sh %{buildroot}%{_libexecdir}/%{name} | ||
| install -m 0755 -vp scripts/generate-device-ca-certs.sh %{buildroot}%{_libexecdir}/%{name} | ||
| install -m 0755 -vp scripts/generate-manufacturer-certs.sh %{buildroot}%{_libexecdir}/%{name} | ||
| install -m 0755 -vp scripts/generate-owner-certs.sh %{buildroot}%{_libexecdir}/%{name} | ||
|
|
||
| %check | ||
| %if %{with check} | ||
|
|
@@ -78,18 +83,29 @@ install -m 0755 -vp -D scripts/* %{buildroot}%{_datadir}/%{name} | |
| %license LICENSE vendor/modules.txt | ||
| %doc DOCKERFILE_USAGE.md FSIM_USAGE.md README.md SECURITY.md | ||
| %{_bindir}/go-fdo-server | ||
| %config(noreplace) %attr(770, root, go-fdo-server) %{_sysconfdir}/%{name} | ||
| %dir %attr(750, root, go-fdo-server) %{_sysconfdir}/%{name} | ||
| %dir %attr(750, root, go-fdo-server) %{_sysconfdir}/pki/%{name} | ||
| %{_sysusersdir}/%{name}.conf | ||
| %dir %{_datadir}/%{name} | ||
| %{_datadir}/%{name}/fdo-utils.sh | ||
| %{_datadir}/%{name}/cert-utils.sh | ||
| %{_datadir}/%{name}/generate-manufacturer-certs.sh | ||
| %{_datadir}/%{name}/generate-device-ca-certs.sh | ||
| %{_datadir}/%{name}/generate-owner-certs.sh | ||
| %dir %{_libexecdir}/%{name} | ||
| %{_libexecdir}/%{name}/cert-utils.sh | ||
| %{_libexecdir}/%{name}/generate-manufacturer-certs.sh | ||
| %{_libexecdir}/%{name}/generate-device-ca-certs.sh | ||
| %{_libexecdir}/%{name}/generate-owner-certs.sh | ||
| # Systemd unit | ||
| %{_unitdir}/go-fdo-server-init.service | ||
|
|
||
| %pre | ||
| %sysusers_create_compat %{SOURCE3} | ||
|
|
||
| %post | ||
| %systemd_post go-fdo-server-init.service | ||
|
|
||
| %preun | ||
| %systemd_preun go-fdo-server-init.service | ||
|
|
||
| %postun | ||
| %systemd_postun_with_restart go-fdo-server-init.service | ||
|
|
||
| %package manufacturer | ||
| Requires: go-fdo-server | ||
| Requires: group(go-fdo-server) | ||
|
|
@@ -104,9 +120,11 @@ preparing devices for the on-boarding process during the manufacturing phase. | |
| %files manufacturer | ||
| # Systemd unit | ||
| %{_unitdir}/go-fdo-server-manufacturer.service | ||
| %config(noreplace) %{_sysconfdir}/sysconfig/go-fdo-server-manufacturer | ||
| # Sysuser | ||
| %{_sysusersdir}/go-fdo-server-manufacturer.conf | ||
| # Default config | ||
| %config(noreplace) %attr(644, root, go-fdo-server) %{_sysconfdir}/%{name}/manufacturing.yaml | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this expands to
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting - that does look suspicious. lemme check... I think it's working - I'm on f41 btw. |
||
|
|
||
| %pre manufacturer | ||
| %sysusers_create_compat %{SOURCE4} | ||
|
|
||
|
|
@@ -133,9 +151,11 @@ voucher. | |
| %files rendezvous | ||
| # Systemd unit | ||
| %{_unitdir}/go-fdo-server-rendezvous.service | ||
| %config(noreplace) %{_sysconfdir}/sysconfig/go-fdo-server-rendezvous | ||
| # Sysuser | ||
| %{_sysusersdir}/go-fdo-server-rendezvous.conf | ||
| # Default config | ||
| %config(noreplace) %attr(644, root, go-fdo-server) %{_sysconfdir}/%{name}/rendezvous.yaml | ||
|
|
||
| %pre rendezvous | ||
| %sysusers_create_compat %{SOURCE5} | ||
|
|
||
|
|
@@ -162,9 +182,11 @@ necessary credentials and configuration for operation. | |
| %files owner | ||
| # Systemd unit | ||
| %{_unitdir}/go-fdo-server-owner.service | ||
| %config(noreplace) %{_sysconfdir}/sysconfig/go-fdo-server-owner | ||
| # Sysuser | ||
| %{_sysusersdir}/go-fdo-server-owner.conf | ||
| # Default config | ||
| %config(noreplace) %attr(644, root, go-fdo-server) %{_sysconfdir}/%{name}/owner.yaml | ||
|
|
||
| %pre owner | ||
| %sysusers_create_compat %{SOURCE6} | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # FDO Manufacturing server default configuration | ||
| log: | ||
| level: "info" | ||
| db: | ||
| type: "sqlite" | ||
| dsn: "file:/var/lib/go-fdo-server-manufacturer/db.sqlite" | ||
| http: | ||
| ip: "0.0.0.0" | ||
| port: "8038" | ||
| # To enable HTTPS provide the server certificate and matching | ||
| # private key below. If the certificate is signed by a certificate | ||
| # authority, the certFile should be the concatenation of the | ||
| # server's certificate, any intermediates, and the CA's certificate. | ||
| ##cert: /etc/pki/go-fdo-server/manufacturer-https-example.crt | ||
| ##key: /etc/pki/go-fdo-server/manufacturer-https-example.key | ||
| manufacturing: | ||
| key: "/etc/pki/go-fdo-server/manufacturer-example.key" | ||
| device_ca: | ||
| cert: "/etc/pki/go-fdo-server/device-ca-example.crt" | ||
| key: "/etc/pki/go-fdo-server/device-ca-example.key" | ||
| owner: | ||
| cert: "/etc/pki/go-fdo-server/owner-example.crt" | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # FDO Owner server default configuration | ||
| log: | ||
| level: "info" | ||
| db: | ||
| type: "sqlite" | ||
| dsn: "file:/var/lib/go-fdo-server-owner/db.sqlite" | ||
| http: | ||
| ip: "0.0.0.0" | ||
| port: "8043" | ||
| # To enable HTTPS provide the server certificate and matching | ||
| # private key below. If the certificate is signed by a certificate | ||
| # authority, the certFile should be the concatenation of the | ||
| # server's certificate, any intermediates, and the CA's certificate. | ||
| ##cert: /etc/pki/go-fdo-server/owner-https-example.crt | ||
| ##key: /etc/pki/go-fdo-server/owner-https-example.key | ||
| device_ca: | ||
| cert: "/etc/pki/go-fdo-server/device-ca-example.crt" | ||
| owner: | ||
| cert: "/etc/pki/go-fdo-server/owner-example.crt" | ||
| key: "/etc/pki/go-fdo-server/owner-example.key" | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # FDO Rendezvous server default configuration | ||
| log: | ||
| level: "info" | ||
| db: | ||
| type: "sqlite" | ||
| dsn: "file:/var/lib/go-fdo-server-rendezvous/db.sqlite" | ||
| http: | ||
| ip: "0.0.0.0" | ||
| port: "8041" | ||
| # To enable HTTPS provide the server certificate and matching | ||
| # private key below. If the certificate is signed by a certificate | ||
| # authority, the certFile should be the concatenation of the | ||
| # server's certificate, any intermediates, and the CA's certificate. | ||
| ##cert: /etc/pki/go-fdo-server/rendezvous-https-example.crt | ||
| ##key: /etc/pki/go-fdo-server/rendezvous-https-example.key |
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| [Unit] | ||
| Description=Create default certificates for the go-fdo-servers | ||
|
|
||
| ConditionPathExists=|!/etc/pki/go-fdo-server/manufacturer-example.key | ||
| ConditionPathExists=|!/etc/pki/go-fdo-server/manufacturer-example.crt | ||
| ConditionPathExists=|!/etc/pki/go-fdo-server/device-ca-example.key | ||
| ConditionPathExists=|!/etc/pki/go-fdo-server/device-ca-example.crt | ||
| ConditionPathExists=|!/etc/pki/go-fdo-server/owner-example.key | ||
| ConditionPathExists=|!/etc/pki/go-fdo-server/owner-example.crt | ||
kgiusti marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| [Service] | ||
| Type=oneshot | ||
| RemainAfterExit=no | ||
| Group=go-fdo-server | ||
|
|
||
| ExecStart=/usr/libexec/go-fdo-server/generate-manufacturer-certs.sh | ||
| ExecStart=/usr/libexec/go-fdo-server/generate-owner-certs.sh | ||
| ExecStart=/usr/libexec/go-fdo-server/generate-device-ca-certs.sh | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,28 @@ | ||
| # Modifying this file in-place is not recommended because changes will | ||
| # be overwritten during package upgrades. Customization should be done | ||
| # by using a systemd "drop-in" instead. | ||
| # | ||
| # For example to add an additional command line option to enable debug | ||
| # logging create an override "drop-in" unit (as is done by systemctl | ||
| # edit) and enter the following: | ||
| # | ||
| # [Service] | ||
| # ExecStart= | ||
| # ExecStart=/usr/bin/go-fdo-server manufacturing --log-level debug | ||
|
|
||
| [Unit] | ||
| Description=Go FDO manufacturer server | ||
| Requires=go-fdo-server-init.service | ||
| After=go-fdo-server-init.service | ||
| After=network.target | ||
|
|
||
| [Service] | ||
| Type=simple | ||
| PrivateDevices=yes | ||
| CacheDirectory=go-fdo-server-manufacturer | ||
| StateDirectory=go-fdo-server-manufacturer | ||
| ExecStartPre=/usr/share/go-fdo-server/generate-manufacturer-certs.sh | ||
| ExecStart=/bin/sh -c 'exec /usr/bin/go-fdo-server \ | ||
| --db-type ${DATABASE_TYPE} \ | ||
| --db-dsn ${DATABASE_DSN} \ | ||
| manufacturing ${LISTEN_IP}:${LISTEN_PORT} \ | ||
| --manufacturing-key ${MANUFACTURER_KEY} \ | ||
| --owner-cert ${OWNER_CRT} \ | ||
| --device-ca-cert ${DEVICE_CA_CRT} \ | ||
| --device-ca-key ${DEVICE_CA_KEY} \ | ||
| ${ADDITIONAL_OPTS}' | ||
| ExecStart=/usr/bin/go-fdo-server manufacturing | ||
| User=go-fdo-server-manufacturer | ||
|
|
||
| EnvironmentFile=-/etc/sysconfig/go-fdo-server-manufacturer | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,28 @@ | ||
| # Modifying this file in-place is not recommended because changes will | ||
| # be overwritten during package upgrades. Customization should be done | ||
| # by using a systemd "drop-in" instead. | ||
| # | ||
| # For example to add an additional command line option to enable debug | ||
| # logging create an override "drop-in" unit (as is done by systemctl | ||
| # edit) and enter the following: | ||
| # | ||
| # [Service] | ||
| # ExecStart= | ||
| # ExecStart=/usr/bin/go-fdo-server owner --log-level debug | ||
|
|
||
| [Unit] | ||
| Description=Go FDO owner server | ||
| Requires=go-fdo-server-init.service | ||
| After=go-fdo-server-init.service | ||
| After=network.target | ||
|
|
||
| [Service] | ||
| Type=simple | ||
| PrivateDevices=yes | ||
| CacheDirectory=go-fdo-server-owner | ||
| StateDirectory=go-fdo-server-owner | ||
| ExecStartPre=/usr/share/go-fdo-server/generate-owner-certs.sh | ||
| ExecStart=/bin/sh -c 'exec /usr/bin/go-fdo-server \ | ||
| --db-type ${DATABASE_TYPE} \ | ||
| --db-dsn ${DATABASE_DSN} \ | ||
| owner ${LISTEN_IP}:${LISTEN_PORT} \ | ||
| --owner-key ${OWNER_KEY} \ | ||
| --device-ca-cert ${DEVICE_CA_CRT} \ | ||
| ${ADDITIONAL_OPTS}' | ||
| ExecStart=/usr/bin/go-fdo-server owner | ||
| User=go-fdo-server-owner | ||
|
|
||
| EnvironmentFile=-/etc/sysconfig/go-fdo-server-owner | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target |
Uh oh!
There was an error while loading. Please reload this page.