-
Notifications
You must be signed in to change notification settings - Fork 0
/
server-setup
executable file
·52 lines (41 loc) · 1.07 KB
/
server-setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh -e
USER=$(whoami)
MEDIA_GROUP="media"
MEDIA_PATH="/media"
sudo groupadd -f "$MEDIA_GROUP"
sudo usermod -aG "$MEDIA_GROUP" "$USER"
sudo chown "$USER:$MEDIA_GROUP" -R "$MEDIA_PATH"
sudo chmod g+s -R "$MEDIA_PATH"
sudo setfacl -R -d -m g::rwx "$MEDIA_PATH"
# SSH Server
pkgs install openssh
sudo systemctl enable --now sshd
# CUPS
meta-install cups
sudo cupsctl --remote-admin --remote-any --share-printers
# Samba
pkgs install samba avahi wsdd2
sudo smbpasswd -a "$USER"
sudo tee /etc/samba/smb.conf > /dev/null << EOF
[global]
server string = %h
use sendfile = yes
min receivefile size = 16384
[homes]
writable = yes
[printers]
guest ok = yes
printable = yes
[media]
path = $MEDIA_PATH
writable = yes
EOF
sudo systemctl enable --now smb.service avahi-daemon.service wsdd2.service
# qBittorrent
pkgs install qbittorrent-nox
sudo systemctl enable --now "qbittorrent-nox@$USER.service"
# Jellyfin
pkgs install jellyfin-server jellyfin-web
sudo usermod -aG "$MEDIA_GROUP" jellyfin
sudo systemctl enable --now jellyfin.service
echo "server-setup done."