Compare commits
271
Commits
7158dd4960
..
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
012bfa48ff | ||
|
|
3cf98e5f3c | ||
|
|
c3611ce591 | ||
|
|
7eeba31e25 | ||
|
|
d98ca06087 | ||
|
|
b5841a9369 | ||
|
|
b34e317667 | ||
|
|
3c556dde9a | ||
|
|
624ee3770c | ||
|
|
4c3a4f8b7c | ||
|
|
d1df6d72de | ||
|
|
14c3053367 | ||
|
|
0741c59653 | ||
|
|
1b4b7849bc | ||
|
|
69c02632e9 | ||
|
|
d5e8518e70 | ||
|
|
e669cbf0e5 | ||
|
|
07d86aac0d | ||
|
|
6c782bf991 | ||
|
|
6b72f3313f | ||
|
|
c7ee26fd10 | ||
|
|
408acfee2d | ||
|
|
d975dc5a12 | ||
|
|
16456bbb2d | ||
|
|
66de2b0de8 | ||
|
|
2ad2c0a96c | ||
|
|
eb59830e40 | ||
|
|
1fb97c2097 | ||
|
|
54bc36037a | ||
|
|
19da576745 | ||
|
|
7ebead0b53 | ||
|
|
f8627a946d | ||
|
|
e25475658f | ||
|
|
4db77445b5 | ||
|
|
e934f0e70b | ||
|
|
9b79f1bd91 | ||
|
|
95e732b088 | ||
|
|
49775c0863 | ||
|
|
8064bc1cd8 | ||
|
|
27df6ce7f8 | ||
|
|
b8a30ad3dd | ||
|
|
c392d97089 | ||
|
|
1ff908daf2 | ||
|
|
2e4cc9af55 | ||
|
|
acb0bc749e | ||
|
|
917f88ba7f | ||
|
|
b47497a73b | ||
|
|
2d13dd63bd | ||
|
|
86f4d73964 | ||
|
|
e06a03ef66 | ||
|
|
1272f92b4e | ||
|
|
ed812c354f | ||
|
|
1cd2dde037 | ||
|
|
a857f07702 | ||
|
|
b446f71562 | ||
|
|
e8db29c7b9 | ||
|
|
2b7de8c43b | ||
|
|
8706f117ad | ||
|
|
425a1dfea5 | ||
|
|
a8080e3e30 | ||
|
|
b90d80ed79 | ||
|
|
69b39940b0 | ||
|
|
8669499c36 | ||
|
|
9ddb167eb3 | ||
|
|
3c21820b3a | ||
|
|
2c7fe68b33 | ||
|
|
7ac877f018 | ||
|
|
152a095f51 | ||
|
|
9373e23592 | ||
|
|
37014ac829 | ||
|
|
69234da7cf | ||
|
|
1aeccb7b82 | ||
|
|
b76155f96d | ||
|
|
692ab8c6d8 | ||
|
|
78d32e3219 | ||
|
|
09752d64ad | ||
|
|
25bf86a8ec | ||
|
|
3a50a94c17 | ||
|
|
27f5dc644f | ||
|
|
5d5ca4a6d6 | ||
|
|
db1995c7b9 | ||
|
|
ce7da99296 | ||
|
|
5daa680948 | ||
|
|
8c48239b77 | ||
|
|
4481664c0b | ||
|
|
6fb22a7582 | ||
|
|
74c66ec88f | ||
|
|
8801ee5153 | ||
|
|
807d03f808 | ||
|
|
24292a3d01 | ||
|
|
057f3101bf | ||
|
|
ba81e01fee | ||
|
|
2dc2483c04 | ||
|
|
f8aa8a73d1 | ||
|
|
4d8d20c6d9 | ||
|
|
d09706f3be | ||
|
|
3aa90fa629 | ||
|
|
f5c794e9f5 | ||
|
|
db4778811f | ||
|
|
def77826ba | ||
|
|
dc0609480f | ||
|
|
08171bf2fb | ||
|
|
6c06998788 | ||
|
|
419d6ed784 | ||
|
|
a3f818f601 | ||
|
|
079915ee49 | ||
|
|
371faab2d9 | ||
|
|
04ac7f9ff7 | ||
|
|
968d007954 | ||
|
|
0bc0b53ed1 | ||
|
|
0c8f33559d | ||
|
|
d3410521bd | ||
|
|
492a2f0d5d | ||
|
|
2670e46526 | ||
|
|
edae754aa4 | ||
|
|
98c687ea9e | ||
|
|
b6a2908b48 | ||
|
|
5ca383e0da | ||
|
|
3470e24c82 | ||
|
|
f55b671ba3 | ||
|
|
7c6c9e6f58 | ||
|
|
cfe2ae0c9d | ||
|
|
d0731ef2b0 | ||
|
|
7404473a60 | ||
|
|
6268fca868 | ||
|
|
c24a20cbf6 | ||
|
|
745503a1ab | ||
|
|
266cfd5bf9 | ||
|
|
3dbdda0472 | ||
|
|
f3a1ca0842 | ||
|
|
5a397e482c | ||
|
|
373030ae74 | ||
|
|
f0c651691e | ||
|
|
64a94c865c | ||
|
|
033ada3924 | ||
|
|
836d8351b8 | ||
|
|
2994ffcc52 | ||
|
|
408293d866 | ||
|
|
aff23eae88 | ||
|
|
68819a3fce | ||
|
|
eb3d4a71f8 | ||
|
|
b00d8b8249 | ||
|
|
8377e61306 | ||
|
|
fbddea4ff6 | ||
|
|
001165c1a6 | ||
|
|
229e6f9b2b | ||
|
|
3aadb9b700 | ||
|
|
2d988203b8 | ||
|
|
97b9232cef | ||
|
|
4b42e5915e | ||
|
|
58bc7fb4bb | ||
|
|
ab300bfa01 | ||
|
|
60ab92d5e2 | ||
|
|
1a8b65cdb1 | ||
|
|
077c4899a0 | ||
|
|
c8b9a25ead | ||
|
|
6d8b2957c6 | ||
|
|
517490384f | ||
|
|
50a6d786f0 | ||
|
|
db350414d4 | ||
|
|
0272366480 | ||
|
|
d99ad7b966 | ||
|
|
1b6d39037c | ||
|
|
6f6bae9a55 | ||
|
|
8268b69004 | ||
|
|
e571fdc729 | ||
|
|
8fb3d4d3b9 | ||
|
|
11027fa9dc | ||
|
|
38736bb6b5 | ||
|
|
3df29a6da6 | ||
|
|
6cf309b454 | ||
|
|
73d6dc947b | ||
|
|
e8a0b2daf9 | ||
|
|
2bea411e45 | ||
|
|
0b020ab4ae | ||
|
|
7c50f30ad1 | ||
|
|
540a837052 | ||
|
|
89d2049288 | ||
|
|
995939d73b | ||
|
|
6e5f0ca0d0 | ||
|
|
a41b5c837f | ||
|
|
5ae7a8cd7f | ||
|
|
6f4dbfeb61 | ||
|
|
75267aad49 | ||
|
|
68ab26a509 | ||
|
|
163319b1cf | ||
|
|
8fc0b60838 | ||
|
|
af2f942465 | ||
|
|
62b73656e6 | ||
|
|
44c2f16c97 | ||
|
|
8c2541fb34 | ||
|
|
942bd7c1f7 | ||
|
|
c81d160d5c | ||
|
|
45aed47f03 | ||
|
|
4708d6a138 | ||
|
|
7bbedc8549 | ||
|
|
1a99bd631f | ||
|
|
6c61138a5e | ||
|
|
c9ba870bf5 | ||
|
|
aa01414bd8 | ||
|
|
76983f3783 | ||
|
|
6c1de5f350 | ||
|
|
2bb2f17746 | ||
|
|
00768fda2e | ||
|
|
ae91f3073d | ||
|
|
e9ed3ff9ab | ||
|
|
a553e51dd7 | ||
|
|
cfdadfd9aa | ||
|
|
a6bd1c2d1a | ||
|
|
07e24ad97e | ||
|
|
bbc56a9908 | ||
|
|
7214cfd52b | ||
|
|
58795e9d5e | ||
|
|
d241017c2a | ||
|
|
104b912404 | ||
|
|
e4ebc3c5b2 | ||
|
|
6e369c3656 | ||
|
|
63c34f5387 | ||
|
|
fcde06e8b6 | ||
|
|
f54919554b | ||
|
|
93a464f49d | ||
|
|
437c91dc7a | ||
|
|
7f27f187d8 | ||
|
|
073ddf11fc | ||
|
|
f5d7962aba | ||
|
|
0a6457abe0 | ||
|
|
aa27e1f350 | ||
|
|
59f1bcb5c1 | ||
|
|
b1c8365bd8 | ||
|
|
c5cf55fe21 | ||
|
|
99573fb241 | ||
|
|
f9d97de61f | ||
|
|
d5c82e364d | ||
|
|
c192114bcf | ||
|
|
179256de3e | ||
|
|
0e52aefa07 | ||
|
|
95c2f90031 | ||
|
|
1dd80d9a45 | ||
|
|
dc537635bb | ||
|
|
be012e334b | ||
|
|
35c2104852 | ||
|
|
d1e2f8a3e5 | ||
|
|
2eb7b8d6d1 | ||
|
|
045861ada6 | ||
|
|
8ae894ffb6 | ||
|
|
208fbd96b4 | ||
|
|
93b262977b | ||
|
|
fd91e7d678 | ||
|
|
9a476ef5cd | ||
|
|
dbb8eda1e6 | ||
|
|
2e273985b7 | ||
|
|
f7865f05a1 | ||
|
|
719c7068e2 | ||
|
|
580b667119 | ||
|
|
3bf1fc1be6 | ||
|
|
7b0b438740 | ||
|
|
2eda7cd33e | ||
|
|
efc150d9ce | ||
|
|
044fbd81ad | ||
|
|
01ab319eea | ||
|
|
d5e627325d | ||
|
|
deaff35bc3 | ||
|
|
27d570fc5c | ||
|
|
d5fb01adb2 | ||
|
|
52c02beb3d | ||
|
|
3f14f53184 | ||
|
|
c41bf36afb | ||
|
|
07bab58ae0 | ||
|
|
d06cff4cbd | ||
|
|
09343a7523 | ||
|
|
dc0cd02e58 |
No files matched your search
@@ -0,0 +1,132 @@
|
||||
name: Python tests
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'wallpaper_changer/**'
|
||||
- 'serverlibrary/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'wallpaper_changer/**'
|
||||
- 'serverlibrary/**'
|
||||
|
||||
jobs:
|
||||
test-serverlibrary:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: nikolaik/python-nodejs:python3.12-nodejs20
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Create virtual environment and install dependencies
|
||||
working-directory: serverlibrary
|
||||
run: |
|
||||
python -m venv .venv
|
||||
. .venv/bin/activate
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install .
|
||||
- name: Run tests
|
||||
working-directory: serverlibrary
|
||||
run: |
|
||||
. .venv/bin/activate
|
||||
python run_tests.py
|
||||
|
||||
test-wallpaper-changer:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: nikolaik/python-nodejs:python3.12-nodejs20
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Create virtual environment and install dependencies
|
||||
working-directory: wallpaper_changer
|
||||
run: |
|
||||
python -m venv .venv
|
||||
. .venv/bin/activate
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install ../serverlibrary
|
||||
python -m pip install .
|
||||
pip install --group test .
|
||||
- name: Run tests
|
||||
working-directory: wallpaper_changer
|
||||
run: |
|
||||
. .venv/bin/activate
|
||||
python tests/run_tests.py
|
||||
lint-wallpaper-changer:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: nikolaik/python-nodejs:python3.12-nodejs20
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Ruff
|
||||
run: pip install ruff
|
||||
|
||||
- name: Lint wallpaper_changer
|
||||
run: ruff check wallpaper_changer
|
||||
|
||||
lint-serverlibrary:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: nikolaik/python-nodejs:python3.12-nodejs20
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Ruff
|
||||
run: pip install ruff
|
||||
|
||||
- name: Lint serverlibrary
|
||||
run: ruff check serverlibrary
|
||||
build:
|
||||
needs: [test-serverlibrary, test-wallpaper-changer, lint-serverlibrary, lint-wallpaper-changer]
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: nikolaik/python-nodejs:python3.12-nodejs20
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install build dependencies
|
||||
working-directory: wallpaper_changer
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install pyinstaller build
|
||||
python -m pip install ../serverlibrary
|
||||
python -m pip install .
|
||||
|
||||
- name: Build executable
|
||||
working-directory: wallpaper_changer
|
||||
run: |
|
||||
python -m PyInstaller \
|
||||
--clean \
|
||||
--onefile \
|
||||
--paths src \
|
||||
--name wallpaper_changer \
|
||||
main.py
|
||||
|
||||
- name: Build wheel
|
||||
working-directory: wallpaper_changer
|
||||
run: |
|
||||
python -m build --wheel
|
||||
|
||||
- name: Verify build outputs
|
||||
run: |
|
||||
ls -lh wallpaper_changer/dist/
|
||||
test -f wallpaper_changer/dist/wallpaper_changer
|
||||
ls wallpaper_changer/dist/*.whl
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: https://github.com/christopherHX/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: wallpaper-changer-build
|
||||
path: wallpaper_changer/dist/
|
||||
if-no-files-found: error
|
||||
+2
-3
@@ -15,8 +15,7 @@ wheels/
|
||||
.idea
|
||||
uv.lock
|
||||
youtubelist.txt
|
||||
*.mkv
|
||||
*.mp4
|
||||
.spotdl-cache
|
||||
script_template.txt
|
||||
|
||||
.kilo/
|
||||
/docker_compose/serverhost/qbittorrent/gluetun/wg0.conf
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Python: torrent_qbittorrent_api",
|
||||
"type": "debugpy",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/torrent/torrent_qbittorrent_api.py",
|
||||
"console": "integratedTerminal"
|
||||
}
|
||||
]
|
||||
}
|
||||
+1698
File diff suppressed because it is too large.
Load diff
@@ -1,231 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from __future__ import annotations
|
||||
from concurrent.futures import ProcessPoolExecutor, as_completed
|
||||
|
||||
import argparse
|
||||
import subprocess
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
import time
|
||||
from typing import Any
|
||||
|
||||
RED = "\033[91m"
|
||||
GREEN = "\033[92m"
|
||||
YELLOW = "\033[93m"
|
||||
BLUE = "\033[94m"
|
||||
RESET = "\033[0m"
|
||||
logfile=Path(f"media_{time.strftime("%Y%m%d_%H%M%S")}.log")
|
||||
|
||||
def log_message(message):
|
||||
with open(logfile, "a") as log:
|
||||
log.write(f"{message}\n")
|
||||
print(message)
|
||||
|
||||
def get_duration_ms(media: Path) -> int:
|
||||
duration = subprocess.check_output(
|
||||
[
|
||||
"ffprobe",
|
||||
"-v",
|
||||
"error",
|
||||
"-show_entries",
|
||||
"format=duration",
|
||||
"-of",
|
||||
"default=noprint_wrappers=1:nokey=1",
|
||||
str(media),
|
||||
],
|
||||
text=True,
|
||||
).strip()
|
||||
|
||||
return int(float(duration) * 1000)
|
||||
|
||||
def ffmpeg_escape(path: Path) -> str:
|
||||
return str(path.resolve()).replace("'", r"'\''")
|
||||
|
||||
def create_m4b(root_path: Path, book_dir: Path) -> None:
|
||||
media_files = sorted(list(book_dir.glob("*.mp3"))
|
||||
+ list(book_dir.glob("*.m4a"))
|
||||
+ list(book_dir.glob("*.m4b"))
|
||||
+ list(book_dir.glob("*.opus")))
|
||||
if not media_files:
|
||||
return
|
||||
|
||||
output_file_final = book_dir / f"{book_dir.name}.m4b"
|
||||
|
||||
if output_file_final.exists():
|
||||
log_message(f"{RED}[SKIP]{RESET} {output_file_final}")
|
||||
log_message("Book already present")
|
||||
return
|
||||
|
||||
log_message(f"[CREATE] {output_file_final}")
|
||||
|
||||
with (tempfile.TemporaryDirectory(dir=root_path.parent) as tmp):
|
||||
tmpdir = Path(tmp)
|
||||
|
||||
output_file_tmp = tmpdir / f"{book_dir.name}.m4b"
|
||||
concat_file = tmpdir / "concat.txt"
|
||||
metadata_file = tmpdir / "chapters.txt"
|
||||
|
||||
current_ms = 0
|
||||
|
||||
with concat_file.open("w", encoding="utf-8") as cf, \
|
||||
metadata_file.open("w", encoding="utf-8") as mf:
|
||||
mf.write(";FFMETADATA1\n")
|
||||
|
||||
for media in media_files:
|
||||
cf.write(f"file '{ffmpeg_escape(media)}'\n")
|
||||
|
||||
duration_ms = get_duration_ms(media)
|
||||
|
||||
mf.write("[CHAPTER]\n")
|
||||
mf.write("TIMEBASE=1/1000\n")
|
||||
mf.write(f"START={current_ms}\n")
|
||||
mf.write(f"END={current_ms + duration_ms}\n")
|
||||
mf.write(f"title={media.stem}\n")
|
||||
|
||||
current_ms += duration_ms
|
||||
cmd_backup = [ "ffmpeg","-y","-f","concat","-safe","0",
|
||||
"-i",str(concat_file),"-i",str(metadata_file),
|
||||
# cover from first media
|
||||
"-i",str(media_files[0]),
|
||||
# audio from concat
|
||||
"-map","0:a",
|
||||
# cover image from first media
|
||||
"-map","2:v?",
|
||||
# copy artist/album/composer/etc from first media file
|
||||
"-map_metadata", "2",
|
||||
# copy chapters from ffmetadata
|
||||
"-map_chapters", "1",
|
||||
|
||||
"-c:a","copy",
|
||||
"-c:a", "aac",
|
||||
"-b:a", "128k",
|
||||
# copy cover image without re-encoding
|
||||
"-c:v","copy","-disposition:v:0","attached_pic",
|
||||
str(output_file_tmp),
|
||||
]
|
||||
cmd_default = ["ffmpeg", "-y", "-f", "concat", "-safe", "0",
|
||||
"-i", str(concat_file), "-i", str(metadata_file),
|
||||
# cover from first media
|
||||
"-i", str(media_files[0]),
|
||||
# audio from concat
|
||||
"-map", "0:a",
|
||||
# cover image from first media
|
||||
"-map", "2:v?",
|
||||
|
||||
# copy artist/album/composer/etc from first media file
|
||||
"-map_metadata", "2",
|
||||
# copy chapters from ffmetadata
|
||||
"-map_chapters", "1",
|
||||
"-c:a", "copy",
|
||||
# copy cover image without re-encoding
|
||||
"-c:v", "copy", "-disposition:v:0", "attached_pic",
|
||||
str(output_file_tmp),
|
||||
]
|
||||
with logfile.open("a", encoding="utf-8") as log:
|
||||
result = subprocess.run(
|
||||
cmd_default,
|
||||
stdout=log,
|
||||
stderr=subprocess.STDOUT,
|
||||
text=True,
|
||||
)
|
||||
if result.returncode == 234:
|
||||
log_message(f"{YELLOW}[WARNING]{RESET} - {book_dir.name} - {result.returncode} retrying with aac encoder")
|
||||
result = subprocess.run(
|
||||
cmd_backup,
|
||||
stdout=log,
|
||||
stderr=subprocess.STDOUT,
|
||||
text=True,
|
||||
)
|
||||
if result.returncode == 0:
|
||||
output_file_tmp.rename(output_file_final)
|
||||
for media in media_files:
|
||||
media.unlink()
|
||||
log_message(f"{GREEN}[SUCCESS]{RESET} - {book_dir.name} - delete media files")
|
||||
else:
|
||||
log_message(f"{RED}[ERROR]{RESET} - {book_dir.name} - Code: {result.returncode}, Stderr: {result.stderr}")
|
||||
|
||||
def find_book_dirs(root: Path) -> tuple[list[Any], int]:
|
||||
"""
|
||||
A book directory is any directory containing more than one
|
||||
audiobook file (.mp3, .m4a, .m4b)
|
||||
"""
|
||||
|
||||
media_files = (
|
||||
list(root.rglob("*.mp3"))
|
||||
+ list(root.rglob("*.m4a"))
|
||||
+ list(root.rglob("*.m4b"))
|
||||
+ list(root.rglob("*.opus"))
|
||||
)
|
||||
|
||||
counts: dict[Path, int] = {}
|
||||
|
||||
for file in media_files:
|
||||
if counts.get(file.parent, 0) > 1:
|
||||
continue
|
||||
counts[file.parent] = counts.get(file.parent, 0) + 1
|
||||
|
||||
directories = []
|
||||
size = 0
|
||||
for directory, count in counts.items():
|
||||
if count > 1:
|
||||
directories.append(directory)
|
||||
size += sum(file.stat().st_size for pattern in ("*.mp3", "*.m4a", "*.m4b", "*.opus") for file in directory.glob(pattern))
|
||||
|
||||
|
||||
return sorted(directories), size
|
||||
|
||||
def process_book(args):
|
||||
target, book_dir = args
|
||||
try:
|
||||
create_m4b(target, book_dir)
|
||||
return book_dir, None
|
||||
except Exception as exc:
|
||||
return book_dir, str(exc)
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
"path",
|
||||
type=Path,
|
||||
help="Book folder or root folder",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
target = args.path.resolve()
|
||||
|
||||
if not target.exists():
|
||||
raise SystemExit(f"Path does not exist: {target}")
|
||||
|
||||
# Direct book folder
|
||||
if any(list(target.glob("*.mp3"))
|
||||
+ list(target.glob("*.m4a"))
|
||||
+ list(target.glob("*.m4b"))
|
||||
+ list(target.glob("*.opus"))):
|
||||
create_m4b(target.parent,target)
|
||||
return
|
||||
|
||||
book_dir_set, library_size = find_book_dirs(target)
|
||||
|
||||
for book_dir in book_dir_set:
|
||||
log_message(f"Found Media: {book_dir}")
|
||||
|
||||
print("Proceed? y/n")
|
||||
name = input()
|
||||
if name != "y":
|
||||
log_message(f"Aborted")
|
||||
exit(0)
|
||||
|
||||
# Root folder containing many books
|
||||
with ProcessPoolExecutor(max_workers=8) as executor:
|
||||
for book_dir, error in executor.map(
|
||||
process_book,
|
||||
((target, book_dir) for book_dir in book_dir_set),
|
||||
):
|
||||
if error:
|
||||
log_message(f"{RED}[ERROR]{RESET} {book_dir}: {error}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,60 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(sys.argv[1]) if len(sys.argv) > 1 else Path(".")
|
||||
|
||||
audio_extensions = {
|
||||
".m4b",
|
||||
".m4a",
|
||||
".mp3",
|
||||
".flac",
|
||||
".ogg",
|
||||
}
|
||||
|
||||
|
||||
def get_metadata(field, file):
|
||||
try:
|
||||
result = subprocess.run(
|
||||
["kid3-cli", "-c", f"get {field}", str(file)],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.DEVNULL,
|
||||
text=True,
|
||||
)
|
||||
return result.stdout.strip()
|
||||
|
||||
except (OSError, subprocess.SubprocessError):
|
||||
return ""
|
||||
|
||||
|
||||
# Include ROOT itself, matching find "$ROOT" -type d
|
||||
for directory in [ROOT] + [p for p in ROOT.rglob("*") if p.is_dir()]:
|
||||
audio_files = sorted(
|
||||
(
|
||||
file
|
||||
for file in directory.iterdir()
|
||||
if file.is_file()
|
||||
and file.suffix.lower() in audio_extensions
|
||||
),
|
||||
key=lambda p: str(p),
|
||||
)
|
||||
|
||||
if not audio_files:
|
||||
continue
|
||||
|
||||
first_file = audio_files[0]
|
||||
|
||||
artist = get_metadata("artist", first_file)
|
||||
album = get_metadata("album", first_file)
|
||||
composer = get_metadata("composer", first_file)
|
||||
comment = get_metadata("comment", first_file)
|
||||
|
||||
print("====≠===============================")
|
||||
print(f"Folder: {directory.name}")
|
||||
print(f"Album: {album}")
|
||||
print(f"Artist: {artist}")
|
||||
print(f"Narrator: {composer}")
|
||||
print(f"Comment: {comment}")
|
||||
@@ -1,192 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import re
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
def get_genre(file_path):
|
||||
try:
|
||||
result = subprocess.run(
|
||||
["kid3-cli", "-c", "get genre", str(file_path)],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=False,
|
||||
)
|
||||
return result.stdout.strip()
|
||||
except Exception:
|
||||
return ""
|
||||
|
||||
|
||||
def set_genre(file_path, genre):
|
||||
subprocess.run(
|
||||
[
|
||||
"kid3-cli",
|
||||
"-c",
|
||||
"tag 2",
|
||||
"-c",
|
||||
f"set genre \"{genre}\"",
|
||||
"-c",
|
||||
"save",
|
||||
str(file_path),
|
||||
],
|
||||
check=False,
|
||||
)
|
||||
|
||||
|
||||
def clean_genre(genre):
|
||||
|
||||
genre = re.sub(r'(?i)^audio\s*books?$', '', genre)
|
||||
genre = re.sub(r'(?i)^audiobooks?;?$', '', genre)
|
||||
genre = re.sub(r'(?i)\b(hörb(uch|ücher)|hoerb(uch|uecher))\b', '', genre)
|
||||
genre = re.sub(r'(?i)^(hörspiele?|hoerspiele?)$', '', genre)
|
||||
genre = re.sub(r'(?i)^spoken\s*word$', '', genre)
|
||||
genre = re.sub(r'(?i)gesprochene\s*inhalte$', '', genre)
|
||||
genre = re.sub(r'(?i)^speech$', '', genre)
|
||||
genre = re.sub(r'Fanasie', 'Fantasie', genre)
|
||||
genre = re.sub(r'Mit Videospiel-?', 'Videospielbezug', genre)
|
||||
genre = re.sub(r'(?i)nonfiction', 'NonFiction', genre)
|
||||
|
||||
genre = re.sub(r'(?i)^speech$', '', genre)
|
||||
genre = re.sub(r'(?i)^vocal$', '', genre)
|
||||
genre = re.sub(r'(?i)^retail$', '', genre)
|
||||
genre = re.sub(r'(?i)^other$', '', genre)
|
||||
genre = re.sub(r'(?i)^misc$', '', genre)
|
||||
|
||||
genre = re.sub(r'(?i)^(sci[- ]?fi|sf)$', 'Science Fiction', genre)
|
||||
genre = re.sub(r'(?i)^\(?science fiction\)?$', 'Science Fiction', genre)
|
||||
genre = re.sub(r'Thrillers', 'Thriller', genre)
|
||||
genre = re.sub(r"(?i)\bchildren'?s audiobooks?\b", "", genre)
|
||||
genre = re.sub(r'^-\s*|\s*-$', '', genre)
|
||||
genre = re.sub(r'(?i)Engelske\s*\sLydbånd', '', genre)
|
||||
genre = re.sub(r'^FIC028000.*$', '', genre)
|
||||
genre = re.sub(r'^800.*$', '', genre)
|
||||
genre = re.sub(r'^Fantastic Beasts.*$', '', genre)
|
||||
genre = re.sub(r'^and thei.*$', '', genre)
|
||||
genre = re.sub(r'^those you.*$', '', genre)
|
||||
# Normalize separators
|
||||
genre = re.sub(
|
||||
r'\s*[,&:/]\s*',
|
||||
';',
|
||||
genre
|
||||
)
|
||||
|
||||
genre = re.sub(
|
||||
r'\s*;\s*',
|
||||
'; ',
|
||||
genre
|
||||
)
|
||||
|
||||
# Trim punctuation / whitespace
|
||||
genre = re.sub(
|
||||
r'^[\s,;:\-]+',
|
||||
'',
|
||||
genre
|
||||
)
|
||||
|
||||
genre = re.sub(
|
||||
r'[\s,;\-]+$',
|
||||
'',
|
||||
genre
|
||||
)
|
||||
|
||||
genre = genre.strip()
|
||||
genre = genre.lstrip()
|
||||
|
||||
return genre
|
||||
|
||||
def find_audio_files(library):
|
||||
extensions = {".mp3", ".m4a", ".m4b"}
|
||||
|
||||
return [
|
||||
p for p in Path(library).rglob("*")
|
||||
if p.is_file() and p.suffix.lower() in extensions
|
||||
]
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Audiobook Genre Cleanup"
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"library",
|
||||
help="Library path"
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--delete",
|
||||
action="store_true",
|
||||
help="Update tags instead of reporting only"
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--report",
|
||||
default="/home/lucas/audiobook_genre_cleanup.txt",
|
||||
help="Report file"
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
files = find_audio_files(args.library)
|
||||
|
||||
total = len(files)
|
||||
processed = 0
|
||||
matches = 0
|
||||
modified = 0
|
||||
|
||||
with open(args.report, "w", encoding="utf-8") as report:
|
||||
report.write("Audiobook Genre Cleanup Report\n")
|
||||
report.write(f"Generated: {datetime.now()}\n")
|
||||
report.write(f"Library: {args.library}\n")
|
||||
report.write(f"Total files: {total}\n\n")
|
||||
|
||||
for file in files:
|
||||
processed += 1
|
||||
|
||||
if processed % 100 == 0:
|
||||
print(f"Progress: {processed}/{total} files processed")
|
||||
|
||||
genre = get_genre(file)
|
||||
|
||||
if not genre:
|
||||
continue
|
||||
|
||||
cleaned = clean_genre(genre)
|
||||
|
||||
if genre != cleaned:
|
||||
matches += 1
|
||||
status = "MATCH"
|
||||
|
||||
if args.delete:
|
||||
set_genre(file, cleaned)
|
||||
modified += 1
|
||||
status = "UPDATED"
|
||||
|
||||
line = (
|
||||
f'[{processed}/{total}] [{status}] '
|
||||
f'{file} | OLD="{genre}" | NEW="{cleaned}"'
|
||||
)
|
||||
|
||||
print(line)
|
||||
|
||||
with open(args.report, "a", encoding="utf-8") as report:
|
||||
report.write(line + "\n")
|
||||
|
||||
with open(args.report, "a", encoding="utf-8") as report:
|
||||
report.write("\n========== SUMMARY ==========\n")
|
||||
report.write(f"Files scanned : {total}\n")
|
||||
report.write(f"Matches found : {matches}\n")
|
||||
report.write(f"Files updated : {modified}\n")
|
||||
|
||||
print("\n========== SUMMARY ==========")
|
||||
print(f"Files scanned : {total}")
|
||||
print(f"Matches found : {matches}")
|
||||
print(f"Files updated : {modified}")
|
||||
print(f"Report written to: {args.report}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,27 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
ROOT="${1:-.}"
|
||||
|
||||
find "$ROOT" -type d | while read -r dir; do
|
||||
first_file=$(
|
||||
find "$dir" -maxdepth 1 -type f \
|
||||
\( -iname "*.m4b" -o -iname "*.m4a" -o -iname "*.mp3" \
|
||||
-o -iname "*.flac" -o -iname "*.ogg" \) |
|
||||
sort |
|
||||
head -n1
|
||||
)
|
||||
|
||||
[[ -z "$first_file" ]] && continue
|
||||
|
||||
artist=$(kid3-cli -c "get artist" "$first_file" 2>/dev/null)
|
||||
album=$(kid3-cli -c "get album" "$first_file" 2>/dev/null)
|
||||
composer=$(kid3-cli -c "get composer" "$first_file" 2>/dev/null)
|
||||
comment=$(kid3-cli -c "get comment" "$first_file" 2>/dev/null)
|
||||
echo "====≠==============================="
|
||||
echo "Folder: $(basename "$dir")"
|
||||
echo "Album: $album"
|
||||
echo "Artist: $artist"
|
||||
echo "Narrator: $composer"
|
||||
echo "Comment: $comment"
|
||||
done
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
-9
@@ -6,15 +6,6 @@ import subprocess
|
||||
from pathlib import Path
|
||||
from difflib import SequenceMatcher
|
||||
|
||||
AUDIO_EXTENSIONS = {
|
||||
".mp3",
|
||||
".m4b",
|
||||
".m4a",
|
||||
}
|
||||
|
||||
RED = "\033[31m"
|
||||
GREEN = "\033[32m"
|
||||
RESET = "\033[0m"
|
||||
USE_KID3 = True
|
||||
def normalize(text: str) -> str:
|
||||
return re.sub(r"[^a-z0-9]", "", text.lower())
|
||||
+1
-1
@@ -27,7 +27,7 @@ fi
|
||||
list="$1"
|
||||
|
||||
while IFS= read -r file; do
|
||||
|
||||
book
|
||||
[[ -z "$file" ]] && continue
|
||||
|
||||
if [[ ! -e "$file" ]]; then
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
-27
@@ -1,27 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $# -lt 2 ]]; then
|
||||
echo "Usage: $0 <dir1> <dir2> [del]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dir1="$1"
|
||||
dir2="$2"
|
||||
|
||||
find "$dir1" -mindepth 2 -maxdepth 2 -type d -printf '%P\n' |
|
||||
while IFS= read -r rel; do
|
||||
if [[ -d "$dir2/$rel" ]]; then
|
||||
# Exists in both
|
||||
if [[ "$3" == "del" ]]; then
|
||||
echo "Deleting: $dir1/$rel"
|
||||
rm -rf -- "$dir1/$rel"
|
||||
|
||||
# Remove empty author directory
|
||||
author="${rel%%/*}"
|
||||
rmdir --ignore-fail-on-non-empty "$dir1/$author" 2>/dev/null
|
||||
fi
|
||||
else
|
||||
# Only exists in $1
|
||||
echo "$rel"
|
||||
fi
|
||||
done
|
||||
@@ -1,63 +0,0 @@
|
||||
#!/bin/bash
|
||||
USER="lucas"
|
||||
DEST="~/Downloads"
|
||||
|
||||
get_config() {
|
||||
while [[ ${1:0:1} == - ]]; do
|
||||
echo "Param: $1"
|
||||
[[ $1 == -h ]] && {
|
||||
if [ "$2" == "" ]; then echo "Too few arguments"; usage; exit; fi
|
||||
HOST="$2"
|
||||
shift 2;
|
||||
continue;
|
||||
};
|
||||
[[ $1 == -f ]] && {
|
||||
if [ "$2" == "" ]; then echo "Too few arguments"; usage; exit; fi
|
||||
file="$2"
|
||||
shift 2;
|
||||
continue;
|
||||
};
|
||||
[[ $1 == -o ]] && {
|
||||
if [ "$2" == "" ]; then echo "Too few arguments"; usage; exit; fi
|
||||
opt="$2"
|
||||
shift 2;
|
||||
continue;
|
||||
};
|
||||
[[ $1 == -d ]] && {
|
||||
if [ "$2" == "" ]; then echo "Too few arguments"; usage; exit; fi
|
||||
DEST="$2"
|
||||
shift 2;
|
||||
continue;
|
||||
};
|
||||
[[ $1 == -p ]] && {
|
||||
DEST="~/Videos/.stuff"
|
||||
shift 1;
|
||||
continue;
|
||||
};
|
||||
[[ $1 == --help ]] && {
|
||||
usage
|
||||
exit
|
||||
};
|
||||
echo "Parameter $1 discarded"
|
||||
usage
|
||||
exit
|
||||
done
|
||||
}
|
||||
usage() {
|
||||
printf "Usage:
|
||||
-h <hostname>\tRemote Hostname
|
||||
-f <filename>\tPath of local file
|
||||
-o <options>\tGive additional Options
|
||||
-d <dest>\tChoose other Destination Folder
|
||||
-p\t\tChange Destination
|
||||
--help\t\tDisplay Usage\n"
|
||||
exit
|
||||
}
|
||||
get_config "$@"
|
||||
if [ "${HOST}" == "deluge" ]; then
|
||||
HOST="serverhost"
|
||||
USER="deluge-user"
|
||||
DEST="/home/deluge-user/Downloads/Torrents/"
|
||||
fi
|
||||
echo "Copy ${file} to ${HOST}:${DEST}"
|
||||
scp -r ${opt} "${file}" ${USER}@${HOST}:${DEST}
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/bash
|
||||
scp lucas@serverhost:/etc/update-motd.d/10-help-text ~/Documents/Dokumente/Dokumente/Projekte/Server/motd.serverhost.10-help-text
|
||||
scp lucas@raspberry:~/.profile ~/Documents/Dokumente/Dokumente/Projekte/Server/motd.raspberry.profile
|
||||
rm 0
|
||||
@@ -1,30 +0,0 @@
|
||||
#!/usr/bin/expect -f
|
||||
#Copy Crontab of raspberry and serverhost
|
||||
set host "raspberry"
|
||||
array set user { 0 "root" 1 "lucas"}
|
||||
set port "1160"
|
||||
for {set j 0} {$j < 2} {incr j 1} {
|
||||
spawn ssh -p $port lucas@$host
|
||||
expect {
|
||||
"No route to host" {
|
||||
puts "spawn ssh -p $port SendEnv=TERM lucas@$host failed."
|
||||
exit 0
|
||||
}
|
||||
"Login Sucsessfull" {
|
||||
if {$user($j)=="root"} {
|
||||
send "sudo crontab -l >> crontab.buf\r"
|
||||
expect "lucas: "
|
||||
send "Gina\&1994\&Nonna\r"
|
||||
} else {
|
||||
send "crontab -l >> crontab.buf\r"
|
||||
}
|
||||
#expect "$ "
|
||||
#send "cat crontab.buf\r"
|
||||
expect "$ "
|
||||
send "scp -P 3032 crontab.buf lucas@serverhost:~/Documents/Dokumente/Dokumente/Projekte/Server/crontab.$host.$user($j)\r"
|
||||
expect "$ "
|
||||
send "rm crontab.buf\r"
|
||||
puts "crontab.$host.$user($j) created."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/expect -f
|
||||
#Copy Crontab of raspberry and serverhost
|
||||
array set host { 0 "serverhost" 1 "raspberry"}
|
||||
array set user { 0 "root" 1 "lucas"}
|
||||
array set port { 0 "3032" 1 "1160"}
|
||||
|
||||
for {set i 0} {$i < 2} {incr i 1} {
|
||||
for {set j 0} {$j < 2} {incr j 1} {
|
||||
spawn ssh -p $port($i) lucas@$host($i)
|
||||
expect {
|
||||
"No route to host" {
|
||||
puts "spawn ssh -p $port($i) lucas@$host($i) failed."
|
||||
exit 0
|
||||
}
|
||||
"Login Sucsessfull" {
|
||||
if {$user($j)=="root"} {
|
||||
send "sudo crontab -l >> crontab.buf\r"
|
||||
expect "lucas: "
|
||||
send "Gina\&1994\&Nonna\r"
|
||||
} else {
|
||||
send "crontab -l >> crontab.buf\r"
|
||||
}
|
||||
#expect "$ "
|
||||
#send "cat crontab.buf\r"
|
||||
expect "$ "
|
||||
send "scp -P 1160 crontab.buf lucas@workhost:~/Documents/Dokumente/Dokumente/Projekte/Server/crontab.$host($i).$user($j)\r"
|
||||
expect "$ "
|
||||
send "rm crontab.buf\r"
|
||||
puts "crontab.$host($i).$user($j) created."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,8 @@
|
||||
[Desktop Entry]
|
||||
Name=Wallpaper Changer
|
||||
Comment=
|
||||
Exec=/home/lucas/scripts/utils/WallpaperChanger.sh -c
|
||||
Icon=/home/lucas/scripts/desktop_apps/wallpaper.png
|
||||
Terminal=false
|
||||
Type=Application
|
||||
StartupNotify=true
|
||||
@@ -0,0 +1,8 @@
|
||||
[Desktop Entry]
|
||||
Name=Wallpaper Changer
|
||||
Comment=
|
||||
Exec=/home/lucas/scripts/utils/WallpaperChanger.sh -clear
|
||||
Icon=/home/lucas/scripts/desktop_apps/wallpaperClear.png
|
||||
Terminal=false
|
||||
Type=Application
|
||||
StartupNotify=true
|
||||
@@ -0,0 +1,8 @@
|
||||
[Desktop Entry]
|
||||
Name=Wallpaper Changer
|
||||
Comment=
|
||||
Exec=/home/lucas/scripts/utils/WallpaperChanger.sh -x
|
||||
Icon=/home/lucas/scripts/desktop_apps/wallpaperX.png
|
||||
Terminal=false
|
||||
Type=Application
|
||||
StartupNotify=true
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env xdg-open
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Terminal=false
|
||||
Exec=sudo systemctl hibernate
|
||||
Name=Hibernate
|
||||
Comment=Hibernate GW
|
||||
Icon=/home/lucas/Documents/Dokumente/Projekte/Icons/hibernate.png
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
cd /docker
|
||||
find . -maxdepth 3 -type f \( -name "*.yaml" -o -name "*.yml" -o -name "*.conf" -o -name "*.sh" -o -name "*.py" \) \
|
||||
-print0 2>/dev/null | rsync -aR --files-from=- --from0 ./ /home/lucas/scripts/docker_compose/$(hostname)
|
||||
crontab -l > /home/lucas/scripts/docker_compose/$(hostname)/crontab.bak
|
||||
cp /etc/fstab /home/lucas/scripts/docker_compose/$(hostname)
|
||||
if [ -f /etc/exports ]; then
|
||||
cp /etc/exports /home/lucas/scripts/docker_compose/$(hostname)
|
||||
fi
|
||||
@@ -0,0 +1,189 @@
|
||||
#!/usr/bin/env bash
|
||||
set -uo pipefail
|
||||
|
||||
CONTAINER="${1:-}"
|
||||
COMPOSE_FILE="${2:-}"
|
||||
|
||||
if [ -z "$CONTAINER" ]; then
|
||||
echo "Usage:"
|
||||
echo " $0 <container-name> [docker-compose.yml]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
|
||||
OUTDIR="/tmp/${CONTAINER}-debug-${TIMESTAMP}"
|
||||
|
||||
mkdir -p "$OUTDIR"
|
||||
|
||||
echo "[*] Collecting debug data for container: $CONTAINER"
|
||||
|
||||
# --------------------------------------------------
|
||||
# Docker info
|
||||
# --------------------------------------------------
|
||||
|
||||
docker inspect "$CONTAINER" \
|
||||
> "$OUTDIR/docker-inspect.json" 2>&1 || true
|
||||
|
||||
docker inspect "$CONTAINER" --format '{{.Config.Image}}' \
|
||||
> "$OUTDIR/image.txt" 2>&1 || true
|
||||
|
||||
# --------------------------------------------------
|
||||
# Logs
|
||||
# --------------------------------------------------
|
||||
|
||||
docker logs "$CONTAINER" --tail=10000 \
|
||||
> "$OUTDIR/container.log" 2>&1 || true
|
||||
|
||||
# --------------------------------------------------
|
||||
# Environment
|
||||
# --------------------------------------------------
|
||||
|
||||
docker exec "$CONTAINER" env \
|
||||
> "$OUTDIR/container-env.txt" 2>&1 || true
|
||||
|
||||
# --------------------------------------------------
|
||||
# Host information
|
||||
# --------------------------------------------------
|
||||
|
||||
{
|
||||
echo "=== HOST ==="
|
||||
|
||||
if command -v lsb_release >/dev/null 2>&1; then
|
||||
lsb_release -a
|
||||
fi
|
||||
|
||||
uname -a
|
||||
|
||||
echo
|
||||
echo "=== DOCKER ==="
|
||||
docker --version
|
||||
|
||||
} > "$OUTDIR/host.txt" 2>&1
|
||||
|
||||
PROGRAMS=(
|
||||
"yt-dlp"
|
||||
"ffmpeg"
|
||||
"ffprobe"
|
||||
"node"
|
||||
"npm"
|
||||
"python"
|
||||
"python3"
|
||||
"java"
|
||||
"curl"
|
||||
"wget"
|
||||
"git"
|
||||
)
|
||||
|
||||
# --------------------------------------------------
|
||||
# Common program versions
|
||||
# --------------------------------------------------
|
||||
|
||||
{
|
||||
echo "=== PROGRAM VERSIONS ==="
|
||||
echo
|
||||
|
||||
for prog in "${PROGRAMS[@]}"; do
|
||||
echo "----- $prog -----"
|
||||
|
||||
if docker exec "$CONTAINER" sh -c "command -v '$prog'" \
|
||||
>/dev/null 2>&1; then
|
||||
|
||||
docker exec "$CONTAINER" sh -c "
|
||||
$prog --version 2>/dev/null ||
|
||||
$prog -version 2>/dev/null ||
|
||||
$prog -V 2>/dev/null ||
|
||||
true
|
||||
" | head -n 5
|
||||
|
||||
else
|
||||
echo "not installed"
|
||||
fi
|
||||
|
||||
echo
|
||||
done
|
||||
|
||||
} > "$OUTDIR/versions.txt" 2>&1
|
||||
|
||||
# --------------------------------------------------
|
||||
# Compose snippet
|
||||
# --------------------------------------------------
|
||||
|
||||
if [ -n "$COMPOSE_FILE" ] && [ -f "$COMPOSE_FILE" ]; then
|
||||
|
||||
SERVICE=$(docker inspect "$CONTAINER" \
|
||||
--format '{{ index .Config.Labels "com.docker.compose.service" }}' \
|
||||
2>/dev/null)
|
||||
|
||||
if [ -n "$SERVICE" ]; then
|
||||
yq ".services.\"$SERVICE\"" "$COMPOSE_FILE" \
|
||||
> "$OUTDIR/compose-service.yaml" 2>&1 || true
|
||||
fi
|
||||
fi
|
||||
|
||||
# --------------------------------------------------
|
||||
# Summary
|
||||
# --------------------------------------------------
|
||||
|
||||
{
|
||||
echo "================================="
|
||||
echo "Debug Summary"
|
||||
echo "================================="
|
||||
echo
|
||||
|
||||
echo "Container:"
|
||||
echo " $CONTAINER"
|
||||
echo
|
||||
|
||||
echo "Image:"
|
||||
cat "$OUTDIR/image.txt" 2>/dev/null
|
||||
echo
|
||||
|
||||
echo "Host:"
|
||||
uname -a
|
||||
lsb_release -a
|
||||
docker --version
|
||||
echo
|
||||
|
||||
echo "Compose Service:"
|
||||
|
||||
docker inspect "$CONTAINER" \
|
||||
--format '{{ index .Config.Labels "com.docker.compose.service" }}' \
|
||||
2>/dev/null || echo "unknown"
|
||||
|
||||
if [ -n "$SERVICE" ]; then
|
||||
echo "Docker Compose Config"
|
||||
yq ".services.\"$SERVICE\"" "$COMPOSE_FILE"
|
||||
fi
|
||||
echo
|
||||
echo "Programs found:"
|
||||
|
||||
for prog in "${PROGRAMS[@]}"; do
|
||||
if docker exec "$CONTAINER" sh -c "command -v '$prog'" \
|
||||
>/dev/null 2>&1; then
|
||||
echo "$prog: $(
|
||||
$prog --version 2>/dev/null ||
|
||||
$prog -version 2>/dev/null ||
|
||||
$prog -V 2>/dev/null ||
|
||||
true
|
||||
)" | head -n1
|
||||
fi
|
||||
done
|
||||
|
||||
} | tee "$OUTDIR/summary.txt"
|
||||
|
||||
# --------------------------------------------------
|
||||
# Archive
|
||||
# --------------------------------------------------
|
||||
|
||||
ARCHIVE="${OUTDIR}.tar.gz"
|
||||
|
||||
tar czf "$ARCHIVE" \
|
||||
-C "$(dirname "$OUTDIR")" \
|
||||
"$(basename "$OUTDIR")"
|
||||
|
||||
echo
|
||||
echo "[OK] Debug report created:"
|
||||
echo "$ARCHIVE"
|
||||
|
||||
echo
|
||||
ls -lh "$ARCHIVE"
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
/usr/bin/docker compose -f /docker/nginx/docker-compose.yaml run --rm certbot renew && \
|
||||
/usr/bin/docker compose -f /docker/nginx/docker-compose.yaml exec nginx nginx -s reload
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
/usr/bin/docker exec -u www-data nextcloud /usr/local/bin/php -f /var/www/html/cron.php
|
||||
@@ -0,0 +1,41 @@
|
||||
# Edit this file to introduce tasks to be run by cron.
|
||||
#
|
||||
# Each task to run has to be defined through a single line
|
||||
# indicating with different fields when the task will be run
|
||||
# and what command to run for the task
|
||||
#
|
||||
# To define the time you can provide concrete values for
|
||||
# minute (m), hour (h), day of month (dom), month (mon),
|
||||
# and day of week (dow) or use '*' in these fields (for 'any').
|
||||
#
|
||||
# Notice that tasks will be started based on the cron's system
|
||||
# daemon's notion of time and timezones.
|
||||
#
|
||||
# Output of the crontab jobs (including errors) is sent through
|
||||
# email to the user the crontab file belongs to (unless redirected).
|
||||
#
|
||||
# For example, you can run a backup of all your user accounts
|
||||
# at 5 a.m every week with:
|
||||
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
|
||||
#
|
||||
# For more information see the manual pages of crontab(5) and cron(8)
|
||||
#
|
||||
# Example of job definition:
|
||||
# .---------------- minute (0 - 59)
|
||||
# | .------------- hour (0 - 23)
|
||||
# | | .---------- day of month (1 - 31)
|
||||
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
|
||||
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
|
||||
# | | | | |
|
||||
# * * * * * user-name command to be executed
|
||||
|
||||
*/5 * * * * /home/lucas/scripts/docker_compose/docker_update_nextcloud.sh && logger "CRON_SUCCESS nextcloud" || logger "CRON_FAILURE nextcloud"
|
||||
*/5 * * * * /home/lucas/scripts/docker_compose/node-exporter-pubip-docker-states.sh && logger "CRON_SUCCESS pubip" || logger "CRON_FAILURE pubip"
|
||||
#0 * * * * /home/lucas/scripts/media_editing/convert_heic.sh && logger "CRON_SUCCESS conv_heic" || logger "CRON_FAILURE conv_heic"
|
||||
0 * * * * /home/lucas/scripts/file_processing/rename_memes_folder.sh && logger "CRON_SUCCESS rename_mem" || logger "CRON_FAILURE rename_mem"
|
||||
0 * * * * /home/lucas/scripts/file_processing/sync_dropfolder_to_immich.sh && logger "CRON_SUCCESS immich" || logger "CRON_FAILURE immich"
|
||||
#10 * * * * /home/lucas/scripts/file_processing/rename_camera_folder.py && logger "CRON_SUCCESS rename_cam" || logger "CRON_FAILURE rename_cam"
|
||||
0 3 * * * /home/lucas/scripts/docker_compose/docker_renew_certbot.sh && logger "CRON_SUCCESS renew_cert" || logger "CRON_FAILURE renew_cert"
|
||||
0 3 * * 0 /home/lucas/scripts/utils/download_latest_ubuntu.sh && logger "CRON_SUCCESS ubuntu" || logger "CRON_FAILURE ubuntu"
|
||||
0 3 * * 0 /home/lucas/scripts/utils/rotate_logs.py && logger "CRON_SUCCESS logs" || logger "CRON_FAILURE logs"
|
||||
0 0 1 * * /home/lucas/scripts/network/wol.sh quiethost && logger "CRON_SUCCESS quietwake" || logger "CRON_FAILURE quietwake"
|
||||
@@ -17,17 +17,27 @@ services:
|
||||
DIUN_PROVIDERS_DOCKER: "true"
|
||||
DIUN_PROVIDERS_DOCKER_WATCHBYDEFAULT: "true"
|
||||
|
||||
# Email notifications
|
||||
DIUN_NOTIF_MAIL_HOST: smtp.web.de
|
||||
DIUN_NOTIF_MAIL_PORT: 587
|
||||
DIUN_NOTIF_MAIL_USERNAME: ll_m@web.de
|
||||
DIUN_NOTIF_MAIL_PASSWORD: Mira2012
|
||||
DIUN_NOTIF_MAIL_FROM: ll_m@web.de
|
||||
DIUN_NOTIF_MAIL_TO: ll_m@web.de
|
||||
DIUN_NOTIF_MAIL_INSECURESKIPVERIFY: "false"
|
||||
# Metrics
|
||||
|
||||
DIUN_METRICS_ENABLED: "true"
|
||||
DIUN_METRICS_ADDR: ":9090"
|
||||
DIUN_METRICS_TOKEN: "Qj#8C!@Uz3uRWm@mCd@KH6Bo7nfQ4K"
|
||||
# # Email notifications
|
||||
# DIUN_NOTIF_MAIL_HOST: smtp.web.de
|
||||
# DIUN_NOTIF_MAIL_PORT: 587
|
||||
# DIUN_NOTIF_MAIL_USERNAME: ll_m@web.de
|
||||
# DIUN_NOTIF_MAIL_PASSWORD: Mira2012
|
||||
# DIUN_NOTIF_MAIL_FROM: ll_m@web.de
|
||||
# DIUN_NOTIF_MAIL_TO: ll_m@web.de
|
||||
# DIUN_NOTIF_MAIL_INSECURESKIPVERIFY: "false"
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
networks:
|
||||
- shared-prometheus-services
|
||||
networks:
|
||||
shared-prometheus-services:
|
||||
external: true
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# /etc/exports: the access control list for filesystems which may be exported
|
||||
# to NFS clients. See exports(5).
|
||||
#
|
||||
# Example for NFSv2 and NFSv3:
|
||||
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
|
||||
#
|
||||
# Example for NFSv4:
|
||||
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
|
||||
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
|
||||
#
|
||||
/data/torrent/qbittorrent/mediahost 192.168.0.2(rw,sync,no_subtree_check)
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# /etc/fstab: static file system information.
|
||||
#
|
||||
# Use 'blkid' to print the universally unique identifier for a
|
||||
# device; this may be used with UUID= as a more robust way to name devices
|
||||
# that works even if disks are added and removed. See fstab(5).
|
||||
#
|
||||
# <file system> <mount point> <type> <options> <dump> <pass>
|
||||
# / was on /dev/ubuntu-vg/ubuntu-lv during curtin installation
|
||||
/dev/disk/by-id/dm-uuid-LVM-r8YfWcv5quj81USd5JVq2hhAsFYHSOzApd2lI7XnRXm9tFwB4UaNsO2f5le5eX0f / ext4 defaults 0 1
|
||||
# /boot was on /dev/nvme0n1p2 during curtin installation
|
||||
/dev/disk/by-uuid/d88641c2-0c6a-47a6-b3e6-af4b6bbd9b05 /boot ext4 defaults 0 1
|
||||
# /boot/efi was on /dev/nvme0n1p1 during curtin installation
|
||||
/dev/disk/by-uuid/CEA1-EE2F /boot/efi vfat defaults 0 1
|
||||
# /docker was on /dev/ubuntu-vg/docker-vg during curtin installation
|
||||
/dev/disk/by-id/dm-uuid-LVM-r8YfWcv5quj81USd5JVq2hhAsFYHSOzAoaSA1n5zU8GkQuzTSQ9OBbNTaAoY2giE /docker ext4 defaults 0 1
|
||||
/swap.img none swap sw 0 0
|
||||
192.168.0.2:/torrent/qbittorrent-private/downloads /data/torrent/qbittorrent-private/downloads nfs defaults,_netdev 0 0
|
||||
192.168.0.2:/torrent/qbittorrent-public/downloads /data/torrent/qbittorrent-public/downloads nfs defaults,_netdev 0 0
|
||||
192.168.0.2:/special-torrent/torrent /data/torrent/qbittorrent-special/downloads nfs defaults,_netdev 0 0
|
||||
#192.168.0.2:/torrent/qbittorrent/downloads /torrent/qbittorrent/downloads nfs defaults,_netdev,uid=1000,gid=1000 0 0
|
||||
|
||||
# Backup
|
||||
/dev/disk/by-uuid/8a602724-8401-4b4b-8b54-7e9d2f633a9c /backup ext4 defaults 0 1
|
||||
@@ -0,0 +1,2 @@
|
||||
container:
|
||||
network: gitea-network
|
||||
@@ -16,4 +16,44 @@ services:
|
||||
- /data/gitea:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
networks:
|
||||
- gitea-network
|
||||
- shared-proxy-services
|
||||
gitea-runner:
|
||||
image: docker.io/gitea/act_runner:latest
|
||||
container_name: gitea-runner
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
GITEA_INSTANCE_URL: http://gitea:3000
|
||||
GITEA_RUNNER_REGISTRATION_TOKEN: ${GITEA_RUNNER_TOKEN}
|
||||
GITEA_RUNNER_NAME: docker-runner
|
||||
GITEA_RUNNER_LABELS: ubuntu-latest:docker://node:20-bookworm
|
||||
CONFIG_FILE: /config.yaml
|
||||
volumes:
|
||||
- ./runner-data:/data
|
||||
- ./config.yaml:/config.yaml:ro
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
networks:
|
||||
- gitea-network
|
||||
# gitea-runner:
|
||||
# image: docker.io/gitea/runner:5-dind
|
||||
# container_name: gitea-runner
|
||||
# restart: unless-stopped
|
||||
# privileged: true
|
||||
# environment:
|
||||
# GITEA_INSTANCE_URL: http://gitea:3000
|
||||
# GITEA_RUNNER_REGISTRATION_TOKEN: ${GITEA_RUNNER_TOKEN}
|
||||
# GITEA_RUNNER_NAME: docker-runner
|
||||
# GITEA_RUNNER_LABELS: ubuntu-latest:docker://node:20-bookworm
|
||||
#
|
||||
# volumes:
|
||||
# - ./runner-data:/data
|
||||
# - ./config.yaml:/config.yaml
|
||||
# networks:
|
||||
# - gitea-network
|
||||
|
||||
networks:
|
||||
gitea-network:
|
||||
external: true
|
||||
shared-proxy-services:
|
||||
external: true
|
||||
@@ -9,6 +9,11 @@ services:
|
||||
TZ: Europe/Vienna
|
||||
volumes:
|
||||
- /srv/homeassistant:/config
|
||||
devices:
|
||||
- /dev/bus/usb:/dev/bus/usb
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
|
||||
mosquitto:
|
||||
container_name: mosquitto
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
#
|
||||
# WARNING: To install Immich, follow our guide: https://docs.immich.app/install/docker-compose
|
||||
#
|
||||
# Make sure to use the docker-compose.yml of the current release:
|
||||
#
|
||||
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
|
||||
#
|
||||
# The compose file on main may not be compatible with the latest release.
|
||||
|
||||
name: immich
|
||||
|
||||
services:
|
||||
immich-server:
|
||||
container_name: immich_server
|
||||
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
|
||||
# extends:
|
||||
# file: hwaccel.transcoding.yml
|
||||
# service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
|
||||
volumes:
|
||||
# Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
|
||||
- ${UPLOAD_LOCATION}:/data
|
||||
- /data/immich/pictures:/library
|
||||
- /data/immich/dropfolder:/library_dropfolder
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
env_file:
|
||||
- .env
|
||||
ports:
|
||||
- '2283:2283'
|
||||
depends_on:
|
||||
- database
|
||||
restart: always
|
||||
healthcheck:
|
||||
disable: false
|
||||
networks:
|
||||
- immich
|
||||
- shared-redis-services
|
||||
- shared-proxy-services
|
||||
|
||||
immich-machine-learning:
|
||||
container_name: immich_machine_learning
|
||||
# For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag.
|
||||
# Example tag: ${IMMICH_VERSION:-release}-cuda
|
||||
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
|
||||
# extends: # uncomment this section for hardware acceleration - see https://docs.immich.app/features/ml-hardware-acceleration
|
||||
# file: hwaccel.ml.yml
|
||||
# service: cpu # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable
|
||||
volumes:
|
||||
- model-cache:/cache
|
||||
env_file:
|
||||
- .env
|
||||
restart: always
|
||||
healthcheck:
|
||||
disable: false
|
||||
networks:
|
||||
- immich
|
||||
|
||||
database:
|
||||
container_name: immich_postgres
|
||||
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:bcf63357191b76a916ae5eb93464d65c07511da41e3bf7a8416db519b40b1c23
|
||||
environment:
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||
POSTGRES_USER: ${DB_USERNAME}
|
||||
POSTGRES_DB: ${DB_DATABASE_NAME}
|
||||
POSTGRES_INITDB_ARGS: '--data-checksums'
|
||||
# Uncomment the DB_STORAGE_TYPE: 'HDD' var if your database isn't stored on SSDs
|
||||
DB_STORAGE_TYPE: 'HDD'
|
||||
volumes:
|
||||
# Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
|
||||
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
|
||||
shm_size: 128mb
|
||||
restart: always
|
||||
healthcheck:
|
||||
disable: false
|
||||
networks:
|
||||
- immich
|
||||
immich-power-tools:
|
||||
container_name: immich_power_tools
|
||||
image: ghcr.io/immich-power-tools/immich-power-tools:latest
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8001:3000"
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- immich-power-tools-data:/app/data
|
||||
environment:
|
||||
IMMICH_URL: http://immich_server:2283
|
||||
EXTERNAL_IMMICH_URL: https://fotos.someoneslinux.selfhost.eu
|
||||
IMMICH_API_KEY: "ROCfyJGLFBJSxKYXBcdfEfec7P80FVkvyr6fk8hThg"
|
||||
DB_HOST: database
|
||||
DB_PORT: 5432
|
||||
DB_USERNAME: ${DB_USERNAME}
|
||||
DB_PASSWORD: ${DB_PASSWORD}
|
||||
DB_DATABASE_NAME: ${DB_DATABASE_NAME}
|
||||
networks:
|
||||
- immich
|
||||
volumes:
|
||||
model-cache:
|
||||
immich-power-tools-data:
|
||||
networks:
|
||||
immich:
|
||||
shared-redis-services:
|
||||
external: true
|
||||
shared-proxy-services:
|
||||
external: true
|
||||
@@ -7,6 +7,8 @@ services:
|
||||
- /docker/jellyfin/config:/config
|
||||
- /docker/jellyfin/cache:/cache
|
||||
- /data/jellyfin/media:/media
|
||||
devices:
|
||||
- /dev/dri:/dev/dri
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8096:8096"
|
||||
@@ -15,7 +17,6 @@ services:
|
||||
networks:
|
||||
- default
|
||||
- shared-proxy-services
|
||||
|
||||
seerr:
|
||||
image: ghcr.io/seerr-team/seerr:latest
|
||||
container_name: seerr
|
||||
@@ -29,6 +30,7 @@ services:
|
||||
networks:
|
||||
- default
|
||||
- shared-proxy-services
|
||||
|
||||
networks:
|
||||
default:
|
||||
external: true
|
||||
|
||||
@@ -1,7 +1,29 @@
|
||||
|
||||
services:
|
||||
sonarr-de:
|
||||
# image: lscr.io/linuxserver/sonarr:latest
|
||||
image: ghcr.io/hotio/sonarr:latest
|
||||
container_name: sonarr-de
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8990:8989"
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=Europe/Berlin
|
||||
volumes:
|
||||
- ./sonarr_DE:/config
|
||||
- /data/jellyfin/media/series-german:/JellyfinSeriesGerman
|
||||
- /data/jellyfin/media/anime-german:/JellyfinAnimeGerman
|
||||
- /data/jellyfin/media/series-kids:/JellyfinKinder
|
||||
- /data/jellyfin/media/documentaries-german:/JellyfinDocusGerman
|
||||
- /data/jellyfin/buffer:/buffer
|
||||
- /torrent/qbittorrent-private/downloads:/downloads-private
|
||||
- /torrent/qbittorrent-public/downloads:/downloads-public
|
||||
- /torrent/rundfunkarr-de:/downloads-rundfunkarr
|
||||
sonarr-en:
|
||||
image: lscr.io/linuxserver/sonarr:latest
|
||||
# image: lscr.io/linuxserver/sonarr:latest
|
||||
image: ghcr.io/hotio/sonarr:latest
|
||||
container_name: sonarr-en
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
@@ -16,25 +38,8 @@ services:
|
||||
- /data/jellyfin/media/anime-english:/JellyfinAnimeEnglish
|
||||
- /data/jellyfin/media/documentaries-english:/JellyfinDocus
|
||||
- /data/jellyfin/buffer:/buffer
|
||||
- /torrent/qbittorrent/downloads:/downloads
|
||||
sonarr-de:
|
||||
image: lscr.io/linuxserver/sonarr:latest
|
||||
container_name: sonarr-de
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8990:8989"
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=Europe/Berlin
|
||||
volumes:
|
||||
- ./sonarr_DE:/config
|
||||
- /data/jellyfin/media/series-german:/JellyfinSeriesGerman
|
||||
- /data/jellyfin/media/anime-german:/JellyfinAnimeGerman
|
||||
- /data/jellyfin/media/series-kids:/JellyfinKinder
|
||||
- /data/jellyfin/buffer:/buffer
|
||||
- /torrent/qbittorrent/downloads:/downloads
|
||||
- /torrent/rundfunkarr:/downloads-rundfunkarr
|
||||
- /torrent/qbittorrent-private/downloads:/downloads-private
|
||||
- /torrent/qbittorrent-public/downloads:/downloads-public
|
||||
radarr-en:
|
||||
image: lscr.io/linuxserver/radarr:latest
|
||||
container_name: radarr-en
|
||||
@@ -49,7 +54,8 @@ services:
|
||||
- ./radarr_EN:/config
|
||||
- /data/jellyfin/media/movies-english:/JellyfinMoviesEnglish
|
||||
- /data/jellyfin/media/comedy-english:/JellyfinComedy
|
||||
- /torrent/qbittorrent/downloads:/downloads
|
||||
- /torrent/qbittorrent-private/downloads:/downloads-private
|
||||
- /torrent/qbittorrent-public/downloads:/downloads-public
|
||||
- /data/jellyfin/buffer:/buffer
|
||||
radarr-de:
|
||||
image: lscr.io/linuxserver/radarr:latest
|
||||
@@ -66,8 +72,9 @@ services:
|
||||
- /data/jellyfin/media/movies-german:/JellyfinMoviesGerman
|
||||
- /data/jellyfin/media/movies-kids:/JellyfinKinder
|
||||
- /data/jellyfin/buffer:/buffer
|
||||
- /torrent/qbittorrent/downloads:/downloads
|
||||
- /torrent/rundfunkarr:/downloads-rundfunkarr
|
||||
- /torrent/qbittorrent-private/downloads:/downloads-private
|
||||
- /torrent/qbittorrent-public/downloads:/downloads-public
|
||||
- /torrent/rundfunkarr-de:/downloads-rundfunkarr
|
||||
prowlarr:
|
||||
image: lscr.io/linuxserver/prowlarr:latest
|
||||
container_name: prowlarr
|
||||
@@ -80,25 +87,36 @@ services:
|
||||
- TZ=Europe/Vienna
|
||||
volumes:
|
||||
- ./prowlarr:/config
|
||||
|
||||
gluetun-rundfunkarr-de:
|
||||
image: qmcgaw/gluetun
|
||||
image: qmcgaw/gluetun:latest
|
||||
container_name: gluetun-rundfunkarr-de
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
- ./gluetun-de:/gluetun/wireguard
|
||||
|
||||
environment:
|
||||
- VPN_SERVICE_PROVIDER=custom
|
||||
- VPN_TYPE=wireguard
|
||||
ports:
|
||||
- "6767:6767" # Rundfunkarr UI
|
||||
|
||||
# rundfunkarr-at:
|
||||
# image: rundfunkarr:local
|
||||
# container_name: rundfunkarr-at
|
||||
# environment:
|
||||
# - TZ=Europe/Berlin
|
||||
# - PUID=1000 # User ID (id -u)
|
||||
# - PGID=1000 # Group ID (id -g)
|
||||
# - DOWNLOAD_FOLDER_PATH=/downloads-rundfunkarr
|
||||
# volumes:
|
||||
# - ./rundfunkarr-at:/app/prisma/data
|
||||
# - /torrent/rundfunkarr-at:/downloads-rundfunkarr
|
||||
# ports:
|
||||
# - 6768:6767
|
||||
# restart: unless-stopped
|
||||
rundfunkarr-de:
|
||||
image: ghcr.io/rundfunkarr/rundfunkarr:latest
|
||||
# image: ghcr.io/rundfunkarr/rundfunkarr:latest
|
||||
image: rundfunkarr:local
|
||||
container_name: rundfunkarr-de
|
||||
environment:
|
||||
- TZ=Europe/Berlin
|
||||
@@ -114,18 +132,14 @@ services:
|
||||
network_mode: "service:gluetun-rundfunkarr-de"
|
||||
depends_on:
|
||||
- gluetun-rundfunkarr-de
|
||||
|
||||
gluetun-at:
|
||||
image: qmcgaw/gluetun:latest
|
||||
container_name: gluetun-at
|
||||
restart: unless-stopped
|
||||
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
|
||||
devices:
|
||||
- /dev/net/tun:/dev/net/tun
|
||||
|
||||
ports:
|
||||
- "8888:8888" # HTTP Proxy
|
||||
- "1080:1080" # SOCKS5 Proxy
|
||||
@@ -134,10 +148,12 @@ services:
|
||||
- VPN_TYPE=wireguard
|
||||
- SOCKS5_ENABLED=on
|
||||
- HTTPPROXY=on
|
||||
- HTTP_LISTENING_ADDRESS:=8888
|
||||
- SOCKSPROXY=on
|
||||
|
||||
- TZ=Europe/Vienna
|
||||
|
||||
- DNS_SERVER=on
|
||||
- DNS_UPSTREAM_RESOLVER_TYPE=plain
|
||||
- DNS_UPSTREAM_PLAIN_ADDRESSES=1.1.1.1:53,8.8.8.8:53
|
||||
volumes:
|
||||
- ./gluetun-at:/gluetun/wireguard
|
||||
# lazylibrarian:
|
||||
@@ -154,7 +170,7 @@ services:
|
||||
# - ./lazylibrarian:/config
|
||||
# - /data/audiobookshelf/podcasts:/podcasts
|
||||
# - /data/audiobookshelf/audiobooks-englisch:/audiobooks
|
||||
# - /torrent/qbittorrent/downloads:/downloads
|
||||
# - /torrent/qbittorrent-private/downloads:/downloads
|
||||
|
||||
flaresolverr:
|
||||
image: ghcr.io/flaresolverr/flaresolverr:latest
|
||||
@@ -169,7 +185,7 @@ services:
|
||||
- "8191:8191"
|
||||
|
||||
lidarr:
|
||||
image: lscr.io/linuxserver/lidarr:latest
|
||||
image: lscr.io/linuxserver/lidarr:develop #latest
|
||||
container_name: lidarr
|
||||
environment:
|
||||
- PUID=1000
|
||||
@@ -177,8 +193,9 @@ services:
|
||||
- TZ=Europe/Berlin
|
||||
volumes:
|
||||
- ./lidarr:/config
|
||||
- /data/navidrome/music:/music
|
||||
- /torrent/qbittorrent/downloads:/downloads
|
||||
- /data/navidrome/music/music:/music
|
||||
- /torrent/qbittorrent-private/downloads:/downloads-private
|
||||
- /torrent/qbittorrent-public/downloads:/downloads-public
|
||||
|
||||
ports:
|
||||
- 8686:8686
|
||||
@@ -232,44 +249,129 @@ services:
|
||||
- /data/audiobookshelf/data/audiobooks-englisch:/audiobooks-english
|
||||
- /data/audiobookshelf/data/audiobooks-deutsch:/audiobooks-german
|
||||
- /data/audiobookshelf/data/audiobooks-kinder:/audiobooks-kinder
|
||||
- /torrent/qbittorrent/downloads:/downloads
|
||||
- /torrent/qbittorrent-public/downloads:/downloads-public
|
||||
- /torrent/qbittorrent-private/downloads:/downloads-private
|
||||
restart: unless-stopped
|
||||
upload-assistant:
|
||||
image: ghcr.io/audionut/upload-assistant:latest
|
||||
container_name: upload-assistant
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "5000:5000"
|
||||
jackett:
|
||||
image: lscr.io/linuxserver/jackett:latest
|
||||
container_name: jackett
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
# Paths visible in the file browser
|
||||
- UA_BROWSE_ROOTS=/downloads,/data
|
||||
|
||||
command: ["--webui", "0.0.0.0:5000"]
|
||||
|
||||
- TZ=Europe/Vienna
|
||||
volumes:
|
||||
- ./upload-assistant:/Upload-Assistant/data
|
||||
# Sonarr/Radarr libraries
|
||||
- /data/jellyfin/media/series-english:/data/series-english:ro
|
||||
- /data/jellyfin/media/anime-english:/data/anime-english:ro
|
||||
- /data/jellyfin/media/documentaries-english:/docus-english:ro
|
||||
- /data/jellyfin/media/series-german:/series-german:ro
|
||||
- /data/jellyfin/media/anime-german:/anime-german:ro
|
||||
- /data/jellyfin/media/series-kids:/series-kids:ro
|
||||
- /data/jellyfin/media/movies-english:/data/movies-english:ro
|
||||
- /data/jellyfin/media/comedy-english:/data/comedy-english:ro
|
||||
- /data/jellyfin/media/movies-german:/data/movies-german:ro
|
||||
- /data/jellyfin/media/movies-kids:/data/movies-kids:ro
|
||||
# - /data/audiobookshelf/podcasts:/podcasts
|
||||
# - /data/audiobookshelf/audiobooks-englisch:/audiobooks
|
||||
- /data/navidrome/music:/data/music:ro
|
||||
- /data/audiobookshelf/data/audiobooks-englisch:/data/audiobooks-english:ro
|
||||
- /data/audiobookshelf/data/audiobooks-deutsch:/data/audiobooks-german:ro
|
||||
- /data/audiobookshelf/data/audiobooks-kinder:/data/audiobooks-kinder:ro
|
||||
# Download location
|
||||
- /torrent/qbittorrent/downloads:/downloads
|
||||
|
||||
- ./jackett/config:/config
|
||||
- ./jackett/downloads:/downloads
|
||||
ports:
|
||||
- "9117:9117"
|
||||
restart: unless-stopped
|
||||
gluetun-proxy:
|
||||
image: qmcgaw/gluetun:latest
|
||||
container_name: gluetun-proxy
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
ports:
|
||||
- "8889:8888" # HTTP proxy
|
||||
- "8388:8388" # SOCKS5 proxy
|
||||
volumes:
|
||||
- ./gluetun-proxy:/gluetun/wireguard
|
||||
- /dev/net/tun:/dev/net/tun
|
||||
environment:
|
||||
- VPN_SERVICE_PROVIDER=custom
|
||||
- VPN_TYPE=wireguard
|
||||
- SOCKS5_ENABLED=on
|
||||
- HTTPPROXY=on
|
||||
- SOCKSPROXY=on
|
||||
restart: unless-stopped
|
||||
#cleanuparr:
|
||||
# image: ghcr.io/cleanuparr/cleanuparr:latest
|
||||
# container_name: cleanuparr
|
||||
# restart: unless-stopped
|
||||
# ports:
|
||||
# - "11011:11011"
|
||||
# volumes:
|
||||
# - ./cleanuparr:/config
|
||||
# - /torrent/qbittorrent-private/downloads:/downloads-private
|
||||
# - /torrent/qbittorrent-public/downloads:/downloads-public
|
||||
# - /torrent/qbittorrent-private/orphaned:/orphaned
|
||||
# environment:
|
||||
# - PORT=11011
|
||||
# - BASE_PATH=
|
||||
# - PUID=1000
|
||||
# - PGID=1000
|
||||
# - UMASK=022
|
||||
# - TZ=Europe/Vienna
|
||||
whisparr:
|
||||
image: ghcr.io/thespad/whisparr:latest
|
||||
container_name: whisparr
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=Europe/Vienna
|
||||
ports:
|
||||
- "6969:6969"
|
||||
volumes:
|
||||
- ./whisparr:/config
|
||||
- /data/whisparr:/data
|
||||
- /torrent/qbittorrent-private/downloads:/downloads-private
|
||||
- /torrent/qbittorrent-public/downloads:/downloads-public
|
||||
restart: unless-stopped
|
||||
unpackerr:
|
||||
image: golift/unpackerr
|
||||
container_name: unpackerr
|
||||
volumes:
|
||||
- /torrent/qbittorrent-private/downloads:/downloads-private
|
||||
- ./unpackerr:/config
|
||||
restart: always
|
||||
user: 1000:1000
|
||||
environment:
|
||||
- TZ=America/New_York
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
## Global Settings
|
||||
- UN_DEBUG=true
|
||||
- UN_LOG_FILE=/config/unpackerr.log
|
||||
- UN_LOG_FILES=10
|
||||
- UN_LOG_FILE_MB=10
|
||||
- UN_INTERVAL=10m
|
||||
- UN_PROGRESS=15s
|
||||
- UN_START_DELAY=1m
|
||||
- UN_RETRY_DELAY=5m
|
||||
- UN_MAX_RETRIES=2
|
||||
- UN_REMNANT_ACTION=rename
|
||||
- UN_PARALLEL=1
|
||||
- UN_FILE_MODE=0644
|
||||
- UN_DIR_MODE=0755
|
||||
# Sonarr-de
|
||||
- UN_SONARR_0_URL=http://sonarr-de:8989
|
||||
- UN_SONARR_0_API_KEY=707d4fcbb3d74822ba990c6a8b7278e9
|
||||
- UN_SONARR_0_PATHS_0=/downloads-private/tv-sonarr-de
|
||||
- UN_SONARR_0_DELETE_DELAY=5m
|
||||
# Sonarr-en
|
||||
- UN_SONARR_1_URL=http://sonarr-en:8989
|
||||
- UN_SONARR_1_API_KEY=e2005c5c204840878f8eb37d1ac6aa0e
|
||||
- UN_SONARR_1_PATHS_0=/downloads-private/tv-sonarr-en
|
||||
- UN_SONARR_1_DELETE_DELAY=5m
|
||||
# Radarr-de
|
||||
- UN_RADARR_0_URL=http://radarr-de:7878
|
||||
- UN_RADARR_0_API_KEY=29f67f0ac8894357b22ea3f7fc1abfdf
|
||||
- UN_RADARR_0_PATHS_0=/downloads-private/radarr-de
|
||||
- UN_RADARR_0_DELETE_DELAY=5m
|
||||
# Radarr-en
|
||||
- UN_RADARR_1_URL=http://radarr-en:7878
|
||||
- UN_RADARR_1_API_KEY=4332aee075c748f2acee41aa26f06007
|
||||
- UN_RADARR_1_PATHS_0=/downloads-private/radarr-en
|
||||
- UN_RADARR_1_DELETE_DELAY=5m
|
||||
# Lidarr
|
||||
- UN_LIDARR_0_URL=http://lidarr:8686
|
||||
- UN_LIDARR_0_API_KEY=bb41cbf2b17e439290f90ecfaeb24dff
|
||||
- UN_LIDARR_0_PATHS_0=/downloads-private/lidarr
|
||||
- UN_LIDARR_0_DELETE_DELAY=5m
|
||||
# Whisparr
|
||||
- UN_WHISPARR_0_URL=http://whisparr:6969
|
||||
- UN_WHISPARR_0_API_KEY=3a5403b7a36f4e679398d959cdd39b1b
|
||||
- UN_WHISPARR_0_PATHS_0=/downloads-private/whisparr
|
||||
- UN_WHISPARR_0_DELETE_DELAY=5m
|
||||
networks:
|
||||
default:
|
||||
external: true
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Use this configuration with WireGuard client
|
||||
#
|
||||
[Interface]
|
||||
Address = 10.14.0.2/16
|
||||
PrivateKey = mKeDQdxtM1iFJS7WLlb2jPGabZIt3NkoA/nGCcNOU1I=
|
||||
DNS = 162.252.172.57, 149.154.159.92
|
||||
[Peer]
|
||||
PublicKey = dPZe8Jq3Hu0k07MDk+Y4+AS2XHSLYalyg91TSFXRYEA=
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
Endpoint = 87.249.133.4:51820
|
||||
@@ -0,0 +1,566 @@
|
||||
#######################################################
|
||||
## Unpackerr Example Configuration File ##
|
||||
#######################################################
|
||||
## The values are a mix of defaults and examples. ##
|
||||
## Env vars overlay the process, not this file. ##
|
||||
## More configuration help: https://unpackerr.zip ##
|
||||
## Config Generator: https://notifiarr.com/unpackerr ##
|
||||
#######################################################
|
||||
|
||||
## Turn on debug messages in the output. Do not wrap this in quotes.
|
||||
## Recommend trying this so you know what it looks like. I personally leave it on.
|
||||
#debug = false
|
||||
|
||||
## Disable writing messages to stdout/stderr. This silences the app. Set a log
|
||||
## file below if you set this to true. Recommended when starting with systemctl.
|
||||
#quiet = false
|
||||
|
||||
## Send error output to stderr instead of stdout by setting error_stderr to true.
|
||||
## Recommend leaving this at false. Ignored if quiet (above) is true.
|
||||
#error_stderr = false
|
||||
|
||||
## Setting activity to true will silence all app queue log lines with only zeros.
|
||||
## Set this to true when you want less log spam.
|
||||
#activity = false
|
||||
|
||||
## The Starr-application activity queue is logged on an interval.
|
||||
## Adjust that interval with this setting.
|
||||
## Default is a minute. 2m, 5m, 10m, 30m, 1h are also perfectly acceptable.
|
||||
#log_queues = "1m"
|
||||
|
||||
## Write messages to a log file. This is the same data that is normally output to stdout.
|
||||
## This setting is great for Docker users that want to export their logs to a file.
|
||||
## The alternative is to use syslog to log the output of the application to a file.
|
||||
## Default is no log file; this is unset.
|
||||
## Except on macOS and Windows, the log file gets set to "~/.unpackerr/unpackerr.log"
|
||||
## log_files=0 turns off auto-rotation so logrotate can own the file.
|
||||
## After logrotate renames the live file, send SIGHUP (`systemctl reload unpackerr`)
|
||||
## to close and reopen it. Use logrotate `create` plus postrotate HUP, not copytruncate.
|
||||
## Default files is 10 and size(mb) is 10 Megabytes.
|
||||
#log_file = ''
|
||||
#log_files = 10
|
||||
#log_file_mb = 10
|
||||
#log_file_mode = "0600"
|
||||
|
||||
## How many completed or failed items to keep in unpackerr.history.jsonl
|
||||
## (next to the log file, or the config file if logs go to stdout).
|
||||
## With neither a log file nor a config file, history stays in memory
|
||||
## for this process and is not written to disk, so it does not survive
|
||||
## a restart. Set `log_file` or use a config file to persist it.
|
||||
## In-progress extracts are also written so a restart can resume them
|
||||
## for 72 hours (Starr waiting for import, folders waiting on
|
||||
## delete_after). Those in-progress rows do not count against this
|
||||
## number. Imported and failed rows do. The history API still lists
|
||||
## only completed or failed rows.
|
||||
## `0` disables history and restart resume.
|
||||
#keep_history = 400
|
||||
|
||||
## How often to poll starr apps (sonarr, radarr, etc).
|
||||
## Recommend 1m-5m. Uses Go Duration.
|
||||
#interval = "2m"
|
||||
|
||||
## How often status is logged for in-progress extractions.
|
||||
## `0` uses the default `15s`. Uses Go Duration.
|
||||
#progress = "15s"
|
||||
|
||||
## How long an item must be queued (download complete) before extraction will start.
|
||||
## One minute is the historic default and works well. Set higher if your downloads
|
||||
## take longer to finalize (or transfer locally). Uses Go Duration.
|
||||
#start_delay = "1m"
|
||||
|
||||
## How long to wait before removing the history for a failed extraction.
|
||||
## Once the history is deleted the item will be recognized as new and
|
||||
## extraction will start again. Uses Go Duration.
|
||||
#retry_delay = "5m"
|
||||
|
||||
## How many times to retry a failed extraction after the first try. Default is 2
|
||||
## (3 attempts total). `0` uses that default. Pauses retry_delay between attempts.
|
||||
#max_retries = 2
|
||||
|
||||
## Applies to Starr apps and to watched folders with `move_back` enabled
|
||||
## (the default folder config extracts into a sidecar tree and does not
|
||||
## classify leftovers there). When an extracted file cannot be moved into
|
||||
## place because the destination already exists, Unpackerr checks whether
|
||||
## that name was present before extraction. Names that arrived with the
|
||||
## download are kept; names that were not (leftovers from an interrupted
|
||||
## extraction) are handled by this setting. `rename` (default) moves the
|
||||
## leftover to a sibling named with a `.remnant` suffix and retries the
|
||||
## extract. `delete` removes it and retries. `off` leaves the leftover
|
||||
## in place and fails the extract without retrying. The item stays failed
|
||||
## until it leaves the Starr queue (folders are untracked). Bounded by
|
||||
## max_retries; if retries are exhausted the leftover fails the extract
|
||||
## instead of reporting success.
|
||||
#remnant_action = "rename"
|
||||
|
||||
## How many files may be extracted in parallel. 1 works fine.
|
||||
## Do not wrap the number in quotes. Raise this only if you have fast disks and CPU.
|
||||
#parallel = 1
|
||||
|
||||
## Extracted files are created with this mode. The process umask still
|
||||
## applies, so 0666 becomes 0644 under umask 0022. Use 0644, or 0660 or
|
||||
## 0666 when another user must write the extracted files. Archive
|
||||
## execute bits are kept only for a watched folder with preserve_exec
|
||||
## enabled.
|
||||
#file_mode = "0644"
|
||||
|
||||
## Extracted directories are created with this mode. The process umask
|
||||
## still applies.
|
||||
#dir_mode = "0755"
|
||||
|
||||
## List of passwords to use for encrypted archives. Must be a list of strings.
|
||||
## Use this special format as a password to read more passwords from a file:
|
||||
## passwords = [ "filepath:/path/to/passwords.txt" ]
|
||||
#passwords = []
|
||||
|
||||
[webserver]
|
||||
## Expose Prometheus metrics at /metrics. The HTTP server starts whenever listen_addr is set;
|
||||
## this only controls the /metrics route. Scrapes must send an API key with
|
||||
## system:metrics:read via Authorization: Bearer or X-Api-Key.
|
||||
# metrics = false
|
||||
## Expose Go pprof handlers at /debug/pprof/. Leave this false unless you
|
||||
## are debugging the running process.
|
||||
# pprof = false
|
||||
## This may be set to a port or an ip:port to bind a specific IP. 0.0.0.0 binds ALL IPs.
|
||||
## Set this to an empty string to disable the HTTP server.
|
||||
# listen_addr = "0.0.0.0:5656"
|
||||
## Local UI login. Use user:pass (hashed on startup), !!cryptd!!user:$2a$...
|
||||
## for a stored hash, webauth:X-Webauth-User for a reverse-proxy header, or
|
||||
## noauth. The HTTP API does not accept plaintext; send user:<PBKDF2 hex>
|
||||
## (same digest as login) and uiCurrentKdf when changing a live password.
|
||||
## filepath:/path reads that file for the live password and keeps filepath: in the
|
||||
## config. Empty generates a temporary password when the HTTP server is enabled.
|
||||
## Reset with --reset. Do not set an empty
|
||||
## UN_WEBSERVER_UI_PASSWORD; a present empty env value wipes a stored hash.
|
||||
ui_password = "!!cryptd!!admin:$2a$10$t8pChUtJw.VZW2DO47Lh/.2nE9J.jHnx.MH5VncjCZ2LADfso64oe"
|
||||
## Used with webauth (proxy header auth). Empty keeps those proxy users
|
||||
## as admin. Ignored for noauth and local password login. Set this to a
|
||||
## header the reverse proxy fills, for example X-Webauth-Role or
|
||||
## X-Authentik-Groups. Matching names are a built-in admin or a custom
|
||||
## [webserver.roles] name. Comma, semicolon, pipe, or space separated
|
||||
## lists are unioned; extra IdP groups are ignored. A selected header
|
||||
## that is missing, empty, or has no matching role is access denied,
|
||||
## not admin.
|
||||
## example: ui_role_header = "X-Webauth-Role"
|
||||
# ui_role_header = ""
|
||||
## Recommend setting a log file for HTTP requests. Otherwise, they go with other logs.
|
||||
# log_file = ''
|
||||
## This app automatically rotates logs. Set these to the size and number to keep.
|
||||
## log_files=0 disables auto-rotation; SIGHUP reopens the HTTP log too.
|
||||
# log_files = 10
|
||||
# log_file_mb = 10
|
||||
## Set both of these to valid file paths to enable HTTPS/TLS.
|
||||
# ssl_cert_file = ''
|
||||
# ssl_key_file = ''
|
||||
## Base URL from which to serve content.
|
||||
# urlbase = "/"
|
||||
## Upstreams should be set to the IP or CIDR of your trusted upstream proxy.
|
||||
## Setting this correctly allows X-Forwarded-For to be used in logs.
|
||||
## In the future it may control auth proxy trust. Must be a list of strings.
|
||||
## example: upstreams = [ "127.0.0.1/32", "10.1.2.0/24" ]
|
||||
# upstreams = []
|
||||
## Empty keeps the library same-origin check (the embedded UI). Add hosts
|
||||
## when a browser on another origin should open GET /ws, for example
|
||||
## localhost:5173 or https://ui.example.com. Patterns use path.Match;
|
||||
## a URI scheme is matched as scheme://host. Do not set * unless you
|
||||
## intend to allow every origin.
|
||||
## example: ws_origins = [ "localhost:5173" ]
|
||||
# ws_origins = []
|
||||
## Nested [[webserver.api_keys]] tables, not an inline array. Each key is 60–150 ASCII
|
||||
## characters. Names and key values must be unique. Built-in role `admin` grants every
|
||||
## permission. Custom roles are listed under [webserver.roles].
|
||||
## Env uses UN_WEBSERVER_API_KEYS_0_NAME, _KEY, and _ROLES_0.
|
||||
## Nested [webserver.roles.<name>] tables. Names are letters, digits, _ or -.
|
||||
## Built-in admin cannot be redefined. `*` is reserved for that built-in role.
|
||||
## Each custom role needs at least one known permission.
|
||||
## File browser is system:browse:read (list) and system:browse:write (create folder).
|
||||
## Env works but is picky: do not set UN_WEBSERVER_ROLES itself. Role names are
|
||||
## case-sensitive and may contain underscores. Index permissions from 0:
|
||||
## UN_WEBSERVER_ROLES_stats_PERMISSIONS_0=system:stats:read
|
||||
## UN_WEBSERVER_ROLES_read_only_PERMISSIONS_0=system:stats:read
|
||||
## [webserver.roles.stats]
|
||||
## permissions = ["system:stats:read"]
|
||||
|
||||
[[webserver.api_keys]]
|
||||
name = "admin"
|
||||
key = "Gv7I8Y0wY7-KFjZxeRD_mVvSm8Ca2sxvo267DY9GG5YKD34BBMGIeudHQy_tI7gq"
|
||||
roles = ["admin"]
|
||||
|
||||
## Global Folder configuration that affects all watched folders.
|
||||
[folders]
|
||||
## How many new folder events can be immediately queued. Don't change this.
|
||||
# buffer = 20000
|
||||
|
||||
###############################################################################
|
||||
##-IMPORTANT-#######-READ THIS!!!-################ Seriously, read this. ######
|
||||
###############################################################################
|
||||
## The following sections can be repeated if you have more than one Sonarr, ##
|
||||
## Radarr, Lidarr, Readarr, Folder, Webhook, and/or Command Hook. ##
|
||||
## Identify each instance with a short key: [sonarr.uhd], [folder.tv]. ##
|
||||
## Changed in v1.0.0 (October 2026): map keys, not [[array]] list rows. ##
|
||||
## You MUST uncomment the [header.0], url and api_key for any Starr app. ##
|
||||
## Uncomment [sonarr.0], [radarr.0], [lidarr.0], and/or [readarr.0] plus the ##
|
||||
## url and api_key if that app is in use. ##
|
||||
## Do not set a bare UN_SONARR / UN_FOLDER / UN_WEBHOOK / UN_CMDHOOK. ##
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
## ALL LINES BEGINNING WITH A HASH # ARE IGNORED COMMENTS ##
|
||||
## REMOVE THE HASH # FROM CONFIG LINES YOU WANT TO CHANGE ##
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
|
||||
#[sonarr.0]
|
||||
## Empty uses the app name (Sonarr, Radarr, and so on). Set this for a
|
||||
## Sonarr-compatible app such as Sportarr so logs and Discord are not
|
||||
## tagged Sonarr. Add Whisparr as a Radarr instance with name = "Whisparr".
|
||||
## Hook exclude matches this name or the app dialect.
|
||||
## Names must be printable and cannot contain quotes, braces, or angle brackets.
|
||||
# name = ""
|
||||
# url = "http://127.0.0.1:8989"
|
||||
# api_key = "0123456789abcdef0123456789abcdef"
|
||||
## Username for HTTP basic authentication on the Starr app, if enabled.
|
||||
# http_user = ""
|
||||
## Password for HTTP basic authentication on the Starr app, if enabled.
|
||||
# http_pass = ""
|
||||
## Username for Starr native (forms) authentication, if enabled.
|
||||
# username = ""
|
||||
## Password for Starr native (forms) authentication, if enabled.
|
||||
# password = ""
|
||||
## List of paths where content is downloaded for this app.
|
||||
## Used as fallback if the path the Starr app reports does not exist or is not accessible.
|
||||
# paths = ['/downloads']
|
||||
## Protocols to process from the download queue. Starr apps historically
|
||||
## used "torrent" and "usenet" as the protocol strings, but newer versions
|
||||
## emit the full class names "TorrentDownloadProtocol" and
|
||||
## "UsenetDownloadProtocol" instead. List every string your app may return,
|
||||
## separated by commas. The default covers both the legacy and new torrent
|
||||
## strings. Add "usenet,UsenetDownloadProtocol" if you use a Usenet client.
|
||||
# protocols = "torrent,TorrentDownloadProtocol"
|
||||
## How long to wait for a reply from the backend.
|
||||
# timeout = "10s"
|
||||
## How long to wait after import before deleting the extracted items.
|
||||
# delete_delay = "5m"
|
||||
## If you use this app with NZB you may wish to delete archives after extraction.
|
||||
## General recommendation is: do not enable this for torrent use.
|
||||
## Setting this to true deletes the entire original download folder after import.
|
||||
# delete_orig = false
|
||||
## If you use Syncthing, setting this to true will make unpackerr wait for syncs to finish.
|
||||
# syncthing = false
|
||||
## When true, Unpackerr verifies the Starr app HTTPS certificate.
|
||||
## The default is false for backward compatibility.
|
||||
# valid_ssl = false
|
||||
## Per-archive uncompressed-byte cap. Empty uses the app default:
|
||||
## Sonarr 20GB, Radarr 75GB, Lidarr 4GB, Readarr 1GB.
|
||||
## `0` or `0B` disables the cap for this instance.
|
||||
# max_bytes = ""
|
||||
|
||||
#[radarr.0]
|
||||
## Empty uses the app name (Sonarr, Radarr, and so on). Set this for a
|
||||
## Sonarr-compatible app such as Sportarr so logs and Discord are not
|
||||
## tagged Sonarr. Add Whisparr as a Radarr instance with name = "Whisparr".
|
||||
## Hook exclude matches this name or the app dialect.
|
||||
## Names must be printable and cannot contain quotes, braces, or angle brackets.
|
||||
# name = ""
|
||||
# url = "http://127.0.0.1:7878"
|
||||
# api_key = "0123456789abcdef0123456789abcdef"
|
||||
## Username for HTTP basic authentication on the Starr app, if enabled.
|
||||
# http_user = ""
|
||||
## Password for HTTP basic authentication on the Starr app, if enabled.
|
||||
# http_pass = ""
|
||||
## Username for Starr native (forms) authentication, if enabled.
|
||||
# username = ""
|
||||
## Password for Starr native (forms) authentication, if enabled.
|
||||
# password = ""
|
||||
## List of paths where content is downloaded for this app.
|
||||
## Used as fallback if the path the Starr app reports does not exist or is not accessible.
|
||||
# paths = ['/downloads']
|
||||
## Protocols to process from the download queue. Starr apps historically
|
||||
## used "torrent" and "usenet" as the protocol strings, but newer versions
|
||||
## emit the full class names "TorrentDownloadProtocol" and
|
||||
## "UsenetDownloadProtocol" instead. List every string your app may return,
|
||||
## separated by commas. The default covers both the legacy and new torrent
|
||||
## strings. Add "usenet,UsenetDownloadProtocol" if you use a Usenet client.
|
||||
# protocols = "torrent,TorrentDownloadProtocol"
|
||||
## How long to wait for a reply from the backend.
|
||||
# timeout = "10s"
|
||||
## How long to wait after import before deleting the extracted items.
|
||||
# delete_delay = "5m"
|
||||
## If you use this app with NZB you may wish to delete archives after extraction.
|
||||
## General recommendation is: do not enable this for torrent use.
|
||||
## Setting this to true deletes the entire original download folder after import.
|
||||
# delete_orig = false
|
||||
## If you use Syncthing, setting this to true will make unpackerr wait for syncs to finish.
|
||||
# syncthing = false
|
||||
## When true, Unpackerr verifies the Starr app HTTPS certificate.
|
||||
## The default is false for backward compatibility.
|
||||
# valid_ssl = false
|
||||
## Per-archive uncompressed-byte cap. Empty uses the app default:
|
||||
## Sonarr 20GB, Radarr 75GB, Lidarr 4GB, Readarr 1GB.
|
||||
## `0` or `0B` disables the cap for this instance.
|
||||
# max_bytes = ""
|
||||
|
||||
#[lidarr.0]
|
||||
## Empty uses the app name (Sonarr, Radarr, and so on). Set this for a
|
||||
## Sonarr-compatible app such as Sportarr so logs and Discord are not
|
||||
## tagged Sonarr. Add Whisparr as a Radarr instance with name = "Whisparr".
|
||||
## Hook exclude matches this name or the app dialect.
|
||||
## Names must be printable and cannot contain quotes, braces, or angle brackets.
|
||||
# name = ""
|
||||
# url = "http://127.0.0.1:8686"
|
||||
# api_key = "0123456789abcdef0123456789abcdef"
|
||||
## Username for HTTP basic authentication on the Starr app, if enabled.
|
||||
# http_user = ""
|
||||
## Password for HTTP basic authentication on the Starr app, if enabled.
|
||||
# http_pass = ""
|
||||
## Username for Starr native (forms) authentication, if enabled.
|
||||
# username = ""
|
||||
## Password for Starr native (forms) authentication, if enabled.
|
||||
# password = ""
|
||||
## List of paths where content is downloaded for this app.
|
||||
## Used as fallback if the path the Starr app reports does not exist or is not accessible.
|
||||
# paths = ['/downloads']
|
||||
## Protocols to process from the download queue. Starr apps historically
|
||||
## used "torrent" and "usenet" as the protocol strings, but newer versions
|
||||
## emit the full class names "TorrentDownloadProtocol" and
|
||||
## "UsenetDownloadProtocol" instead. List every string your app may return,
|
||||
## separated by commas. The default covers both the legacy and new torrent
|
||||
## strings. Add "usenet,UsenetDownloadProtocol" if you use a Usenet client.
|
||||
# protocols = "torrent,TorrentDownloadProtocol"
|
||||
## How long to wait for a reply from the backend.
|
||||
# timeout = "10s"
|
||||
## How long to wait after import before deleting the extracted items.
|
||||
# delete_delay = "5m"
|
||||
## If you use this app with NZB you may wish to delete archives after extraction.
|
||||
## General recommendation is: do not enable this for torrent use.
|
||||
## Setting this to true deletes the entire original download folder after import.
|
||||
# delete_orig = false
|
||||
## If you use Syncthing, setting this to true will make unpackerr wait for syncs to finish.
|
||||
# syncthing = false
|
||||
## When true, Unpackerr verifies the Starr app HTTPS certificate.
|
||||
## The default is false for backward compatibility.
|
||||
# valid_ssl = false
|
||||
## Per-archive uncompressed-byte cap. Empty uses the app default:
|
||||
## Sonarr 20GB, Radarr 75GB, Lidarr 4GB, Readarr 1GB.
|
||||
## `0` or `0B` disables the cap for this instance.
|
||||
# max_bytes = ""
|
||||
## When enabled, FLAC and APE files with CUE sheets are split into
|
||||
## individual track files. ape_format and ape_compression choose what
|
||||
## an APE image becomes.
|
||||
# split_flac = false
|
||||
## ape keeps Monkey's Audio. wav and flac decode the audio.
|
||||
## Empty means ape. FLAC cannot store 32-bit or float PCM.
|
||||
## Compression is ignored unless the format is ape.
|
||||
# ape_format = "ape"
|
||||
## Used only when ape_format is ape (or empty). A default of 0 is set
|
||||
## to 2000. Accepted values are 1000, 2000, 3000, 4000, and 5000.
|
||||
## WAV and FLAC ignore this.
|
||||
# ape_compression = 0
|
||||
|
||||
#[readarr.0]
|
||||
## Empty uses the app name (Sonarr, Radarr, and so on). Set this for a
|
||||
## Sonarr-compatible app such as Sportarr so logs and Discord are not
|
||||
## tagged Sonarr. Add Whisparr as a Radarr instance with name = "Whisparr".
|
||||
## Hook exclude matches this name or the app dialect.
|
||||
## Names must be printable and cannot contain quotes, braces, or angle brackets.
|
||||
# name = ""
|
||||
# url = "http://127.0.0.1:8787"
|
||||
# api_key = "0123456789abcdef0123456789abcdef"
|
||||
## Username for HTTP basic authentication on the Starr app, if enabled.
|
||||
# http_user = ""
|
||||
## Password for HTTP basic authentication on the Starr app, if enabled.
|
||||
# http_pass = ""
|
||||
## Username for Starr native (forms) authentication, if enabled.
|
||||
# username = ""
|
||||
## Password for Starr native (forms) authentication, if enabled.
|
||||
# password = ""
|
||||
## List of paths where content is downloaded for this app.
|
||||
## Used as fallback if the path the Starr app reports does not exist or is not accessible.
|
||||
# paths = ['/downloads']
|
||||
## Protocols to process from the download queue. Starr apps historically
|
||||
## used "torrent" and "usenet" as the protocol strings, but newer versions
|
||||
## emit the full class names "TorrentDownloadProtocol" and
|
||||
## "UsenetDownloadProtocol" instead. List every string your app may return,
|
||||
## separated by commas. The default covers both the legacy and new torrent
|
||||
## strings. Add "usenet,UsenetDownloadProtocol" if you use a Usenet client.
|
||||
# protocols = "torrent,TorrentDownloadProtocol"
|
||||
## How long to wait for a reply from the backend.
|
||||
# timeout = "10s"
|
||||
## How long to wait after import before deleting the extracted items.
|
||||
# delete_delay = "5m"
|
||||
## If you use this app with NZB you may wish to delete archives after extraction.
|
||||
## General recommendation is: do not enable this for torrent use.
|
||||
## Setting this to true deletes the entire original download folder after import.
|
||||
# delete_orig = false
|
||||
## If you use Syncthing, setting this to true will make unpackerr wait for syncs to finish.
|
||||
# syncthing = false
|
||||
## When true, Unpackerr verifies the Starr app HTTPS certificate.
|
||||
## The default is false for backward compatibility.
|
||||
# valid_ssl = false
|
||||
## Per-archive uncompressed-byte cap. Empty uses the app default:
|
||||
## Sonarr 20GB, Radarr 75GB, Lidarr 4GB, Readarr 1GB.
|
||||
## `0` or `0B` disables the cap for this instance.
|
||||
# max_bytes = ""
|
||||
|
||||
##################################################################################
|
||||
### ### STOP HERE ### STOP HERE ### STOP HERE ### STOP HERE #### STOP HERE ### #
|
||||
### Only using Starr apps? The things above. The below configs are OPTIONAL. ### #
|
||||
##################################################################################
|
||||
|
||||
|
||||
##-Folders-#######################################################################
|
||||
## This application can also watch folders for things to extract. If you copy a ##
|
||||
## subfolder into a watched folder (defined below) any extractable items in the ##
|
||||
## folder will be decompressed. This has nothing to do with Starr applications. ##
|
||||
##################################################################################
|
||||
#[folder.0]
|
||||
# path = '/downloads/auto_extract'
|
||||
## How often this folder is scanned for new archives.
|
||||
## Off (`0s`) uses filesystem events (inotify and friends).
|
||||
## Enable a poll interval if files never show up in the queue, which is
|
||||
## common on Docker and CIFS. Polling increases disk reads and is not
|
||||
## recommended when fsnotify works.
|
||||
# interval = "0s"
|
||||
## Paths to ignore while watching this folder. Excluded paths and their
|
||||
## children are not tracked or extracted.
|
||||
## Paths may be absolute, or relative to this folder's `path`.
|
||||
# exclude_paths = []
|
||||
## Path to extract files to. The default (leaving this blank) is the same as `path` (above).
|
||||
# extract_path = ''
|
||||
## Delete extracted or original files this long after extraction.
|
||||
## The default is 10m. Set to 0 to disable all deletes. Deletes also
|
||||
## require `delete_files` and/or `delete_original`. Uses Go Duration.
|
||||
# delete_after = "10m"
|
||||
## Nested archives are extracted by default. Disable recursion to extract only the outer archive.
|
||||
# disable_recursion = false
|
||||
## Per-archive uncompressed-byte cap. Empty is unlimited. `0` or `0B` is also unlimited.
|
||||
# max_bytes = ""
|
||||
## Cap on files, directories, and symlinks created during extract. `0` is unlimited.
|
||||
# max_files = 0
|
||||
## Cap on `bytes written / archive file size`. `0` is unlimited.
|
||||
# max_ratio = 0
|
||||
## Cap on archives extracted from this folder's output (one extras pass). `0` is unlimited.
|
||||
# max_nested = 0
|
||||
## Walk depth for the extras pass. `0` is unlimited.
|
||||
# extras_max_depth = 0
|
||||
## When true, the initial archive search may include symlink-named files.
|
||||
## The extras pass never follows archive-member zip links.
|
||||
# allow_symlinks = false
|
||||
## Delete extracted files after successful extraction? delete_after must be greater than 0.
|
||||
# delete_files = false
|
||||
## Delete original items after successful extraction? delete_after must be greater than 0.
|
||||
# delete_original = false
|
||||
## Disable extraction log (unpackerred.txt) file creation?
|
||||
# disable_log = false
|
||||
## Move extracted files into original folder? If false, files go into an _unpackerred folder.
|
||||
# move_back = false
|
||||
## Set this to true if you want this app to extract ISO files with .iso extension.
|
||||
# extract_isos = false
|
||||
## When true, an execute bit stored in the archive is kept for owner,
|
||||
## group, or other only when file_mode already grants that class access.
|
||||
## A 6 beside an archived 7 becomes 7, a 4 becomes 5, and a 0 stays 0.
|
||||
## Off, extracted files use file_mode only. Starr extracts stay off.
|
||||
## The process umask still applies.
|
||||
# preserve_exec = false
|
||||
## Incomplete-download suffixes such as `.part` or `.crdownload`. Extraction
|
||||
## stays in waiting as long as any matching file is in the watched item's
|
||||
## top folder. Subfolders are not scanned. The UI and config always store
|
||||
## a leading period. Waiting items are rechecked every 5s even without the
|
||||
## poller. Enabling folder poller will double-poll the folder and increase
|
||||
## disk reads. Useful when fsnotify is not available, and not recommended
|
||||
## when it is.
|
||||
# wait_extensions = []
|
||||
## After start delay, skip watched folders that have no extractable archives.
|
||||
## They leave waiting without history or webhooks.
|
||||
# skip_empty = false
|
||||
|
||||
####################
|
||||
### Hook Payload ###
|
||||
####################
|
||||
# Extra IDs and custom event titles shared by every webhook and command hook.
|
||||
[hooks]
|
||||
## Nested [hooks.custom_ids] table, not an inline map.
|
||||
## Webhooks get `customIDs` in JSON (`{{index .CustomIDs "url"}}` in templates).
|
||||
## Command hooks get `UN_CUSTOM_ID_<key>` environment variables.
|
||||
## Env: UN_HOOKS_CUSTOM_IDS_url=https://…
|
||||
## [hooks.custom_ids]
|
||||
## url = "https://unpackerr.example"
|
||||
## Nested [hooks.titles] table with one field per extract event:
|
||||
## waiting, queued, extracting, extractfailed, extracted, imported,
|
||||
## deleting, deletefailed, deleted, extractednothing.
|
||||
## Empty values keep the built-in English title. Built-in Discord, Slack,
|
||||
## Telegram, Gotify, and Pushover templates use this string.
|
||||
## Env: UN_HOOKS_TITLES_EXTRACTING=Archive Found
|
||||
## [hooks.titles]
|
||||
## extracting = "Archive Found"
|
||||
|
||||
################
|
||||
### Webhooks ###
|
||||
################
|
||||
# Sends a webhook when an extraction queues, starts, finishes, and/or is deleted.
|
||||
# Created to integrate with notifiarr.com.
|
||||
# Also works natively with Discord.com, Telegram.org, Slack.com, ntfy, Apprise, and Mattermost webhooks.
|
||||
# Can possibly be used with other services by providing a custom template_path.
|
||||
###### Don't forget to uncomment [webhook.0] and url at a minimum !!!!
|
||||
#[webhook.0]
|
||||
## Notifiarr: https://notifiarr.com/api/v1/notification/unpackerr plus headers.X-Api-Key.
|
||||
## A path API key in a pasted URL is moved to that header.
|
||||
# url = "https://notifiarr.com/api/v1/notification/unpackerr"
|
||||
## Provide an optional name to hide the URL in logs.
|
||||
## If a name is not provided then the URL is used.
|
||||
# name = ""
|
||||
## Do not log success (less log spam).
|
||||
# silent = false
|
||||
## List of event ids to send notification for, [0] for all.
|
||||
## The default is [0] and this is an example:
|
||||
# events = [1, 4, 6]
|
||||
## ===> Advanced Optional Webhook Configuration <===
|
||||
## Discord, Slack, and Mattermost: bot/display name. Telegram: chat_id.
|
||||
## Gotify, ntfy, and Apprise: optional title prefix. Unused by Notifiarr JSON.
|
||||
# nickname = "Unpackerr"
|
||||
## Also passed into templates. Slack and Mattermost optional channel. Pushover user key.
|
||||
# channel = ""
|
||||
## Passed into webhook templates. Pushover requires the application token. ntfy sends Authorization Bearer when set. Unused by Discord, Telegram, and Slack incoming webhooks.
|
||||
# token = ""
|
||||
## Dialect tokens skip every instance of that API. Any other value matches an instance name. None by default. This is an example:
|
||||
# exclude = ["readarr", "lidarr"]
|
||||
## Used when template is empty (automatic). A named template ignores this file.
|
||||
# template_path = ''
|
||||
## Override automatic template detection. Values: notifiarr, discord, telegram, gotify, pushover, slack, ntfy, apprise, mattermost. Empty uses the URL or template_path.
|
||||
# template = ""
|
||||
## Default on for Discord webhooks and Telegram sendMessage. Other templates ignore this. Set false to post a new message for every extract event.
|
||||
# update = true
|
||||
## Set this to true to ignore the SSL certificate on the server.
|
||||
# ignore_ssl = false
|
||||
## You can adjust how long to wait for a server response.
|
||||
# timeout = "10s"
|
||||
## If your custom template uses another MIME type, set this.
|
||||
# content_type = "application/json"
|
||||
## Nested [webhook.0.headers] table. Header names are letters, digits, underscore, or hyphen.
|
||||
## Applied first; Content-Type and ntfy Authorization Bearer from token still win.
|
||||
## Notifiarr client key: X-Api-Key. Env: UN_WEBHOOK_0_HEADERS_X-Api-Key=api_key_from_notifiarr_com
|
||||
## [webhook.0.headers]
|
||||
## X-Api-Key = "api_key_from_notifiarr_com"
|
||||
|
||||
#####################
|
||||
### Command Hooks ###
|
||||
#####################
|
||||
# Executes a script or command when an extraction queues, starts, finishes, and/or is deleted.
|
||||
# All data is passed in as environment variables. Try /usr/bin/env to see what variables are available.
|
||||
###### Don't forget to uncomment [cmdhook.0] at a minimum !!!!
|
||||
#[cmdhook.0]
|
||||
# command = '/downloads/scripts/command.sh'
|
||||
## Provide an optional name to hide the URL in logs.
|
||||
## If a name is not provided the first word in the command is used.
|
||||
# name = ""
|
||||
## Runs the command inside /bin/sh ('nix) or cmd.exe (Windows).
|
||||
# shell = false
|
||||
## Do not log command's output.
|
||||
# silent = false
|
||||
## List of event ids to run command for, [0] for all.
|
||||
## The default is [0] and this is an example:
|
||||
# events = [1, 4, 7]
|
||||
## ===> Optional Command Hook Configuration <===
|
||||
## Dialect tokens skip every instance of that API. Any other value matches an instance name. None by default. This is an example:
|
||||
# exclude = ["readarr", "lidarr"]
|
||||
## You can adjust how long to wait for the command to run.
|
||||
# timeout = "10s"
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
modules:
|
||||
http_2xx:
|
||||
prober: http
|
||||
timeout: 5s
|
||||
http:
|
||||
valid_status_codes: []
|
||||
method: GET
|
||||
preferred_ip_protocol: ip4
|
||||
@@ -8,14 +8,17 @@ services:
|
||||
volumes:
|
||||
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
||||
- prometheus-data:/prometheus
|
||||
|
||||
networks:
|
||||
- default
|
||||
- shared-prometheus-services
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
grafana:
|
||||
image: grafana/grafana:latest
|
||||
container_name: grafana
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:3000"
|
||||
|
||||
environment:
|
||||
GF_SECURITY_ADMIN_USER: lucas
|
||||
GF_SECURITY_ADMIN_PASSWORD: Mira2012
|
||||
@@ -47,9 +50,9 @@ services:
|
||||
volumes:
|
||||
- '/:/host:ro,rslave'
|
||||
- ./node_exporter/textfile_collector:/textfile:ro
|
||||
ports:
|
||||
- '9100:9100'
|
||||
|
||||
# ports:
|
||||
# - '9100:9100'
|
||||
network_mode: host
|
||||
cadvisor:
|
||||
image: gcr.io/cadvisor/cadvisor:latest
|
||||
container_name: cadvisor
|
||||
@@ -58,8 +61,64 @@ services:
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
- /:/rootfs:ro
|
||||
- /data:/data:ro
|
||||
- /docker:/docker:ro
|
||||
# - /data:/data:ro
|
||||
# - /docker:/docker:ro
|
||||
- /var/run:/var/run:ro
|
||||
- /sys:/sys:ro
|
||||
- /var/lib/docker:/var/lib/docker:ro
|
||||
- /dev/disk:/dev/disk:ro
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
command:
|
||||
- "--disable_metrics=percpu,tcp,udp,process,sched"
|
||||
- "--housekeeping_interval=30s"
|
||||
- "--housekeeping_interval=1m"
|
||||
- "--docker_only=true"
|
||||
cap_add:
|
||||
- SYS_ADMIN
|
||||
blackbox-exporter:
|
||||
image: prom/blackbox-exporter:latest
|
||||
container_name: blackbox-exporter
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "9115:9115"
|
||||
volumes:
|
||||
- ./blackbox.yml:/etc/blackbox_exporter/config.yml:ro
|
||||
# build: listenarr-exporter
|
||||
# container_name: listenarr-exporter
|
||||
# restart: unless-stopped
|
||||
# environment:
|
||||
# LISTENARR_URL: http://listenarr:4545
|
||||
# LISTENARR_APIKEY: FtKkg30FLbORoaJXXBx4oHJL2r1/3kPtZXKlxqSloWs
|
||||
# ports:
|
||||
# - "9712:9712"
|
||||
# networks:
|
||||
# - default
|
||||
# - mediarr-services
|
||||
|
||||
loki:
|
||||
image: grafana/loki:3.0.0
|
||||
container_name: loki
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3100:3100"
|
||||
command: -config.file=/etc/loki/local-config.yaml
|
||||
|
||||
alloy:
|
||||
image: grafana/alloy:latest
|
||||
container_name: alloy
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "12345:12345"
|
||||
command: >
|
||||
run /etc/alloy/config.alloy
|
||||
--server.http.listen-addr=0.0.0.0:12345
|
||||
volumes:
|
||||
- ./alloy/config.alloy:/etc/alloy/config.alloy:ro
|
||||
- /var/log:/var/log:ro
|
||||
- /var/log/journal:/var/log/journal:ro
|
||||
- /run/log/journal:/run/log/journal:ro
|
||||
- /etc/machine-id:/etc/machine-id:ro
|
||||
- /var/lib/docker/containers:/var/lib/docker/containers:ro
|
||||
|
||||
volumes:
|
||||
prometheus-data:
|
||||
@@ -68,3 +127,6 @@ networks:
|
||||
default:
|
||||
shared-proxy-services:
|
||||
external: true
|
||||
shared-prometheus-services:
|
||||
external: true
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import requests
|
||||
from prometheus_client import start_http_server, Gauge
|
||||
from time import sleep
|
||||
from datetime import datetime
|
||||
|
||||
LISTENARR_URL = os.getenv("LISTENARR_URL", "http://localhost:4545")
|
||||
API_KEY = os.getenv("LISTENARR_APIKEY", "")
|
||||
HTTP_PORT = int(os.getenv("EXPORTER_PORT", "9712"))
|
||||
|
||||
HEADERS = {"X-Api-Key": API_KEY}
|
||||
|
||||
up = Gauge("listenarr_up", "Listenarr API reachable")
|
||||
queue_items = Gauge("listenarr_queue_items", "Items in queue")
|
||||
health_issues = Gauge("listenarr_health_issues", "Health issues")
|
||||
books_total = Gauge("listenarr_books_total", "Total monitored books")
|
||||
|
||||
|
||||
def log(msg):
|
||||
print(
|
||||
f"[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] {msg}",
|
||||
flush=True,
|
||||
)
|
||||
|
||||
|
||||
def fetch_json(endpoint):
|
||||
url = f"{LISTENARR_URL}/api/v1/{endpoint}"
|
||||
|
||||
log(f"GET {url}")
|
||||
|
||||
response = requests.get(
|
||||
url,
|
||||
headers=HEADERS,
|
||||
timeout=10,
|
||||
)
|
||||
|
||||
log(f"Response: {response.status_code}")
|
||||
|
||||
response.raise_for_status()
|
||||
|
||||
return response.json()
|
||||
|
||||
|
||||
def update_metrics():
|
||||
reachable = False
|
||||
|
||||
try:
|
||||
data = fetch_json("queue")
|
||||
queue_items.set(len(data))
|
||||
reachable = True
|
||||
log(f"Queue items: {len(data)}")
|
||||
|
||||
except Exception as e:
|
||||
queue_items.set(-1)
|
||||
log(f"ERROR queue endpoint: {e}")
|
||||
|
||||
try:
|
||||
data = fetch_json("health")
|
||||
health_issues.set(len(data))
|
||||
reachable = True
|
||||
log(f"Health issues: {len(data)}")
|
||||
|
||||
except Exception as e:
|
||||
health_issues.set(-1)
|
||||
log(f"ERROR health endpoint: {e}")
|
||||
|
||||
try:
|
||||
data = fetch_json("book")
|
||||
books_total.set(len(data))
|
||||
reachable = True
|
||||
log(f"Books total: {len(data)}")
|
||||
|
||||
except Exception as e:
|
||||
books_total.set(-1)
|
||||
log(f"ERROR book endpoint: {e}")
|
||||
|
||||
up.set(1 if reachable else 0)
|
||||
|
||||
log(f"listenarr_up={1 if reachable else 0}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
log("Starting Listenarr exporter")
|
||||
log(f"Listenarr URL: {LISTENARR_URL}")
|
||||
log(f"Metrics port: {HTTP_PORT}")
|
||||
log(f"API key configured: {'yes' if API_KEY else 'no'}")
|
||||
|
||||
start_http_server(HTTP_PORT)
|
||||
|
||||
log("Prometheus endpoint started")
|
||||
|
||||
while True:
|
||||
try:
|
||||
update_metrics()
|
||||
except Exception as e:
|
||||
log(f"FATAL ERROR: {e}")
|
||||
|
||||
sleep(60)
|
||||
@@ -1,6 +1,6 @@
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 15s
|
||||
scrape_interval: 30s
|
||||
evaluation_interval: 30s
|
||||
|
||||
scrape_configs:
|
||||
|
||||
@@ -8,6 +8,31 @@ scrape_configs:
|
||||
static_configs:
|
||||
- targets:
|
||||
- "prometheus:9090"
|
||||
- job_name: blackbox_https
|
||||
metrics_path: /probe
|
||||
params:
|
||||
module: [http_2xx]
|
||||
|
||||
static_configs:
|
||||
- targets:
|
||||
- https://cloud.someoneslinux.selfhost.eu
|
||||
- https://media.someoneslinux.selfhost.eu
|
||||
- https://audiobooks.someoneslinux.selfhost.eu
|
||||
# - https://login.someoneslinux.selfhost.eu
|
||||
- https://auto.someoneslinux.selfhost.eu
|
||||
- https://music.someoneslinux.selfhost.eu
|
||||
- https://passwd.someoneslinux.selfhost.eu
|
||||
- https://requests.someoneslinux.selfhost.eu
|
||||
# - https://torrent.someoneslinux.selfhost.eu
|
||||
- https://status.someoneslinux.selfhost.eu
|
||||
|
||||
relabel_configs:
|
||||
- source_labels: [__address__]
|
||||
target_label: __param_target
|
||||
- source_labels: [__param_target]
|
||||
target_label: instance
|
||||
- target_label: __address__
|
||||
replacement: blackbox-exporter:9115
|
||||
|
||||
- job_name: "node-exporter"
|
||||
static_configs:
|
||||
@@ -16,22 +41,57 @@ scrape_configs:
|
||||
labels:
|
||||
host: serverhost
|
||||
- targets:
|
||||
- "node-exporter:9100"
|
||||
- "192.168.0.4:9100"
|
||||
labels:
|
||||
host: "mediahost"
|
||||
|
||||
- targets:
|
||||
- "192.168.0.39:9100"
|
||||
labels:
|
||||
host: "quiethost"
|
||||
- job_name: "cadvisor"
|
||||
static_configs:
|
||||
- targets:
|
||||
- "cadvisor:8080"
|
||||
labels:
|
||||
host: mediahost
|
||||
- targets:
|
||||
- "192.168.0.2:8081"
|
||||
labels:
|
||||
host: serverhost
|
||||
- job_name: "smartctl"
|
||||
static_configs:
|
||||
- targets:
|
||||
- "192.168.0.2:9633"
|
||||
labels:
|
||||
host: serverhost
|
||||
- targets:
|
||||
- "192.168.0.39:9633"
|
||||
labels:
|
||||
host: "quiethost"
|
||||
- targets:
|
||||
- "192.168.0.4:9633"
|
||||
labels:
|
||||
host: "mediahost"
|
||||
|
||||
- job_name: diun
|
||||
metrics_path: /metrics
|
||||
authorization:
|
||||
credentials: "Qj#8C!@Uz3uRWm@mCd@KH6Bo7nfQ4K"
|
||||
static_configs:
|
||||
- targets:
|
||||
- diun:9090
|
||||
labels:
|
||||
host: "mediahost"
|
||||
- targets:
|
||||
- "192.168.0.39:9090"
|
||||
labels:
|
||||
host: "quiethost"
|
||||
- targets:
|
||||
- "192.168.0.2:9090"
|
||||
labels:
|
||||
host: "serverhost"
|
||||
- job_name: 'crowdsec'
|
||||
static_configs:
|
||||
- targets:
|
||||
- host.docker.internal:6060
|
||||
labels:
|
||||
host: "mediahost"
|
||||
@@ -23,6 +23,7 @@ services:
|
||||
- /data/navidrome/music/kamerun:/kamerun:ro
|
||||
- /data/navidrome/music/weihnachten:/weihnachten:ro
|
||||
- /data/navidrome/music/playlists:/playlists:ro
|
||||
- /data/navidrome/music/playlists-export:/playlists-export
|
||||
networks:
|
||||
- shared-proxy-services
|
||||
- default
|
||||
|
||||
@@ -27,7 +27,8 @@ services:
|
||||
- OVERWRITEPROTOCOL=https
|
||||
- OVERWRITECLIURL=https://${NEXTCLOUD_DOMAIN}
|
||||
- OVERWRITEHOST=${NEXTCLOUD_DOMAIN}
|
||||
- TRUSTED_PROXIES=nginx 172.16.0.0/12
|
||||
- TRUSTED_PROXIES=172.16.0.0/12
|
||||
- DEFAULT_PHONE_REGION=AT
|
||||
# SMTP
|
||||
- SMTP_HOST=${SMTP_HOST}
|
||||
- SMTP_PORT=${SMTP_PORT}
|
||||
|
||||
@@ -16,8 +16,11 @@ server {
|
||||
music.someoneslinux.selfhost.eu
|
||||
passwd.someoneslinux.selfhost.eu
|
||||
requests.someoneslinux.selfhost.eu
|
||||
torrent.someoneslinux.selfhost.eu
|
||||
status.someoneslinux.selfhost.eu;
|
||||
status.someoneslinux.selfhost.eu
|
||||
fotos.someoneslinux.selfhost.eu
|
||||
code.someoneslinux.selfhost.eu
|
||||
aiapi.someoneslinux.selfhost.eu
|
||||
ai.someoneslinux.selfhost.eu;
|
||||
#ssl_conf_command Groups X25519:secp256r1:secp384r1;
|
||||
# ssl_conf_command Groups X25519:prime256v1:secp384r1;
|
||||
location /.well-known/acme-challenge/ {
|
||||
@@ -27,12 +30,28 @@ server {
|
||||
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
|
||||
}
|
||||
|
||||
listen 8080;
|
||||
location /nginx_status {
|
||||
stub_status;
|
||||
allow 172.16.0.0/12;
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
|
||||
# Common SSL settings
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_prefer_server_ciphers on;
|
||||
server {
|
||||
listen 443 ssl default_server;
|
||||
server_name _;
|
||||
|
||||
ssl_certificate /etc/nginx/certs/live/cloud.someoneslinux.selfhost.eu/fullchain.pem;
|
||||
ssl_certificate_key /etc/nginx/certs/live/cloud.someoneslinux.selfhost.eu/privkey.pem;
|
||||
return 404;
|
||||
}
|
||||
|
||||
###################
|
||||
# NEXTCLOUD
|
||||
@@ -51,6 +70,8 @@ server {
|
||||
|
||||
location / {
|
||||
proxy_pass http://nextcloud:80;
|
||||
# Do not try another upstream on errors
|
||||
proxy_next_upstream off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@@ -76,6 +97,8 @@ server {
|
||||
|
||||
location / {
|
||||
proxy_pass http://jellyfin:8096;
|
||||
# Do not try another upstream on errors
|
||||
proxy_next_upstream off;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
@@ -103,6 +126,8 @@ server {
|
||||
|
||||
location / {
|
||||
proxy_pass http://audiobookshelf:80;
|
||||
# Do not try another upstream on errors
|
||||
proxy_next_upstream off;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
@@ -112,40 +137,14 @@ server {
|
||||
}
|
||||
}
|
||||
|
||||
###################
|
||||
# AUTHENTIK
|
||||
###################
|
||||
server {
|
||||
listen 443 ssl;http2 on;
|
||||
server_name login.someoneslinux.selfhost.eu;
|
||||
|
||||
add_header Content-Security-Policy "frame-ancestors 'self';" always;
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||
|
||||
ssl_certificate /etc/nginx/certs/live/cloud.someoneslinux.selfhost.eu/fullchain.pem;
|
||||
ssl_certificate_key /etc/nginx/certs/live/cloud.someoneslinux.selfhost.eu/privkey.pem;
|
||||
|
||||
location / {
|
||||
proxy_pass http://authentik-server-1:9000;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
}
|
||||
|
||||
####################
|
||||
## HOME ASSISTANT
|
||||
## AUTHENTIK
|
||||
####################
|
||||
#server {
|
||||
# listen 443 ssl;http2 on;
|
||||
# server_name auto.someoneslinux.selfhost.eu;
|
||||
# server_name login.someoneslinux.selfhost.eu;
|
||||
#
|
||||
# add_header Content-Security-Policy "default-src 'self'; frame-ancestors 'self';" always;
|
||||
# add_header Content-Security-Policy "frame-ancestors 'self';" always;
|
||||
# add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
# add_header X-Content-Type-Options "nosniff" always;
|
||||
# add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
@@ -155,17 +154,45 @@ server {
|
||||
# ssl_certificate_key /etc/nginx/certs/live/cloud.someoneslinux.selfhost.eu/privkey.pem;
|
||||
#
|
||||
# location / {
|
||||
# proxy_pass http://192.168.0.4:8123;
|
||||
# proxy_pass http://authentik-server-1:9000;
|
||||
# proxy_http_version 1.1;
|
||||
#
|
||||
# proxy_set_header Host $host;
|
||||
# proxy_set_header Upgrade $http_upgrade;
|
||||
# proxy_set_header Connection $connection_upgrade;
|
||||
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
# proxy_set_header X-Forwarded-Proto https;
|
||||
# proxy_set_header X-Forwarded-Host $host;
|
||||
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
# }
|
||||
#}
|
||||
|
||||
###################
|
||||
# HOME ASSISTANT
|
||||
###################
|
||||
server {
|
||||
listen 443 ssl;http2 on;
|
||||
server_name auto.someoneslinux.selfhost.eu;
|
||||
|
||||
# add_header Content-Security-Policy "default-src 'self'; frame-ancestors 'self';" always;
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||
|
||||
ssl_certificate /etc/nginx/certs/live/cloud.someoneslinux.selfhost.eu/fullchain.pem;
|
||||
ssl_certificate_key /etc/nginx/certs/live/cloud.someoneslinux.selfhost.eu/privkey.pem;
|
||||
|
||||
location / {
|
||||
proxy_pass http://192.168.0.4:8123;
|
||||
# Do not try another upstream on errors
|
||||
proxy_next_upstream off;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
}
|
||||
}
|
||||
|
||||
###################
|
||||
# NAVIDROME
|
||||
###################
|
||||
@@ -184,6 +211,8 @@ server {
|
||||
location / {
|
||||
proxy_pass http://navidrome:4533;
|
||||
|
||||
# Do not try another upstream on errors
|
||||
proxy_next_upstream off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
@@ -208,6 +237,8 @@ server {
|
||||
|
||||
location / {
|
||||
proxy_pass http://vaultwarden:80;
|
||||
# Do not try another upstream on errors
|
||||
proxy_next_upstream off;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
@@ -216,6 +247,8 @@ server {
|
||||
|
||||
location /notifications/hub {
|
||||
proxy_pass http://vaultwarden:3012;
|
||||
# Do not try another upstream on errors
|
||||
proxy_next_upstream off;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
@@ -240,6 +273,8 @@ server {
|
||||
|
||||
location / {
|
||||
proxy_pass http://seerr:5055;
|
||||
# Do not try another upstream on errors
|
||||
proxy_next_upstream off;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
@@ -249,33 +284,36 @@ server {
|
||||
}
|
||||
}
|
||||
|
||||
###################
|
||||
# QBITTORRENT
|
||||
###################
|
||||
server {
|
||||
listen 443 ssl;http2 on;
|
||||
server_name torrent.someoneslinux.selfhost.eu;
|
||||
|
||||
add_header Content-Security-Policy "frame-ancestors 'self';" always;
|
||||
# add_header Content-Security-Policy "default-src 'self'; frame-ancestors 'self';" always;
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||
|
||||
ssl_certificate /etc/nginx/certs/live/cloud.someoneslinux.selfhost.eu/fullchain.pem;
|
||||
ssl_certificate_key /etc/nginx/certs/live/cloud.someoneslinux.selfhost.eu/privkey.pem;
|
||||
|
||||
location / {
|
||||
proxy_pass http://192.168.0.2:8080;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
}
|
||||
}
|
||||
####################
|
||||
## QBITTORRENT
|
||||
####################
|
||||
#server {
|
||||
# listen 443 ssl;http2 on;
|
||||
# server_name torrent.someoneslinux.selfhost.eu;
|
||||
#
|
||||
# add_header Content-Security-Policy "frame-ancestors 'self';" always;
|
||||
## add_header Content-Security-Policy "default-src 'self'; frame-ancestors 'self';" always;
|
||||
# add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
# add_header X-Content-Type-Options "nosniff" always;
|
||||
# add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
# add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||
#
|
||||
# ssl_certificate /etc/nginx/certs/live/cloud.someoneslinux.selfhost.eu/fullchain.pem;
|
||||
# ssl_certificate_key /etc/nginx/certs/live/cloud.someoneslinux.selfhost.eu/privkey.pem;
|
||||
#
|
||||
# location / {
|
||||
# proxy_pass http://192.168.0.2:8080;
|
||||
# # Do not try another upstream on errors
|
||||
# proxy_next_upstream off;
|
||||
# proxy_http_version 1.1;
|
||||
#
|
||||
# proxy_set_header Host $host;
|
||||
# proxy_set_header Upgrade $http_upgrade;
|
||||
# proxy_set_header Connection $connection_upgrade;
|
||||
# proxy_set_header X-Forwarded-Proto https;
|
||||
# }
|
||||
#
|
||||
#}
|
||||
|
||||
###################
|
||||
# GRFANA
|
||||
@@ -294,6 +332,8 @@ server {
|
||||
|
||||
location / {
|
||||
proxy_pass http://grafana:3000;
|
||||
# Do not try another upstream on errors
|
||||
proxy_next_upstream off;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
@@ -302,3 +342,124 @@ server {
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
}
|
||||
}
|
||||
|
||||
###################
|
||||
# GITEA
|
||||
###################
|
||||
server {
|
||||
listen 443 ssl;http2 on;
|
||||
server_name code.someoneslinux.selfhost.eu;
|
||||
|
||||
add_header Content-Security-Policy "frame-ancestors 'self';" always;
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||
|
||||
ssl_certificate /etc/nginx/certs/live/cloud.someoneslinux.selfhost.eu/fullchain.pem;
|
||||
ssl_certificate_key /etc/nginx/certs/live/cloud.someoneslinux.selfhost.eu/privkey.pem;
|
||||
|
||||
client_max_body_size 10G;
|
||||
location / {
|
||||
proxy_pass http://gitea:3000;
|
||||
# Do not try another upstream on errors
|
||||
proxy_next_upstream off;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
}
|
||||
}
|
||||
###################
|
||||
# IMMICH
|
||||
###################
|
||||
server {
|
||||
listen 443 ssl;http2 on;
|
||||
server_name fotos.someoneslinux.selfhost.eu;
|
||||
|
||||
add_header Content-Security-Policy "frame-ancestors 'self';" always;
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||
|
||||
ssl_certificate /etc/nginx/certs/live/cloud.someoneslinux.selfhost.eu/fullchain.pem;
|
||||
ssl_certificate_key /etc/nginx/certs/live/cloud.someoneslinux.selfhost.eu/privkey.pem;
|
||||
|
||||
client_max_body_size 10G;
|
||||
location / {
|
||||
proxy_pass http://immich_server:2283;
|
||||
# Do not try another upstream on errors
|
||||
proxy_next_upstream off;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
}
|
||||
}
|
||||
###################
|
||||
# OLLAMA
|
||||
###################
|
||||
server {
|
||||
listen 443 ssl;http2 on;
|
||||
server_name ai.someoneslinux.selfhost.eu;
|
||||
|
||||
add_header Content-Security-Policy "frame-ancestors 'self';" always;
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||
|
||||
ssl_certificate /etc/nginx/certs/live/cloud.someoneslinux.selfhost.eu/fullchain.pem;
|
||||
ssl_certificate_key /etc/nginx/certs/live/cloud.someoneslinux.selfhost.eu/privkey.pem;
|
||||
|
||||
client_max_body_size 10G;
|
||||
location / {
|
||||
proxy_pass http://192.168.0.39:3000;
|
||||
# Do not try another upstream on errors
|
||||
proxy_next_upstream off;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
}
|
||||
}
|
||||
###################
|
||||
# OLLAMA API
|
||||
###################
|
||||
server {
|
||||
listen 443 ssl;http2 on;
|
||||
server_name aiapi.someoneslinux.selfhost.eu;
|
||||
|
||||
add_header Content-Security-Policy "frame-ancestors 'self';" always;
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||
|
||||
ssl_certificate /etc/nginx/certs/live/cloud.someoneslinux.selfhost.eu/fullchain.pem;
|
||||
ssl_certificate_key /etc/nginx/certs/live/cloud.someoneslinux.selfhost.eu/privkey.pem;
|
||||
|
||||
client_max_body_size 10G;
|
||||
location / {
|
||||
proxy_pass http://192.168.0.39:11434;
|
||||
# Do not try another upstream on errors
|
||||
proxy_next_upstream off;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,9 @@ services:
|
||||
image: nginx:stable
|
||||
container_name: nginx
|
||||
restart: unless-stopped
|
||||
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
|
||||
volumes:
|
||||
- ./conf.d:/etc/nginx/conf.d
|
||||
- ./certs:/etc/nginx/certs
|
||||
@@ -15,6 +13,21 @@ services:
|
||||
# Access and error logs
|
||||
- ./logs:/var/log/nginx
|
||||
networks:
|
||||
- default
|
||||
- shared-proxy-services
|
||||
|
||||
nginx-exporter:
|
||||
image: nginx/nginx-prometheus-exporter:latest
|
||||
container_name: nginx-exporter
|
||||
restart: unless-stopped
|
||||
command:
|
||||
- --nginx.scrape-uri=http://nginx:8080/nginx_status
|
||||
ports:
|
||||
- "9113:9113"
|
||||
depends_on:
|
||||
- nginx
|
||||
networks:
|
||||
- default
|
||||
- shared-proxy-services
|
||||
|
||||
crowdsec:
|
||||
@@ -29,7 +42,8 @@ services:
|
||||
- crowdsec-db:/var/lib/crowdsec/data
|
||||
- ./logs:/var/log/nginx:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
|
||||
networks:
|
||||
- default
|
||||
|
||||
certbot:
|
||||
image: certbot/certbot:latest
|
||||
@@ -41,7 +55,9 @@ services:
|
||||
- shared-proxy-services
|
||||
|
||||
networks:
|
||||
default:
|
||||
shared-proxy-services:
|
||||
external: true
|
||||
|
||||
volumes:
|
||||
crowdsec-db:
|
||||
@@ -3,7 +3,7 @@ services:
|
||||
image: redis:7
|
||||
container_name: redis
|
||||
restart: unless-stopped
|
||||
command: redis-server --appendonly yes --requirepass PerCent7heStorySp0tInOrd3r
|
||||
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD}
|
||||
|
||||
healthcheck:
|
||||
test:
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
# Note: Do not edit this file directly.
|
||||
# Your changes will be overwritten!
|
||||
|
||||
# Server
|
||||
[Interface]
|
||||
PrivateKey = 6CXCZMoH8bj7Ku//g0vyXms2IIffHR18K8RnOklzgnc=
|
||||
Address = 10.8.0.1/24
|
||||
ListenPort = 51820
|
||||
PreUp =
|
||||
PostUp = iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE; iptables -A INPUT -p udp -m udp --dport 51820 -j ACCEPT; iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT;
|
||||
PreDown =
|
||||
PostDown = iptables -t nat -D POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE; iptables -D INPUT -p udp -m udp --dport 51820 -j ACCEPT; iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT;
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
#!/bin/bash
|
||||
|
||||
OUT=/docker/monitoring/node_exporter/textfile_collector/custom.prom
|
||||
TS=$(date +%s%3N)
|
||||
if [[ "$(hostname)" == "mediahost" ]]; then
|
||||
DOCKER_CONTAINER_NUM=50
|
||||
elif [[ "$(hostname)" == "serverhost" ]]; then
|
||||
DOCKER_CONTAINER_NUM=4
|
||||
elif [[ "$(hostname)" == "quiethost" ]]; then
|
||||
DOCKER_CONTAINER_NUM=1
|
||||
fi
|
||||
{
|
||||
# Docker container states
|
||||
docker ps -a --format '{{.Names}}' | while read -r name; do
|
||||
if docker inspect -f '{{.State.Running}}' "$name" 2>/dev/null | grep -q true; then
|
||||
echo "docker_container_state{name=\"$name\"} 1"
|
||||
else
|
||||
echo "docker_container_state{name=\"$name\"} 0"
|
||||
fi
|
||||
done
|
||||
|
||||
echo docker_container_number $DOCKER_CONTAINER_NUM
|
||||
|
||||
docker ps -a --format '{{.Names}}' | grep -E '^qbittorrent' | while read -r qbit_host; do
|
||||
IP_JSON=$(docker exec "$qbit_host" curl -fsSL http://ip-api.com/json) || continue
|
||||
|
||||
IP=$(jq -r '.query' <<<"$IP_JSON")
|
||||
COUNTRY=$(jq -r '.country' <<<"$IP_JSON")
|
||||
CITY=$(jq -r '.city' <<<"$IP_JSON")
|
||||
ISP=$(jq -r '.isp' <<<"$IP_JSON" | sed 's/"/\\"/g')
|
||||
COUNTRYCODE=$(jq -r '.countryCode' <<<"$IP_JSON")
|
||||
LAT=$(jq -r '.lat' <<<"$IP_JSON")
|
||||
LON=$(jq -r '.lon' <<<"$IP_JSON")
|
||||
|
||||
echo "public_ip_info{ip=\"$IP\",country=\"$COUNTRY\",city=\"$CITY\",isp=\"$ISP\",countrycode=\"$COUNTRYCODE\",lat=\"$LAT\",lon=\"$LON\",exported_host=\"$qbit_host\"} 1"
|
||||
done
|
||||
|
||||
|
||||
# Public IP information
|
||||
IP_JSON=$(curl -fsSL http://ip-api.com/json)
|
||||
IP=$(jq -r '.query' <<< "$IP_JSON")
|
||||
COUNTRY=$(jq -r '.country' <<< "$IP_JSON")
|
||||
CITY=$(jq -r '.city' <<< "$IP_JSON")
|
||||
ISP=$(jq -r '.isp' <<< "$IP_JSON" | sed 's/"/\\"/g')
|
||||
COUNTRYCODE=$(jq -r '.countryCode' <<< "$IP_JSON")
|
||||
LAT=$(jq -r '.lat' <<< "$IP_JSON")
|
||||
LON=$(jq -r '.lon' <<< "$IP_JSON")
|
||||
|
||||
echo "public_ip_info{ip=\"$IP\",country=\"$COUNTRY\",city=\"$CITY\",isp=\"$ISP\",countrycode=\"$COUNTRYCODE\",lat=\"$LAT\",lon=\"$LON\",exported_host=\"$(hostname)\"} 1"
|
||||
|
||||
if [ -f /var/run/reboot-required ]; then
|
||||
# HELP reboot_required Reboot required
|
||||
# TYPE reboot_required gauge
|
||||
echo reboot_required 1
|
||||
else
|
||||
# HELP reboot_required Reboot required
|
||||
# TYPE reboot_required gauge
|
||||
echo reboot_required 0
|
||||
fi
|
||||
echo "custom_metrics_last_update_timestamp_seconds $(date +%s)"
|
||||
} > "$OUT.$$"
|
||||
|
||||
mv "$OUT.$$" "$OUT"
|
||||
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
OUT="/docker/monitoring/node_exporter/textfile_collector/smart_selftest.prom"
|
||||
|
||||
> "$OUT"
|
||||
|
||||
for dev in $(smartctl --scan-open | awk '{print $1}'); do
|
||||
name=$(basename "$dev")
|
||||
LAST=0
|
||||
if [[ "$dev" == *nvme* ]]; then
|
||||
POWER_ON=$(smartctl -a "$dev" | awk -F': *' '/Power On Hours:/ {print $2}')
|
||||
LAST=$(smartctl -l selftest "$dev" 2>/dev/null \
|
||||
| grep "Completed" \
|
||||
| head -1 \
|
||||
| awk '{print $(NF-5)}')
|
||||
elif [[ "$dev" == *sd* ]]; then
|
||||
POWER_ON=$(smartctl -a "$dev" | awk '/Power_On_Hours/ {print $10}')
|
||||
LAST=$(smartctl -l selftest "$dev" 2>/dev/null \
|
||||
| grep "Completed" \
|
||||
| head -1 \
|
||||
| awk '{print $(NF-1)}')
|
||||
MODEL=$(smartctl -i "$dev" | awk -F': *' '/Device Model/ {print $2}')
|
||||
# ST2000LM003 self-test hour counter rolls over at 65536
|
||||
if [[ "$MODEL" == "ST2000LM003 HN-M201RAD" ]] && \
|
||||
[[ "$LAST" =~ ^[0-9]+$ ]] && \
|
||||
[[ "$POWER_ON" =~ ^[0-9]+$ ]] && \
|
||||
(( POWER_ON > 65535 && LAST < 65536 )); then
|
||||
LAST=$((LAST + 65536))
|
||||
fi
|
||||
else
|
||||
POWER_ON=99999999999
|
||||
echo $dev
|
||||
fi
|
||||
# Skip devices without self-test history
|
||||
echo $name: Last: ${LAST}, PowerOn: ${POWER_ON}
|
||||
echo "smart_last_selftest_poweron_hours{device=\"$name\"} $LAST" >> "$OUT"
|
||||
|
||||
done
|
||||
|
||||
upgradable=$(apt update > /dev/null 2>&1 && apt list --upgradable 2>/dev/null | wc -l)
|
||||
echo "apt_upgradable $upgradable" >> "$OUT"
|
||||
@@ -0,0 +1,25 @@
|
||||
# Edit this file to introduce tasks to be run by cron.
|
||||
#
|
||||
# Each task to run has to be defined through a single line
|
||||
# indicating with different fields when the task will be run
|
||||
# and what command to run for the task
|
||||
#
|
||||
# To define the time you can provide concrete values for
|
||||
# minute (m), hour (h), day of month (dom), month (mon),
|
||||
# and day of week (dow) or use '*' in these fields (for 'any').
|
||||
#
|
||||
# Notice that tasks will be started based on the cron's system
|
||||
# daemon's notion of time and timezones.
|
||||
#
|
||||
# Output of the crontab jobs (including errors) is sent through
|
||||
# email to the user the crontab file belongs to (unless redirected).
|
||||
#
|
||||
# For example, you can run a backup of all your user accounts
|
||||
# at 5 a.m every week with:
|
||||
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
|
||||
#
|
||||
# For more information see the manual pages of crontab(5) and cron(8)
|
||||
#
|
||||
# m h dom mon dow command
|
||||
*/5 * * * * /home/lucas/scripts/docker_compose/node-exporter-pubip-docker-states.sh && logger "CRON_SUCCESS smartmon" || logger "CRON_FAILURE smartmon"
|
||||
*/1 * * * * /home/lucas/scripts/docker_compose/node-exporter-rocm-exporter.sh && logger "CRON_SUCCESS rocm" || logger "CRON_FAILURE rocm"
|
||||
@@ -0,0 +1,41 @@
|
||||
services:
|
||||
diun:
|
||||
image: crazymax/diun:latest
|
||||
container_name: diun
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- ./data:/data
|
||||
|
||||
environment:
|
||||
TZ: Europe/Vienna
|
||||
|
||||
# General
|
||||
DIUN_WATCH_WORKERS: 20
|
||||
DIUN_WATCH_SCHEDULE: "0 0 * * *"
|
||||
DIUN_PROVIDERS_DOCKER: "true"
|
||||
DIUN_PROVIDERS_DOCKER_WATCHBYDEFAULT: "true"
|
||||
# Metrics
|
||||
|
||||
DIUN_METRICS_ENABLED: "true"
|
||||
DIUN_METRICS_ADDR: ":9090"
|
||||
DIUN_METRICS_TOKEN: "Qj#8C!@Uz3uRWm@mCd@KH6Bo7nfQ4K"
|
||||
|
||||
# # Email notifications
|
||||
# DIUN_NOTIF_MAIL_HOST: smtp.web.de
|
||||
# DIUN_NOTIF_MAIL_PORT: 587
|
||||
# DIUN_NOTIF_MAIL_USERNAME: ll_m@web.de
|
||||
# DIUN_NOTIF_MAIL_PASSWORD: Mira2012
|
||||
# DIUN_NOTIF_MAIL_FROM: ll_m@web.de
|
||||
# DIUN_NOTIF_MAIL_TO: ll_m@web.de
|
||||
# DIUN_NOTIF_MAIL_INSECURESKIPVERIFY: "false"
|
||||
ports:
|
||||
- 9090:9090
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
labels:
|
||||
- diun.enable=false
|
||||
@@ -0,0 +1,17 @@
|
||||
# /etc/fstab: static file system information.
|
||||
#
|
||||
# Use 'blkid' to print the universally unique identifier for a
|
||||
# device; this may be used with UUID= as a more robust way to name devices
|
||||
# that works even if disks are added and removed. See fstab(5).
|
||||
#
|
||||
# <file system> <mount point> <type> <options> <dump> <pass>
|
||||
# / was on /dev/nvme0n1p2 during curtin installation
|
||||
/dev/disk/by-uuid/7bc9c1f7-6d4b-431f-b213-9de3a98a7ab5 / ext4 defaults 0 1
|
||||
/dev/disk/by-uuid/e75f0b67-c158-40e9-b155-f08af89a82a9 none swap sw 0 0
|
||||
# /home was on /dev/nvme0n1p4 during curtin installation
|
||||
/dev/disk/by-uuid/96ecc248-410d-4c34-a664-7bbefb2b5ec8 /home ext4 defaults 0 1
|
||||
# /boot/efi was on /dev/nvme0n1p1 during curtin installation
|
||||
/dev/disk/by-uuid/9F46-5BD7 /boot/efi vfat defaults 0 1
|
||||
UUID=1729d425-17c9-4032-b8bd-98d60ca564ab /games ext4 defaults,nofail 0 2
|
||||
UUID=C28E92B18E929E0B /data ntfs defaults 0 2
|
||||
UUID=cc633125-60bc-4180-a53e-43015a4b6180 /stable ext4 defaults 0 2
|
||||
@@ -0,0 +1,16 @@
|
||||
services:
|
||||
node-exporter:
|
||||
container_name: node-exporter
|
||||
image: prom/node-exporter:latest
|
||||
restart: unless-stopped
|
||||
pid: host
|
||||
command:
|
||||
- '--path.rootfs=/host'
|
||||
- '--collector.textfile.directory=/textfile'
|
||||
volumes:
|
||||
- '/:/host:ro,rslave'
|
||||
- ./node_exporter/textfile_collector:/textfile:ro
|
||||
# ports:
|
||||
# - '9100:9100'
|
||||
network_mode: host
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
services:
|
||||
ollama:
|
||||
image: ollama/ollama:latest
|
||||
container_name: ollama
|
||||
restart: unless-stopped
|
||||
|
||||
ports:
|
||||
- "11434:11434"
|
||||
|
||||
environment:
|
||||
OLLAMA_HOST: 0.0.0.0:11434
|
||||
OLLAMA_VULKAN: "1"
|
||||
OLLAMA_KEEP_ALIVE: "10m"
|
||||
|
||||
devices:
|
||||
- /dev/dri:/dev/dri
|
||||
- /dev/kfd:/dev/kfd
|
||||
|
||||
group_add:
|
||||
- "44"
|
||||
- "990"
|
||||
|
||||
volumes:
|
||||
- /stable/ollama:/root/.ollama
|
||||
open-webui:
|
||||
image: ghcr.io/open-webui/open-webui:main
|
||||
container_name: open-webui
|
||||
restart: unless-stopped
|
||||
|
||||
depends_on:
|
||||
- ollama
|
||||
|
||||
ports:
|
||||
- "3000:8080"
|
||||
|
||||
environment:
|
||||
OLLAMA_BASE_URL: http://ollama:11434
|
||||
WEBUI_SECRET_KEY: "eae4639d2f8d5d8afee8cf65fe4d4f3b970b32cfd6c68f0455c9721ccd04d324"
|
||||
|
||||
volumes:
|
||||
- open_webui_data:/app/backend/data
|
||||
|
||||
volumes:
|
||||
ollama_data:
|
||||
open_webui_data:
|
||||
@@ -0,0 +1,12 @@
|
||||
# Example of job definition:
|
||||
# .---------------- minute (0 - 59)
|
||||
# | .------------- hour (0 - 23)
|
||||
# | | .---------- day of month (1 - 31)
|
||||
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
|
||||
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
|
||||
# | | | | |
|
||||
# * * * * * user-name command to be executed
|
||||
|
||||
*/5 * * * * /home/lucas/scripts/docker_compose/node-exporter-pubip-docker-states.sh
|
||||
0 0 */2 * * /home/lucas/scripts/network/wg-randomize.sh /docker/qbittorrent/gluetun/ && /usr/bin/docker restart gluetun qbittorrent-public
|
||||
|
||||
@@ -16,15 +16,22 @@ services:
|
||||
DIUN_WATCH_SCHEDULE: "0 0 * * *"
|
||||
DIUN_PROVIDERS_DOCKER: "true"
|
||||
DIUN_PROVIDERS_DOCKER_WATCHBYDEFAULT: "true"
|
||||
# Metrics
|
||||
|
||||
# Email notifications
|
||||
DIUN_NOTIF_MAIL_HOST: smtp.web.de
|
||||
DIUN_NOTIF_MAIL_PORT: 587
|
||||
DIUN_NOTIF_MAIL_USERNAME: ll_m@web.de
|
||||
DIUN_NOTIF_MAIL_PASSWORD: Mira2012
|
||||
DIUN_NOTIF_MAIL_FROM: ll_m@web.de
|
||||
DIUN_NOTIF_MAIL_TO: ll_m@web.de
|
||||
DIUN_NOTIF_MAIL_INSECURESKIPVERIFY: "false"
|
||||
DIUN_METRICS_ENABLED: "true"
|
||||
DIUN_METRICS_ADDR: ":9090"
|
||||
DIUN_METRICS_TOKEN: "Qj#8C!@Uz3uRWm@mCd@KH6Bo7nfQ4K"
|
||||
|
||||
# # Email notifications
|
||||
# DIUN_NOTIF_MAIL_HOST: smtp.web.de
|
||||
# DIUN_NOTIF_MAIL_PORT: 587
|
||||
# DIUN_NOTIF_MAIL_USERNAME: ll_m@web.de
|
||||
# DIUN_NOTIF_MAIL_PASSWORD: Mira2012
|
||||
# DIUN_NOTIF_MAIL_FROM: ll_m@web.de
|
||||
# DIUN_NOTIF_MAIL_TO: ll_m@web.de
|
||||
# DIUN_NOTIF_MAIL_INSECURESKIPVERIFY: "false"
|
||||
ports:
|
||||
- 9090:9090
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# /etc/exports: the access control list for filesystems which may be exported
|
||||
# to NFS clients. See exports(5).
|
||||
#
|
||||
# Example for NFSv2 and NFSv3:
|
||||
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
|
||||
#
|
||||
# Example for NFSv4:
|
||||
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
|
||||
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
|
||||
#
|
||||
/torrent/qbittorrent-private/downloads 192.168.0.4(rw,sync,no_subtree_check)
|
||||
/torrent/qbittorrent-public/downloads/ 192.168.0.4(rw,sync,no_subtree_check)
|
||||
/special-torrent/torrent/ 192.168.0.4(rw,sync,no_subtree_check)
|
||||
#/backup/homeassistant 192.168.0.4(rw,sync,no_subtree_check)
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# /etc/fstab: static file system information.
|
||||
#
|
||||
# Use 'blkid' to print the universally unique identifier for a
|
||||
# device; this may be used with UUID= as a more robust way to name devices
|
||||
# that works even if disks are added and removed. See fstab(5).
|
||||
#
|
||||
# <file system> <mount point> <type> <options> <dump> <pass>
|
||||
# / was on /dev/sdb3 during curtin installation
|
||||
/dev/disk/by-uuid/78ad42f7-ea96-4979-9d97-ebed17e8e794 / ext4 defaults 0 1
|
||||
# /boot/efi was on /dev/sdb1 during curtin installation
|
||||
/dev/disk/by-uuid/B2BA-82AA /boot/efi vfat defaults 0 1
|
||||
# /docker was on /dev/sdb4 during curtin installation
|
||||
/dev/disk/by-uuid/91e3f4d6-cb10-4627-9e3f-59382832b489 /docker ext4 defaults 0 1
|
||||
# /data was on /dev/sdb5 during curtin installation
|
||||
/dev/disk/by-uuid/97e0ba27-0cf7-4502-9f8d-d2fac39cc941 /special-torrent ext4 defaults 0 1
|
||||
/swap.img none swap sw 0 0
|
||||
/dev/disk/by-uuid/98695b57-1d90-484d-9347-c886c6395050 /torrent ext4 defaults 0 1
|
||||
192.168.0.4:/data/torrent/qbittorrent/mediahost /torrent/qbittorrent/mediahost nfs defaults,nofail,x-systemd.automount,x-systemd.mount-timeout=30,_netdev 0 0
|
||||
@@ -10,6 +10,19 @@ services:
|
||||
volumes:
|
||||
- '/:/host:ro,rslave'
|
||||
- ./node_exporter/textfile_collector:/textfile:ro
|
||||
# ports:
|
||||
# - '9100:9100'
|
||||
network_mode: host
|
||||
cadvisor:
|
||||
image: gcr.io/cadvisor/cadvisor:latest
|
||||
container_name: cadvisor
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- '9100:9100'
|
||||
|
||||
- "8081:8080"
|
||||
volumes:
|
||||
- /:/rootfs:ro
|
||||
- /data:/data:ro
|
||||
- /docker:/docker:ro
|
||||
- /var/run:/var/run:ro
|
||||
- /sys:/sys:ro
|
||||
- /var/lib/docker:/var/lib/docker:ro
|
||||
@@ -7,18 +7,18 @@ cp -f /hostscripts/torrent_qbittorrent_complete.sh /config/
|
||||
|
||||
chmod +x /config/torrent_qbittorrent_complete.sh
|
||||
|
||||
#if ! command -v scp >/dev/null 2>&1; then
|
||||
# echo "Install scp"
|
||||
#
|
||||
# for i in {1..12}; do
|
||||
# if apk add --no-cache openssh-client; then
|
||||
# break
|
||||
# fi
|
||||
#
|
||||
# echo "Retry $i/12"
|
||||
# sleep 5
|
||||
# done
|
||||
#fi
|
||||
if ! command -v scp >/dev/null 2>&1; then
|
||||
echo "Install scp"
|
||||
|
||||
for i in {1..12}; do
|
||||
if apk add --no-cache openssh-client; then
|
||||
break
|
||||
fi
|
||||
|
||||
echo "Retry $i/12"
|
||||
sleep 5
|
||||
done
|
||||
fi
|
||||
|
||||
if [ ! -d /config/.venv ]; then
|
||||
echo "Generate venv"
|
||||
|
||||
@@ -1,193 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
###############################################################################
|
||||
# Description:
|
||||
# qBittorrent external script that:
|
||||
# 1. Receives torrent name, root path and category from qBittorrent.
|
||||
# 2. Sends the torrent name to torrent_mqtt.py.
|
||||
# 3. Copies the torrent contents to mediahost via SCP.
|
||||
# 4. Logs all output to a timestamped logfile.
|
||||
#
|
||||
# Usage:
|
||||
# torrent_complete.sh <torrent_name> <root_path> <category>
|
||||
#
|
||||
# qBittorrent configuration:
|
||||
# /home/lucas/scripts/serverhost/torrent_complete.sh "%N" "%R" "%L"
|
||||
#
|
||||
# Arguments:
|
||||
# $1 Torrent name
|
||||
# $2 Root path
|
||||
# $3 Torrent category
|
||||
#
|
||||
# Log files:
|
||||
# /home/lucas/.LOG/log_torrent_name_YYYY-MM-DD_HH-MM-SS.log
|
||||
#
|
||||
# Requirements:
|
||||
# - bash
|
||||
# - scp
|
||||
# - SSH access to "mediahost"
|
||||
# - /home/lucas/scripts/serverhost/torrent_mqtt.py
|
||||
###############################################################################
|
||||
|
||||
set -u
|
||||
|
||||
SCRIPT_NAME="$(basename "$0")"
|
||||
|
||||
###############################################################################
|
||||
# Usage
|
||||
###############################################################################
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage:
|
||||
$SCRIPT_NAME <torrent_name> <root_path> <category>
|
||||
|
||||
Description:
|
||||
Sends the torrent name to torrent_mqtt.py and copies the torrent
|
||||
contents to mediahost.
|
||||
|
||||
Arguments:
|
||||
torrent_name Torrent name
|
||||
root_path Torrent root path
|
||||
category Torrent category
|
||||
|
||||
Example:
|
||||
$SCRIPT_NAME "Ubuntu 24.04" "/downloads/Ubuntu 24.04" "Linux"
|
||||
|
||||
qBittorrent:
|
||||
$SCRIPT_NAME "%N" "%R" "%L"
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Check arguments
|
||||
###############################################################################
|
||||
|
||||
if [[ $# -ne 3 ]]; then
|
||||
usage >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TORRENT_NAME="$1"
|
||||
ROOT_PATH="$2"
|
||||
CATEGORY="$3"
|
||||
|
||||
if [[ "$CATEGORY" != *arr* ]]; then
|
||||
###############################################################################
|
||||
# Start
|
||||
###############################################################################
|
||||
|
||||
echo "=================================================="
|
||||
echo "Torrent transfer started"
|
||||
echo "Date: $(date)"
|
||||
echo "Script: $SCRIPT_NAME"
|
||||
echo "Torrent name: $TORRENT_NAME"
|
||||
echo "Root path: $ROOT_PATH"
|
||||
echo "Category: $CATEGORY"
|
||||
echo "=================================================="
|
||||
|
||||
###############################################################################
|
||||
# Check for scp command
|
||||
###############################################################################
|
||||
|
||||
if ! command -v scp >/dev/null 2>&1; then
|
||||
echo "Install scp"
|
||||
sed -i 's|http://|https://|g' /etc/apk/repositories
|
||||
for i in {1..12}; do
|
||||
if apk add --no-cache openssh-client; then
|
||||
break
|
||||
fi
|
||||
|
||||
echo "Retry $i/12"
|
||||
sleep 5
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Send torrent name to MQTT script
|
||||
###############################################################################
|
||||
|
||||
echo
|
||||
echo "--- Sending torrent name to torrent_mqtt.py ---"
|
||||
|
||||
/config/.venv/bin/python3 /config/torrent_mqtt.py "$TORRENT_NAME"
|
||||
|
||||
MQTT_STATUS=$?
|
||||
|
||||
echo "torrent_mqtt.py exit status: $MQTT_STATUS"
|
||||
|
||||
###############################################################################
|
||||
# Check root path
|
||||
###############################################################################
|
||||
|
||||
echo
|
||||
echo "--- Checking root path ---"
|
||||
|
||||
if [[ ! -d "$ROOT_PATH" ]]; then
|
||||
echo "ERROR: Root path does not exist or is not a directory:"
|
||||
echo " $ROOT_PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Root path exists."
|
||||
|
||||
###############################################################################
|
||||
# Copy torrent to mediahost
|
||||
###############################################################################
|
||||
|
||||
basename_root=$(basename "$ROOT_PATH")
|
||||
echo $basename_root
|
||||
if [ "$basename_root" = "downloads" ]; then
|
||||
remote_dir="$TORRENT_NAME"
|
||||
else
|
||||
remote_dir="$basename_root"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "--- Copying torrent to mediahost ---"
|
||||
echo "Source: $ROOT_PATH"
|
||||
echo "Destination: mediahost:/torrent/qbittorrent/mediahost/"
|
||||
|
||||
ssh -i /config/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
|
||||
lucas@mediahost "mkdir -p \"/torrent/qbittorrent/mediahost/$remote_dir\""
|
||||
SSH_STATUS=$?
|
||||
scp -i /config/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
|
||||
-r "$ROOT_PATH"/. lucas@mediahost:/torrent/qbittorrent/mediahost/
|
||||
SCP_STATUS=$?
|
||||
|
||||
echo "scp exit status: $SCP_STATUS"
|
||||
|
||||
###############################################################################
|
||||
# Result
|
||||
###############################################################################
|
||||
|
||||
echo
|
||||
echo "=================================================="
|
||||
|
||||
if [[ $MQTT_STATUS -ne 0 ]]; then
|
||||
echo "WARNING: torrent_mqtt.py failed."
|
||||
fi
|
||||
if [[ $SSH_STATUS -eq 0 ]]; then
|
||||
echo "Target Dir generated"
|
||||
else
|
||||
echo "ERROR: Target dir generation failed."
|
||||
fi
|
||||
|
||||
if [[ $SCP_STATUS -eq 0 ]]; then
|
||||
echo "Torrent transfer completed successfully."
|
||||
else
|
||||
echo "ERROR: Torrent transfer failed."
|
||||
fi
|
||||
|
||||
echo "Finished: $(date +'%y%m%d %H%M%Sr')"
|
||||
echo "=================================================="
|
||||
else
|
||||
echo "ARR handled torrent: $(date +'%y%m%d %H%M%S'): $TORRENT_NAME"
|
||||
fi
|
||||
|
||||
# Return SCP's exit status to qBittorrent
|
||||
exit 0
|
||||
|
||||
@@ -1,23 +1,72 @@
|
||||
services:
|
||||
qbittorrent:
|
||||
#image: "lscr.io/linuxserver/qbittorrent:latest"
|
||||
build: .
|
||||
container_name: "qbittorrent"
|
||||
qbittorrent-private:
|
||||
image: "lscr.io/linuxserver/qbittorrent:5.2.3"
|
||||
container_name: "qbittorrent-private"
|
||||
environment:
|
||||
- PGID=1000
|
||||
- TZ=Europe/Vienna
|
||||
- PUID=1000
|
||||
- WEBUI_PORT=8080
|
||||
- WEBUI_NAME=qBittorrent-Private
|
||||
ports:
|
||||
- "8080:8080/tcp"
|
||||
- "55661:55661/udp"
|
||||
- "55661:55661/tcp"
|
||||
restart: "unless-stopped"
|
||||
|
||||
volumes:
|
||||
- "./10-torrent-init.sh:/custom-cont-init.d/10-torrent-init.sh:ro"
|
||||
- "./config:/config"
|
||||
- "./qbittorrent-private:/config"
|
||||
- "./qbittorrent-scripts:/scripts"
|
||||
- "/home/lucas/scripts/torrent:/hostscripts:ro"
|
||||
- "/torrent/qbittorrent/downloads:/downloads"
|
||||
- "/torrent/qbittorrent/torrents:/torrents"
|
||||
- "/torrent/qbittorrent/watch:/watch"
|
||||
- "/torrent/qbittorrent-private/downloads:/downloads-private"
|
||||
- "/torrent/qbittorrent-private/torrents:/torrents"
|
||||
- "/torrent/qbittorrent/mediahost:/mediahost"
|
||||
qbittorrent-public:
|
||||
# image: "lscr.io/linuxserver/qbittorrent:latest"
|
||||
build: qbittorrent-public/
|
||||
container_name: "qbittorrent-public"
|
||||
environment:
|
||||
- PGID=1000
|
||||
- TZ=Europe/Vienna
|
||||
- PUID=1000
|
||||
- WEBUI_PORT=8080
|
||||
- WEBUI_NAME=qBittorrent-Public
|
||||
network_mode: "service:gluetun"
|
||||
depends_on:
|
||||
- gluetun
|
||||
# ports:
|
||||
# - 8082:8080 # qBittorrent WebUI
|
||||
# - 55662:55663
|
||||
# - 55662:55663/udp
|
||||
restart: "unless-stopped"
|
||||
volumes:
|
||||
- "./10-torrent-init.sh:/custom-cont-init.d/10-torrent-init.sh:ro"
|
||||
- "./qbittorrent-public:/config"
|
||||
- "./qbittorrent-scripts:/scripts"
|
||||
- "/home/lucas/scripts/torrent:/hostscripts:ro"
|
||||
- "/torrent/qbittorrent-public/downloads:/downloads-public"
|
||||
- "/torrent/qbittorrent-public/torrents:/torrents"
|
||||
- "/special-torrent/torrent:/downloads-special"
|
||||
- "/torrent/qbittorrent/mediahost:/mediahost"
|
||||
gluetun:
|
||||
image: qmcgaw/gluetun:latest
|
||||
container_name: gluetun
|
||||
restart: unless-stopped
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
devices:
|
||||
- /dev/net/tun:/dev/net/tun
|
||||
ports:
|
||||
- 8082:8080 # qBittorrent WebUI
|
||||
- 55662:55662
|
||||
- 55662:55662/udp
|
||||
environment:
|
||||
- VPN_SERVICE_PROVIDER=custom
|
||||
- VPN_TYPE=wireguard
|
||||
- SOCKS5_ENABLED=on
|
||||
- HTTPPROXY=on
|
||||
- SOCKSPROXY=on
|
||||
- TZ=Europe/Vienna
|
||||
volumes:
|
||||
- ./gluetun:/gluetun/wireguard
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Use this configuration with WireGuard client
|
||||
#
|
||||
[Interface]
|
||||
Address = 10.14.0.2/16
|
||||
PrivateKey = mKeDQdxtM1iFJS7WLlb2jPGabZIt3NkoA/nGCcNOU1I=
|
||||
DNS = 162.252.172.57, 149.154.159.92
|
||||
[Peer]
|
||||
PublicKey = dPZe8Jq3Hu0k07MDk+Y4+AS2XHSLYalyg91TSFXRYEA=
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
Endpoint = at-vie.prod.surfshark.com:51820
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Use this configuration with WireGuard client
|
||||
#
|
||||
[Interface]
|
||||
Address = 10.14.0.2/16
|
||||
PrivateKey = mKeDQdxtM1iFJS7WLlb2jPGabZIt3NkoA/nGCcNOU1I=
|
||||
DNS = 162.252.172.57, 149.154.159.92
|
||||
[Peer]
|
||||
PublicKey = 6tOduT4iNbZyqKNzsSgDe/ckziO6101NPZwrnY5WpTk=
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
Endpoint = bd-dac.prod.surfshark.com:51820
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Use this configuration with WireGuard client
|
||||
#
|
||||
[Interface]
|
||||
Address = 10.14.0.2/16
|
||||
PrivateKey = mKeDQdxtM1iFJS7WLlb2jPGabZIt3NkoA/nGCcNOU1I=
|
||||
DNS = 162.252.172.57, 149.154.159.92
|
||||
[Peer]
|
||||
PublicKey = d3ldwEjnFcbLwD1o8uC5xC3DaSNek8DGeTpOb/h/IE4=
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
Endpoint = de-ber.prod.surfshark.com:51820
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Use this configuration with WireGuard client
|
||||
#
|
||||
[Interface]
|
||||
Address = 10.14.0.2/16
|
||||
PrivateKey = mKeDQdxtM1iFJS7WLlb2jPGabZIt3NkoA/nGCcNOU1I=
|
||||
DNS = 162.252.172.57, 149.154.159.92
|
||||
[Peer]
|
||||
PublicKey = LErFIOc3YBK1khnmwV+a6fBbYff2OS3h+wnIuOKZQTY=
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
Endpoint = ec-uio.prod.surfshark.com:51820
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Use this configuration with WireGuard client
|
||||
#
|
||||
[Interface]
|
||||
Address = 10.14.0.2/16
|
||||
PrivateKey = mKeDQdxtM1iFJS7WLlb2jPGabZIt3NkoA/nGCcNOU1I=
|
||||
DNS = 162.252.172.57, 149.154.159.92
|
||||
[Peer]
|
||||
PublicKey = CsdrT+WfcMRPhrOWgZeHj9DQiQtJfYFci94K5ztjr2E=
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
Endpoint = ee-tll.prod.surfshark.com:51820
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Use this configuration with WireGuard client
|
||||
#
|
||||
[Interface]
|
||||
Address = 10.14.0.2/16
|
||||
PrivateKey = mKeDQdxtM1iFJS7WLlb2jPGabZIt3NkoA/nGCcNOU1I=
|
||||
DNS = 162.252.172.57, 149.154.159.92
|
||||
[Peer]
|
||||
PublicKey = +nv/Z8I2VS0eRdZwkpQW3U9RmsboTz2MUF94jVg5w10=
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
Endpoint = fi-hel.prod.surfshark.com:51820
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Use this configuration with WireGuard client
|
||||
#
|
||||
[Interface]
|
||||
Address = 10.14.0.2/16
|
||||
PrivateKey = mKeDQdxtM1iFJS7WLlb2jPGabZIt3NkoA/nGCcNOU1I=
|
||||
DNS = 162.252.172.57, 149.154.159.92
|
||||
[Peer]
|
||||
PublicKey = zPg3ZJ7OsztQ0CRSSvH5o2KVL1DYgDGW65DFwLsYwyw=
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
Endpoint = gl-goh.prod.surfshark.com:51820
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Use this configuration with WireGuard client
|
||||
#
|
||||
[Interface]
|
||||
Address = 10.14.0.2/16
|
||||
PrivateKey = mKeDQdxtM1iFJS7WLlb2jPGabZIt3NkoA/nGCcNOU1I=
|
||||
DNS = 162.252.172.57, 149.154.159.92
|
||||
[Peer]
|
||||
PublicKey = TjYxodFNdGlefxnWqe9vWWJHnz3meYWWhiIJyU8rgg8=
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
Endpoint = ie-dub.prod.surfshark.com:51820
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Use this configuration with WireGuard client
|
||||
#
|
||||
[Interface]
|
||||
Address = 10.14.0.2/16
|
||||
PrivateKey = mKeDQdxtM1iFJS7WLlb2jPGabZIt3NkoA/nGCcNOU1I=
|
||||
DNS = 162.252.172.57, 149.154.159.92
|
||||
[Peer]
|
||||
PublicKey = +dmGrWPM9NI3vQkZ9E7hMRKAJKYzd3YMXGq10sjbN0A=
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
Endpoint = in-del.prod.surfshark.com:51820
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Use this configuration with WireGuard client
|
||||
#
|
||||
[Interface]
|
||||
Address = 10.14.0.2/16
|
||||
PrivateKey = mKeDQdxtM1iFJS7WLlb2jPGabZIt3NkoA/nGCcNOU1I=
|
||||
DNS = 162.252.172.57, 149.154.159.92
|
||||
[Peer]
|
||||
PublicKey = z2Ik8BG6XgosyYE/O4Vz4kiPTZyoWSlJvZtFeFlNclI=
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
Endpoint = kh-pnh.prod.surfshark.com:51820
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Use this configuration with WireGuard client
|
||||
#
|
||||
[Interface]
|
||||
Address = 10.14.0.2/16
|
||||
PrivateKey = mKeDQdxtM1iFJS7WLlb2jPGabZIt3NkoA/nGCcNOU1I=
|
||||
DNS = 162.252.172.57, 149.154.159.92
|
||||
[Peer]
|
||||
PublicKey = c9EuAnWYvGUyFrzrV70Fph0onkFv2xe3Bc0gTCFuKRw=
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
Endpoint = mt-mla.prod.surfshark.com:51820
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Use this configuration with WireGuard client
|
||||
#
|
||||
[Interface]
|
||||
Address = 10.14.0.2/16
|
||||
PrivateKey = mKeDQdxtM1iFJS7WLlb2jPGabZIt3NkoA/nGCcNOU1I=
|
||||
DNS = 162.252.172.57, 149.154.159.92
|
||||
[Peer]
|
||||
PublicKey = oUFRc+2emXgogDVWnJF4RAzr72PyafCzMVeQOgG92lY=
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
Endpoint = se-sto.prod.surfshark.com:51820
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Use this configuration with WireGuard client
|
||||
#
|
||||
[Interface]
|
||||
Address = 10.14.0.2/16
|
||||
PrivateKey = mKeDQdxtM1iFJS7WLlb2jPGabZIt3NkoA/nGCcNOU1I=
|
||||
DNS = 162.252.172.57, 149.154.159.92
|
||||
[Peer]
|
||||
PublicKey = yPdmxOfzm06fotkt/dlaAiyxWPaWfCuDPaUljNx+c38=
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
Endpoint = si-lju.prod.surfshark.com:51820
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
CONF_DIR="${1:?Usage: $0 <conf-directory>}"
|
||||
|
||||
# Pick a random .conf except wg0.conf
|
||||
random_conf=$(find "$CONF_DIR" -maxdepth 1 -type f -name "*.conf" ! -name "wg0.conf" | shuf -n1)
|
||||
|
||||
echo "Selected: $random_conf"
|
||||
|
||||
# Copy to wg0.conf in current directory
|
||||
cp "$random_conf" ./wg0.conf
|
||||
|
||||
# Resolve hostname in Endpoint to IP
|
||||
endpoint=$(grep '^Endpoint' wg0.conf | awk '{print $3}')
|
||||
host=${endpoint%:*}
|
||||
port=${endpoint##*:}
|
||||
|
||||
ip=$(getent ahostsv4 "$host" | awk '{print $1; exit}')
|
||||
|
||||
if [[ -z "$ip" ]]; then
|
||||
echo "Failed to resolve $host"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sed -i "s|^Endpoint = .*|Endpoint = $ip:$port|" wg0.conf
|
||||
|
||||
echo "Updated Endpoint:"
|
||||
grep '^Endpoint' wg0.conf
|
||||
File renamed without changes.
+21
-38
@@ -87,22 +87,22 @@ if [[ "$CATEGORY" != *arr* && "$CATEGORY" != "mytorrents" ]]; then
|
||||
echo "Category: $CATEGORY"
|
||||
echo "=================================================="
|
||||
|
||||
###############################################################################
|
||||
# Check for scp command
|
||||
###############################################################################
|
||||
|
||||
if ! command -v scp >/dev/null 2>&1; then
|
||||
echo "Install scp"
|
||||
sed -i 's|http://|https://|g' /etc/apk/repositories
|
||||
for i in {1..12}; do
|
||||
if apk add --no-cache openssh-client; then
|
||||
break
|
||||
fi
|
||||
|
||||
echo "Retry $i/12"
|
||||
sleep 5
|
||||
done
|
||||
fi
|
||||
# ###############################################################################
|
||||
# # Check for scp command
|
||||
# ###############################################################################
|
||||
#
|
||||
# if ! command -v scp >/dev/null 2>&1; then
|
||||
# echo "Install scp"
|
||||
# sed -i 's|http://|https://|g' /etc/apk/repositories
|
||||
# for i in {1..12}; do
|
||||
# if apk add --no-cache openssh-client; then
|
||||
# break
|
||||
# fi
|
||||
#
|
||||
# echo "Retry $i/12"
|
||||
# sleep 5
|
||||
# done
|
||||
# fi
|
||||
|
||||
|
||||
|
||||
@@ -138,27 +138,15 @@ if [[ "$CATEGORY" != *arr* && "$CATEGORY" != "mytorrents" ]]; then
|
||||
# Copy torrent to mediahost
|
||||
###############################################################################
|
||||
|
||||
basename_root=$(basename "$ROOT_PATH")
|
||||
echo $basename_root
|
||||
if [ "$basename_root" = "downloads" ]; then
|
||||
remote_dir="$TORRENT_NAME"
|
||||
else
|
||||
remote_dir="$basename_root"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "--- Copying torrent to mediahost ---"
|
||||
echo "Source: $ROOT_PATH"
|
||||
echo "Destination: mediahost:/torrent/qbittorrent/mediahost/"
|
||||
|
||||
ssh -i /config/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
|
||||
lucas@mediahost "mkdir -p \"/torrent/qbittorrent/mediahost/$remote_dir\""
|
||||
SSH_STATUS=$?
|
||||
scp -i /config/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
|
||||
-r "$ROOT_PATH"/. lucas@mediahost:/torrent/qbittorrent/mediahost/$remote_dir/
|
||||
SCP_STATUS=$?
|
||||
cp -r "$ROOT_PATH" /mediahost/
|
||||
CP_STATUS=$?
|
||||
|
||||
echo "scp exit status: $SCP_STATUS"
|
||||
echo "scp exit status: $CP_STATUS"
|
||||
|
||||
###############################################################################
|
||||
# Result
|
||||
@@ -170,13 +158,8 @@ if [[ "$CATEGORY" != *arr* && "$CATEGORY" != "mytorrents" ]]; then
|
||||
if [[ $MQTT_STATUS -ne 0 ]]; then
|
||||
echo "WARNING: torrent_mqtt.py failed."
|
||||
fi
|
||||
if [[ $SSH_STATUS -eq 0 ]]; then
|
||||
echo "Target Dir generated"
|
||||
else
|
||||
echo "ERROR: Target dir generation failed."
|
||||
fi
|
||||
|
||||
if [[ $SCP_STATUS -eq 0 ]]; then
|
||||
if [[ $CP_STATUS -eq 0 ]]; then
|
||||
echo "Torrent transfer completed successfully."
|
||||
else
|
||||
echo "ERROR: Torrent transfer failed."
|
||||
@@ -185,7 +168,7 @@ if [[ "$CATEGORY" != *arr* && "$CATEGORY" != "mytorrents" ]]; then
|
||||
echo "Finished: $(date +'%y%m%d %H%M%Sr')"
|
||||
echo "=================================================="
|
||||
else
|
||||
echo "ARR handled torrent: $(date +'%y%m%d %H%M%S'): $TORRENT_NAME"
|
||||
echo "ARR handled torrent: $(date +'%y%m%d %H%M%S'): $TORRENT_NAME:$CATEGORY"
|
||||
fi
|
||||
|
||||
# Return SCP's exit status to qBittorrent
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Use this configuration with WireGuard client
|
||||
#
|
||||
[Interface]
|
||||
Address = 10.14.0.2/16
|
||||
PrivateKey = mKeDQdxtM1iFJS7WLlb2jPGabZIt3NkoA/nGCcNOU1I=
|
||||
DNS = 162.252.172.57, 149.154.159.92
|
||||
[Peer]
|
||||
PublicKey = d3ldwEjnFcbLwD1o8uC5xC3DaSNek8DGeTpOb/h/IE4=
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
Endpoint = 86.38.98.61:51820
|
||||
Loaded 100 of 288 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user