https://www.bilibili.com/video/BV1ji4y1v7tw/?vd_source=9f0823ff116001b3a2b5ee6adadd2e2f
https://openwrt.org/docs/guide-developer/toolchain/install-buildsystem

https://github.com/jiay-shi/openwrt?tab=readme-ov-file
https://github.com/kiddin9/openwrt-packages
https://dl.openwrt.ai/23.05/packages/arm_cortex-a7/kiddin9/
https://github.com/kenzok8/openwrt-packages
git clone https://github.com/openwrt/openwrt 官方版本
git clone https://github.com/coolsnowwolf/lede lede版本
git clone -b 22.03 --single-branch https://github.com/Lienol/openwrt lienol版本
https://github.com/OldCoding/openwrt_packit_arm/blob/main/immo_diy.sh
https://www.right.com.cn/FORUM/thread-8378388-1-1.html

获取源码

sudo apt update && sudo apt install -y build-essential libncurses5-dev gawk git subversion libssl-dev gettext zlib1g-dev file wget unzip python3
git clone -b ipq60xx-devel_nss https://github.com/JiaY-shi/openwrt.git && cd openwrt

方案一

echo "src-git packages https://git.openwrt.org/feed/packages.git
src-git luci https://git.openwrt.org/project/luci.git
src-git routing https://git.openwrt.org/feed/routing.git
src-git nss_packages https://github.com/JiaY-shi/nss-packages.git;k6.6
src-git passwall https://github.com/xiaorouji/openwrt-passwall.git
src-git passwall_packages https://github.com/xiaorouji/openwrt-passwall-packages.git
" > feeds.conf.default 

拉取包

./scripts/feeds update  -a && ./scripts/feeds install -a
sed -i 's/192.168.1.1/192.168.8.1/g' ./package/base-files/files/bin/config_generate

补丁-1

cd /data/ && git clone https://github.com/OldCoding/openwrt_packit_arm.git
echo 'cp /data/openwrt_packit_arm/patches/* /data/openwrt/feeds/packages/net/shadowsocks-libev/patches' >patch.sh && chmod 777 *.sh
./patch.sh

补丁-2

在 menuconfig 中取消选择 dnsmasq 并选择 dnsmasq-full:
导航到 Base system -> dnsmasq
取消选择 dnsmasq
选择 dnsmasq-full

配置并编译

cd openwrt && rm tmp/ -rf && rm .config
make menuconfig
make V=s -j1

# 多线程编译
make -j$(nproc)

权限问题

user: root

docker-compose.yml

version: "3"
services:
  rocketchat:
    image: registry.rocket.chat/rocketchat/rocket.chat:${RELEASE:-latest}
    container_name: sys_chat
    restart: always
    volumes:
      - ./uploads:/app/uploads
    labels:
      traefik.enable: "true"
      traefik.http.routers.rocketchat.rule: Host(`${DOMAIN:-}`)
      traefik.http.routers.rocketchat.tls: "true"
      traefik.http.routers.rocketchat.entrypoints: https
      traefik.http.routers.rocketchat.tls.certresolver: le
    environment:
      MONGO_URL: "${MONGO_URL:-\
        mongodb://${MONGODB_ADVERTISED_HOSTNAME:-mongodb}:${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017}/\
        ${MONGODB_DATABASE:-rocketchat}?replicaSet=${MONGODB_REPLICA_SET_NAME:-rs0}}"
      MONGO_OPLOG_URL: "${MONGO_OPLOG_URL:\
        -mongodb://${MONGODB_ADVERTISED_HOSTNAME:-mongodb}:${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017}/\
        local?replicaSet=${MONGODB_REPLICA_SET_NAME:-rs0}}"
      ROOT_URL: ${ROOT_URL:-http://localhost:${HOST_PORT:-3000}}
      PORT: ${PORT:-3000}
      DEPLOY_METHOD: docker
      DEPLOY_PLATFORM: ${DEPLOY_PLATFORM:-}
      REG_TOKEN: ${REG_TOKEN:-}
    depends_on:
      - mongodb
    expose:
      - ${PORT:-3000}
    ports:
      - "${BIND_IP:-0.0.0.0}:${HOST_PORT:-3000}:${PORT:-3000}"

  mongodb:
    image: docker.io/bitnami/mongodb:${MONGODB_VERSION:-5.0}
    container_name: sys_mongodb
    restart: always
    user: root
    volumes:
      - ./mongodb:/bitnami/mongodb
    environment:
      MONGODB_REPLICA_SET_MODE: primary
      MONGODB_REPLICA_SET_NAME: ${MONGODB_REPLICA_SET_NAME:-rs0}
      MONGODB_PORT_NUMBER: ${MONGODB_PORT_NUMBER:-27017}
      MONGODB_INITIAL_PRIMARY_HOST: ${MONGODB_INITIAL_PRIMARY_HOST:-mongodb}
      MONGODB_INITIAL_PRIMARY_PORT_NUMBER: ${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017}
      MONGODB_ADVERTISED_HOSTNAME: ${MONGODB_ADVERTISED_HOSTNAME:-mongodb}
      MONGODB_ENABLE_JOURNAL: ${MONGODB_ENABLE_JOURNAL:-true}
      ALLOW_EMPTY_PASSWORD: ${ALLOW_EMPTY_PASSWORD:-yes}

chat.conf

server {
  server_name     chat.wdzs.com;
  include         /common/wdzs.com.inc;
  sendfile        on;
  keepalive_timeout  65;
  client_max_body_size 10m;
#  access_log on;
# access_log  /var/log/nginx/srs.log  main;
  location / {
    root  /;
    proxy_pass  http://192.168.100.1:3000/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_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-Proto https;
    proxy_set_header X-Nginx-Proxy true;
    proxy_redirect off;
  }
}

https://github.com/seaweedfs/seaweedfs/wiki/Client-Libraries

docker-compose.yml

version: '3'

services:
  seaweedfs:
    container_name: sys_seaweedfs
    image: chrislusf/seaweedfs
    restart: always
    networks:
      - mynetwork
#    ports:
#      - "3002:9333"
#      - "3003:8080"
    volumes:
      - ./data:/data
    command: server
      - "-dir=/data"
      - "-filer=true"
networks:
  mynetwork:
    external: true

fs.wdzs.cn.conf

server {
  server_name     oss.wdzs.cn;
  sendfile        on;
  keepalive_timeout  65;
  client_max_body_size 100m;
  include         /common/all_api.inc;
  location / {
    root    /;   
#    proxy_pass   http://192.168.100.1:3003/;
    proxy_pass   http://seaweedfs:8080/;

    limit_except GET {
        deny all;
    }
  }
  location /upload/ {
    root    /;
#    proxy_pass   http://192.168.100.1:3002/;
    proxy_pass   http://seaweedfs:9333/;

    proxy_http_version 1.1;
    proxy_set_header Host $http_host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Proxy "";
    proxy_buffering on;     # GET buffering or “X-Accel-Buffering” enables or disables buffering of a response;
    proxy_buffers 64 1m;  # buffers used for reading a response from the proxied server, for a single connection
    proxy_buffer_size 8k; # maximum size of the data that nginx can receive from the server at a time is set
    proxy_busy_buffers_size 2m;

    proxy_request_buffering on;  # PUT buffering
    proxy_next_upstream error timeout non_idempotent http_500; # PUT request should be passed to the next server:
    proxy_connect_timeout 200ms;
    proxy_read_timeout    3s; #timeout is set only between two successive read operations
    proxy_send_timeout    3s; #timeout is set only between two successive write operations
  }
}

文件上传

curl -F "file=@711561.jpg" http://oss.wdzs.cn/upload/submit

文件删除

curl -X DELETE http://oss.wdzs.cn/4/0947f807b5/711561.jpg

文件访问

http://oss.wdzs.cn/4/0947f807b5/711561.jpg?width=800