Docker
https://docs.docker.com/engine/install/ubuntu/
Shadowsocks
https://hub.docker.com/r/teddysun/shadowsocks-libev
cat > /etc/shadowsocks-libev/config.json <<EOF
{
"server":"0.0.0.0",
"server_port":9000,
"password":"M6617",
"timeout":300,
"method":"chacha20-ietf-poly1305",
"fast_open":false,
"nameserver":"8.8.8.8",
"mode":"tcp_and_udp"
}
EOFsudo docker run -d -p 3387:9000 -p 3387:9000/udp --name ss-libev --restart=always -v /etc/shadowsocks-libev:/etc/shadowsocks-libev teddysun/shadowsocks-libev
Uptime Kuma
sudo docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1Nginx
如果还没有安装 Nginx,可以使用以下命令进行安装:
sudo apt-get update
sudo apt-get install nginx安装完成后,确认 Nginx 服务已经启动并在监听 80 端口:
sudo systemctl status nginx如果显示 Active: active (running),说明 Nginx 正在运行。 对于较新的 Debian/Ubuntu,可以直接使用官方的软件包安装 Certbot 及其 Nginx 插件:
sudo apt-get install certbot python3-certbot-nginx如果还没有为你的域名新建 Nginx 配置文件,可以参考下面示例。
在 /etc/nginx/sites-available/ 中新建或编辑对应配置文件(如 wavenotes.moreae.stream.conf),内容示例如下:
server {
listen 80;
listen [::]:80;
server_name wavenotes.moreae.stream;
root /var/www/wavenotes.moreae.stream;
# 站点根目录,可根据实际情况修改
index index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
}sudo mkdir -p /var/www/wavenotes.moreae.stream
sudo sh -c 'echo "<h1>Hello from wavenotes.moreae.stream</h1>" > /var/www/wavenotes.moreae.stream/index.html'sudo ln -s /etc/nginx/sites-available/wavenotes.moreae.stream.conf /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx此时,访问 http://wavenotes.moreae.stream 应能看到你新放的测试内容。
sudo certbot --nginx -d wavenotes.moreae.streamsudo certbot renew --dry-run
IP update
services:
cloudflare-ddns:
image: favonia/cloudflare-ddns:latest
# Choose the appropriate tag based on your need:
# - "latest" for the latest stable version (which could become 2.x.y
# in the future and break things)
# - "1" for the latest stable version whose major version is 1
# - "1.x.y" to pin the specific version 1.x.y
network_mode: host
# This bypasses network isolation and makes IPv6 easier (optional; see below)
restart: always
# Restart the updater after reboot
user: "1000:1000"
# Run the updater with specific user and group IDs (in that order).
# You can change the two numbers based on your need.
read_only: true
# Make the container filesystem read-only (optional but recommended)
cap_drop: [all]
# Drop all Linux capabilities (optional but recommended)
security_opt: [no-new-privileges:true]
# Another protection to restrict superuser privileges (optional but recommended)
environment:
- CLOUDFLARE_API_TOKEN=aptuou8gHeQSj-U714puoHCc-4m3mXMjNeLTNcAy
# Your Cloudflare API token
- DOMAINS=wavenotes.moreae.stre
# Your domains (separated by commas)
- PROXIED=true
# Tell Cloudflare to cache webpages and hide your IP (optional)
#networks:
# LAN0:
# external: true
# name: LAN0
# Introduce custom Docker networks to the 'services' in this file. A common use case
# for this is binding one of the 'services' to a specific network interface available at
# Docker's host. This section is required for the 'networks' section of each 'services'.docker-compose pull cloudflare-ddns
docker-compose up --detach --build cloudflare-ddns