From d3dc97ad2becb1b40eba690aa8bf1d6afa1827c1 Mon Sep 17 00:00:00 2001 From: Zedhugh Chen Date: Tue, 6 Oct 2026 02:41:11 +0800 Subject: [PATCH 1/4] =?UTF-8?q?ansible:=20=E6=9B=B4=E6=96=B0=20vault=20?= =?UTF-8?q?=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ansible/vars/vault.yaml | 65 +++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/ansible/vars/vault.yaml b/ansible/vars/vault.yaml index 8b2aa37..71b06f9 100644 --- a/ansible/vars/vault.yaml +++ b/ansible/vars/vault.yaml @@ -1,33 +1,34 @@ $ANSIBLE_VAULT;1.1;AES256 -66663436363739383134313731346531623330346566326665386432313337326465356131333431 -3163636630313866616338646337643134386564376430630a336364626338613031313635346430 -64373039396132633361323438306630306663333066633733643266376138636537366336343439 -3131323430616566370a343661313836333635326131653536313063626264366239323033323931 -32656230306137373039636537373435663234363665646463626138626639643035383638373734 -63323138396365643861383235326262356536623138663035373437366131383430636339363461 -62303365396538633766353339643864633736323863666436373464376565303835383663396232 -37653239613663653632323232313331353736643935333437313563346463336165333331376433 -37646466623764306138363762663362656237653339373061633765653234363166366132306438 -33356333343234363165653635626632306531653464636462373738623330306162363861306661 -39353530663763363865336435343334336638373135313539663730323732393533306362303934 -34396632356436393234383761613539393235643936323563336531623763323565333865633134 -39393733363463336362333266333035326439613438306435336135346366336264376433393930 -35383539653863656338383666336263653333383133383738666235306563396637396664303936 -37306538626231336535656266663362343166386531613137616430666433663236343265626266 -64363334366564653665663837376238396665653663646139346536636530326261323035616362 -32306465633731313731623533323938303533376336313039656662656534643338353139663636 -33383966613430316333333630353232336461333130643634663237633835356433636661316432 -65666434616534313736393736646330363963613235333030346461626662313635656238346638 -34326263363131356465373066316464366532343165373466656132386433363466633237636432 -38383636653061396263373639643037656462623636323938353631396431663964323131636166 -65383236393961396630353963303562363535376665666136346466666236366333393564633432 -65353136663930643364343134623066623035363862366564623931663362653161653934303665 -66643234343138343866623163373033626462666263656535643830613837333632653962333231 -31393565386631353635383834366465613137623836313362663032393831653164626131393163 -39663636346163366533363063643232326537363936613362633031643863373838363330616330 -39386461333263356139346261633933636235623831333630326662616630646166323763663031 -64333735633633323030303030636539323235623833383832313935376430346365613864373038 -30653935333434353233373735313433376535616238383330306535306563326563316663333461 -37636262356334633836623763613338363237666535376361363237363562353037366262333562 -33393633386637616531376166623536336564343630643632313961636632393438636136383236 -39623838393432636631 +31326665376531376630356363393661653431613931326234643966653463393735366564323734 +3730396363393537306239663835373062306633646264310a343665376130396339333637346439 +38396237326237363265616437653564636436313732303365376630643033356166336236383831 +3837356238653537380a633130376466623963613361653738353665376239323864323430623063 +39343862633838333834303936346365666236653731346532336132383461316162666666656565 +65643731353635383037353132313534376466653031366133646332383830336662636263373566 +65393466306639363439303165353032666635323131633536643862643533666463313839383361 +33363434666532366666633935353466383134643731376236346661653765643830326537386630 +31656437653935636130356566616436346564306364343538306138353364633135333565393462 +37353037343861346438613430643561666462663831303332376238386135636538653431636466 +39633033613166316465313462656262343032303430346133386663623930376237633065656263 +35313263316466346437353237373538383632326534656365376630396136646530653165316637 +61333262386361326562353136393433663633663362326564386238366333656330343561323730 +36383761313864316135353332306134636661383430316538326436653436386430333762656134 +33373234386365663836356430366633316262646538636237303636636635373335336534373630 +38363131373666613430373031393036636632626338326436323635366462396639396661306439 +35663138346163306561393262323366636264386130313165383836353936633634613930656133 +39323330373232313265366565353061663665613365396166373734386432353931313638333466 +65333732333133613866313363356133353965323966373132326535383464303262353665636537 +34333237353365303136366338613664363936613063636663303861383161616337613532363162 +63353066646563353964623734636236613530636564393537633461336263303565376337653435 +38626230666430383533646561396232356665623962663334393461633365633839323866343031 +30333239666437626439373236663535373664326337333864656237333963616139653031313430 +34306336663533313536383435626161336130623333303034666235393266343935363466313431 +36653566396535656434346132313165626264313236363734306531316438656666333532343638 +30613432343834373166313063663333663930386636306165346536636336393438323464396635 +34393263633266356635623834306239663634323430313765323635626666633337663936636465 +34316637623736353239343430383366343063656430346230393538653834633364343830336435 +37313461626334346130343766363364643636643865383931376635333532363165343932616632 +39663665383833646131326534643737323364343033633135383333643136616532323931333439 +61326338636637353266383463383365383364663330653565386566353434303232643738343037 +62613065333961383136656236636234623338343466333232363861323034633738343035633535 +3733 From a6f134eada167f7193a2263ca9d9403b12359689 Mon Sep 17 00:00:00 2001 From: Zedhugh Chen Date: Tue, 6 Oct 2026 02:42:13 +0800 Subject: [PATCH 2/4] =?UTF-8?q?ansible:=20=E5=B0=86=20TCP=20=E6=8B=A5?= =?UTF-8?q?=E5=A1=9E=E6=8E=A7=E5=88=B6=E7=AE=97=E6=B3=95=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=88=B0=20BBR=20=E6=8F=90=E5=8F=96=E6=88=90=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=20role?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ansible/ansible.cfg | 1 + ansible/playbooks/vps_debian_provision.yaml | 10 +++------- ansible/roles/bbr/README.org | 9 +++++++++ ansible/roles/bbr/handlers/main.yaml | 4 ++++ ansible/roles/bbr/tasks/config.yaml | 15 +++++++++++++++ ansible/roles/bbr/tasks/main.yaml | 4 ++++ ansible/roles/bbr/tasks/module.yaml | 13 +++++++++++++ ansible/roles/bbr/tasks/verify.yaml | 19 +++++++++++++++++++ 8 files changed, 68 insertions(+), 7 deletions(-) create mode 100644 ansible/roles/bbr/README.org create mode 100644 ansible/roles/bbr/handlers/main.yaml create mode 100644 ansible/roles/bbr/tasks/config.yaml create mode 100644 ansible/roles/bbr/tasks/main.yaml create mode 100644 ansible/roles/bbr/tasks/module.yaml create mode 100644 ansible/roles/bbr/tasks/verify.yaml diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg index eb870e3..349fcee 100644 --- a/ansible/ansible.cfg +++ b/ansible/ansible.cfg @@ -1,2 +1,3 @@ [defaults] inventory = ./inventory.ini +roles_path = ./roles \ No newline at end of file diff --git a/ansible/playbooks/vps_debian_provision.yaml b/ansible/playbooks/vps_debian_provision.yaml index 5570432..10799d1 100644 --- a/ansible/playbooks/vps_debian_provision.yaml +++ b/ansible/playbooks/vps_debian_provision.yaml @@ -12,14 +12,10 @@ timezone: Asia/Shanghai ssh_public_key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}" - tasks: - - name: 启用 BBR - sysctl: - name: net.ipv4.tcp_congestion_control - value: bbr - sysctl_set: yes - reload: yes + roles: + - role: bbr + tasks: - name: 设置时区 timezone: name: "{{ timezone }}" diff --git a/ansible/roles/bbr/README.org b/ansible/roles/bbr/README.org new file mode 100644 index 0000000..e992b94 --- /dev/null +++ b/ansible/roles/bbr/README.org @@ -0,0 +1,9 @@ +#+title: TCP 拥塞控制算法设置为 BBR + +这个 role 是为了将服务器上的 linux 系统的 TCP 拥塞控制算法设置为 BBR 以提供更好的网络环境, +主要时提高吞吐量,降低延迟和提升弱网稳定性。 + +最开始是使用 =ansible= 的 =sysctl= 模块实现的,配置是写入 =/etc/sysctl.conf= 的,但后面发现重启机器后配置未生效。 + +查询原因发现是 =systemd-sysctl= 不会读取 =/etc/sysctl.conf= ,读取的是 =/etc/sysctl.d= 目录下的配置文件。 +因此配置方式改为手动写入配置文件,不再直接使用 ansible 的 sysctl 模块。 diff --git a/ansible/roles/bbr/handlers/main.yaml b/ansible/roles/bbr/handlers/main.yaml new file mode 100644 index 0000000..629143c --- /dev/null +++ b/ansible/roles/bbr/handlers/main.yaml @@ -0,0 +1,4 @@ +--- +- name: reload sysctl + command: sysctl --system + changed_when: false diff --git a/ansible/roles/bbr/tasks/config.yaml b/ansible/roles/bbr/tasks/config.yaml new file mode 100644 index 0000000..3e2d342 --- /dev/null +++ b/ansible/roles/bbr/tasks/config.yaml @@ -0,0 +1,15 @@ +--- +- name: 启用 BBR + copy: + dest: /etc/sysctl.d/bbr.conf + content: | + net.core.default_qdisc=fq + net.ipv4.tcp_congestion_control=bbr + mode: '0644' + owner: root + group: root + notify: reload sysctl + +- name: 应用 sysctl 配置 + command: sysctl --system + changed_when: false diff --git a/ansible/roles/bbr/tasks/main.yaml b/ansible/roles/bbr/tasks/main.yaml new file mode 100644 index 0000000..5d54a0d --- /dev/null +++ b/ansible/roles/bbr/tasks/main.yaml @@ -0,0 +1,4 @@ +--- +- import_tasks: config.yaml +- import_tasks: module.yaml +- import_tasks: verify.yaml diff --git a/ansible/roles/bbr/tasks/module.yaml b/ansible/roles/bbr/tasks/module.yaml new file mode 100644 index 0000000..5669215 --- /dev/null +++ b/ansible/roles/bbr/tasks/module.yaml @@ -0,0 +1,13 @@ +--- +- name: 开机加载 tcp_bbr 模块 + copy: + dest: /etc/modules-load.d/bbr.conf + content: "tcp_bbr\n" + mode: '0644' + owner: root + group: root + +- name: 立即加载 tcp_bbr 模块 + modprobe: + name: tcp_bbr + state: present diff --git a/ansible/roles/bbr/tasks/verify.yaml b/ansible/roles/bbr/tasks/verify.yaml new file mode 100644 index 0000000..ac1ce2b --- /dev/null +++ b/ansible/roles/bbr/tasks/verify.yaml @@ -0,0 +1,19 @@ +--- +- name: 获取可用的 TCP 拥塞控制算法列表 + command: sysctl net.ipv4.tcp_available_congestion_control + register: available_cc + changed_when: false + +- name: 确认 bbr 在可用列表中 + fail: + msg: "BBR 不在可用的 TCP 拥塞控制算法列表中" + when: "'bbr' not in available_cc.stdout" + +- name: 验证当前拥塞控制算法 + command: sysctl net.ipv4.tcp_congestion_control + register: current_cc + changed_when: false + +- name: 打印当前 TCP 拥塞控制算法 + debug: + msg: "当前 TPC 拥塞控制算法: {{ current_cc.stdout }}" From ab396a2603b84d251e1f935a6cfca043ae719177 Mon Sep 17 00:00:00 2001 From: Zedhugh Chen Date: Wed, 7 Oct 2026 07:05:46 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BB=A3=E7=90=86=E7=AD=96=E7=95=A5?= =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/README.org | 13 +++++++------ dot/.bashrc.d/proxy.bash | 2 +- dot/.mozilla/autoproxy.pac | 3 ++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docker/README.org b/docker/README.org index eaca0d2..5dc9256 100644 --- a/docker/README.org +++ b/docker/README.org @@ -4,13 +4,14 @@ * 文件用途 -| 文件 | 说明 | -|----------------------+--------------------------------| -| y480.yaml | 家用服务器 docker compose 配置 | -| xray-config.json | xray 服务器配置 | -| V2RayA-RoutingA.conf | V2rayA 路由配置 | +| 文件 | 说明 | +|----------------------+---------------------------| +| v2raya.yaml | V2rayA 代理客户端容器配置 | +| V2RayA-RoutingA.conf | V2rayA 路由配置 | +| webdav.yaml | webdav 服务容器配置 | +| webdav-config.yaml | webdav 配置文件 | * docker 镜像对应的 git 仓库 -- https://github.com/ronggang/OWSS +- https://github.com/hacdias/webdav - https://github.com/v2rayA/v2rayA diff --git a/dot/.bashrc.d/proxy.bash b/dot/.bashrc.d/proxy.bash index a81abfc..abe5229 100644 --- a/dot/.bashrc.d/proxy.bash +++ b/dot/.bashrc.d/proxy.bash @@ -1,4 +1,4 @@ -proxy_ip="192.168.0.104" +proxy_ip="127.0.0.1" proxy_http_port="20172" # SOCKS_PROXY="socks5://${PROXY_IP}:20170" diff --git a/dot/.mozilla/autoproxy.pac b/dot/.mozilla/autoproxy.pac index 5a26104..7d400d2 100644 --- a/dot/.mozilla/autoproxy.pac +++ b/dot/.mozilla/autoproxy.pac @@ -1,5 +1,5 @@ /* -*- mode: js; -*- */ -const proxy_ip = "192.168.0.104" +const proxy_ip = "127.0.0.1" const PROXY = `SOCKS5 ${proxy_ip}:20170; HTTP ${proxy_ip}:20172; DIRECT`; const DIRECT = 'DIRECT'; @@ -7,6 +7,7 @@ const direct_ip_list = [ ["192.168.0.0", "255.255.255.0"], ["192.168.1.0", "255.255.255.0"], ["192.168.2.0", "255.255.255.0"], + ["192.168.5.0", "255.255.255.0"], ["127.0.0.1", "255.255.255.0"], ]; From d794a17f8b3fd6121a7893b327a0bfa692edfedf Mon Sep 17 00:00:00 2001 From: Zedhugh Chen Date: Wed, 7 Oct 2026 07:08:49 +0800 Subject: [PATCH 4/4] =?UTF-8?q?gentoo=5Fportage:=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E9=83=A8=E5=88=86=E8=BD=AF=E4=BB=B6=E7=9A=84=20accept=5Fkeywor?= =?UTF-8?q?ds=20=E5=92=8C=20use=20flag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gentoo_portage/package.accept_keywords | 4 ++-- gentoo_portage/package.use | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gentoo_portage/package.accept_keywords b/gentoo_portage/package.accept_keywords index 9bfc672..e2d2e50 100644 --- a/gentoo_portage/package.accept_keywords +++ b/gentoo_portage/package.accept_keywords @@ -20,8 +20,8 @@ dev-util/android-studio ~amd64 net-vpn/frp ~amd64 # firefox -dev-libs/nspr ~amd64 -dev-libs/nss ~amd64 +# dev-libs/nspr ~amd64 +# dev-libs/nss ~amd64 www-client/firefox ~amd64 # wechat diff --git a/gentoo_portage/package.use b/gentoo_portage/package.use index 3d16ac6..849942d 100644 --- a/gentoo_portage/package.use +++ b/gentoo_portage/package.use @@ -71,7 +71,7 @@ net-fs/samba client net-libs/ngtcp2 gnutls # mpv -media-video/mpv bluray dvd nvenc pipewire -vulkan +media-video/mpv bluray dvd nvenc pipewire # pdf-tools need poppler-glib library app-text/poppler cairo