Skip to content

Commit 1eff30c

Browse files
committed
🎉 开源发布准备:清理真实 IP、新增 .gitignore 与 CI(shellcheck)
1 parent f105099 commit 1eff30c

5 files changed

Lines changed: 43 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
shell:
10+
name: Shell checks
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Bash syntax check
16+
run: bash -n apply.sh revert.sh
17+
18+
- name: ShellCheck
19+
uses: ludeeus/action-shellcheck@master
20+
with:
21+
scandir: "./"
22+
severity: warning

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# macOS
2+
.DS_Store
3+
4+
# Editors / IDEs
5+
.vscode/
6+
.idea/
7+
*.swp
8+
*.swo
9+
*~
10+
11+
# Logs
12+
*.log
13+
14+
# OS noise
15+
Thumbs.db

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pnpm install
6666
#### ③ 克隆 dsh-lan 并打补丁
6767
6868
```bash
69-
git clone https://github.com/<your-name>/dsh-lan.git
69+
git clone https://github.com/oitsukiii/dsh-lan.git
7070
cd dsh-lan
7171
./apply.sh /path/to/deepseek-harness
7272
```

apply.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ set -euo pipefail
1616
# ---- colors (TTY only) ----
1717
if [ -t 1 ]; then
1818
C_GREEN=$'\033[0;32m'; C_YELLOW=$'\033[1;33m'; C_RED=$'\033[0;31m'
19-
C_CYAN=$'\033[0;36m'; C_BOLD=$'\033[1m'; C_RESET=$'\033[0m'
19+
C_CYAN=$'\033[0;36m'; C_RESET=$'\033[0m'
2020
else
21-
C_GREEN=''; C_YELLOW=''; C_RED=''; C_CYAN=''; C_BOLD=''; C_RESET=''
21+
C_GREEN=''; C_YELLOW=''; C_RED=''; C_CYAN=''; C_RESET=''
2222
fi
2323
ok() { echo -e "${C_GREEN}${C_RESET} $*"; }
2424
warn() { echo -e "${C_YELLOW}${C_RESET} $*"; }
@@ -83,7 +83,7 @@ ok "[3/4] 补丁应用成功"
8383

8484
# ---- 5. build dependency ----
8585
info "[4/4] 检查构建依赖 unrun(tsdown 需要)..."
86-
if ! ls "$DSH_DIR/node_modules/.pnpm" 2>/dev/null | grep -q '^unrun@'; then
86+
if ! compgen -G "$DSH_DIR/node_modules/.pnpm/unrun@*" >/dev/null; then
8787
if (cd "$DSH_DIR" && pnpm add -D unrun -w >/dev/null 2>&1); then
8888
ok "[4/4] unrun 已安装"
8989
else

patches/dsh-lan.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ index feb85db..765a496 100644
1616
*/
1717
+// Local patch: crypto.randomUUID is only available in secure contexts
1818
+// (HTTPS or localhost). When dsh is served over plain HTTP on a LAN IP
19-
+// (e.g. http://192.168.2.102:3080), provide a standards-shaped fallback so
19+
+// (e.g. http://192.168.1.100:3080), provide a standards-shaped fallback so
2020
+// provider-directory loading and other client code keeps working.
2121
+if (typeof globalThis.crypto === 'object' && typeof globalThis.crypto.randomUUID !== 'function') {
2222
+ try {
@@ -42,7 +42,7 @@ index af6997c..d3d5da3 100644
4242
const program = webCommand()
4343
program.action(() => {
4444
const options = program.opts<WebOptions>()
45-
+ // Local patch: allow explicit LAN binds (e.g. --host 192.168.2.102) so the
45+
+ // Local patch: allow explicit LAN binds (e.g. --host 192.168.1.100) so the
4646
+ // UI can be reached from home devices. 0.0.0.0 wildcard remains a usage error.
4747
if (options.host === '0.0.0.0') {
4848
- program.error('error: --host 0.0.0.0 is intentionally not supported yet for safety: it would expose remote code execution to the network; use 127.0.0.1 instead')

0 commit comments

Comments
 (0)