fogact 1.1.6 → 1.1.8

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
@@ -2,7 +2,7 @@
2
2
 
3
3
  [简体中文](./README.zh-CN.md) | English
4
4
 
5
- FogAct is a simple activation helper for Claude Code and Codex. It is designed to be used like `npx yunyi-activator`: run one command, choose from the menu, paste your activation code or API key, and let the tool write the local config automatically.
5
+ FogAct is a simple activation helper for Claude Code and Codex. It is designed to be used like `npx fogact`: run one command, choose from the menu, paste your activation code, and let FogAct auto-detect the Codex / Claude entitlement before writing local config.
6
6
 
7
7
  ## Start
8
8
 
@@ -27,6 +27,8 @@ That is the user-facing command. Running it opens the interactive menu:
27
27
 
28
28
  Do not run `npm fogact`; npm treats that as an npm subcommand. Use `npx fogact`.
29
29
 
30
+ FogAct checks npm for the latest version before opening the menu. If an older installed version is detected, it updates first and then continues. Set `FOGACT_SKIP_UPDATE=1` to skip this check.
31
+
30
32
  ## Clean VPS
31
33
 
32
34
  If the machine does not have Node.js/npm yet, use the bootstrap installer first:
@@ -47,8 +49,8 @@ Minimum bootstrap requirement: the machine needs `curl` or `wget`. The installer
47
49
 
48
50
  1. Run `npx fogact`.
49
51
  2. Choose `1. Activate service`.
50
- 3. Select Claude Code or Codex when prompted.
51
- 4. Enter the activation code or API key.
52
+ 3. Enter the activation / redeem code.
53
+ 4. FogAct auto-detects the Codex / Claude entitlement and shows only supported targets.
52
54
  5. Confirm the plan and restart the target tool.
53
55
 
54
56
  FogAct backs up existing configuration before writing new files.
@@ -71,7 +73,7 @@ Most users only need `npx fogact`. Advanced operators can still use:
71
73
  fogact web
72
74
  ```
73
75
 
74
- The Web UI defaults to `http://localhost:34020/`. You can set `PORT`, `ADMIN_PASSWORD`, `NEWAPI_BASE_URL`, `NEWAPI_API_KEY`, `CLIPROXY_API_BASE`, or `CLIPROXY_UPSTREAM_CONFIG` when needed.
76
+ The Web UI defaults to `http://localhost:34020/`. You can set `PORT`, `ADMIN_PASSWORD`, `NEWAPI_BASE_URL`, `NEWAPI_API_KEY`, `FOGACT_API_BASE`, or `FOGACT_UPSTREAM_CONFIG` when needed.
75
77
 
76
78
  ## Repository
77
79
 
package/README.zh-CN.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # FogAct
2
2
 
3
- FogAct 是一个简单的 Claude Code / Codex 激活工具。它的使用方式要和 `npx yunyi-activator` 一样:用户只运行一个命令,进入菜单,输入激活码或 API Key,然后自动写入本地配置。
3
+ FogAct 是一个简单的 Claude Code / Codex 激活工具。它的使用方式要和 `npx fogact` 一样:用户只运行一个命令,进入菜单,输入激活码,FogAct 自动识别 Codex / Claude 能力并写入本地配置。
4
4
 
5
5
  [English](./README.md) | 简体中文
6
6
 
@@ -27,6 +27,8 @@ npx fogact
27
27
 
28
28
  不要运行 `npm fogact`;npm 会把它当成 npm 子命令。正确方式是 `npx fogact`。
29
29
 
30
+ FogAct 启动时会自动检查 npm 最新版本;检测到旧版本会先更新,再进入菜单。需要跳过检查时可设置 `FOGACT_SKIP_UPDATE=1`。
31
+
30
32
  ## 干净 VPS
31
33
 
32
34
  如果机器还没有 Node.js/npm,先用 bootstrap 安装:
@@ -47,8 +49,8 @@ fogact
47
49
 
48
50
  1. 运行 `npx fogact`。
49
51
  2. 选择 `1. 激活服务`。
50
- 3. 根据提示选择 Claude Code 或 Codex。
51
- 4. 输入激活码或 API Key。
52
+ 3. 输入激活码 / 兑换码。
53
+ 4. FogAct 自动识别 Codex / Claude 能力,并只展示可激活的平台。
52
54
  5. 确认激活计划,然后重启对应工具。
53
55
 
54
56
  FogAct 写入新配置前会自动备份旧配置。
@@ -71,7 +73,7 @@ FogAct 写入新配置前会自动备份旧配置。
71
73
  fogact web
72
74
  ```
73
75
 
74
- Web UI 默认地址是 `http://localhost:34020/`。需要时可以设置 `PORT`、`ADMIN_PASSWORD`、`NEWAPI_BASE_URL`、`NEWAPI_API_KEY`、`CLIPROXY_API_BASE` 或 `CLIPROXY_UPSTREAM_CONFIG`。
76
+ Web UI 默认地址是 `http://localhost:34020/`。需要时可以设置 `PORT`、`ADMIN_PASSWORD`、`NEWAPI_BASE_URL`、`NEWAPI_API_KEY`、`FOGACT_API_BASE` 或 `FOGACT_UPSTREAM_CONFIG`。
75
77
 
76
78
  ## 项目链接
77
79
 
package/bin/web-server.js CHANGED
@@ -218,7 +218,7 @@ function trimTrailingSlash(value) {
218
218
  }
219
219
 
220
220
  function getUpstreamConfigPath() {
221
- return process.env.CLIPROXY_UPSTREAM_CONFIG || DEFAULT_CONFIG_PATH;
221
+ return process.env.FOGACT_UPSTREAM_CONFIG || DEFAULT_CONFIG_PATH;
222
222
  }
223
223
 
224
224
  function readRawUpstreamConfig() {
@@ -1277,10 +1277,18 @@ const server = http.createServer((req, res) => {
1277
1277
  return;
1278
1278
  }
1279
1279
 
1280
- // Proxy requests to yunyi.cfd API for user frontend
1280
+ // Proxy requests to configured upstream API for user frontend
1281
1281
  if (urlPath.startsWith("/proxy/")) {
1282
1282
  const targetPath = urlPath.replace("/proxy", "");
1283
- const targetUrl = `https://yunyi.cfd${targetPath}`;
1283
+ const proxyBaseUrl = trimTrailingSlash(process.env.FOGACT_PROXY_TARGET || readRawUpstreamConfig().baseUrl || "");
1284
+
1285
+ if (!proxyBaseUrl) {
1286
+ res.writeHead(502, { "Content-Type": "application/json" });
1287
+ res.end(JSON.stringify({ success: false, message: "Proxy target is not configured" }));
1288
+ return;
1289
+ }
1290
+
1291
+ const targetUrl = `${proxyBaseUrl}${targetPath}`;
1284
1292
 
1285
1293
  const options = {
1286
1294
  method: req.method,
@@ -7,7 +7,7 @@
7
7
  <meta name="description" content="输入 FogAct 激活码,完成服务绑定并查看额度与有效期。" />
8
8
  <script>
9
9
  ;(function () {
10
- var theme = localStorage.getItem('fogact_theme') || localStorage.getItem('admin_theme') || localStorage.getItem('yunyi_user_theme') || 'system';
10
+ var theme = localStorage.getItem('fogact_theme') || localStorage.getItem('admin_theme') || 'system';
11
11
  var prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
12
12
  var isDark = theme === 'dark' || (theme === 'system' && prefersDark);
13
13
  document.documentElement.classList.toggle('dark', isDark);
@@ -270,7 +270,7 @@ const DEFAULT_SETTINGS = {
270
270
  notifyLowQuota: true
271
271
  },
272
272
  app: {
273
- appName: 'CLIProxy Client',
273
+ appName: 'FogAct Client',
274
274
  appDownloadUrl: '',
275
275
  iosUrl: '',
276
276
  androidUrl: '',
@@ -1277,7 +1277,7 @@ const LogsManagement = {
1277
1277
  };
1278
1278
 
1279
1279
  const SettingsManagement = {
1280
- storageKey: 'cliproxy_admin_settings_v1',
1280
+ storageKey: 'fogact_admin_settings_v1',
1281
1281
 
1282
1282
  sections: [
1283
1283
  {
@@ -7,7 +7,7 @@
7
7
 
8
8
  <script>
9
9
  ;(function () {
10
- var theme = localStorage.getItem('fogact_theme') || localStorage.getItem('admin_theme') || localStorage.getItem('yunyi_user_theme') || 'system';
10
+ var theme = localStorage.getItem('fogact_theme') || localStorage.getItem('admin_theme') || 'system';
11
11
  var prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
12
12
  var isDark = theme === 'dark' || (theme === 'system' && prefersDark);
13
13
  document.documentElement.classList.toggle('dark', isDark);
@@ -731,6 +731,128 @@ body.market-dark .market-auth-card::before {
731
731
  color: var(--market-primary);
732
732
  }
733
733
 
734
+ .market-service-card {
735
+ position: relative;
736
+ overflow: hidden;
737
+ border: 1px solid var(--market-line);
738
+ border-radius: 28px;
739
+ padding: 18px;
740
+ background:
741
+ radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--market-primary) 14%, transparent), transparent 42%),
742
+ var(--market-panel);
743
+ box-shadow: var(--market-shadow-soft);
744
+ }
745
+
746
+ .market-service-head {
747
+ display: grid;
748
+ grid-template-columns: 44px 1fr auto;
749
+ gap: 12px;
750
+ align-items: center;
751
+ }
752
+
753
+ .market-service-icon {
754
+ display: inline-flex;
755
+ align-items: center;
756
+ justify-content: center;
757
+ width: 44px;
758
+ height: 44px;
759
+ border-radius: 16px;
760
+ color: #fff;
761
+ background: linear-gradient(135deg, var(--market-primary), var(--market-primary-3));
762
+ box-shadow: 0 14px 32px color-mix(in srgb, var(--market-primary) 24%, transparent);
763
+ }
764
+
765
+ .market-service-head p,
766
+ .market-service-head h3,
767
+ .market-service-copy {
768
+ margin: 0;
769
+ }
770
+
771
+ .market-service-head p {
772
+ color: var(--market-muted);
773
+ font-size: 12px;
774
+ font-weight: 900;
775
+ }
776
+
777
+ .market-service-head h3 {
778
+ margin-top: 3px;
779
+ color: var(--market-ink);
780
+ font-family: var(--market-headline);
781
+ font-size: 17px;
782
+ letter-spacing: -0.04em;
783
+ }
784
+
785
+ .market-port-badge {
786
+ display: inline-flex;
787
+ align-items: center;
788
+ gap: 6px;
789
+ height: 32px;
790
+ padding: 0 10px;
791
+ border: 1px solid var(--market-line);
792
+ border-radius: 999px;
793
+ color: var(--market-muted);
794
+ background: var(--market-panel-muted);
795
+ font-size: 12px;
796
+ font-weight: 900;
797
+ }
798
+
799
+ .market-service-copy {
800
+ margin-top: 14px;
801
+ color: var(--market-muted);
802
+ font-size: 13px;
803
+ line-height: 1.65;
804
+ }
805
+
806
+ .market-entry-grid {
807
+ display: grid;
808
+ grid-template-columns: repeat(2, minmax(0, 1fr));
809
+ gap: 10px;
810
+ margin-top: 16px;
811
+ }
812
+
813
+ .market-entry-card {
814
+ display: grid;
815
+ gap: 5px;
816
+ min-height: 92px;
817
+ border: 1px solid var(--market-line);
818
+ border-radius: 18px;
819
+ padding: 13px;
820
+ color: var(--market-ink);
821
+ background: color-mix(in srgb, var(--market-panel-strong) 78%, transparent);
822
+ text-decoration: none;
823
+ transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
824
+ }
825
+
826
+ .market-entry-card .material-symbols-outlined {
827
+ width: 30px;
828
+ height: 30px;
829
+ border-radius: 12px;
830
+ display: inline-flex;
831
+ align-items: center;
832
+ justify-content: center;
833
+ color: var(--market-primary);
834
+ background: color-mix(in srgb, var(--market-primary) 12%, transparent);
835
+ font-size: 18px;
836
+ }
837
+
838
+ .market-entry-card strong {
839
+ font-size: 13px;
840
+ font-weight: 900;
841
+ }
842
+
843
+ .market-entry-card small {
844
+ color: var(--market-muted);
845
+ font-size: 12px;
846
+ font-weight: 700;
847
+ }
848
+
849
+ .market-entry-card:hover {
850
+ transform: translateY(-2px);
851
+ border-color: color-mix(in srgb, var(--market-primary) 42%, var(--market-line));
852
+ background: color-mix(in srgb, var(--market-primary) 8%, var(--market-panel-strong));
853
+ box-shadow: var(--market-shadow-soft);
854
+ }
855
+
734
856
  .market-result-list {
735
857
  display: grid;
736
858
  gap: 10px;
@@ -1183,111 +1305,6 @@ body.market-user {
1183
1305
  transform: translateY(-1px);
1184
1306
  }
1185
1307
 
1186
- /* Distinct motion layer */
1187
- .market-orbit-stage {
1188
- position: absolute;
1189
- inset: auto 28px 28px auto;
1190
- width: min(48vw, 440px);
1191
- height: min(48vw, 440px);
1192
- pointer-events: none;
1193
- opacity: 0.95;
1194
- }
1195
-
1196
- .market-orbit-stage::before,
1197
- .market-orbit-stage::after {
1198
- content: "";
1199
- position: absolute;
1200
- inset: 12%;
1201
- border: 1px solid color-mix(in srgb, var(--market-ink) 12%, transparent);
1202
- border-radius: 999px;
1203
- animation: orbitSpin 18s linear infinite;
1204
- }
1205
-
1206
- .market-orbit-stage::after {
1207
- inset: 25%;
1208
- border-style: dashed;
1209
- animation-duration: 12s;
1210
- animation-direction: reverse;
1211
- opacity: 0.72;
1212
- }
1213
-
1214
- .market-orbit-node {
1215
- position: absolute;
1216
- display: inline-flex;
1217
- align-items: center;
1218
- justify-content: center;
1219
- width: 74px;
1220
- height: 74px;
1221
- border: 1px solid var(--market-line-strong);
1222
- border-radius: 24px;
1223
- color: #fff;
1224
- background: linear-gradient(135deg, var(--node-a, var(--market-primary)), var(--node-b, var(--market-primary-2)));
1225
- box-shadow: 0 20px 50px color-mix(in srgb, var(--node-a, var(--market-primary)) 28%, transparent);
1226
- font-size: 28px;
1227
- transform: translate3d(0, 0, 0) rotate(var(--tilt, 0deg));
1228
- animation: nodeFloat var(--speed, 6s) ease-in-out infinite;
1229
- }
1230
-
1231
- .market-orbit-node:nth-child(1) {
1232
- --node-a: #6d5dfc;
1233
- --node-b: #b86bff;
1234
- --tilt: -10deg;
1235
- --speed: 6.5s;
1236
- left: 6%;
1237
- top: 18%;
1238
- }
1239
-
1240
- .market-orbit-node:nth-child(2) {
1241
- --node-a: #ff7a59;
1242
- --node-b: #ffd166;
1243
- --tilt: 9deg;
1244
- --speed: 7.5s;
1245
- right: 11%;
1246
- top: 7%;
1247
- animation-delay: -1.8s;
1248
- }
1249
-
1250
- .market-orbit-node:nth-child(3) {
1251
- --node-a: #17c3b2;
1252
- --node-b: #5eead4;
1253
- --tilt: 12deg;
1254
- --speed: 8s;
1255
- right: 5%;
1256
- bottom: 21%;
1257
- animation-delay: -3s;
1258
- }
1259
-
1260
- .market-orbit-node:nth-child(4) {
1261
- --node-a: #101014;
1262
- --node-b: #6d5dfc;
1263
- --tilt: -8deg;
1264
- --speed: 7s;
1265
- left: 19%;
1266
- bottom: 8%;
1267
- animation-delay: -4.3s;
1268
- }
1269
-
1270
- .market-signal-line {
1271
- position: absolute;
1272
- left: 8%;
1273
- right: 8%;
1274
- top: 50%;
1275
- height: 1px;
1276
- background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--market-primary) 55%, transparent), transparent);
1277
- transform: rotate(-18deg);
1278
- opacity: 0.72;
1279
- overflow: hidden;
1280
- }
1281
-
1282
- .market-signal-line::after {
1283
- content: "";
1284
- position: absolute;
1285
- inset: 0 auto 0 0;
1286
- width: 38%;
1287
- background: linear-gradient(90deg, transparent, #fff, transparent);
1288
- animation: signalSweep 2.6s cubic-bezier(0.16, 1, 0.3, 1) infinite;
1289
- }
1290
-
1291
1308
  .market-card-lab {
1292
1309
  min-height: 318px;
1293
1310
  padding: 0;
@@ -1729,16 +1746,6 @@ body.is-pointer-active .market-mouse-light {
1729
1746
  to { transform: rotate(360deg); }
1730
1747
  }
1731
1748
 
1732
- @keyframes nodeFloat {
1733
- 0%, 100% { transform: translate3d(0, 0, 0) rotate(var(--tilt)); }
1734
- 50% { transform: translate3d(0, -3px, 0) rotate(var(--tilt)); }
1735
- }
1736
-
1737
- @keyframes signalSweep {
1738
- 0% { transform: translateX(-120%); }
1739
- 100% { transform: translateX(360%); }
1740
- }
1741
-
1742
1749
  @keyframes cardShine {
1743
1750
  from { transform: translateX(-120%); }
1744
1751
  to { transform: translateX(120%); }
@@ -1801,14 +1808,6 @@ body.is-pointer-active .market-mouse-light {
1801
1808
  }
1802
1809
 
1803
1810
  @media (max-width: 980px) {
1804
- .market-orbit-stage {
1805
- position: relative;
1806
- inset: auto;
1807
- width: min(100%, 420px);
1808
- height: 300px;
1809
- margin: 28px auto 0;
1810
- }
1811
-
1812
1811
  .market-hero,
1813
1812
  .market-activation {
1814
1813
  grid-template-columns: 1fr;
@@ -1876,17 +1875,6 @@ body.is-pointer-active .market-mouse-light {
1876
1875
  min-height: 150px;
1877
1876
  }
1878
1877
 
1879
- .market-orbit-stage {
1880
- height: 240px;
1881
- }
1882
-
1883
- .market-orbit-node {
1884
- width: 58px;
1885
- height: 58px;
1886
- border-radius: 20px;
1887
- font-size: 22px;
1888
- }
1889
-
1890
1878
  .market-mouse-light {
1891
1879
  display: none;
1892
1880
  }
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>配色方案测试 | FogIDC Activator</title>
6
+ <title>配色方案测试 | FogAct</title>
7
7
  <link href="https://fonts.googleapis.com/css2?family=Manrope:wght@600;700;800&family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
8
8
  <script src="https://cdn.tailwindcss.com"></script>
9
9
  <script>
@@ -7,7 +7,7 @@
7
7
  <meta name="description" content="FogAct 提供用户中心、激活码管理、配额查看和多平台 CLI 接入入口。" />
8
8
  <script>
9
9
  ;(function () {
10
- var theme = localStorage.getItem('fogact_theme') || localStorage.getItem('admin_theme') || localStorage.getItem('yunyi_user_theme') || 'system';
10
+ var theme = localStorage.getItem('fogact_theme') || localStorage.getItem('admin_theme') || 'system';
11
11
  var prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
12
12
  var isDark = theme === 'dark' || (theme === 'system' && prefersDark);
13
13
  document.documentElement.classList.toggle('dark', isDark);
@@ -73,13 +73,6 @@
73
73
  <span class="market-ambient-item"><span class="material-symbols-outlined">query_stats</span></span>
74
74
  </div>
75
75
 
76
- <div class="market-orbit-stage" aria-hidden="true">
77
- <span class="market-orbit-node material-symbols-outlined">code</span>
78
- <span class="market-orbit-node material-symbols-outlined">vpn_key</span>
79
- <span class="market-orbit-node material-symbols-outlined">monitoring</span>
80
- <span class="market-orbit-node material-symbols-outlined">hub</span>
81
- <span class="market-signal-line"></span>
82
- </div>
83
76
  </div>
84
77
 
85
78
  <aside class="market-hero-side" aria-label="服务状态概览">
@@ -110,14 +103,40 @@
110
103
  </div>
111
104
  </div>
112
105
 
113
- <div class="market-panel" style="border-radius: 26px; padding: 18px;">
114
- <div class="market-card-footer">
115
- <span class="market-tag">Local server</span>
116
- <span class="market-status-pill"><span class="market-kicker-dot"></span> 34020</span>
106
+ <div class="market-service-card">
107
+ <div class="market-service-head">
108
+ <span class="market-service-icon material-symbols-outlined">conversion_path</span>
109
+ <div>
110
+ <p>本地服务</p>
111
+ <h3>选择要进入的工作区</h3>
112
+ </div>
113
+ <span class="market-port-badge"><span class="market-kicker-dot"></span> :34020</span>
117
114
  </div>
118
- <p class="market-mini-copy" style="margin-top: 14px; font-size: 14px; line-height: 1.7;">
119
- 本地 Web 服务默认运行在 34020 端口,提供首页、用户中心、管理中心和激活入口。
115
+ <p class="market-service-copy">
116
+ Web 控制台已按角色拆成独立入口,直接选择当前要处理的任务。
120
117
  </p>
118
+ <div class="market-entry-grid" aria-label="本地服务快捷入口">
119
+ <a class="market-entry-card" href="/">
120
+ <span class="material-symbols-outlined">home</span>
121
+ <strong>首页</strong>
122
+ <small>查看入口总览</small>
123
+ </a>
124
+ <a class="market-entry-card" href="/user/">
125
+ <span class="material-symbols-outlined">person</span>
126
+ <strong>用户中心</strong>
127
+ <small>用量与配额</small>
128
+ </a>
129
+ <a class="market-entry-card" href="/admin/">
130
+ <span class="material-symbols-outlined">admin_panel_settings</span>
131
+ <strong>管理中心</strong>
132
+ <small>用户与 CDK</small>
133
+ </a>
134
+ <a class="market-entry-card" href="/activate.html">
135
+ <span class="material-symbols-outlined">bolt</span>
136
+ <strong>激活入口</strong>
137
+ <small>绑定服务</small>
138
+ </a>
139
+ </div>
121
140
  </div>
122
141
  </aside>
123
142
  </section>