-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The systemd service is run as root but is significanty hardened. There is no default config file shipped.
- Loading branch information
1 parent
e5afc55
commit 2947fdc
Showing
6 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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 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 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,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Expects array $CHANGED_PACKAGES with list of changed packages | ||
# Expects $COPR_API_CONFIG with copr API token | ||
|
||
echo "$COPR_API_CONFIG" > ~/.config/copr | ||
|
||
for package in "$CHANGED_PACKAGES"; do | ||
echo $package | ||
curl -X POST $COPR_WEBHOOK/$(echo $package ) | ||
done | ||
|
||
|
This file contains 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,34 @@ | ||
[Unit] | ||
Description=T2FanRD daemon to manage fan curves for t2 macs | ||
|
||
[Service] | ||
Type=exec | ||
ExecStart=t2fanrd | ||
Restart=always | ||
|
||
PrivateTmp=true | ||
ProtectSystem=true | ||
ProtectHome=true | ||
ProtectClock=true | ||
ProtectHostname=true | ||
ProtectControlGroups=true | ||
ProtectHostname=true | ||
ProtectKernelLogs=true | ||
ProtectKernelModules=true | ||
ProtectProc=invisible | ||
PrivateDevices=true | ||
PrivateNetwork=true | ||
NoNewPrivileges=true | ||
DevicePolicy=closed | ||
KeyringMode=private | ||
LockPersonality=true | ||
MemoryDenyWriteExecute=true | ||
PrivateUsers=yes | ||
RemoveIPC=yes | ||
RestrictNamespaces=yes | ||
RestrictRealtime=yes | ||
RestrictSUIDSGID=yes | ||
SystemCallArchitectures=native | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains 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,68 @@ | ||
%global forgeurl https://github.com/GnomedDev/T2FanRD | ||
%global commit 68859ca5f858d542444c64391faa90678afb6995 | ||
%forgemeta -iv | ||
|
||
%bcond_without check | ||
|
||
# prevent library files from being installed | ||
%global __cargo_is_lib() 0 | ||
|
||
%global crate t2fanrd | ||
|
||
Name: t2fanrd | ||
Version: 0.1.0 | ||
Release: 1%{?dist} | ||
Summary: Simple Fan Daemon for T2 Macs | ||
|
||
SourceLicense: GPL-3.0-or-later | ||
License: GPL-3.0-or-later AND Apache-2.0 OR MIT AND MIT | ||
|
||
URL: %{forgeurl} | ||
Source0: %{forgesource} | ||
Source1: t2fanrd.service | ||
|
||
BuildRequires: cargo-rpm-macros >= 24 | ||
BuildRequires: systemd-rpm-macros | ||
|
||
%description | ||
Simple Fan Daemon for T2 Macs. | ||
|
||
%prep | ||
%forgeautosetup -p1 | ||
%cargo_prep | ||
|
||
%generate_buildrequires | ||
%cargo_generate_buildrequires | ||
|
||
%build | ||
%cargo_build | ||
%{cargo_license_summary} | ||
%{cargo_license} > LICENSE.dependencies | ||
|
||
%install | ||
%cargo_install | ||
install -Dpm0644 -t %{buildroot}%{_unitdir} %{SOURCE1} | ||
|
||
%if %{with check} | ||
%check | ||
%cargo_test | ||
%endif | ||
|
||
%post | ||
%systemd_post %{crate}.service | ||
|
||
%preun | ||
%systemd_preun %{crate}.service | ||
|
||
%postun | ||
%systemd_postun_with_restart %{crate}.service | ||
|
||
%files | ||
%license LICENCE | ||
%license LICENSE.dependencies | ||
%doc README.md | ||
%{_bindir}/%{crate} | ||
%{_unitdir}/%{crate}.service | ||
|
||
%changelog | ||
%autochangelog |