2021年3月

{
  "log": {
    "access": "",
    "error": "",
    "loglevel": "warning"
  },
  "inbounds": [
    {
      "port": 10808,
      "protocol": "socks",
      "settings": {
        "auth": "noauth",
        "udp": true,
        "userLevel": 8
      },
      "sniffing": {
        "destOverride": [
          "http",
          "tls"
        ],
        "enabled": true
      },
      "tag": "socks"
    },
    {
      "port": 10809,
      "protocol": "http",
      "settings": {
        "userLevel": 8
      },
      "tag": "http"
    }
  ],
  "outbounds": [
    {
      "tag": "proxy",
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "xxx.kele.xxx",
            "port": 443,
            "users": [
              {
                "id": "999999999999999999999999999999999",
                "alterId": 64,
                "email": "t@t.tt",
                "security": "auto"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "ws",
        "security": "tls",
        "tlsSettings": {
          "allowInsecure": false
        },
        "wsSettings": {
          "path": "/xxxxxx/"
        }
      },
      "mux": {
        "enabled": false,
        "concurrency": -1
      }
    },
    {
      "tag": "direct",
      "protocol": "freedom",
      "settings": {}
    },
    {
      "tag": "block",
      "protocol": "blackhole",
      "settings": {
        "response": {
          "type": "http"
        }
      }
    }
  ],
  "routing": {
    "domainStrategy": "IPIfNonMatch",
    "rules": [
      {
        "type": "field",
        "inboundTag": [
          "api"
        ],
        "outboundTag": "api"
      }
    ]
  }
}

网上有教程,但是都有或多或少的瑕疵。这里总结一份。
我这里是先安装的oneinstack。

我用的是root用户,当前目录/root/

mkdir /opt/seafile
wget https://seafile-downloads.oss-cn-shanghai.aliyuncs.com/seafile-server_7.1.5_x86-64.tar.gz
mv seafile-server_* /opt/seafile
cd /opt/seafile

将 seafile-server_* 移动到 seafile 目录下后

tar -xzf seafile-server_*
mkdir installed
mv seafile-server_* installed
apt install tree
tree ../seafile -L 2

我用的是Debian 10

apt-get update
apt-get install python3 python3-setuptools python3-pip python3-ldap -y
pip3 install --timeout=3600 Pillow pylibmc captcha jinja2 sqlalchemy psd-tools
pip3 install django-pylibmc django-simple-captcha

cd seafile-server-*
./setup-seafile-mysql.sh  #运行安装脚本并回答预设问题
#nginx配置文件
  location / {
     proxy_pass         http://127.0.0.1:8000;
     proxy_set_header   Host $host;
     proxy_set_header   X-Real-IP $remote_addr;
     proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_set_header   X-Forwarded-Host $server_name;
     proxy_read_timeout  1200s;
     # used for view/edit office file via Office Online Server
     client_max_body_size 0;
  }
  location /seafhttp {
    rewrite ^/seafhttp(.*)$ $1 break;
    proxy_pass http://127.0.0.1:8082;
    client_max_body_size 0;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_connect_timeout  36000s;
    proxy_read_timeout  36000s;
    proxy_send_timeout  36000s;
    send_timeout  36000s;
    proxy_request_buffering off;
  }

  location /media {
    root /opt/seafile/seafile-server-latest/seahub;
  }

下面这部分要注释掉

  #location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
  #  expires 30d;
  #  access_log off;
  #}
  #location ~ .*\.(js|css)?$ {
  #  expires 7d;
  #  access_log off;
  #}
  #location ~ /(\.user\.ini|\.ht|\.git|\.svn|\.project|LICENSE|README\.md) {
  #  deny all;
  #}

添加用户和组

groupadd seafile
useradd -d /opt/seafile/ -g seafile -s /bin/false seafile

更改权限

chown -R seafile:seafile /opt/seafile/*
chown -R seafile:seafile /tmp/seahub_cache/

编辑开机启动服务

vim /etc/systemd/system/seahub.service

内容:

[Unit]
Description=Seafile hub
After=network.target seafile.service

[Service]
# change start to start-fastcgi if you want to run fastcgi
ExecStart=/opt/seafile/seafile-server-latest/seahub.sh start
ExecStop=/opt/seafile/seafile-server-latest/seahub.sh stop
User=seafile
Group=seafile
Type=oneshot
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

然后:

vim /etc/systemd/system/seafile.service

内容:

[Unit]
Description=Seafile
# add mysql.service or postgresql.service depending on your database to the line below
After=network.target

[Service]
Type=oneshot
ExecStart=/opt/seafile/seafile-server-latest/seafile.sh start
ExecStop=/opt/seafile/seafile-server-latest/seafile.sh stop
RemainAfterExit=yes
User=seafile
Group=seafile

[Install]
WantedBy=multi-user.target

这就完成了。

https://downloads.openwrt.org/snapshots/targets/ramips/mt7621/openwrt-ramips-mt7621-linksys_ea7500-v2-initramfs-kernel.bin
https://downloads.openwrt.org/snapshots/targets/ramips/mt7621/openwrt-ramips-mt7621-linksys_ea7500-v2-squashfs-factory.bin
https://downloads.openwrt.org/snapshots/targets/ramips/mt7621/openwrt-ramips-mt7621-linksys_ea7500-v2-squashfs-sysupgrade.bin

不容易。周末搞搞试试。

节目名称和ID
http://m.miguvideo.com/wap/resource/migu/miguH5/liveList.jsp

获取某个频道的M3U8播放地址
https://www.miguvideo.com/gateway/playurl/v1/play/playurl?contId=608807420&rateType=3
https://yk.miguvideo.com/playurl/v1/play/playurlh5?contId=608807420&rateType=3 这个接口可以看720P,取决于源,有的源有,有的源只有最高540

https://www.miguvideo.com/wap/resource/pc/data/miguData.jsp
剧集的介绍。

EPG
http://live.miguvideo.com/live/v2/tv-programs-data/617290047/20210318

因为默认的检测URL是google的。
众所周知,google域名在国内时不时的会被墙。

GET /generate_204 HTTP/1.1
Connection: close
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.32 Safari/537.36
Host: connectivitycheck.gstatic.com
Accept-Encoding: gzip, deflate
这是我抓到的包

所以有时候,明明连接上网络,还是提示网络受限。moto的官方社区也有人发现这个问题了。
https://mclub.lenovo.com.cn/thread-7682109-1-1.html

解决办法,更改这个URL为其他的。步骤如下:
1,开启usb调试。版本号连按7次,开发者选项,开启USB调试。
2,本地装ADB。
3,ADB命令:
adb shell "settings put global captive_portal_http_url http://www.google.cn/generate_204";
adb shell "settings put global captive_portal_https_url https://www.google.cn/generate_204";
改成google中国的域名就好了。或者改成其他的也行:

http://connectivitycheck.platform.hicloud.com/generate_204 这个是华为的
http://pms.mb.qq.com/rsp204 腾讯的
https://connect.rom.miui.com/generate_204 小米的
http://wifi.vivo.com.cn/generate_204 VIVO的。
你要问联想的哪个?我还真不知道。