|
6 | 6 | categories: |
7 | 7 | - 折腾 |
8 | 8 | date: 2023-06-17 19:12:49 |
9 | | -updated: 2025-08-25 21:46:26 |
| 9 | +updated: 2025-10-08 17:26:50 |
10 | 10 | toc: true |
11 | 11 | thumbnail: /2023/06/17/基于-Proxmox-VE-的-All-in-One-服务器搭建/proxmox-logo.svg |
12 | 12 | --- |
@@ -335,7 +335,7 @@ LXC 开销小,故尝试使用 LXC 安装 OpenWrt |
335 | 335 |
|
336 | 336 | 下载地址:<https://downloads.openwrt.org/> |
337 | 337 |
|
338 | | -我选择了 20.03.5 版本:<https://downloads.openwrt.org/releases/22.03.5/targets/x86/64/> |
| 338 | +我选择当时最新的稳定版本 22.03.5:<https://downloads.openwrt.org/releases/22.03.5/targets/x86/64/> |
339 | 339 |
|
340 | 340 | 下载 `rootfs.tar.xz` 即可,可以在下载时选择哈希校验。 |
341 | 341 |
|
@@ -629,6 +629,66 @@ uci commit |
629 | 629 | /etc/init.d/goauthing start |
630 | 630 | ``` |
631 | 631 |
|
| 632 | +**20251008 更新:** 上述 `goauthing@` 脚本会导致进程监测(如 htop)中明文暴露密码,故还是改为使用配置文件方式进行配置,虽然也是明文,但没有那么直接了()。 |
| 633 | + |
| 634 | +```shell /etc/init.d/goauthing |
| 635 | +#!/bin/sh /etc/rc.common |
| 636 | +# Authenticating utility for auth.tsinghua.edu.cn |
| 637 | +# This init script is used explicitly with OpenWRT |
| 638 | + |
| 639 | +USE_PROCD=1 |
| 640 | +START=96 |
| 641 | +PROG="/usr/bin/goauthing" |
| 642 | +CONF="/etc/goauthing.json" |
| 643 | + |
| 644 | +generate_command() { |
| 645 | + sleep 15 # Wait for link up |
| 646 | +CMD="\ |
| 647 | +\"$PROG\" -c \"$CONF\" -D deauth; \ |
| 648 | +sleep 1; \ |
| 649 | +\"$PROG\" -c \"$CONF\" -D auth; \ |
| 650 | +sleep 3; \ |
| 651 | +\"$PROG\" -c \"$CONF\" online; \ |
| 652 | +" |
| 653 | +} |
| 654 | + |
| 655 | +start_service() { |
| 656 | + generate_command |
| 657 | + procd_open_instance |
| 658 | + procd_set_param command sh |
| 659 | + procd_append_param command -c "$CMD" |
| 660 | + procd_set_param stderr 1 |
| 661 | + procd_set_param respawn |
| 662 | + procd_close_instance |
| 663 | +} |
| 664 | + |
| 665 | +stop_service() { |
| 666 | + "$PROG" -c "$CONF" -D deauth |
| 667 | +} |
| 668 | +``` |
| 669 | + |
| 670 | +```json /etc/goauthing.json |
| 671 | +{ |
| 672 | + "username": "xxx", |
| 673 | + "password": "xxx" |
| 674 | +} |
| 675 | +``` |
| 676 | + |
| 677 | +如果后续有服务的启动过程需要已经完成认证,可以添加一个启动项来等待认证完成: |
| 678 | + |
| 679 | +```shell /etc/init.d/wait_goauthing |
| 680 | +#!/bin/sh /etc/rc.common |
| 681 | +# Wait for goauthing to finish authentication |
| 682 | + |
| 683 | +START=97 |
| 684 | + |
| 685 | +start() { |
| 686 | + echo "Waiting for goauthing to finish authentication..." |
| 687 | + sleep 5 |
| 688 | + echo "Goauthing should be done now." |
| 689 | +} |
| 690 | +``` |
| 691 | + |
632 | 692 | #### 配置链路聚合 AP |
633 | 693 |
|
634 | 694 | 另购置了一台 Wi-Fi 6 无线路由器作为 AP,支持 2x2 MU-MIMO,160 MHz 频宽,理论带宽可达 2402 Mbps。 |
@@ -791,6 +851,12 @@ opkg install luci-i18n-wireguard-zh-cn |
791 | 851 | - 配置 Grafana 可视化路由运行状态、MosDNS 运行数据等 |
792 | 852 | - 配置 UDP 转发以及游戏优化 |
793 | 853 |
|
| 854 | +### 升级 OpenWrt |
| 855 | + |
| 856 | +对于软件包的升级,除了可以在 LuCI 中手动逐个升级外,还可以在命令行中先 `opkg update` 再 `opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade` 来一键升级所有可升级的软件包。 |
| 857 | + |
| 858 | +对于系统升级,可以 `opkg install luci-app-attendedsysupgrade` 后,在 LuCI 中使用 `系统` -> `值守式系统更新` 来升级。小版本升级似乎可以保留软件包和配置(装的已经是小版本最新,没试过),但是大版本升级则相当于重新安装了,需要重新配置。 |
| 859 | + |
794 | 860 | ## 基于 LXC 的其它功能服务器 |
795 | 861 |
|
796 | 862 | 其它杂七杂八的服务以及 Docker 就另外开在一个虚拟机上吧。 |
|
0 commit comments