Switched to transmission
This commit is contained in:
parent
7cab1bb7e8
commit
6abb660efe
24 changed files with 273 additions and 133 deletions
7
pillars/roles/mount/transmission.sls
Normal file
7
pillars/roles/mount/transmission.sls
Normal file
|
@ -0,0 +1,7 @@
|
|||
mount:
|
||||
sshfs:
|
||||
/mnt/video:
|
||||
name: video
|
||||
host: host.actcur.com
|
||||
directory: /mnt/butter/video
|
||||
user: mount
|
14
pillars/roles/nginx/transmission.sls
Normal file
14
pillars/roles/nginx/transmission.sls
Normal file
|
@ -0,0 +1,14 @@
|
|||
nginx:
|
||||
transmission:
|
||||
auth: 2fa
|
||||
default: no
|
||||
https:
|
||||
port: 9091
|
||||
prot: http
|
||||
|
||||
portal:
|
||||
Media:
|
||||
transmission:
|
||||
name: Torrents
|
||||
summary: Transmission Torrent Server
|
||||
public: false
|
|
@ -1,3 +0,0 @@
|
|||
services:
|
||||
aurrepo:
|
||||
updateaur.timer: []
|
1
pillars/servers/env/server/transmission.sls
vendored
Normal file
1
pillars/servers/env/server/transmission.sls
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
env: prod
|
|
@ -10,3 +10,4 @@ grains:
|
|||
- lidarr
|
||||
- jackett
|
||||
- ytdownloader
|
||||
- podfox
|
||||
|
|
|
@ -5,5 +5,5 @@ grains:
|
|||
- nrpe
|
||||
- saltminion
|
||||
- pkg-cache
|
||||
- aurrepo
|
||||
- aurblobs
|
||||
- nginx-proxy
|
||||
|
|
8
pillars/servers/roles/server/transmission.sls
Normal file
8
pillars/servers/roles/server/transmission.sls
Normal file
|
@ -0,0 +1,8 @@
|
|||
grains:
|
||||
roles:
|
||||
- server
|
||||
- nrpe
|
||||
- saltminion
|
||||
- nginx-proxy
|
||||
- windscribe
|
||||
- transmission
|
|
@ -4,6 +4,17 @@ base-devel:
|
|||
sudo:
|
||||
pkg.installed
|
||||
|
||||
python-pip:
|
||||
pkg.installed
|
||||
|
||||
docker:
|
||||
pkg.installed
|
||||
|
||||
install_aurblobs:
|
||||
pip.installed:
|
||||
- name: aurblobs
|
||||
- upgrade: true
|
||||
|
||||
{% if pillar['aur'] is defined -%}
|
||||
{% if pillar['aur']['require'] is defined -%}
|
||||
{% for pkg in pillar['aur']['require'] %}
|
||||
|
@ -30,19 +41,7 @@ user-build:
|
|||
file.symlink:
|
||||
- target: /mnt/build/
|
||||
|
||||
git-aur_repo:
|
||||
git.latest:
|
||||
- name: https://git.actcur.com/actcur/aur_repo
|
||||
- target: /home/build/aur_repo
|
||||
- user: build
|
||||
|
||||
build-aur_repo:
|
||||
cmd.run:
|
||||
- name: "makepkg -si --noconfirm;git reset --hard;git clean -f"
|
||||
- runas: build
|
||||
- cwd: /home/build/aur_repo
|
||||
- onchanges:
|
||||
- git: git-aur_repo
|
||||
|
||||
/etc/aur_repo/pkglist:
|
||||
file.managed:
|
71
states/roles/maintain/aurblobs/init.sls.save
Normal file
71
states/roles/maintain/aurblobs/init.sls.save
Normal file
|
@ -0,0 +1,71 @@
|
|||
base-devel:
|
||||
pkg.group_installed
|
||||
|
||||
sudo:
|
||||
pkg.installed
|
||||
|
||||
python-pip:
|
||||
pkg.installed
|
||||
|
||||
docker:
|
||||
pkg.installed
|
||||
|
||||
install_aurblobs:
|
||||
pip.installed:
|
||||
- name: aurblobs
|
||||
- upgrade: truere
|
||||
|
||||
{% if pillar['aur'] is defined -%}
|
||||
{% if pillar['aur']['require'] is defined -%}
|
||||
{% for pkg in pillar['aur']['require'] %}
|
||||
aur_require_{{pkg}}:
|
||||
pkg.installed:
|
||||
- name: "{{pkg}}"
|
||||
{%- endfor -%}
|
||||
{%- endif -%}
|
||||
{%- endif %}
|
||||
|
||||
user-build:
|
||||
user.present:
|
||||
- name: build
|
||||
- createhome: true
|
||||
file.append:
|
||||
- name: /etc/sudoers
|
||||
- text: "build ALL=(ALL) NOPASSWD: ALL"
|
||||
|
||||
/repo:
|
||||
file.symlink:
|
||||
- target: /mnt/pkgs/aur-local/os/x86_64/
|
||||
|
||||
/build:
|
||||
file.symlink:
|
||||
- target: /mnt/build/
|
||||
|
||||
|
||||
|
||||
/etc/aur_repo/pkglist:
|
||||
file.managed:
|
||||
- source: salt://roles/maintain/aurrepo/pkglist
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 644
|
||||
- makedirs: true
|
||||
- template: jinja
|
||||
|
||||
"/usr/lib/systemd/system/updateaur.service":
|
||||
file.managed:
|
||||
- source: salt://roles/maintain/aurrepo/updateaur.service
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 644
|
||||
|
||||
"/usr/lib/systemd/system/updateaur.timer":
|
||||
file.managed:
|
||||
- source: salt://roles/maintain/aurrepo/updateaur.timer
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 644
|
||||
|
||||
"updateaur.timer":
|
||||
service.running:
|
||||
- enable: true
|
44
states/roles/maintain/podfox/init.sls
Normal file
44
states/roles/maintain/podfox/init.sls
Normal file
|
@ -0,0 +1,44 @@
|
|||
python-pip:
|
||||
pkg.installed
|
||||
|
||||
podfox:
|
||||
pip.installed:
|
||||
- require:
|
||||
- pkg: python-pip
|
||||
|
||||
/opt/scripts/run_podfox.sh:
|
||||
file.managed:
|
||||
- source: salt://roles/maintain/podfox/run_podfox.sh
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 644
|
||||
- mkdirs: true
|
||||
|
||||
/etc/systemd/system/run_podfox.service:
|
||||
file.managed:
|
||||
- source: salt://roles/maintain/podfox/run_podfox.service
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 644
|
||||
- mkdirs: true
|
||||
|
||||
/etc/systemd/system/run_podfox.timer:
|
||||
file.managed:
|
||||
- source: salt://roles/maintain/podfox/run_podfox.timer
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 644
|
||||
- mkdirs: true
|
||||
|
||||
run_podfox_timer:
|
||||
service.running:
|
||||
- name: run_podfox.timer
|
||||
- enable: true
|
||||
|
||||
/root/.podfox.json:
|
||||
file.managed:
|
||||
- source: salt://roles/maintain/podfox/podfox.json
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 644
|
||||
- mkdirs: true
|
4
states/roles/maintain/podfox/podfox.json
Normal file
4
states/roles/maintain/podfox/podfox.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"podcast-directory" : "/mnt/video/Unorganized_Podcasts",
|
||||
"maxnum" : 5
|
||||
}
|
11
states/roles/maintain/podfox/run_podfox.service
Normal file
11
states/roles/maintain/podfox/run_podfox.service
Normal file
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=rTorrent
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
Type=simple
|
||||
KillMode=none
|
||||
ExecStart=/bin/bash /opt/scripts/run_podfox.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
2
states/roles/maintain/podfox/run_podfox.sh
Normal file
2
states/roles/maintain/podfox/run_podfox.sh
Normal file
|
@ -0,0 +1,2 @@
|
|||
podfox update
|
||||
podfox download
|
11
states/roles/maintain/podfox/run_podfox.timer
Normal file
11
states/roles/maintain/podfox/run_podfox.timer
Normal file
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=Run podfox update and download every 30 minutes
|
||||
|
||||
[Timer]
|
||||
OnBootSec=5min
|
||||
OnUnitActiveSec=30min
|
||||
|
||||
Unit=run_podfox.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
42
states/roles/maintain/transmission/init.sls
Normal file
42
states/roles/maintain/transmission/init.sls
Normal file
|
@ -0,0 +1,42 @@
|
|||
transmission-pkg:
|
||||
pkg.installed:
|
||||
- name: transmission-cli
|
||||
|
||||
transmission-settings:
|
||||
file.symlink:
|
||||
- name: /var/lib/transmission/.config/transmission-daemon/settings.json
|
||||
- target: /mnt/video/transmission/settings.json
|
||||
- force: true
|
||||
|
||||
transmission-service:
|
||||
service.running:
|
||||
- name: transmission
|
||||
- enable: true
|
||||
|
||||
/opt/scripts/restart_transmission.sh:
|
||||
file.managed:
|
||||
- source: salt://roles/maintain/transmission/restart_transmission.sh
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 644
|
||||
- mkdirs: true
|
||||
|
||||
/etc/systemd/system/restart_transmission.service:
|
||||
file.managed:
|
||||
- source: salt://roles/maintain/transmission/restart_transmission.service
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 644
|
||||
- mkdirs: true
|
||||
|
||||
/etc/systemd/system/restart_transmission.timer:
|
||||
file.managed:
|
||||
- source: salt://roles/maintain/transmission/restart_transmission.timer
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 644
|
||||
- mkdirs: true
|
||||
transmission_timer:
|
||||
service.running:
|
||||
- name: restart_transmission.timer
|
||||
- enable: true
|
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=rTorrent
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
Type=simple
|
||||
KillMode=none
|
||||
ExecStart=/bin/bash /opt/scripts/rtorrent.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
21
states/roles/maintain/transmission/restart_transmission.sh
Normal file
21
states/roles/maintain/transmission/restart_transmission.sh
Normal file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
#resurrect rtorrent when it dies and restart every 6 hours
|
||||
hour=`date | grep -Po "\d\d:\d\d:\d\d" | grep -Po "^\d\d:\d\d"`
|
||||
|
||||
if [ "$hour" = "00:00" ] || [ "$hour" = "06:00" ] || [ "$hour" = "12:00" ] || [ "$hour" = "18:00" ];then
|
||||
windscribe disconnect
|
||||
windscribe connect
|
||||
systemctl restart transmission.service
|
||||
fi
|
||||
|
||||
currentip=`ps aux | grep rtorrent | grep -v "SCREEN" | grep -Po "\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"`
|
||||
tunip=`ip addr show tun0 | grep -Po "inet \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}" | grep -Po "\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"`
|
||||
|
||||
if [ "$currentip" = "$tunip" ];then
|
||||
echo "transmission is up"
|
||||
else
|
||||
echo "restarting transmission"
|
||||
windscribe disconnect
|
||||
windscribe connect
|
||||
systemctl restart transmission.service
|
||||
fi
|
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=Verify that rtorrent is running
|
||||
|
||||
[Timer]
|
||||
OnBootSec=2min
|
||||
OnUnitActiveSec=1min
|
||||
|
||||
Unit=restart_transmission.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -1,42 +1,5 @@
|
|||
#windscribe:
|
||||
# service.running:
|
||||
# - enable: true
|
||||
|
||||
windscribe-vpn-pkg:
|
||||
windscribe:
|
||||
pkg.installed:
|
||||
- name: openvpn
|
||||
|
||||
#/etc/firewalld/direct.xml:
|
||||
# file.managed:
|
||||
# - source: salt://roles/maintain/windscribe/firewalld-direct.xml
|
||||
# - user: root
|
||||
# - group: root
|
||||
# - mode: 644
|
||||
|
||||
/etc/openvpn/client/windscribe-denmark.conf:
|
||||
file.managed:
|
||||
- source: salt://roles/maintain/windscribe/windscribe-denmark.conf
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 644
|
||||
|
||||
/etc/openvpn/client/windscribe.login:
|
||||
file.managed:
|
||||
- source: salt://secure/files/windscribe.login
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 600
|
||||
|
||||
openvpn-client@windscribe-denmark:
|
||||
- name: windscribe-cli
|
||||
service.running:
|
||||
- enable: true
|
||||
- watch:
|
||||
- file: /etc/openvpn/client/windscribe-denmark.conf
|
||||
- file: /etc/openvpn/client/windscribe.login
|
||||
|
||||
#windscribe-firewall:
|
||||
# service.running:
|
||||
# - name: firewalld
|
||||
# - enable: true
|
||||
# - watch:
|
||||
# - file: /etc/firewalld/direct.xml
|
|
@ -1,78 +0,0 @@
|
|||
client
|
||||
dev tun
|
||||
proto udp
|
||||
remote dk.windscribe.com 1194
|
||||
|
||||
nobind
|
||||
auth-user-pass windscribe.login
|
||||
|
||||
resolv-retry infinite
|
||||
|
||||
auth SHA512
|
||||
cipher AES-256-CBC
|
||||
keysize 256
|
||||
comp-lzo
|
||||
verb 2
|
||||
mute-replay-warnings
|
||||
remote-cert-tls server
|
||||
persist-key
|
||||
persist-tun
|
||||
|
||||
key-direction 1
|
||||
<ca>
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIF3DCCA8SgAwIBAgIJAMsOivWTmu9fMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNV
|
||||
BAYTAkNBMQswCQYDVQQIDAJPTjEQMA4GA1UEBwwHVG9yb250bzEbMBkGA1UECgwS
|
||||
V2luZHNjcmliZSBMaW1pdGVkMRMwEQYDVQQLDApPcGVyYXRpb25zMRswGQYDVQQD
|
||||
DBJXaW5kc2NyaWJlIE5vZGUgQ0EwHhcNMTYwMzA5MDMyNjIwWhcNNDAxMDI5MDMy
|
||||
NjIwWjB7MQswCQYDVQQGEwJDQTELMAkGA1UECAwCT04xEDAOBgNVBAcMB1Rvcm9u
|
||||
dG8xGzAZBgNVBAoMEldpbmRzY3JpYmUgTGltaXRlZDETMBEGA1UECwwKT3BlcmF0
|
||||
aW9uczEbMBkGA1UEAwwSV2luZHNjcmliZSBOb2RlIENBMIICIjANBgkqhkiG9w0B
|
||||
AQEFAAOCAg8AMIICCgKCAgEAruBtLR1Vufd71LeQEqChgHS4AQJ0fSRner0gmZPE
|
||||
r2TL5uWboOEWXFFoEUTthF+P/N8yy3xRZ8HhG/zKlmJ1xw+7KZRbTADD6shJPj3/
|
||||
uvTIO80sU+9LmsyKSWuPhQ1NkgNA7rrMTfz9eHJ2MVDs4XCpYWyX9iuAQrHSY6aP
|
||||
q+4TpCbUgprkM3Gwjh9RSt9IoDoc4CF2bWSaVepUcL9yz/SXLPzFx2OT9rFrDhL3
|
||||
ryHRzJQ/tA+VD8A7lo8bhOcDqiXgEFmVOZNMLw+r167Qq1Ck7X86yr2mnW/6HK2g
|
||||
JOvY0/SPKukfGJAiYZKdG+fe4ekyYcAVhDfPJg7rF9wUqPwUzejJyAs1K18JwX94
|
||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YgnqS9OAtRSYWbNX/wliiPz7u13yj+qSWgMfu8WPYNQlMZJXuGWUvKLE
|
||||
XCUExlu7/o8D4HpsVs30E0pUdaqN0vExB1KegxPWWrmLcYnPG3knXpkC3ZBZ5P/e
|
||||
l/2eyhZRy9ydiITF8gM3L08E8aeqvzZMw2FDSmousydIzlXgeS5VuEf+lUFA2h8o
|
||||
ZYGQgrLt+ot8MbLhJlkp4Q==
|
||||
-----END CERTIFICATE-----
|
||||
</ca>
|
||||
<tls-auth>
|
||||
-----BEGIN OpenVPN Static key V1-----
|
||||
5801926a57ac2ce27e3dfd1dd6ef8204
|
||||
2d82bd4f3f0021296f57734f6f1ea714
|
||||
a6623845541c4b0c3dea0a050fe6746c
|
||||
b66dfab14cda27e5ae09d7c155aa554f
|
||||
399fa4a863f0e8c1af787e5c602a801d
|
||||
3a2ec41e395a978d56729457fe6102d7
|
||||
d9e9119aa83643210b33c678f9d4109e
|
||||
3154ac9c759e490cb309b319cf708cae
|
||||
83ddadc3060a7a26564d1a24411cd552
|
||||
fe6620ea16b755697a4fc5e6e9d0cfc0
|
||||
c5c4a1874685429046a424c026db672e
|
||||
4c2c492898052ba59128d46200b40f88
|
||||
0027a8b6610a4d559bdc9346d33a0a6b
|
||||
08e75c7fd43192b162bfd0aef0c716b3
|
||||
1584827693f676f9a5047123466f0654
|
||||
eade34972586b31c6ce7e395f4b478cb
|
||||
-----END OpenVPN Static key V1-----
|
||||
</tls-auth>
|
||||
|
Loading…
Add table
Reference in a new issue