mirror of
https://github.com/StepanovPlaton/HomeServerServices.git
synced 2026-04-03 12:20:43 +04:00
init
This commit is contained in:
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
**/.env
|
||||||
|
!.env.example
|
||||||
|
|
||||||
|
syncthing/config/*
|
||||||
|
transmission/config/*
|
||||||
|
|
||||||
|
!.keep
|
||||||
6
autossh/.env.example
Normal file
6
autossh/.env.example
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
SSH_HOST=192.168.32.1
|
||||||
|
SSH_USER=user
|
||||||
|
SSH_PASSWORD=password
|
||||||
|
SSH_PORT=22
|
||||||
|
SSH_TUNNEL_FROM=1080
|
||||||
|
SSH_TUNNEL_TO=1443
|
||||||
7
autossh/Dockerfile
Normal file
7
autossh/Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
FROM jnovack/autossh:2.1.0
|
||||||
|
|
||||||
|
# Устанавливаем sshpass для работы с паролями
|
||||||
|
RUN apk add --no-cache sshpass
|
||||||
|
|
||||||
|
# Переопределяем входную точку, чтобы использовать sshpass
|
||||||
|
ENTRYPOINT ["/usr/bin/sshpass", "-e", "autossh"]
|
||||||
29
autossh/docker-compose.yml
Normal file
29
autossh/docker-compose.yml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
services:
|
||||||
|
autossh:
|
||||||
|
build: .
|
||||||
|
container_name: autossh
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "${SSH_TUNNEL_TO}:${SSH_TUNNEL_TO}"
|
||||||
|
|
||||||
|
environment:
|
||||||
|
# Пароль берется из переменной SSHPASS (для sshpass)
|
||||||
|
- SSHPASS=${SSH_PASSWORD:?}
|
||||||
|
|
||||||
|
# Настройки AutoSSH
|
||||||
|
- AUTOSSH_LOGFILE=/dev/stdout
|
||||||
|
- AUTOSSH_GATETIME=30
|
||||||
|
- AUTOSSH_POLL=60
|
||||||
|
# Отключает мониторинг через доп. порт (использует эхо SSH)
|
||||||
|
- AUTOSSH_PORT=0
|
||||||
|
|
||||||
|
command: >
|
||||||
|
-M 0
|
||||||
|
-N
|
||||||
|
|
||||||
|
-o StrictHostKeyChecking=no
|
||||||
|
-o ServerAliveInterval=60
|
||||||
|
-o ServerAliveCountMax=3
|
||||||
|
|
||||||
|
-L 0.0.0.0:${SSH_TUNNEL_TO:?}:localhost:${SSH_TUNNEL_FROM}
|
||||||
|
${SSH_USER}@${SSH_HOST} -p ${SSH_PORT}
|
||||||
3
grafana/.env.example
Normal file
3
grafana/.env.example
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
GRAFANA_PORT=3000
|
||||||
|
GRAFANA_USER=user
|
||||||
|
GRAFANA_PASSWORD=password
|
||||||
57
grafana/docker-compose.yml
Normal file
57
grafana/docker-compose.yml
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
services:
|
||||||
|
prometheus:
|
||||||
|
image: prom/prometheus:latest
|
||||||
|
container_name: prometheus
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
||||||
|
- prometheus_data:/prometheus
|
||||||
|
command:
|
||||||
|
- '--config.file=/etc/prometheus/prometheus.yml'
|
||||||
|
- '--storage.tsdb.path=/prometheus'
|
||||||
|
# ports:
|
||||||
|
# - "9090:9090"
|
||||||
|
networks:
|
||||||
|
- grafana_network
|
||||||
|
|
||||||
|
grafana:
|
||||||
|
image: grafana/grafana:latest
|
||||||
|
container_name: grafana
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- ${GRAFANA_PORT:?}:3000
|
||||||
|
volumes:
|
||||||
|
- ./grafana:/etc/grafana/provisioning
|
||||||
|
- grafana_data:/var/lib/grafana
|
||||||
|
environment:
|
||||||
|
- GF_SECURITY_ADMIN_USER=${GRAFANA_USER:?} # Ваш логин
|
||||||
|
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:?} # Ваш пароль
|
||||||
|
networks:
|
||||||
|
- grafana_network
|
||||||
|
|
||||||
|
node-exporter:
|
||||||
|
image: prom/node-exporter:latest
|
||||||
|
container_name: node-exporter
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- /proc:/host/proc:ro
|
||||||
|
- /sys:/host/sys:ro
|
||||||
|
- /:/rootfs:ro
|
||||||
|
command:
|
||||||
|
- '--path.procfs=/host/proc'
|
||||||
|
- '--path.rootfs=/rootfs'
|
||||||
|
- '--path.sysfs=/host/sys'
|
||||||
|
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
|
||||||
|
- '--collector.systemd'
|
||||||
|
# ports:
|
||||||
|
# - "9100:9100"
|
||||||
|
networks:
|
||||||
|
- grafana_network
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
prometheus_data:
|
||||||
|
grafana_data:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
grafana_network:
|
||||||
|
driver: bridge
|
||||||
10
grafana/grafana/dashboards/dashboards.yaml
Normal file
10
grafana/grafana/dashboards/dashboards.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: 1
|
||||||
|
providers:
|
||||||
|
- name: 'DefaultDashboards'
|
||||||
|
orgId: 1
|
||||||
|
folder: ''
|
||||||
|
type: file
|
||||||
|
disableDeletion: false
|
||||||
|
updateIntervalSeconds: 10
|
||||||
|
options:
|
||||||
|
path: /etc/grafana/provisioning/dashboards
|
||||||
23899
grafana/grafana/dashboards/node_exporter_dash.json
Normal file
23899
grafana/grafana/dashboards/node_exporter_dash.json
Normal file
File diff suppressed because it is too large
Load Diff
8
grafana/grafana/datasources/datasource.yaml
Normal file
8
grafana/grafana/datasources/datasource.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
apiVersion: 1
|
||||||
|
datasources:
|
||||||
|
- name: Prometheus
|
||||||
|
type: prometheus
|
||||||
|
url: http://prometheus:9090
|
||||||
|
isDefault: true
|
||||||
|
access: proxy
|
||||||
|
editable: true
|
||||||
11
grafana/prometheus.yml
Normal file
11
grafana/prometheus.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
global:
|
||||||
|
scrape_interval: 15s
|
||||||
|
|
||||||
|
scrape_configs:
|
||||||
|
- job_name: 'prometheus'
|
||||||
|
static_configs:
|
||||||
|
- targets: ['prometheus:9090']
|
||||||
|
|
||||||
|
- job_name: 'node_exporter'
|
||||||
|
static_configs:
|
||||||
|
- targets: ['node-exporter:9100']
|
||||||
1
portainer/.env.example
Normal file
1
portainer/.env.example
Normal file
@@ -0,0 +1 @@
|
|||||||
|
PORTAINER_PORT=9443
|
||||||
17
portainer/docker-compose.yml
Normal file
17
portainer/docker-compose.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
services:
|
||||||
|
portainer:
|
||||||
|
image: portainer/portainer-ce:latest
|
||||||
|
container_name: portainer
|
||||||
|
restart: always
|
||||||
|
security_opt:
|
||||||
|
- no-new-privileges:true
|
||||||
|
volumes:
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
- portainer_data:/data
|
||||||
|
ports:
|
||||||
|
- "9443:9443"
|
||||||
|
- "8000:8000"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
portainer_data:
|
||||||
7
powersave_mode.sh
Executable file
7
powersave_mode.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
sudo apt update
|
||||||
|
sudo apt install linux-cpupower
|
||||||
|
|
||||||
|
sudo cpupower frequency-set -g ondemand
|
||||||
|
|
||||||
|
echo "===== CPU FREQUENCY INFO ====="
|
||||||
|
cpupower frequency-info
|
||||||
10
samba/.env.example
Normal file
10
samba/.env.example
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
SHARED_FOLDER=/path/to/folder
|
||||||
|
|
||||||
|
OWNER_USERID=1000
|
||||||
|
OWNER_GROUPID=1000
|
||||||
|
|
||||||
|
SMB_USER=user
|
||||||
|
SMD_PASSWORD=password
|
||||||
|
|
||||||
|
NET_NAME=Storage
|
||||||
|
READONLY_NET_NAME=ReadonlyStorage
|
||||||
19
samba/docker-compose.yml
Normal file
19
samba/docker-compose.yml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
services:
|
||||||
|
samba:
|
||||||
|
image: dperson/samba
|
||||||
|
container_name: samba
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "139:139"
|
||||||
|
- "445:445"
|
||||||
|
volumes:
|
||||||
|
- ${SHARED_FOLDER:?}:/mnt/shared
|
||||||
|
environment:
|
||||||
|
- TZ=Europe/Samara
|
||||||
|
- USERID=${OWNER_USERID:?} # UID вашего пользователя в Linux (id -u)
|
||||||
|
- GROUPID=${OWNER_GROUPID:?} # GID вашего пользователя в Linux (id -g)
|
||||||
|
|
||||||
|
command: >
|
||||||
|
-u "${SMB_USER:?};${SMB_PASSWORD:?}"
|
||||||
|
-s "${READONLY_NET_NAME:?};/mnt/shared;yes;yes;yes"
|
||||||
|
-s "${NET_NAME:?};/mnt/shared;yes;no;no;${SMB_USER:?}"
|
||||||
6
syncthing/.env.example
Normal file
6
syncthing/.env.example
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
OWNER_USERID=1000
|
||||||
|
OWNER_GROUPID=1000
|
||||||
|
|
||||||
|
SYNCTHING_HOSTNAME=host
|
||||||
|
SYNCTHING_WEB_UI_PORT=8384
|
||||||
|
SYNCTHING_FOLDER=/path/to/folder
|
||||||
0
syncthing/config/.keep
Normal file
0
syncthing/config/.keep
Normal file
17
syncthing/docker-compose.yml
Normal file
17
syncthing/docker-compose.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
services:
|
||||||
|
syncthing:
|
||||||
|
image: syncthing/syncthing:latest
|
||||||
|
container_name: syncthing
|
||||||
|
hostname: ${SYNCTHING_HOSTNAME:?} # Имя устройства в сети Syncthing
|
||||||
|
environment:
|
||||||
|
- PUID=${OWNER_USERID} # ID пользователя в системе (можно узнать командой id)
|
||||||
|
- PGID=${OWNER_GROUPID} # ID группы в системе
|
||||||
|
volumes:
|
||||||
|
- ./config:/var/syncthing/config # Конфигурация и база данных
|
||||||
|
- ${SYNCTHING_FOLDER}:/var/syncthing/Sync # Папка с данными (путь на хосте:путь в контейнере)
|
||||||
|
ports:
|
||||||
|
- ${SYNCTHING_WEB_UI_PORT}:8384 # Web GUI (управление через браузер)
|
||||||
|
- 22000:22000/tcp # Передача данных
|
||||||
|
- 22000:22000/udp # Передача данных (QUIC)
|
||||||
|
- 21027:21027/udp # Локальный поиск (Discovery)
|
||||||
|
restart: unless-stopped
|
||||||
10
transmission/.env.example
Normal file
10
transmission/.env.example
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
OWNER_USERID=1000
|
||||||
|
OWNER_GROUPID=1000
|
||||||
|
|
||||||
|
TRANSMISSION_USER=user
|
||||||
|
TRANSMISSION_PASSWORD=password
|
||||||
|
|
||||||
|
TRANSMISSION_DOWNLOADS=/path/to/downloads
|
||||||
|
TRANSMISSION_WATCH=/path/to/watch
|
||||||
|
|
||||||
|
TRANSMISSION_WEB_UI_PORT=9091
|
||||||
0
transmission/config/.keep
Normal file
0
transmission/config/.keep
Normal file
24
transmission/docker-compose.yml
Normal file
24
transmission/docker-compose.yml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
services:
|
||||||
|
transmission:
|
||||||
|
image: lscr.io/linuxserver/transmission:latest
|
||||||
|
container_name: transmission
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 1G
|
||||||
|
environment:
|
||||||
|
- PUID=${OWNER_USERID:?}
|
||||||
|
- PGID=${OWNER_GROUPID:?}
|
||||||
|
- TZ=Europe/Samara
|
||||||
|
- USER=${TRANSMISSION_USER:?}
|
||||||
|
- PASS=${TRANSMISSION_PASSWORD:?}
|
||||||
|
# - WHITELIST=127.0.0.1,192.168.1.* # Список разрешенных IP (опционально)
|
||||||
|
volumes:
|
||||||
|
- ./config:/config
|
||||||
|
- ${TRANSMISSION_DOWNLOADS:?}:/downloads
|
||||||
|
- ${TRANSMISSION_WATCH:?}:/watch # Добавляет автоматически все torrent файлы из этой папки
|
||||||
|
ports:
|
||||||
|
- ${TRANSMISSION_WEB_UI_PORT}:9091 # Веб-интерфейс
|
||||||
|
- 51413:51413 # Порт для входящих соединений (TCP)
|
||||||
|
- 51413:51413/udp # Порт для входящих соединений (UDP)
|
||||||
|
restart: unless-stopped
|
||||||
Reference in New Issue
Block a user