-
Notifications
You must be signed in to change notification settings - Fork 5
/
ssss.sh
149 lines (148 loc) · 4.42 KB
/
ssss.sh
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#!/bin/bash
apt update
apt install -y wget debian-keyring debian-archive-keyring apt-transport-https
wget -qO - https://dl.cloudsmith.io/public/caddy/stable/gpg.key | apt-key add -
wget -qO - https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt | tee -a /etc/apt/sources.list.d/caddy-stable.list
mkdir /var/torrent
mkdir /var/torrent/downloads
apt update
apt install -y caddy transmission-daemon
systemctl stop caddy
systemctl stop transmission-daemon
rm /etc/caddy/Caddyfile
PW=`caddy hash-password --plaintext $3`
cat > /etc/caddy/Caddyfile << EOL
https://$1
root * /var/torrent/
file_server {
browse
}
reverse_proxy /transmission/* localhost:9091
basicauth /downloads/* {
$2 $PW
}
EOL
chmod 444 /etc/caddy/Caddyfile
wget -O /var/torrent/torrent.svg https://upload.wikimedia.org/wikipedia/commons/4/46/Transmission_Icon.svg
wget -O /var/torrent/folder.svg https://upload.wikimedia.org/wikipedia/commons/8/8f/Gnome-folder-open.svg
cat > /var/torrent/index.html << EOL
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Seedbox</title>
</head>
<style>
h1 {
font-family: sans-serif;
font-weight: 900
}
p {
font-family: sans-serif;
font-weight: 300
}
</style>
<body>
<table width="700" border="0" align="center">
<tr>
<td><div align="center"><h1>Welcome to your seedbox</h1></div></td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="10">
<tr>
<td><a href="/transmission/web/" target="_top"><img src="torrent.svg" alt="Go to Transmission web UI" width="300" height="300" border="0"/></a></td>
<td><a href="/downloads/" target="_top"><img src="folder.svg" alt="Go to file list" width="300" height="300" border="0"/></a></td>
</tr>
</table></td>
</tr>
<tr>
<td><br/>
<br/>
<br/></td>
</tr>
<tr>
<td><div align="center"><p>Powered by: <a href=https://github.com/salakis/ssss>Stupid Simple Seedbox Script</a></p></div></td>
</tr>
</table>
<br/>
</body>
</html>
</html>
EOL
chown -R -f debian-transmission:debian-transmission /var/torrent
rm /etc/transmission-daemon/settings.json
cat > /etc/transmission-daemon/settings.json << EOL
{
"alt-speed-down": 50,
"alt-speed-enabled": false,
"alt-speed-time-begin": 540,
"alt-speed-time-day": 127,
"alt-speed-time-enabled": false,
"alt-speed-time-end": 1020,
"alt-speed-up": 50,
"bind-address-ipv4": "0.0.0.0",
"bind-address-ipv6": "::",
"blocklist-enabled": false,
"blocklist-url": "http://www.example.com/blocklist",
"cache-size-mb": 4,
"dht-enabled": true,
"download-dir": "/var/torrent/downloads",
"download-limit": 100,
"download-limit-enabled": 0,
"download-queue-enabled": true,
"download-queue-size": 5,
"encryption": 1,
"idle-seeding-limit": 30,
"idle-seeding-limit-enabled": false,
"incomplete-dir": "/var/lib/transmission-daemon/Downloads",
"incomplete-dir-enabled": false,
"lpd-enabled": false,
"max-peers-global": 200,
"message-level": 1,
"peer-congestion-algorithm": "",
"peer-id-ttl-hours": 6,
"peer-limit-global": 200,
"peer-limit-per-torrent": 50,
"peer-port": 51413,
"peer-port-random-high": 65535,
"peer-port-random-low": 49152,
"peer-port-random-on-start": false,
"peer-socket-tos": "default",
"pex-enabled": true,
"port-forwarding-enabled": false,
"preallocation": 1,
"prefetch-enabled": 1,
"queue-stalled-enabled": true,
"queue-stalled-minutes": 30,
"ratio-limit": 2,
"ratio-limit-enabled": false,
"rename-partial-files": true,
"rpc-authentication-required": true,
"rpc-bind-address": "0.0.0.0",
"rpc-enabled": true,
"rpc-password": "$3",
"rpc-port": 9091,
"rpc-url": "/transmission/",
"rpc-username": "$2",
"rpc-whitelist": "127.0.0.1",
"rpc-whitelist-enabled": true,
"scrape-paused-torrents-enabled": true,
"script-torrent-done-enabled": false,
"script-torrent-done-filename": "",
"seed-queue-enabled": false,
"seed-queue-size": 10,
"speed-limit-down": 100,
"speed-limit-down-enabled": false,
"speed-limit-up": 100,
"speed-limit-up-enabled": false,
"start-added-torrents": true,
"trash-original-torrent-files": false,
"umask": 18,
"upload-limit": 100,
"upload-limit-enabled": 0,
"upload-slots-per-torrent": 14,
"utp-enabled": true
}
EOL
systemctl start transmission-daemon
systemctl start caddy