[GH-ISSUE #988] 请求在安装脚本及升级页面添加对Alpin系统的支持 #528

Closed
opened 2026-02-26 12:08:37 +03:00 by kerem · 14 comments
Owner

Originally created by @bigoovip on GitHub (Apr 26, 2025).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/988

本项目当前的安装脚本主要支持的是使用systemd的debian/ubuntu等系统,没有支持使用OpenRC的Alpine等系统,在Alpine系统无法通过安装脚本安装及管理。
同时,在登陆项目后,在升级页面,在debian系统中可成功升级,但Alpine系统总是升级失败。

故请求,在安装脚本及项目的升级页面添加对Alpin系统的支持。

Originally created by @bigoovip on GitHub (Apr 26, 2025). Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/988 本项目当前的安装脚本主要支持的是使用systemd的debian/ubuntu等系统,没有支持使用OpenRC的Alpine等系统,在Alpine系统无法通过安装脚本安装及管理。 同时,在登陆项目后,在升级页面,在debian系统中可成功升级,但Alpine系统总是升级失败。 故请求,在安装脚本及项目的升级页面添加对Alpin系统的支持。
kerem 2026-02-26 12:08:37 +03:00
Author
Owner

@0xJacky commented on GitHub (Apr 26, 2025):

已经有在计划中了。另外升级失败可以看看日志吗

<!-- gh-comment-id:2832011766 --> @0xJacky commented on GitHub (Apr 26, 2025): 已经有在计划中了。另外升级失败可以看看日志吗
Author
Owner

@bigoovip commented on GitHub (Apr 26, 2025):

已经有在计划中了。另外升级失败可以看看日志吗

感谢,等待支持。
另外,升级失败后,我直接手动升级了,未保留日志。

<!-- gh-comment-id:2832038851 --> @bigoovip commented on GitHub (Apr 26, 2025): > 已经有在计划中了。另外升级失败可以看看日志吗 感谢,等待支持。 另外,升级失败后,我直接手动升级了,未保留日志。
Author
Owner

@0xJacky commented on GitHub (Apr 26, 2025):

你可以试试点击重新安装,再看看有没有报错的信息

<!-- gh-comment-id:2832052026 --> @0xJacky commented on GitHub (Apr 26, 2025): 你可以试试点击重新安装,再看看有没有报错的信息
Author
Owner

@0xJacky commented on GitHub (May 7, 2025):

rc.6 的 OTA 已确认可以在 Apline 上使用

<!-- gh-comment-id:2856744925 --> @0xJacky commented on GitHub (May 7, 2025): rc.6 的 OTA 已确认可以在 Apline 上使用
Author
Owner

@bigoovip commented on GitHub (May 7, 2025):

rc.6 的 OTA 已确认可以在 Apline 上使用

@0xJacky nginx-ui 本身可以在 Apline 上使用,但我刚在Alpine中尝试从rc.5升级到rc.6并不成功,手动更新后,点击“重新安装”,一样不能重新安装成功,安装页面显示如下

核心升级
80%
正在升级 Nginx UI,请等待...

初始化核心升级器

下载最新版本

正在进行核心升级

此时,页面会弹出消息——“Server error”,且无法访问Nginx UI,/tmp/文件夹中含有临时目录nginx-ui-upgrade-1102384980(内含nginx-ui二进制文件等),/usr/local/bin/目录中有原文件nginx-ui二进制文件和nginx-ui-temp-52091824.tar.gz文件,重启nginx-ui后,可正常访问Nginx UI。

因此推测,核心升级的命令在alpine中未正确执行,应该是将/tmp/nginx-ui-upgrade-1102384980中的nginx-ui二进制文件移动并覆盖到/usr/local/bin/目录中,且应清除临时目录、临时文件后重新启动nginx-ui

输入命令cat /etc/alpine-release,可看到alpine版本为3.20.0

root:~# cat /etc/alpine-release
3.20.0
<!-- gh-comment-id:2858717736 --> @bigoovip commented on GitHub (May 7, 2025): > rc.6 的 OTA 已确认可以在 Apline 上使用 @0xJacky nginx-ui 本身可以在 Apline 上使用,但我刚在Alpine中尝试从rc.5升级到rc.6并不成功,手动更新后,点击“重新安装”,一样不能重新安装成功,安装页面显示如下 ``` 核心升级 80% 正在升级 Nginx UI,请等待... 初始化核心升级器 下载最新版本 正在进行核心升级 ``` 此时,页面会弹出消息——“Server error”,且无法访问Nginx UI,/tmp/文件夹中含有临时目录nginx-ui-upgrade-1102384980(内含nginx-ui二进制文件等),/usr/local/bin/目录中有原文件nginx-ui二进制文件和nginx-ui-temp-52091824.tar.gz文件,重启nginx-ui后,可正常访问Nginx UI。 因此推测,核心升级的命令在alpine中未正确执行,应该是将/tmp/nginx-ui-upgrade-1102384980中的nginx-ui二进制文件移动并覆盖到/usr/local/bin/目录中,且应清除临时目录、临时文件后重新启动nginx-ui 输入命令`cat /etc/alpine-release`,可看到alpine版本为`3.20.0` ``` root:~# cat /etc/alpine-release 3.20.0 ```
Author
Owner

@0xJacky commented on GitHub (May 7, 2025):

😂,我前天做了个脚本,在 alpine 上连续更新了几百次都成功了

<!-- gh-comment-id:2858746309 --> @0xJacky commented on GitHub (May 7, 2025): 😂,我前天做了个脚本,在 alpine 上连续更新了几百次都成功了
Author
Owner

@0xJacky commented on GitHub (May 7, 2025):

是不是你之前安装的时候不是在 root 用户或者目录出现权限问题?你可以试试在终端中直接执行 nginx-ui 在前台中运行,然后 ota 查看报错信息。

<!-- gh-comment-id:2858749597 --> @0xJacky commented on GitHub (May 7, 2025): 是不是你之前安装的时候不是在 root 用户或者目录出现权限问题?你可以试试在终端中直接执行 nginx-ui 在前台中运行,然后 ota 查看报错信息。
Author
Owner

@bigoovip commented on GitHub (May 7, 2025):

是不是你之前安装的时候不是在 root 用户或者目录出现权限问题?你可以试试在终端中直接执行 nginx-ui 在前台中运行,然后 ota 查看报错信息。

@0xJacky 直接运行命令启动,内容如下:

root:~# /usr/local/bin/nginx-ui -config /usr/local/etc/nginx-ui/app.ini
2025-05-07 22:28:08     INFO    analytic/node_record.go:99      RetrieveNodesStatus start
2025-05-07 22:28:08     INFO    cert/auto_cert.go:23    AutoCert Worker Started
2025-05-07 22:28:08     INFO    analytic/analytic.go:53 RecordServerAnalytic Started
2025-05-07 22:28:08     INFO    nginx-ui/main.go:93     Starting HTTP server
……
[GIN] 2025/05/07 - 22:28:17 | 304 |       4.706µs |  192.168.0.2 | GET      "/assets/Upgrade-Knuny48f.js"
[GIN] 2025/05/07 - 22:28:17 | 304 |        2.46µs |  192.168.0.2 | GET      "/assets/index-HU-oqyix.js"
[GIN] 2025/05/07 - 22:28:17 | 304 |       3.573µs |  192.168.0.2 | GET      "/assets/marked.esm-ZV7pvAkJ.js"
[GIN] 2025/05/07 - 22:28:17 | 304 |       2.374µs |  192.168.0.2 | GET      "/assets/version-HqVIWt7l.js"
[GIN] 2025/05/07 - 22:28:17 | 200 |      46.637µs |  192.168.0.2 | GET      "/assets/Upgrade-DNUFkxBU.css"
[GIN] 2025/05/07 - 22:28:17 | 304 |       1.874µs |  192.168.0.2 | GET      "/assets/upgrade-STjJSiUc.js"
[GIN] 2025/05/07 - 22:28:19 | 200 |  1.469727184s |  192.168.0.2 | GET      "/api/upgrade/release?channel=stable"

此时可以进入nginx ui,在点击“重新启动”按钮后,终端在上述输出内容后面,只输出了以下内容:

Killed
root:~# 

此时相当于前面命令被结束了,出现前述无法进入页面、新nginx-ui未移至/usr/local/bin/目录、临时目录及文件未清理、nginx-ui未启动等情况。

还是说,之前是手动安装的——但我使用的目录是参考之前systemd脚本的目录,相关目录非内部脚本使用的目录?如果是,默认使用的目录是什么?

<!-- gh-comment-id:2858862553 --> @bigoovip commented on GitHub (May 7, 2025): > 是不是你之前安装的时候不是在 root 用户或者目录出现权限问题?你可以试试在终端中直接执行 nginx-ui 在前台中运行,然后 ota 查看报错信息。 @0xJacky 直接运行命令启动,内容如下: ``` root:~# /usr/local/bin/nginx-ui -config /usr/local/etc/nginx-ui/app.ini 2025-05-07 22:28:08 INFO analytic/node_record.go:99 RetrieveNodesStatus start 2025-05-07 22:28:08 INFO cert/auto_cert.go:23 AutoCert Worker Started 2025-05-07 22:28:08 INFO analytic/analytic.go:53 RecordServerAnalytic Started 2025-05-07 22:28:08 INFO nginx-ui/main.go:93 Starting HTTP server …… [GIN] 2025/05/07 - 22:28:17 | 304 | 4.706µs | 192.168.0.2 | GET "/assets/Upgrade-Knuny48f.js" [GIN] 2025/05/07 - 22:28:17 | 304 | 2.46µs | 192.168.0.2 | GET "/assets/index-HU-oqyix.js" [GIN] 2025/05/07 - 22:28:17 | 304 | 3.573µs | 192.168.0.2 | GET "/assets/marked.esm-ZV7pvAkJ.js" [GIN] 2025/05/07 - 22:28:17 | 304 | 2.374µs | 192.168.0.2 | GET "/assets/version-HqVIWt7l.js" [GIN] 2025/05/07 - 22:28:17 | 200 | 46.637µs | 192.168.0.2 | GET "/assets/Upgrade-DNUFkxBU.css" [GIN] 2025/05/07 - 22:28:17 | 304 | 1.874µs | 192.168.0.2 | GET "/assets/upgrade-STjJSiUc.js" [GIN] 2025/05/07 - 22:28:19 | 200 | 1.469727184s | 192.168.0.2 | GET "/api/upgrade/release?channel=stable" ``` 此时可以进入nginx ui,在点击“重新启动”按钮后,终端在上述输出内容后面,只输出了以下内容: ``` Killed root:~# ``` 此时相当于前面命令被结束了,出现前述无法进入页面、新nginx-ui未移至/usr/local/bin/目录、临时目录及文件未清理、nginx-ui未启动等情况。 还是说,之前是手动安装的——但我使用的目录是参考之前systemd脚本的目录,相关目录非内部脚本使用的目录?如果是,默认使用的目录是什么?
Author
Owner

@0xJacky commented on GitHub (May 7, 2025):

你可以尝试删除之前手动安装的配置,使用一键安装脚本再试试更新?

打扰一下,你的 Alpine VM 的内存(RAM)是多大的呀

<!-- gh-comment-id:2858923635 --> @0xJacky commented on GitHub (May 7, 2025): 你可以尝试删除之前手动安装的配置,使用一键安装脚本再试试更新? 打扰一下,你的 Alpine VM 的内存(RAM)是多大的呀
Author
Owner

@bigoovip commented on GitHub (May 7, 2025):

你可以尝试删除之前手动安装的配置,使用一键安装脚本再试试更新?

打扰一下,你的 Alpine VM 的内存(RAM)是多大的呀

@0xJacky 很遗憾,一键安装脚本未成功,提示如下

sh ./install.sh install
./install.sh: line 442: syntax error: unexpected "(" (expecting "fi")

使用的是pve ct,内存256M

btw,官方文档中安装命令也不适合alpine,比如alpine使用的是sh而不是bash.

<!-- gh-comment-id:2859098012 --> @bigoovip commented on GitHub (May 7, 2025): > 你可以尝试删除之前手动安装的配置,使用一键安装脚本再试试更新? > > 打扰一下,你的 Alpine VM 的内存(RAM)是多大的呀 @0xJacky 很遗憾,一键安装脚本未成功,提示如下 ``` sh ./install.sh install ./install.sh: line 442: syntax error: unexpected "(" (expecting "fi") ``` 使用的是pve ct,内存256M btw,官方文档中安装命令也不适合alpine,比如alpine使用的是sh而不是bash.
Author
Owner

@Hintay commented on GitHub (May 7, 2025):

目前 OTA 会用到比我们预想中更多的 RAM,256M 应该无法成功更新,后续我们会通过缩减 ACME-DNS 的 SDK 包来尽量缩小程序大小。

请尝试用下面的指令使用 dev 分支的安装脚本:

sh -c "$(wget -qO- https://raw.githubusercontent.com/0xJacky/nginx-ui/dev/install.sh)" install
<!-- gh-comment-id:2860212685 --> @Hintay commented on GitHub (May 7, 2025): 目前 OTA 会用到比我们预想中更多的 RAM,256M 应该无法成功更新,后续我们会通过缩减 ACME-DNS 的 SDK 包来尽量缩小程序大小。 请尝试用下面的指令使用 `dev` 分支的安装脚本: ``` sh -c "$(wget -qO- https://raw.githubusercontent.com/0xJacky/nginx-ui/dev/install.sh)" install ```
Author
Owner

@0xJacky commented on GitHub (May 7, 2025):

如果是虚拟机的话也可以增加一下内存,至少需要1G才能正常更新。

<!-- gh-comment-id:2860689607 --> @0xJacky commented on GitHub (May 7, 2025): 如果是虚拟机的话也可以增加一下内存,至少需要1G才能正常更新。
Author
Owner

@bigoovip commented on GitHub (May 8, 2025):

目前 OTA 会用到比我们预想中更多的 RAM,256M 应该无法成功更新,后续我们会通过缩减 ACME-DNS 的 SDK 包来尽量缩小程序大小。

请尝试用下面的指令使用 dev 分支的安装脚本:

sh -c "$(wget -qO- https://raw.githubusercontent.com/0xJacky/nginx-ui/dev/install.sh)" install

@0xJacky
经测试,在手动安装到默认目录的情况下,内存增加到1g,ota更新成功。
经测试,在完全删除原手动安装的文件后,使用dev脚本安装成功。

感谢,盼以后ota时内存占用能少一些。

<!-- gh-comment-id:2861807071 --> @bigoovip commented on GitHub (May 8, 2025): > 目前 OTA 会用到比我们预想中更多的 RAM,256M 应该无法成功更新,后续我们会通过缩减 ACME-DNS 的 SDK 包来尽量缩小程序大小。 > > 请尝试用下面的指令使用 `dev` 分支的安装脚本: > > ``` > sh -c "$(wget -qO- https://raw.githubusercontent.com/0xJacky/nginx-ui/dev/install.sh)" install > ``` @0xJacky 经测试,在手动安装到默认目录的情况下,内存增加到1g,ota更新成功。 经测试,在完全删除原手动安装的文件后,使用dev脚本安装成功。 感谢,盼以后ota时内存占用能少一些。
Author
Owner

@0xJacky commented on GitHub (May 9, 2025):

下一版本的 OTA 更新将显著降低内存占用:
经过我们在 linux amd64 的测试中,原有的 OTA 更新会在峰值时占用大约 700MB+ 的内存空间,经过多方面的优化,现在占用大约 150MB+。

有关 lego 的节省空间计划细节请参阅:https://github.com/0xJacky/nginx-ui/discussions/1033

同时,我们改进了 minio/self-update 在替换二进制时会导致突发占用几倍于原二进制体积的内存的问题。

这是我们的项目地址:nginxui/selfupdate 我计划在一段时间后 PR 回原项目。


The next version of the OTA update will significantly reduce memory usage:
After our testing on Linux amd64, the original OTA update would occupy approximately 700MB+ of memory space at peak times. Through various optimizations, it now occupies approximately 150MB+.

For details of Lego's space-saving plan, please refer to: #103

Meanwhile, we have addressed the issue where minio/self-update would unexpectedly consume several times the original
memory volume when replacing the binary.

This is the address of our project: nginxui/selfupdate . I plan to create a pull request back to the original project after some time.

<!-- gh-comment-id:2865692037 --> @0xJacky commented on GitHub (May 9, 2025): 下一版本的 OTA 更新将显著降低内存占用: 经过我们在 linux amd64 的测试中,原有的 OTA 更新会在峰值时占用大约 700MB+ 的内存空间,经过多方面的优化,现在占用大约 150MB+。 有关 lego 的节省空间计划细节请参阅:https://github.com/0xJacky/nginx-ui/discussions/1033 同时,我们改进了 [minio/self-update](https://github.com/minio/selfupdate) 在替换二进制时会导致突发占用几倍于原二进制体积的内存的问题。 这是我们的项目地址:[nginxui/selfupdate](https://github.com/nginxui/selfupdate) 我计划在一段时间后 PR 回原项目。 --- The next version of the OTA update will significantly reduce memory usage: After our testing on Linux amd64, the original OTA update would occupy approximately 700MB+ of memory space at peak times. Through various optimizations, it now occupies approximately 150MB+. For details of Lego's space-saving plan, please refer to: #103 Meanwhile, we have addressed the issue where minio/self-update would unexpectedly consume several times the original memory volume when replacing the binary. This is the address of our project: [nginxui/selfupdate](https://github.com/nginxui/selfupdate) . I plan to create a pull request back to the original project after some time.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-ui#528
No description provided.