change default port to 19000

This commit is contained in:
Star 2026-03-06 17:11:35 +08:00
parent e5f3fc9247
commit 0f6a224fc2
18 changed files with 51 additions and 39 deletions

View file

@ -28,7 +28,7 @@ cd backend
python3 app.py
```
Open **http://127.0.0.1:18791** and try switching states:
Open **http://127.0.0.1:19000** and try switching states:
```bash
python3 set_state.py writing "Organizing documents"
@ -77,7 +77,7 @@ cd backend
python3 app.py
```
Open `http://127.0.0.1:18791`
Open `http://127.0.0.1:19000`
> ✅ For local development you can start with the defaults; in production, copy `.env.example` to `.env` and set strong random values for `FLASK_SECRET_KEY` and `ASSET_DRAWER_PASS` to avoid weak passwords and session leaks.
@ -93,7 +93,7 @@ python3 set_state.py idle "Standing by"
### 5) Public access (optional)
```bash
cloudflared tunnel --url http://127.0.0.1:18791
cloudflared tunnel --url http://127.0.0.1:19000
```
Share the `https://xxx.trycloudflare.com` link with anyone.
@ -103,7 +103,7 @@ Share the `https://xxx.trycloudflare.com` link with anyone.
While the backend is running, you can run a lightweight smoke test to confirm that the core endpoints are healthy:
```bash
python3 scripts/smoke_test.py --base-url http://127.0.0.1:18791
python3 scripts/smoke_test.py --base-url http://127.0.0.1:19000
```
If all checks report `OK`, your Star Office UI service is wired up correctly for basic status flows.
@ -204,7 +204,7 @@ npm run dev
```
- Auto-launches the Python backend on startup
- Window points to `http://127.0.0.1:18791/?desktop=1` by default
- Window points to `http://127.0.0.1:19000/?desktop=1` by default
- Customizable via environment variables for project path and Python path
> ⚠️ This is an **optional, experimental feature**, primarily developed and tested on macOS. See [`desktop-pet/README.md`](./desktop-pet/README.md) for details.
@ -242,6 +242,7 @@ This project is co-created and maintained by **Ring Hyacinth** and **Simon Lee**
| Date | Summary | Details |
|------|---------|---------|
| 2026-03-06 | 🔌 Default port updated — backend default port changed from 18791 to 19000 to avoid conflicts with OpenClaw Browser Control; synced scripts, desktop shells, and docs defaults | [`docs/CHANGELOG_2026-03.md`](./docs/CHANGELOG_2026-03.md) |
| 2026-03-01 | 🎉 **v2 Rebuild** — Trilingual support, asset management system, AI room design, full art asset overhaul | [`docs/FEATURES_NEW_2026-03-01.md`](./docs/FEATURES_NEW_2026-03-01.md) |
| 2026-03-03 | 📋 Open-source release checklist completed | [`docs/OPEN_SOURCE_RELEASE_CHECKLIST.md`](./docs/OPEN_SOURCE_RELEASE_CHECKLIST.md) |
| 2026-03-04 | 🔒 P0/P1 Security hardening — weak password blocking, backend refactor, stale-state auto-idle, skeleton loading | [`docs/UPDATE_REPORT_2026-03-04_P0_P1.md`](./docs/UPDATE_REPORT_2026-03-04_P0_P1.md) |

View file

@ -28,7 +28,7 @@ cd backend
python3 app.py
```
**http://127.0.0.1:18791** を開き、状態を切り替えてみましょう:
**http://127.0.0.1:19000** を開き、状態を切り替えてみましょう:
> ✅ ローカル開発ではデフォルト設定のままで構いませんが、本番環境では `.env.example``.env` にコピーし、`FLASK_SECRET_KEY` と `ASSET_DRAWER_PASS` に十分な長さのランダム値を設定することをおすすめします(弱いパスワードやセッション漏洩を防ぐため)。
@ -47,7 +47,7 @@ python3 set_state.py idle "待機中"
バックエンドが起動している状態で、簡単な smoke test を実行して主要エンドポイントが正常かどうかを確認できます:
```bash
python3 scripts/smoke_test.py --base-url http://127.0.0.1:18791
python3 scripts/smoke_test.py --base-url http://127.0.0.1:19000
```
すべてのチェックが `OK` と表示されれば、Star Office UI の基本的なステータスフローが正しく動作していることを意味します。
@ -89,7 +89,7 @@ cd backend
python3 app.py
```
`http://127.0.0.1:18791` を開く
`http://127.0.0.1:19000` を開く
### 4) ステータス切替
@ -103,7 +103,7 @@ python3 set_state.py idle "待機中"
### 5) 公開アクセス(任意)
```bash
cloudflared tunnel --url http://127.0.0.1:18791
cloudflared tunnel --url http://127.0.0.1:19000
```
`https://xxx.trycloudflare.com` のリンクを共有するだけで OK。
@ -204,7 +204,7 @@ npm run dev
```
- 起動時に Python バックエンドを自動起動
- デフォルトで `http://127.0.0.1:18791/?desktop=1` を表示
- デフォルトで `http://127.0.0.1:19000/?desktop=1` を表示
- 環境変数でプロジェクトパスや Python パスをカスタマイズ可能
> ⚠️ これは**オプションの実験的機能**であり、現在は主に macOS で開発・テストされています。詳細は [`desktop-pet/README.md`](./desktop-pet/README.md) を参照。
@ -242,6 +242,7 @@ npm run dev
| 日付 | 概要 | 詳細 |
|------|------|------|
| 2026-03-06 | 🔌 デフォルトポート変更 — OpenClaw Browser Control との競合を避けるため、バックエンドの既定ポートを 18791 から 19000 に変更。スクリプト、デスクトップシェル、ドキュメントの既定値も同期更新 | [`docs/CHANGELOG_2026-03.md`](./docs/CHANGELOG_2026-03.md) |
| 2026-03-01 | 🎉 **v2 リビルド公開** — 3 言語対応、資産管理システム、AI 画像生成による模様替え、アート資産全面刷新 | [`docs/FEATURES_NEW_2026-03-01.md`](./docs/FEATURES_NEW_2026-03-01.md) |
| 2026-03-03 | 📋 オープンソース公開チェックリスト完了 | [`docs/OPEN_SOURCE_RELEASE_CHECKLIST.md`](./docs/OPEN_SOURCE_RELEASE_CHECKLIST.md) |
| 2026-03-04 | 🔒 P0/P1 セキュリティ強化 — 弱パスワード拒否、バックエンド分割、stale ステータス自動 idle 復帰、スケルトンローディング | [`docs/UPDATE_REPORT_2026-03-04_P0_P1.md`](./docs/UPDATE_REPORT_2026-03-04_P0_P1.md) |

View file

@ -28,7 +28,7 @@ cd backend
python3 app.py
```
打开 **http://127.0.0.1:18791**,然后试试切状态:
打开 **http://127.0.0.1:19000**,然后试试切状态:
```bash
python3 set_state.py writing "正在整理文档"
@ -77,7 +77,7 @@ cd backend
python3 app.py
```
打开 `http://127.0.0.1:18791`
打开 `http://127.0.0.1:19000`
> ✅ 如果你是首次部署,可以先保留默认的开发配置;在生产环境中,请复制 `.env.example``.env` 并设置强随机的 `FLASK_SECRET_KEY``ASSET_DRAWER_PASS`,避免弱密码和会话泄露。
@ -93,7 +93,7 @@ python3 set_state.py idle "待命中"
### 5) 公网访问(可选)
```bash
cloudflared tunnel --url http://127.0.0.1:18791
cloudflared tunnel --url http://127.0.0.1:19000
```
拿到 `https://xxx.trycloudflare.com` 链接即可分享。
@ -103,7 +103,7 @@ cloudflared tunnel --url http://127.0.0.1:18791
在后端运行中时,可以执行一次轻量级的 smoke test确认核心接口是否正常工作
```bash
python3 scripts/smoke_test.py --base-url http://127.0.0.1:18791
python3 scripts/smoke_test.py --base-url http://127.0.0.1:19000
```
如果所有检查都显示 `OK`,说明后端路由和基础状态流转已经就绪。
@ -204,7 +204,7 @@ npm run dev
```
- 启动时自动拉起 Python 后端
- 窗口默认指向 `http://127.0.0.1:18791/?desktop=1`
- 窗口默认指向 `http://127.0.0.1:19000/?desktop=1`
- 支持通过环境变量自定义项目路径和 Python 路径
> ⚠️ 这是一个**可选的实验性功能**,目前主要在 macOS 上开发测试。详见 [`desktop-pet/README.md`](./desktop-pet/README.md)。
@ -242,6 +242,7 @@ npm run dev
| 日期 | 概要 | 详情 |
|------|------|------|
| 2026-03-06 | 🔌 默认端口调整 — 默认后端端口从 18791 调整为 19000以避开 OpenClaw Browser Control 端口冲突;同步更新脚本、桌面壳与文档默认值 | [`docs/CHANGELOG_2026-03.md`](./docs/CHANGELOG_2026-03.md) |
| 2026-03-01 | 🎉 **v2 重制发布** — 新增三语支持、资产管理系统、AI 生图装修、美术资产全面替换 | [`docs/FEATURES_NEW_2026-03-01.md`](./docs/FEATURES_NEW_2026-03-01.md) |
| 2026-03-03 | 📋 开源发布检查清单完成 | [`docs/OPEN_SOURCE_RELEASE_CHECKLIST.md`](./docs/OPEN_SOURCE_RELEASE_CHECKLIST.md) |
| 2026-03-04 | 🔒 P0/P1 安全加固 — 弱密码拦截、后端模块拆分、stale 状态自动回 idle、首屏骨架屏优化 | [`docs/UPDATE_REPORT_2026-03-04_P0_P1.md`](./docs/UPDATE_REPORT_2026-03-04_P0_P1.md) |

View file

@ -39,7 +39,7 @@ python3 app.py
```
然后告诉主人:
> 好了,你现在打开 http://127.0.0.1:18791 就能看到像素办公室了!
> 好了,你现在打开 http://127.0.0.1:19000 就能看到像素办公室了!
---
@ -131,7 +131,7 @@ python3 -m venv ../skills/gemini-image-generate/.venv
推荐先用 Cloudflare Tunnel最快
```bash
cloudflared tunnel --url http://127.0.0.1:18791
cloudflared tunnel --url http://127.0.0.1:19000
```
拿到 `https://xxx.trycloudflare.com` 后发给主人,并补一句:

View file

@ -2045,20 +2045,20 @@ def assets_upload():
if __name__ == "__main__":
raw_port = os.environ.get("STAR_BACKEND_PORT", "18791")
raw_port = os.environ.get("STAR_BACKEND_PORT", "19000")
try:
backend_port = int(raw_port)
except ValueError:
backend_port = 18791
backend_port = 19000
if backend_port <= 0:
backend_port = 18791
backend_port = 19000
print("=" * 50)
print("Star Office UI - Backend State Service")
print("=" * 50)
print(f"State file: {STATE_FILE}")
print(f"Listening on: http://0.0.0.0:{backend_port}")
if backend_port != 18791:
if backend_port != 19000:
print(f"(Port override: set STAR_BACKEND_PORT to change; current: {raw_port})")
else:
print("(Set STAR_BACKEND_PORT to use a different port, e.g. 3009)")

View file

@ -28,7 +28,7 @@ npm run dev
窗口默认会跳转到:
- `http://127.0.0.1:18791/?desktop=1`
- `http://127.0.0.1:19000/?desktop=1`
## 可选环境变量

View file

@ -210,7 +210,7 @@ fn read_state_file(state_path: &PathBuf) -> Result<PetState, String> {
}
fn read_state_via_backend() -> Result<PetState, String> {
let mut stream = std::net::TcpStream::connect("127.0.0.1:18791")
let mut stream = std::net::TcpStream::connect("127.0.0.1:19000")
.map_err(|e| format!("backend connect: {e}"))?;
let _ = stream.set_read_timeout(Some(Duration::from_millis(1200)));
let _ = stream.set_write_timeout(Some(Duration::from_millis(1200)));
@ -441,8 +441,8 @@ fn find_project_root() -> PathBuf {
}
fn spawn_backend(root: &PathBuf) -> Option<Child> {
if std::net::TcpStream::connect("127.0.0.1:18791").is_ok() {
eprintln!(" backend already running on 127.0.0.1:18791");
if std::net::TcpStream::connect("127.0.0.1:19000").is_ok() {
eprintln!(" backend already running on 127.0.0.1:19000");
return None;
}
@ -501,7 +501,7 @@ fn spawn_backend(root: &PathBuf) -> Option<Child> {
fn wait_backend_ready() -> bool {
let deadline = Instant::now() + Duration::from_secs(20);
while Instant::now() < deadline {
if std::net::TcpStream::connect("127.0.0.1:18791").is_ok() {
if std::net::TcpStream::connect("127.0.0.1:19000").is_ok() {
return true;
}
std::thread::sleep(Duration::from_millis(200));

View file

@ -14,7 +14,7 @@
"y": 60,
"width": 700,
"height": 500,
"url": "http://127.0.0.1:18791/?desktop=1",
"url": "http://127.0.0.1:19000/?desktop=1",
"decorations": false,
"transparent": true,
"alwaysOnTop": true,

View file

@ -102,7 +102,7 @@
const petCtx = petCanvas && petCanvas.getContext ? petCanvas.getContext('2d') : null;
if (isElectron) document.body.classList.add('electron-shell');
const BASE_URL = 'http://127.0.0.1:18791';
const BASE_URL = 'http://127.0.0.1:19000';
const STATIC_URL = `${BASE_URL}/static/`;
let uiLang = 'en';
const I18N = {

View file

@ -1,3 +1,12 @@
# CHANGELOG — 2026-03
## 2026-03-06
- 默认端口从 `18791` 调整为 `19000`,避开 OpenClaw Browser Control 端口冲突
- 同步更新 `office-agent-push.py`、`healthcheck.sh`、`scripts/smoke_test.py` 的默认地址
- 同步更新 Tauri / Electron 桌面壳默认连接地址
- 同步更新 README / SKILL / join-office 文档中的本地访问与 tunnel 示例
# Changelog — 2026-03 Refresh
## Highlights

View file

@ -4,7 +4,7 @@
## 已接入能力
- 复用原有前端:`http://127.0.0.1:18791/?desktop=1`
- 复用原有前端:`http://127.0.0.1:19000/?desktop=1`
- 复用 mini 页面:`desktop-pet/src/minimized.html`
- 启动时自动拉起 Python backend若未运行
- 主窗口 / mini 窗口切换
@ -24,7 +24,7 @@ npm run dev
- `STAR_PROJECT_ROOT`:项目根目录(默认自动探测)
- `STAR_BACKEND_PYTHON`:后端 Python 可执行路径
- `STAR_BACKEND_HOST`:后端主机(默认 `127.0.0.1`
- `STAR_BACKEND_PORT`:后端端口(默认 `18791`
- `STAR_BACKEND_PORT`:后端端口(默认 `19000`
## 说明

View file

@ -5,8 +5,8 @@ const path = require("path");
const net = require("net");
const APP_NAME = "Star Office UI";
const BACKEND_HOST = process.env.STAR_BACKEND_HOST || "127.0.0.1";
const rawBackendPort = Number(process.env.STAR_BACKEND_PORT || 18791);
const BACKEND_PORT = Number.isFinite(rawBackendPort) && rawBackendPort > 0 ? rawBackendPort : 18791;
const rawBackendPort = Number(process.env.STAR_BACKEND_PORT || 19000);
const BACKEND_PORT = Number.isFinite(rawBackendPort) && rawBackendPort > 0 ? rawBackendPort : 19000;
const BACKEND_BASE_URL = `http://${BACKEND_HOST}:${BACKEND_PORT}`;
let mainWindow = null;

View file

@ -2208,7 +2208,7 @@
window.open(url.toString(), '_blank', 'noopener,noreferrer');
}
} catch (_) {
window.open('http://127.0.0.1:18791/', '_blank', 'noopener,noreferrer');
window.open('http://127.0.0.1:19000/', '_blank', 'noopener,noreferrer');
}
});
}

View file

@ -51,7 +51,7 @@ python3 office-agent-push.py
## 本地状态读取优先级
脚本会按以下顺序自动发现你的状态源(无需手动配置):
1. `state.json`(本机 OpenClaw 工作区,自动发现多个候选路径)
2. `http://127.0.0.1:18791/status`(本地 HTTP 接口)
2. `http://127.0.0.1:19000/status`(本地 HTTP 接口)
3. 默认 fallbackidle
如果你的状态文件路径特殊,可以用环境变量指定:

View file

@ -44,7 +44,7 @@ DEFAULT_STATE_CANDIDATES = [
# 如果对方本地 /status 需要鉴权,可在这里填写 token或通过环境变量 OFFICE_LOCAL_STATUS_TOKEN
LOCAL_STATUS_TOKEN = os.environ.get("OFFICE_LOCAL_STATUS_TOKEN", "")
LOCAL_STATUS_URL = os.environ.get("OFFICE_LOCAL_STATUS_URL", "http://127.0.0.1:18791/status")
LOCAL_STATUS_URL = os.environ.get("OFFICE_LOCAL_STATUS_URL", "http://127.0.0.1:19000/status")
# 可选:直接指定本地状态文件路径(最简单方案:绕过 /status 鉴权)
LOCAL_STATE_FILE = os.environ.get("OFFICE_LOCAL_STATE_FILE", "")
VERBOSE = os.environ.get("OFFICE_VERBOSE", "0") in {"1", "true", "TRUE", "yes", "YES"}

View file

@ -2,7 +2,7 @@
# Star Office UI Health Check
# Checks if backend is responding, restarts if not
BACKEND_URL="http://127.0.0.1:18791/health"
BACKEND_URL="http://127.0.0.1:19000/health"
LOG_FILE="/root/.openclaw/workspace/star-office-ui/healthcheck.log"
# Log timestamp

View file

@ -52,7 +52,7 @@ DEFAULT_STATE_CANDIDATES = [
# 如果对方本地 /status 需要鉴权,可在这里填写 token或通过环境变量 OFFICE_LOCAL_STATUS_TOKEN
LOCAL_STATUS_TOKEN = os.environ.get("OFFICE_LOCAL_STATUS_TOKEN", "")
LOCAL_STATUS_URL = os.environ.get("OFFICE_LOCAL_STATUS_URL", "http://127.0.0.1:18791/status")
LOCAL_STATUS_URL = os.environ.get("OFFICE_LOCAL_STATUS_URL", "http://127.0.0.1:19000/status")
# 可选:直接指定本地状态文件路径(最简单方案:绕过 /status 鉴权)
LOCAL_STATE_FILE = os.environ.get("OFFICE_LOCAL_STATE_FILE", "")
VERBOSE = os.environ.get("OFFICE_VERBOSE", "0") in {"1", "true", "TRUE", "yes", "YES"}

View file

@ -2,7 +2,7 @@
"""Star Office UI smoke test (non-destructive).
Usage:
python3 scripts/smoke_test.py --base-url http://127.0.0.1:18791
python3 scripts/smoke_test.py --base-url http://127.0.0.1:19000
Optional env:
SMOKE_AUTH_BEARER=xxxx # if your gateway/proxy requires bearer auth
@ -50,7 +50,7 @@ def req(method: str, url: str, body: dict | None = None, token: str = "") -> tup
def main() -> int:
ap = argparse.ArgumentParser()
ap.add_argument("--base-url", default="http://127.0.0.1:18791", help="Base URL of Star Office UI service")
ap.add_argument("--base-url", default="http://127.0.0.1:19000", help="Base URL of Star Office UI service")
args = ap.parse_args()
base = args.base_url.rstrip("/")