群晖Docker安装youtube-dl并设置v2代理

v2ray安装

  1. docker注册表搜若v2ray,下载v2ray/official

  2. 启用容器

高级设置/网络/使用与Docker Host相同的网络,勾选

  1. 终端/通过命令启动输入/bin/sh

  2. 编辑v2配置

vi /etc/v2ray/config.json

具体配置可从v2客户端导出,修改完成后,按一下Esc鍵跳出修改模式, 然後输入 “:wq” 保存离开。

我的配置参考:

{
  "policy": {
    "system": {
      "statsInboundUplink": true,
      "statsInboundDownlink": true
    }
  },
  "log": {
    "access": "",
    "error": "",
    "loglevel": "warning"
  },
  "inbounds": [
    {
      "tag": "proxy",
      "port": 10808,
      "listen": "0.0.0.0",
      "protocol": "socks",
      "sniffing": {
        "enabled": true,
        "destOverride": [
          "http",
          "tls"
        ]
      },
      "settings": {
        "auth": "noauth",
        "udp": true,
        "ip": null,
        "address": null,
        "clients": null
      },
      "streamSettings": null
    },
    {
      "tag": "api",
      "port": 56392,
      "listen": "127.0.0.1",
      "protocol": "dokodemo-door",
      "sniffing": null,
      "settings": {
        "auth": null,
        "udp": false,
        "ip": null,
        "address": "127.0.0.1",
        "clients": null
      },
      "streamSettings": null
    }
  ],
  "outbounds": [
    {
      "tag": "proxy",
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "v2.213.name",
            "port": 80,
            "users": [
              {
                "id": "db3e422e-44aa-4b37-aab6-3c65d3749c3d",
                "alterId": 16,
                "email": "213@213.name",
                "security": "auto"
              }
            ]
          }
        ],
        "servers": null,
        "response": null
      },
      "streamSettings": {
        "network": "ws",
        "security": null,
        "tlsSettings": null,
        "tcpSettings": null,
        "kcpSettings": null,
        "wsSettings": {
          "connectionReuse": true,
          "path": "/api",
          "headers": null
        },
        "httpSettings": null,
        "quicSettings": null
      },
      "mux": {
        "enabled": true
      }
    },
    {
      "tag": "direct",
      "protocol": "freedom",
      "settings": {
        "vnext": null,
        "servers": null,
        "response": null
      },
      "streamSettings": null,
      "mux": null
    },
    {
      "tag": "block",
      "protocol": "blackhole",
      "settings": {
        "vnext": null,
        "servers": null,
        "response": {
          "type": "http"
        }
      },
      "streamSettings": null,
      "mux": null
    }
  ],
  "stats": {},
  "api": {
    "tag": "api",
    "services": [
      "StatsService"
    ]
  },
  "dns": null,
  "routing": {
    "domainStrategy": "IPIfNonMatch",
    "rules": [
      {
        "type": "field",
        "port": null,
        "inboundTag": "api",
        "outboundTag": "api",
        "ip": null,
        "domain": null
      }
    ]
  }
}
  1. 重启容器

youtube-dl安装

  1. docker注册表搜索youtube-dl-nas下载

  2. 设置卷 downfolder映射到群晖本地目录

  3. 端口使用默认的8080:8080

  4. 环境变量添加:

MY_ID 你的用户名
MY_PW 你的密码
TZ 时区(Asia/Shanghai)
ALL_PROXY 代理配置(socks5://172.17.0.1:10808)
  1. 启用容器

  2. 浏览器访问

http://nas_ip:8080

其他

如果群晖也想使用代理,可以在计划任务中添加开机触发的用户自定义脚本:

export ALL_PROXY=socks5://172.17.0.1:10808

发表评论

[/0o0] [..^v^..] [0_0] [T.T] [=3-❤] [❤.❤] [^v^] [-.0] [!- -] [=x=] [→_→] [><] 更多 »
昵称

抢沙发~