Browse Source

autopt Dockerfile

hongwenjun 4 năm trước cách đây
mục cha
commit
43be123af1
5 tập tin đã thay đổi với 189 bổ sung0 xóa
  1. 14 0
      pt/Dockerfile
  2. 65 0
      pt/config-example.json
  3. 65 0
      pt/goseeder.conf
  4. 5 0
      pt/start.sh
  5. 40 0
      pt/supervisord.conf

+ 14 - 0
pt/Dockerfile

@@ -0,0 +1,14 @@
+FROM  debian
+RUN   apt update -y && apt install -y  ca-certificate supervisor wget    \
+  &&  wget https://raw.githubusercontent.com/hongwenjun/vps_setup/master/pt/start.sh  \
+  &&  wget https://raw.githubusercontent.com/hongwenjun/vps_setup/master/pt/goseeder.conf  \  
+  &&  wget https://raw.githubusercontent.com/hongwenjun/vps_setup/master/pt/supervisord.conf  \ 
+  &&  wget https://github.com/nickfox-taterli/goseeder/releases/download/v1.1/gostat   \
+  &&  wget https://github.com/nickfox-taterli/goseeder/releases/download/v1.1/goseeder  \
+  &&  chmod +x  /start.sh   &&   chmod +x goseeder   &&   chmod +x gostat  \
+  &&  ln -s  /goseeder.conf      /etc/goseeder.conf   \
+  &&  ln -s  /supervisord.conf   /etc/supervisord.conf \
+  &&  mv /goseeder  /usr/bin/goseeder  &&  mv /gostat  /usr/bin/gostat
+ 
+
+CMD ["/start.sh"]

+ 65 - 0
pt/config-example.json

@@ -0,0 +1,65 @@
+{
+  "dbserver": "mongodb+srv://username:[email protected]/?retryWrites=true&w=majority", // (请在正式配置中不要包含此注释) => 数据库
+  "node": [
+    {
+      "source": "www.nicept.net",
+      "passkey": "21232f297a57a5a743894a0e4a801fc3",
+      "limit": 10,
+      "enable": true,
+      "rule": {
+        "seeder_time": 0,
+        "seeder_ratio": 0,
+        "speed_limit": 8.0
+      }
+    },
+    {
+      "source": "pt.btschool.club", // (请在正式配置中不要包含此注释) => 网站域名
+      "passkey": "21232f297a57a5a743894a0e4a801fc3", // (请在正式配置中不要包含此注释) => 密钥
+      "limit": 10, // (请在正式配置中不要包含此注释) => 每次抓取数量,过多可能会D挂PT站
+      "enable": true, // (请在正式配置中不要包含此注释) => 如果为false,则这个配置暂时不用
+      "rule": {
+        "seeder_time": 86400, // (请在正式配置中不要包含此注释) => 该站有HR,限制最小做种86400秒
+        "seeder_ratio": 1.2, // (请在正式配置中不要包含此注释) => 该站有HR,限制分享率1.2
+        "speed_limit": 10.0 // (请在正式配置中不要包含此注释) => 该站限速10.0MB/s
+      }
+    }
+  ],
+  "server": [
+    {
+      "endpoint": "http://173.82.120.1:8080", // (请在正式配置中不要包含此注释) => QB服务器地址
+      "username": "admin", // (请在正式配置中不要包含此注释) => QB用户名
+      "password": "adminadmin", // (请在正式配置中不要包含此注释) => QB密码
+      "remark": "Cloudcone (250G)", // (请在正式配置中不要包含此注释) => 服务器别名
+      "enable": false, // (请在正式配置中不要包含此注释) => 如果false则不使能
+      "rule": {
+        "concurrent_download": 1, // (请在正式配置中不要包含此注释) => 同时下载限制:1个
+        "disk_threshold": 10.0, // (请在正式配置中不要包含此注释) => 10GB
+        "disk_overcommit": true, // (请在正式配置中不要包含此注释) => 是否可超量安排任务(如果盘小推荐关闭)
+        "max_speed": 50.00, // (请在正式配置中不要包含此注释) => 当服务器当前速度大于50MB/s时不再安排任务,避免TOS.
+        "min_alivetime": 3600, // (请在正式配置中不要包含此注释) => 种子在服务器最短存活时间3600秒,小于这个时间即使空间不足也不会删除.
+        "max_alivetime": 86400, // (请在正式配置中不要包含此注释) => 种子在服务器最长存货时间86400秒,大于这个时间的不活跃内容会被自动删除.
+        "min_tasksize": 1.0, // (请在正式配置中不要包含此注释) => 添加的最小种子1GB,太小的话IO太密集.
+        "max_tasksize": 200.0,// (请在正式配置中不要包含此注释) => 添加的最大种子200GB,太大话刷的效率低.
+        "max_disklatency": 10000 // (请在正式配置中不要包含此注释) => 磁盘延迟大于10000就不要添加种子,添进去怕也下不动..
+      }
+    },
+    {
+      "endpoint": "http://173.82.120.2:8080",
+      "username": "admin",
+      "password": "TaterLi1024",
+      "remark": "Cloudcone (500G)",
+      "enable": false,
+      "rule": {
+        "concurrent_download": 1,
+        "disk_threshold": 10.0,
+        "disk_overcommit": true,
+        "max_speed": 50.00,
+        "min_alivetime": 3600,
+        "max_alivetime": 86400,
+        "min_tasksize": 0.0,
+        "max_tasksize": 400.0,
+        "max_disklatency": 10000
+      }
+    }
+  ]
+}

+ 65 - 0
pt/goseeder.conf

@@ -0,0 +1,65 @@
+{
+  "dbserver": "mongodb+srv://username:[email protected]/?retryWrites=true&w=majority",
+  "node": [
+    {
+      "source": "www.nicept.net",
+      "passkey": "21232f297a57a5a743894a0e4a801fc3",
+      "limit": 10,
+      "enable": true,
+      "rule": {
+        "seeder_time": 0,
+        "seeder_ratio": 0,
+        "speed_limit": 8.0
+      }
+    },
+    {
+      "source": "pt.btschool.club",
+      "passkey": "21232f297a57a5a743894a0e4a801fc3",
+      "limit": 10,
+      "enable": true,
+      "rule": {
+        "seeder_time": 86400,
+        "seeder_ratio": 1.2,
+        "speed_limit": 10.0
+      }
+    }
+  ],
+  "server": [
+    {
+      "endpoint": "http://173.82.120.1:8080",
+      "username": "admin",
+      "password": "adminadmin",
+      "remark": "Cloudcone (250G)",
+      "enable": false,
+      "rule": {
+        "concurrent_download": 1,
+        "disk_threshold": 10.0,
+        "disk_overcommit": true,
+        "max_speed": 50.00,
+        "min_alivetime": 3600,
+        "max_alivetime": 86400,
+        "min_tasksize": 1.0,
+        "max_tasksize": 200.0,
+        "max_disklatency": 10000
+      }
+    },
+    {
+      "endpoint": "http://173.82.120.2:8080",
+      "username": "admin",
+      "password": "TaterLi1024",
+      "remark": "Cloudcone (500G)",
+      "enable": false,
+      "rule": {
+        "concurrent_download": 1,
+        "disk_threshold": 10.0,
+        "disk_overcommit": true,
+        "max_speed": 50.00,
+        "min_alivetime": 3600,
+        "max_alivetime": 86400,
+        "min_tasksize": 0.0,
+        "max_tasksize": 400.0,
+        "max_disklatency": 10000
+      }
+    }
+  ]
+}

+ 5 - 0
pt/start.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+# Start supervisord and services
+exec /usr/bin/supervisord -n -c /etc/supervisord.conf
+

+ 40 - 0
pt/supervisord.conf

@@ -0,0 +1,40 @@
+[unix_http_server]
+file=/dev/shm/supervisor.sock   ; (the path to the socket file)
+
+[supervisord]
+logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
+logfile_maxbytes=50MB        ; (max main logfile bytes b4 rotation;default 50MB)
+logfile_backups=10           ; (num of main logfile rotation backups;default 10)
+loglevel=info                ; (log level;default info; others: debug,warn,trace)
+pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
+nodaemon=false               ; (start in foreground if true;default false)
+minfds=1024                  ; (min. avail startup file descriptors;default 1024)
+minprocs=200                 ; (min. avail process descriptors;default 200)
+user=root                    ;
+
+; the below section must remain in the config file for RPC
+; (supervisorctl/web interface) to work, additional interfaces may be
+; added by defining them in separate rpcinterface: sections
+[rpcinterface:supervisor]
+supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
+
+[supervisorctl]
+serverurl=unix:///dev/shm/supervisor.sock ; use a unix:// URL  for a unix socket
+
+[program:Go-Seeder-Service]
+command = /usr/bin/goseeder
+autostart=true
+autorestart=true
+priority=5
+stdout_events_enabled=true
+stderr_events_enabled=true
+stdout_logfile=/dev/stdout
+stdout_logfile_maxbytes=0
+stderr_logfile=/dev/stderr
+stderr_logfile_maxbytes=0
+stopsignal=QUIT
+
+
+[include]
+files = /etc/supervisor/conf.d/*.conf
+