主要用到的软件
frpc adguardhome aria2 transmission qbittorrent smb alist tyyd mihomo zerotier pmail hivision_idphotosn k8m
主要目录 /opt
数据目录 /mnt
默认在 /opt 目录下执行
frpc
1 | docker run --restart=always --network host -d -v ./frp/frpc.toml:/etc/frp/frpc.toml --name frpc snowdreamtech/frpc |
frpc.toml 信息
1 | serverAddr = "xxx.com" |
有公网IP的机器搭建
frps.toml1
2
3
4
5
6
7
8
9
10
11
12imwl@tj:/opt/frp$ cat frps.toml
bindPort = 80
subdomainHost = "xxx.com"
auth.method = "token"
auth.token = "frpPass123"
vhostHTTPPort = 80
vhostHTTPSPort = 443
webServer.port = 8080
webServer.addr = "0.0.0.0"
webServer.user = "itswl"
webServer.password = "frpPass123"
aria2
1 | docker run -d \ |
网页界面1
2
3
4
5
6docker run -d \
--name ariang \
--log-opt max-size=1m \
--restart unless-stopped \
-p 6880:6880 \
p3terx/ariang
k8m
docker-compose.yaml
1 | services: |
transmission
1 | docker run \ |
ui 界面1
解压 UI界面 https://github.com/transmission-web-control/transmission-web-control/releases/download/v1.6.33/dist.zip 到 /transmission-web-control/web
qbittorrent
1 | docker run -d \ |
docker logs -f qbittorrent 查看admin密码
alist
1 | docker run -d --restart=always -v ./alist:/opt/alist/data -v /mnt:/mnt -p \ |
nginx.conf
1 |
|
flatnotes
1 | docker run -d \ |
新增文件 flatnotes.conf
1 | server { |
docker kvm 安装 windows
需要 cpu 支持 kvm egrep -c '(vmx|svm)' /proc/cpuinfo
输出值大于 0
1 | docker run -it -d --name win11 \ |
macos (感觉性能不太行)
1 | docker run -itd --name sonoma -e VERSION="sonoma" \ |
filebrowser
主要用于文件上传下载分享1
2
3
4
5
6
7# 拷贝文件
cd ./filebrowser
docker run --rm -itd -p 80:8080 --name filebrowser-temp -v ./:/srv filebrowser/filebrowser
docker cp filebrowser-temp:/database.db ./database.db
docker cp filebrowser-temp:/.filebrowser.json ./.filebrowser.json
docker run -itd -v ./data:/srv -v ./.database.db:/database.db -v ./.filebrowser.json:/.filebrowser.json -u 0:0 --net host --name filebrowser filebrowser/filebrowser
spug
docker-compose.yml1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32version: "3.3"
services:
db:
image: mariadb:10.8.2
container_name: spug-db
restart: always
command: --port 3306 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
volumes:
- ./spug/mysql:/var/lib/mysql
environment:
- MYSQL_DATABASE=spug
- MYSQL_USER=spug
- MYSQL_PASSWORD=spug.cc
- MYSQL_ROOT_PASSWORD=spug.cc
spug:
image: openspug/spug-service
container_name: spug
privileged: true
restart: always
volumes:
- ./spug/service:/data/spug
- ./spug/repos:/data/repos
ports:
- "82:80"
environment:
- MYSQL_DATABASE=spug
- MYSQL_USER=spug
- MYSQL_PASSWORD=spug.cc
- MYSQL_HOST=db
- MYSQL_PORT=3306
depends_on:
- db
nextcloud + onlyoffice
使用 docker-compose1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46services:
db:
image: mariadb:10.6
restart: always
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
volumes:
- ./db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=Wl19950707
- MYSQL_PASSWORD=Wl19950707
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
redis:
image: redis:alpine
restart: always
volumes:
- ./redis:/data
app:
image: nextcloud
restart: always
ports:
- 8088:80
links:
- db
- redis
volumes:
- ./app:/var/www/html
environment:
- MYSQL_PASSWORD=Wl19950707
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db
- REDIS_HOST=redis
documentserver:
image: 186184848/documentserver
restart: always
ports:
- 88:80
volumes:
- ./documentServer/logs:/var/log/onlyoffice
- ./documentServer/data:/var/www/onlyoffice/Data
environment:
- JWT_ENABLED=false
需要加载一下 字体
mihomo
1 | docker run --name mihomo -d \ |
推荐使用 system 二进制
mihomo.service1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16[Unit]
Description=mihomo Daemon, Another Clash Kernel.
After=network.target NetworkManager.service systemd-networkd.service iwd.service
[Service]
Type=simple
LimitNPROC=500
LimitNOFILE=1000000
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SYS_TIME CAP_SYS_PTRACE CAP_DAC_READ_SEARCH
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SYS_TIME CAP_SYS_PTRACE CAP_DAC_READ_SEARCH
Restart=always
ExecStartPre=/usr/bin/sleep 1s
ExecStart=/usr/local/bin/mihomo -d /opt/mihomo
ExecReload=/bin/kill -HUP $MAINPID
[Install]
1 | /etc/systemd/resolved.conf 修改 DNSStubListener=no |
添加 iptables 规则,tun 模式
1 | iptables -P FORWARD ACCEPT |
添加 ui
1 | git clone https://github.com/metacubex/metacubexd.git -b gh-pages /opt/mihomo/ui |
config.yaml 新增
1 | external-ui: '/ui' |
it-tools
1 | docker run -d --name it-tools --restart always -p 18080:80 corentinth/it-tools:latest |
samba
1 | apt -y install samba |
共享目录配置 /etc/samba/smb.conf
1 |
|
创建用户
1 | smbpasswd -a root |
tyyd
建议使用 二进制安装
ttyd.service
1 |
|
zerotier
1 | docker run --name myzerotier-client -d --restart=always --cap-add=SYS_ADMIN --cap-add NET_ADMIN --net=host --device /dev/net/tun zerotier/zerotier:latest zerotiernetid |
推荐使用脚本安装
1 | curl -s 'https://raw.githubusercontent.com/zerotier/ZeroTierOne/main/doc/contact%40zerotier.com.gpg' | gpg --import && \ |
代理局域网设备
1 | sysctl -w net.ipv4.ip_forward=1 |
执行 iptables 规则1
2
3sudo iptables -t nat -A POSTROUTING -o $PHY_IFACE -j MASQUERADE
sudo iptables -A FORWARD -i $PHY_IFACE -o $ZT_IFACE -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i $ZT_IFACE -o $PHY_IFACE -j ACCEPT
常用开发服务
数据库,监控服务1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43docker run -d \
--name=postgres \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_USER=postgres \
-e POSTGRES_DB=postgres \
-v /opt/postgres/data:/var/lib/postgresql/data \
-p 5432:5432 \
postgres
docker run -d \
--name=mysql \
-e MYSQL_ROOT_PASSWORD=yourpassword \
-e MYSQL_DATABASE=yourdatabase \
-e MYSQL_USER=yourusername \
-e MYSQL_PASSWORD=yourpassword \
-v /opt/mysql/data:/var/lib/mysql \
-p 3306:3306 \
mysql
docker run -d \
--name=redis \
-v /opt/redis/data:/data \
-p 6379:6379 \
redis
docker run -d \
--name=prometheus \
-v /opt/prometheus/config/prometheus.yml:/etc/prometheus/prometheus.yml \
-v /opt/prometheus/data:/prometheus \
-p 9090:9090 \
prom/prometheus
# -v /opt/prometheus/grafana/grafana.ini:/etc/grafana/grafana.ini \
docker run -p 3000:3000 --name grafana \
-v /opt/prometheus/grafana/data:/var/lib/grafana \
-e "GF_SECURITY_ADMIN_PASSWORD=grafana123" \
-itd grafana/grafana
docker run -d --name node-exporter --restart=always -p 9100:9100 -v "/proc:/host/proc:ro" -v "/sys:/host/sys:ro" -v "/:/rootfs:ro" prom/node-exporter
adguardhome
双 adguardhome1
2docker run -d --name adguardhome1 -v ./adguardhome/work1:/opt/adguardhome/work -v ./adguardhome/conf1:/opt/adguardhome/conf --net=host --restart=always adguard/adguardhome
docker run -d --name adguardhome2 -v ./adguardhome/work2:/opt/adguardhome/work -v ./adguardhome/conf2:/opt/adguardhome/conf --net=host --restart=always adguard/adguardhome
conf1/AdGuardHome.yaml1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199http:
pprof:
port: 6060
enabled: false
address: 0.0.0.0:3001
session_ttl: 720h
users:
- name: admin
password: $2a$10$ZLthKbjuIi5RS6dAPy7Ome3JOL8UynIlj53oIjCDV/TIieYX0Liqq
auth_attempts: 5
block_auth_min: 15
http_proxy: ""
language: ""
theme: auto
dns:
bind_hosts:
- 0.0.0.0
port: 531
anonymize_client_ip: false
ratelimit: 0
ratelimit_subnet_len_ipv4: 24
ratelimit_subnet_len_ipv6: 56
ratelimit_whitelist: []
refuse_any: true
upstream_dns:
- https://dns.alidns.com/dns-query
- https://doh.pub/dns-query
- tls://dot.360.cn:853
- https://doh.360.cn/dns-query
- https://223.5.5.5/dns-query
- https://223.6.6.6/dns-query
upstream_dns_file: ""
bootstrap_dns:
- 114.114.114.114
- 223.5.5.5
fallback_dns: []
upstream_mode: parallel
fastest_timeout: 1s
allowed_clients: []
disallowed_clients: []
blocked_hosts:
- version.bind
- id.server
- hostname.bind
trusted_proxies:
- 127.0.0.0/8
- ::1/128
cache_size: 4194304
cache_ttl_min: 0
cache_ttl_max: 0
cache_optimistic: false
bogus_nxdomain: []
aaaa_disabled: false
enable_dnssec: false
edns_client_subnet:
custom_ip: ""
enabled: false
use_custom: false
max_goroutines: 300
handle_ddr: true
ipset: []
ipset_file: ""
bootstrap_prefer_ipv6: false
upstream_timeout: 10s
private_networks: []
use_private_ptr_resolvers: true
local_ptr_upstreams: []
use_dns64: false
dns64_prefixes: []
serve_http3: false
use_http3_upstreams: false
serve_plain_dns: true
hostsfile_enabled: true
tls:
enabled: false
server_name: ""
force_https: false
port_https: 443
port_dns_over_tls: 853
port_dns_over_quic: 853
port_dnscrypt: 0
dnscrypt_config_file: ""
allow_unencrypted_doh: false
certificate_chain: ""
private_key: ""
certificate_path: ""
private_key_path: ""
strict_sni_check: false
querylog:
dir_path: ""
ignored: []
interval: 2160h
size_memory: 1000
enabled: true
file_enabled: true
statistics:
dir_path: ""
ignored: []
interval: 24h
enabled: true
filters:
- enabled: true
url: https://adguardteam.github.io/HostlistsRegistry/assets/filter_1.txt
name: AdGuard DNS filter
id: 1
- enabled: true
url: https://adguardteam.github.io/HostlistsRegistry/assets/filter_37.txt
name: No Google
id: 1717654057
- enabled: true
url: https://adguardteam.github.io/HostlistsRegistry/assets/filter_21.txt
name: 'CHN: anti-AD'
id: 1717654058
- enabled: true
url: https://easylist-downloads.adblockplus.org/easylistchina.txt
name: easylistchina
id: 1717654059
- enabled: true
url: https://raw.githubusercontent.com/jdlingyu/ad-wars/master/hosts
name: 大圣净化
id: 1717654061
- enabled: true
url: https://raw.githubusercontent.com/googlehosts/hosts/master/hosts-files/hosts
name: Google Host
id: 1717654062
- enabled: true
url: https://raw.githubusercontent.com/217heidai/adblockfilters/main/rules/adblockdns.txt
name: adblock
id: 1717654063
whitelist_filters: []
user_rules: []
dhcp:
enabled: false
interface_name: ""
local_domain_name: lan
dhcpv4:
gateway_ip: ""
subnet_mask: ""
range_start: ""
range_end: ""
lease_duration: 86400
icmp_timeout_msec: 1000
options: []
dhcpv6:
range_start: ""
lease_duration: 86400
ra_slaac_only: false
ra_allow_slaac: false
filtering:
blocking_ipv4: ""
blocking_ipv6: ""
blocked_services:
schedule:
time_zone: UTC
ids: []
protection_disabled_until: null
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
blocking_mode: default
parental_block_host: family-block.dns.adguard.com
safebrowsing_block_host: standard-block.dns.adguard.com
rewrites: []
safebrowsing_cache_size: 1048576
safesearch_cache_size: 1048576
parental_cache_size: 1048576
cache_time: 30
filters_update_interval: 168
blocked_response_ttl: 10
filtering_enabled: true
parental_enabled: false
safebrowsing_enabled: false
protection_enabled: true
clients:
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
persistent: []
log:
file: ""
max_backups: 0
max_size: 100
max_age: 3
compress: false
local_time: false
verbose: false
os:
group: ""
user: ""
rlimit_nofile: 0
schema_version: 28
conf2/AdGuardHome.yaml1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195cat AdGuardHome.yaml
http:
pprof:
port: 6060
enabled: false
address: 0.0.0.0:3002
session_ttl: 720h
users:
- name: admin
password: $2a$10$ZLthKbjuIi5RS6dAPy7Ome3JOL8UynIlj53oIjCDV/TIieYX0Liqq
auth_attempts: 5
block_auth_min: 15
http_proxy: ""
language: ""
theme: auto
dns:
bind_hosts:
- 0.0.0.0
port: 532
anonymize_client_ip: false
ratelimit: 20
ratelimit_subnet_len_ipv4: 24
ratelimit_subnet_len_ipv6: 56
ratelimit_whitelist: []
refuse_any: true
upstream_dns:
- https://dns.cloudflare.com/dns-query
- https://dns.google/dns-query
- tls://dns.google:853
- tls://1.1.1.1:853
- tls://1.1.1.1/dns-query
- https://1.1.1.1/dns-query
- tls://dns11.quad9.net
- https://dns11.quad9.net/dns-query
- https://jp.tiarap.org/dns-query
- https://jp.tiar.app/dns-query
- tls://8.8.8.8/dns-query
- tls://8.8.4.4/dns-query
upstream_dns_file: ""
bootstrap_dns:
- 1.1.1.1
- 9.9.9.10
- 8.8.8.8
fallback_dns: []
upstream_mode: parallel
fastest_timeout: 1s
allowed_clients: []
disallowed_clients: []
blocked_hosts:
- version.bind
- id.server
- hostname.bind
trusted_proxies:
- 127.0.0.0/8
- ::1/128
cache_size: 10487600
cache_ttl_min: 60
cache_ttl_max: 86400
cache_optimistic: true
bogus_nxdomain: []
aaaa_disabled: false
enable_dnssec: false
edns_client_subnet:
custom_ip: ""
enabled: false
use_custom: false
max_goroutines: 300
handle_ddr: true
ipset: []
ipset_file: ""
bootstrap_prefer_ipv6: false
upstream_timeout: 10s
private_networks: []
use_private_ptr_resolvers: true
local_ptr_upstreams: []
use_dns64: false
dns64_prefixes: []
serve_http3: false
use_http3_upstreams: false
serve_plain_dns: true
hostsfile_enabled: true
tls:
enabled: false
server_name: ""
force_https: false
port_https: 443
port_dns_over_tls: 853
port_dns_over_quic: 853
port_dnscrypt: 0
dnscrypt_config_file: ""
allow_unencrypted_doh: false
certificate_chain: ""
private_key: ""
certificate_path: ""
private_key_path: ""
strict_sni_check: false
querylog:
dir_path: ""
ignored: []
interval: 2160h
size_memory: 1000
enabled: true
file_enabled: true
statistics:
dir_path: ""
ignored: []
interval: 24h
enabled: true
filters:
- enabled: true
url: https://adguardteam.github.io/HostlistsRegistry/assets/filter_1.txt
name: AdGuard DNS filter
id: 1
- enabled: true
url: https://adguardteam.github.io/HostlistsRegistry/assets/filter_21.txt
name: 'CHN: anti-AD'
id: 1717654066
- enabled: true
url: https://adguardteam.github.io/HostlistsRegistry/assets/filter_29.txt
name: 'CHN: AdRules DNS List'
id: 1717654067
- enabled: true
url: https://fastly.jsdelivr.net/gh/huangwb8/bloghelper@latest/others/chndomains_For_Adblock.txt
name: List 1717654069
id: 1717654069
whitelist_filters: []
user_rules: []
dhcp:
enabled: false
interface_name: ""
local_domain_name: lan
dhcpv4:
gateway_ip: ""
subnet_mask: ""
range_start: ""
range_end: ""
lease_duration: 86400
icmp_timeout_msec: 1000
options: []
dhcpv6:
range_start: ""
lease_duration: 86400
ra_slaac_only: false
ra_allow_slaac: false
filtering:
blocking_ipv4: ""
blocking_ipv6: ""
blocked_services:
schedule:
time_zone: UTC
ids: []
protection_disabled_until: null
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
blocking_mode: default
parental_block_host: family-block.dns.adguard.com
safebrowsing_block_host: standard-block.dns.adguard.com
rewrites: []
safebrowsing_cache_size: 1048576
safesearch_cache_size: 1048576
parental_cache_size: 1048576
cache_time: 30
filters_update_interval: 24
blocked_response_ttl: 10
filtering_enabled: true
parental_enabled: false
safebrowsing_enabled: false
protection_enabled: true
clients:
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
persistent: []
log:
file: ""
max_backups: 0
max_size: 100
max_age: 3
compress: false
local_time: false
verbose: false
os:
group: ""
user: ""
rlimit_nofile: 0
schema_version: 28