-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit resolves many long-standing problems: * Issue #25 (RESTRICTED setting) is resolved. Bots are still not fully secure, but now they are more secure that they've even been given that RESTRICTED setting is entirely useless * Issue #52 (predictable filenames) is no longer blocked * Issue #55 (sandboxable) is probably no longer relevant * Issue #118 (ramfs for /tmp) now needs an update * Issue #144 (bots leaving stuff behind) is resolved because every bot has its own /tmp * Issue #183 (source ip issue) possibly has a systemd solution for it * Issue #197 is tackled a little bit also because now there's a memory limit for every bot (3G for now, we can probably make it smaller) * Issue #238 (e.g. forkbombs) is basically resolved, but needs a bit more work * Moreover, there's now a watchdog that makes sure that bots come back online if something bad happens Not that all of this wasn't possible without systemd, it's just that it is so much easier now. Feel free to hate me as much as you want.
- Loading branch information
1 parent
3c015b2
commit 845db2e
Showing
3 changed files
with
89 additions
and
11 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Some settings don't work from user systemd, so you have to install | ||
# this file under root. See https://github.com/systemd/systemd/issues/3944 | ||
|
||
[Unit] | ||
Description=All Whateverable Bots | ||
After=network-online.target | ||
Wants=whateverable@Bisectable.service | ||
Wants=whateverable@Committable.service | ||
Wants=whateverable@Benchable.service | ||
Wants=whateverable@Evalable.service | ||
Wants=whateverable@Statisfiable.service | ||
Wants=whateverable@Unicodable.service | ||
Wants=whateverable@Bloatable.service | ||
Wants=whateverable@Quotable.service | ||
Wants=whateverable@Greppable.service | ||
Wants=whateverable@Coverable.service | ||
Wants=whateverable@Releasable.service | ||
Wants=whateverable@Nativecallable.service | ||
Wants=whateverable@Squashable.service | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/bin/true | ||
RemainAfterExit=yes | ||
|
||
[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,45 @@ | ||
# Some settings don't work from user systemd, so you have to install | ||
# this file under root. See https://github.com/systemd/systemd/issues/3944 | ||
|
||
[Unit] | ||
Description=Whateverable bot %i | ||
PartOf=whateverable-all.service | ||
|
||
[Service] | ||
Type=simple | ||
User=bisectable | ||
ExecStart=/home/bisectable/.rakudobrew/bin/perl6 /home/bisectable/git/whateverable/bin/%i.p6 | ||
Environment=PERL6LIB=/home/bisectable/git/whateverable/lib | ||
#Environment=DEBUGGABLE=1 | ||
WorkingDirectory=/home/bisectable/git/whateverable | ||
|
||
NoNewPrivileges=yes | ||
ProtectSystem=strict | ||
ProtectHome=read-only | ||
ProtectKernelTunables=yes | ||
ProtectKernelModules=yes | ||
ProtectControlGroups=yes | ||
RestrictRealtime=yes | ||
PrivateTmp=yes | ||
PrivateDevices=yes | ||
PrivateUsers=yes | ||
ReadWritePaths=/home/bisectable/git/whateverable/.precomp | ||
ReadWritePaths=/home/bisectable/git/whateverable/sandbox | ||
ReadWritePaths=/home/bisectable/git/whateverable/data | ||
ReadOnlyPaths=/home/bisectable/git/whateverable/data/builds | ||
|
||
MemoryMax=3G | ||
TasksMax=40 | ||
|
||
Restart=always | ||
RestartSec=2 | ||
# WatchdogSec is set approximately to ping timeout | ||
# TODO ... or not. There should be at least one non-ping message in 15 minutes | ||
WatchdogSec=900 | ||
# TODO is exec the right option here? | ||
NotifyAccess=exec | ||
|
||
# TODO SystemCallFilter | ||
|
||
[Install] | ||
# WantedBy=multi-user.target |