Skip to content

Commit 875cdc8

Browse files
Copilotunixfox
andauthored
Add systemd service file for invidious-companion (#184)
* Initial plan * Initial analysis - plan systemd service implementation Co-authored-by: unixfox <[email protected]> * Add systemd service file and installation documentation Co-authored-by: unixfox <[email protected]> * Fix systemd service configuration and add secret key requirement Co-authored-by: unixfox <[email protected]> * Add Tor proxy support to systemd service configuration - Added PROXY environment variable to systemd service for Tor SOCKS5 proxy - Included comments for both Tor daemon (port 9050) and Tor Browser (port 9150) - Updated SYSTEMD.md with proxy configuration instructions - Added support for HTTP, HTTPS, SOCKS4, and SOCKS5 proxies - Tested systemd service environment variable loading and validation Co-authored-by: unixfox <[email protected]> * Test and configure systemd service with Tor proxy on port 9150 Co-authored-by: unixfox <[email protected]> * Remove Tor proxy configuration from systemd service file Co-authored-by: unixfox <[email protected]> * Set CHANGE_ME for SERVER KEY * Delete SYSTEMD.md * Remove Systemd service installation reference Remove Systemd service installation link from README. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: unixfox <[email protected]>
1 parent 7206646 commit 875cdc8

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,6 @@ invidious_companion
4141
test_things/
4242
config/config.toml
4343
.cache/
44+
45+
# Temporary files
46+
*.zip

invidious-companion.service

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[Unit]
2+
Description=invidious-companion (companion for Invidious which handle all the video stream retrieval from YouTube servers)
3+
After=syslog.target
4+
After=network.target
5+
6+
[Service]
7+
RestartSec=2s
8+
Type=simple
9+
10+
User=invidious
11+
Group=invidious
12+
13+
# Security hardening - balanced approach for Deno applications
14+
NoNewPrivileges=true
15+
PrivateDevices=true
16+
PrivateTmp=true
17+
ProtectControlGroups=true
18+
ProtectHostname=true
19+
ProtectKernelLogs=true
20+
ProtectKernelModules=true
21+
ProtectKernelTunables=true
22+
ProtectSystem=strict
23+
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
24+
RestrictNamespaces=true
25+
RestrictSUIDSGID=true
26+
RestrictRealtime=true
27+
28+
# Filesystem access
29+
BindReadOnlyPaths=/home/invidious/invidious-companion
30+
BindPaths=/home/invidious/tmp
31+
BindPaths=/var/tmp/youtubei.js
32+
33+
WorkingDirectory=/home/invidious/invidious-companion
34+
ExecStart=/home/invidious/invidious-companion/invidious_companion
35+
36+
Environment=SERVER_USE_UNIX_SOCKET=true
37+
Environment=SERVER_UNIX_SOCKET_PATH=/home/invidious/tmp/invidious-companion.sock
38+
Environment=SERVER_SECRET_KEY=CHANGE_ME
39+
Environment=CACHE_DIRECTORY=/var/tmp/youtubei.js
40+
41+
Restart=always
42+
43+
[Install]
44+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)