@ghyper9023/u2secure 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,7 @@ Linux 服务器安全加固工具(CLI + TUI 双模式),基于 Rust 构建
4
4
 
5
5
  > Linux server security hardening tool (CLI + TUI) built with Rust. One run builds a complete security baseline: system updates, user creation, deep SSH hardening, firewall, intrusion prevention, auditing and automatic updates.
6
6
  >
7
- > 支持平台 / Supported platforms: Linux x86_64 & ARM64, macOS x86_64 & ARM64, Windows x64
7
+ > 支持平台 / Supported platform: Linux x86_64 & ARM64 (Linux only)
8
8
  >
9
9
  > 详细文档与使用指南请访问 / For full documentation and usage guide, visit:
10
10
  > [GitHub 主页](https://github.com/cherish-ltt/U2Secure)
package/bin/install.js CHANGED
@@ -25,37 +25,25 @@ if (repo.endsWith('.git')) {
25
25
 
26
26
  const tag = `v${version}`;
27
27
 
28
+ // U2Secure 是 Linux 专用工具,只发布 Linux 二进制。
29
+ // 这里给出明确报错,而不是让 postinstall 去下载一个永远不存在的资产。
28
30
  function getPlatformAsset() {
29
31
  const platform = os.platform();
30
32
  const arch = os.arch();
31
33
  console.log(`Detected platform: ${platform}, arch: ${arch}`);
32
34
 
33
- if (platform === 'win32') {
34
- // Windows: currently only x64 builds are provided.
35
- if (arch === 'x64' || arch === 'ia32' || arch === 'arm64') {
36
- console.log('Using Windows x64 binary (compatible with all Windows architectures)');
37
- return 'u2secure-x86_64-pc-windows-msvc.exe';
38
- } else {
39
- throw new Error(`Unsupported Windows architecture: ${arch}`);
40
- }
41
- } else if (platform === 'linux') {
42
- if (arch === 'x64') {
43
- return 'u2secure-x86_64-unknown-linux-gnu';
44
- } else if (arch === 'arm64') {
45
- return 'u2secure-aarch64-unknown-linux-gnu';
46
- } else {
47
- throw new Error(`Unsupported Linux architecture: ${arch}`);
48
- }
49
- } else if (platform === 'darwin') {
50
- if (arch === 'arm64') {
51
- return 'u2secure-aarch64-apple-darwin';
52
- } else if (arch === 'x64') {
53
- return 'u2secure-x86_64-apple-darwin';
54
- } else {
55
- throw new Error(`Unsupported macOS architecture: ${arch}`);
56
- }
35
+ if (platform !== 'linux') {
36
+ throw new Error(
37
+ `U2Secure only supports Linux (detected: ${platform}). ` +
38
+ 'On other platforms please use Docker or a Linux server / VM.'
39
+ );
40
+ }
41
+ if (arch === 'x64') {
42
+ return 'u2secure-x86_64-unknown-linux-gnu';
43
+ } else if (arch === 'arm64') {
44
+ return 'u2secure-aarch64-unknown-linux-gnu';
57
45
  } else {
58
- throw new Error(`Unsupported platform: ${platform}`);
46
+ throw new Error(`Unsupported Linux architecture: ${arch}`);
59
47
  }
60
48
  }
61
49
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghyper9023/u2secure",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Make your Linux system more secure through interactive CLI | 通过交互式的 CLI 让你的 Linux 系统更安全",
5
5
  "bin": {
6
6
  "u2secure": "bin/u2secure-wrapper.js"