add files
This commit is contained in:
3
docker/authelia/action.d/cloudflare.conf
Normal file
3
docker/authelia/action.d/cloudflare.conf
Normal file
@ -0,0 +1,3 @@
|
||||
[Definition]
|
||||
actionban = /data/action.d/entryPoint.py <ip> add
|
||||
actionunban = /data/action.d/entryPoint.py <ip>clea del
|
19
docker/authelia/action.d/entryPoint.py
Normal file
19
docker/authelia/action.d/entryPoint.py
Normal file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
if len(sys.argv) < 3:
|
||||
print("Usage: ./entryPoint.py <ip> <add|del>")
|
||||
sys.exit(1)
|
||||
|
||||
venv_dir = 'env'
|
||||
|
||||
if not os.path.exists(venv_dir):
|
||||
os.system(f"{sys.executable} -m venv {venv_dir}")
|
||||
|
||||
activate_script = os.path.join(venv_dir, 'bin', 'activate')
|
||||
os.system(f"chmod +x {activate_script}")
|
||||
os.system(f"{os.path.join(venv_dir, 'bin', 'pip')} install --upgrade requests ipaddress")
|
||||
|
||||
os.system(f"{os.path.join(venv_dir, 'bin', 'python')} /data/action.d/modifyBanList.py {sys.argv[1]} {sys.argv[2]}")
|
77
docker/authelia/action.d/modifyBanList.py
Normal file
77
docker/authelia/action.d/modifyBanList.py
Normal file
@ -0,0 +1,77 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
import requests
|
||||
from requests import Response
|
||||
import json
|
||||
import ipaddress
|
||||
|
||||
def getIPList(apiEndpoint : str, headers : dict) -> json:
|
||||
response = requests.get(apiEndpoint, headers=headers)
|
||||
if response.status_code == 200:
|
||||
return response.json()
|
||||
else:
|
||||
print(f"Failed to fetch existing IP list. Status code: {response.status_code}")
|
||||
print(response.text)
|
||||
sys.exit(1)
|
||||
|
||||
def addIPtoList(ipAddr : str, apiEndpoint : str, headers : dict) -> Response:
|
||||
payload = [{"ip": ipAddr}]
|
||||
response = requests.post(apiEndpoint, headers=headers, data=json.dumps(payload))
|
||||
return response
|
||||
|
||||
def removeIPFromList(ipId : str, apiEndpoint : str, headers : dict) -> Response:
|
||||
payload = {"items": [{"id": ipId}]}
|
||||
response = requests.delete(apiEndpoint, headers=headers, data=json.dumps(payload))
|
||||
return response
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) < 3:
|
||||
print("Usage: ./modifyBanList.py <ip> <add|del>")
|
||||
sys.exit(1)
|
||||
|
||||
ipAddr = sys.argv[1]
|
||||
|
||||
try:
|
||||
addr = ipaddress.IPv6Address(ipAddr)
|
||||
first_64_bits = str(addr.exploded).split(':')[:4]
|
||||
ipAddr = ':'.join(first_64_bits) + '::/64'
|
||||
except:
|
||||
pass
|
||||
|
||||
action = sys.argv[2]
|
||||
listId = ''
|
||||
accountId = ''
|
||||
email = ''
|
||||
apiKey = ''
|
||||
apiEndpoint = f'https://api.cloudflare.com/client/v4/accounts/{accountId}/rules/lists/{listId}/items'
|
||||
|
||||
headers = {
|
||||
'X-Auth-Email': f'{email}',
|
||||
'X-Auth-Key': f'{apiKey}',
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
|
||||
existingIpList = getIPList(apiEndpoint,headers)
|
||||
response = None
|
||||
|
||||
if action == "del":
|
||||
ipId = None
|
||||
for item in existingIpList['result']:
|
||||
if item['ip'] == ipAddr:
|
||||
ipId = item['id']
|
||||
break
|
||||
payload = {"items": [{"id": ipId}]}
|
||||
|
||||
if ipId is not None:
|
||||
response = requests.delete(apiEndpoint,headers=headers,data=json.dumps(payload))
|
||||
elif not any(item['ip'] == ipAddr for item in existingIpList['result']):
|
||||
payload = [{
|
||||
"ip": ipAddr
|
||||
}]
|
||||
response = requests.post(apiEndpoint, headers=headers, data=json.dumps(payload))
|
||||
|
||||
if response is not None and response.status_code == 200:
|
||||
print(f"IP address {ipAddr} {action} to the custom IP list successfully.")
|
||||
else:
|
||||
print(f"Failed to {action} IP address {ipAddr} to the custom IP list.")
|
82
docker/compose/arrs.yml
Normal file
82
docker/compose/arrs.yml
Normal file
@ -0,0 +1,82 @@
|
||||
---
|
||||
version: "3.7"
|
||||
services:
|
||||
transmission:
|
||||
image: haugene/transmission-openvpn:latest
|
||||
container_name: transmission
|
||||
restart: always
|
||||
ports:
|
||||
- "9091:9091"
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
environment:
|
||||
- TZ=$TZ
|
||||
- OPENVPN_PROVIDER=$PROVIDER
|
||||
- OPENVPN_CONFIG=$CONFIG
|
||||
- OPENVPN_USERNAME=$USER
|
||||
- OPENVPN_PASSWORD=$PASSWORD
|
||||
- LOCAL_NETWORK=$NETWORK
|
||||
- TRANSMISSION_SPEED_LIMIT_UP=$SPEED_LIMIT_UP
|
||||
- TRANSMISSION_SPEED_LIMIT_UP_ENABLED=true
|
||||
- WEBPROXY_ENABLED=false
|
||||
- LOG_TO_STDOUT=true
|
||||
- TRANSMISSION_WEB_UI=flood-for-transmission
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
volumes:
|
||||
- $DOWNLOADS:/data
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
|
||||
radarr:
|
||||
image: linuxserver/radarr:latest
|
||||
container_name: radarr
|
||||
restart: always
|
||||
ports:
|
||||
- "7878:7878"
|
||||
environment:
|
||||
- PGID=1000
|
||||
- PUID=1000
|
||||
- TZ=$TZ
|
||||
volumes:
|
||||
- radarr_config:/config
|
||||
- $MOVIES:/movies
|
||||
- $DOWNLOADS:/downloads
|
||||
|
||||
sonarr:
|
||||
image: linuxserver/sonarr:latest
|
||||
container_name: sonarr
|
||||
restart: always
|
||||
ports:
|
||||
- "8989:8989"
|
||||
environment:
|
||||
- PGID=1000
|
||||
- PUID=1000
|
||||
- TZ=$TZ
|
||||
volumes:
|
||||
- sonarr_config:/config
|
||||
- $TV:/tv
|
||||
- $DOWNLOADS:/downloads
|
||||
|
||||
prowlarr:
|
||||
image: linuxserver/prowlarr:develop
|
||||
container_name: prowlarr
|
||||
restart: always
|
||||
ports:
|
||||
- "9696:9696"
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
environment:
|
||||
- PGID=1000
|
||||
- PUID=1000
|
||||
- TZ=$TZ
|
||||
volumes:
|
||||
- prowlarr_config:/config
|
||||
- $DOWNLOADS/watch:/downloads
|
||||
|
||||
volumes:
|
||||
radarr_config:
|
||||
driver: local
|
||||
sonarr_config:
|
||||
driver: local
|
||||
prowlarr_config:
|
||||
driver: local
|
83
docker/compose/exposee.yml
Normal file
83
docker/compose/exposee.yml
Normal file
@ -0,0 +1,83 @@
|
||||
---
|
||||
version: "3.7"
|
||||
services:
|
||||
transmission:
|
||||
image: haugene/transmission-openvpn:latest
|
||||
container_name: transmission
|
||||
restart: always
|
||||
ports:
|
||||
- "8091:9091"
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
environment:
|
||||
- TZ=$TZ
|
||||
- OPENVPN_PROVIDER=$PROVIDER
|
||||
- OPENVPN_CONFIG=$CONFIG
|
||||
- OPENVPN_USERNAME=$USER
|
||||
- OPENVPN_PASSWORD=$PASSWORD
|
||||
- WEBPROXY_ENABLED=false
|
||||
- LOCAL_NETWORK=$NETWORK
|
||||
- TRANSMISSION_SPEED_LIMIT_UP=$SPEED_LIMIT_UP
|
||||
- TRANSMISSION_SPEED_LIMIT_UP_ENABLED=true
|
||||
- LOG_TO_STDOUT=true
|
||||
- TRANSMISSION_WEB_UI=flood-for-transmission
|
||||
volumes:
|
||||
- $DOWNLOADS:/data
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- transmission_config:/config
|
||||
|
||||
radarr:
|
||||
image: linuxserver/radarr:latest
|
||||
container_name: radarr
|
||||
restart: always
|
||||
ports:
|
||||
- "7878:7878"
|
||||
environment:
|
||||
- PGID=1000
|
||||
- PUID=1000
|
||||
- TZ=$TZ
|
||||
volumes:
|
||||
- radarr_config:/config
|
||||
- $MOVIES:/movies
|
||||
- $DOWNLOADS:/downloads
|
||||
|
||||
sonarr:
|
||||
image: linuxserver/sonarr:latest
|
||||
container_name: sonarr
|
||||
restart: always
|
||||
ports:
|
||||
- "8989:8989"
|
||||
environment:
|
||||
- PGID=1000
|
||||
- PUID=1000
|
||||
- TZ=$TZ
|
||||
volumes:
|
||||
- sonarr_config:/config
|
||||
- $TV:/tv
|
||||
- $DOWNLOADS:/downloads
|
||||
|
||||
prowlarr:
|
||||
image: linuxserver/prowlarr:develop
|
||||
container_name: prowlarr
|
||||
restart: always
|
||||
ports:
|
||||
- "9696:9696"
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
environment:
|
||||
- PGID=1000
|
||||
- PUID=1000
|
||||
- TZ=$TZ
|
||||
volumes:
|
||||
- prowlarr_config:/config
|
||||
- $DOWNLOADS/watch:/downloads
|
||||
|
||||
volumes:
|
||||
radarr_config:
|
||||
driver: local
|
||||
sonarr_config:
|
||||
driver: local
|
||||
prowlarr_config:
|
||||
driver: local
|
||||
transmission_config:
|
||||
driver: local
|
21
docker/compose/kanboard.yml
Normal file
21
docker/compose/kanboard.yml
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
version: "3.7"
|
||||
services:
|
||||
kanboard:
|
||||
image: kanboard/kanboard:latest
|
||||
ports:
|
||||
- "10080:80"
|
||||
- "10443:443"
|
||||
volumes:
|
||||
- data:/var/www/app/data
|
||||
- plugins:/var/www/app/plugins
|
||||
- $HOME_FOLDER/config.php:/var/www/app/config.php
|
||||
- kanboard_ssl:/etc/nginx/ssl
|
||||
|
||||
volumes:
|
||||
data:
|
||||
driver: local
|
||||
plugins:
|
||||
driver: local
|
||||
ssl:
|
||||
driver: local
|
Reference in New Issue
Block a user