Skip to content

Commit f52eac6

Browse files
authored
opt.: new website (#1138)
* opt.: new website Fixes #1137 * opt. * opt. Co-authored-by: Copilot <copilot@github.com> * opt. * opt. * opt.: docs * fix * new: more locales * opt.: js -> ts * fix * fix
1 parent c1ccc09 commit f52eac6

80 files changed

Lines changed: 3380 additions & 325 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ PLATFORM ?=
1010
ENV_FILE ?=
1111
XCARCHIVE_PATH ?=
1212
APP_PATH ?=
13+
DMG_PATH ?=
14+
TAP_REPO_PATH ?=
1315

1416
.PHONY: help deps pub-get run run-device analyze test test-one coverage \
1517
gen gen-build gen-build-clean gen-l10n build build-android build-ios \
16-
build-macos build-linux build-windows clean release-macos-dmg package-dmg
18+
build-macos build-linux build-windows clean release-macos-dmg package-dmg \
19+
sync-homebrew-cask
1720

1821
help:
1922
@printf '%s\n' \
@@ -48,7 +51,11 @@ help:
4851
' Optional: make release-macos-dmg ENV_FILE=.env.release' \
4952
' package-dmg Run scripts/release/package-dmg-from-xcarchive.sh' \
5053
' Example: make package-dmg APP_PATH="/path/Server Box.app"' \
51-
' Example: make package-dmg XCARCHIVE_PATH=/path/Runner.xcarchive'
54+
' Example: make package-dmg XCARCHIVE_PATH=/path/Runner.xcarchive' \
55+
' sync-homebrew-cask Generate ~/proj/homebrew-taps/Casks/server-box.rb from a built DMG' \
56+
' Example: make sync-homebrew-cask APP_PATH="/path/Server Box.app"' \
57+
' Example: make sync-homebrew-cask XCARCHIVE_PATH=/path/Runner.xcarchive' \
58+
' Example: make sync-homebrew-cask DMG_PATH=build/artifacts/ServerBox-1.0.1.dmg'
5259

5360
deps pub-get:
5461
$(FLUTTER) pub get
@@ -134,3 +141,19 @@ package-dmg:
134141
else \
135142
XCARCHIVE_PATH="$(XCARCHIVE_PATH)" bash scripts/release/package-dmg-from-xcarchive.sh; \
136143
fi
144+
145+
sync-homebrew-cask:
146+
@if [ -z "$(APP_PATH)" ] && [ -z "$(XCARCHIVE_PATH)" ] && [ -z "$(DMG_PATH)" ]; then \
147+
echo 'APP_PATH, XCARCHIVE_PATH, or DMG_PATH is required.'; \
148+
echo 'Example: make sync-homebrew-cask APP_PATH="/path/Server Box.app"'; \
149+
echo 'Example: make sync-homebrew-cask XCARCHIVE_PATH=/path/Runner.xcarchive'; \
150+
echo 'Example: make sync-homebrew-cask DMG_PATH=build/artifacts/ServerBox-1.0.1.dmg'; \
151+
exit 1; \
152+
fi
153+
@if [ -n "$(APP_PATH)" ]; then \
154+
APP_PATH="$(APP_PATH)" DMG_PATH="$(DMG_PATH)" TAP_REPO_PATH="$(TAP_REPO_PATH)" bash scripts/release/sync-homebrew-cask.sh; \
155+
elif [ -n "$(XCARCHIVE_PATH)" ]; then \
156+
XCARCHIVE_PATH="$(XCARCHIVE_PATH)" DMG_PATH="$(DMG_PATH)" TAP_REPO_PATH="$(TAP_REPO_PATH)" bash scripts/release/sync-homebrew-cask.sh; \
157+
else \
158+
DMG_PATH="$(DMG_PATH)" TAP_REPO_PATH="$(TAP_REPO_PATH)" bash scripts/release/sync-homebrew-cask.sh; \
159+
fi

README.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ Especially thanks to <a href="https://github.com/TerminalStudio/dartssh2">dartss
3030

3131
|Platform| From|
3232
|--|--|
33-
| iOS / macOS | [AppStore](https://apps.apple.com/app/id1586449703) |
34-
| Android | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid) / [F-Droid](https://f-droid.org/packages/tech.lolli.toolbox) / [OpenAPK](https://www.openapk.net/serverbox/tech.lolli.toolbox/) |
35-
| Linux / Windows | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid) |
33+
| iOS | [AppStore](https://apps.apple.com/app/id1586449703) |
34+
| macOS | [AppStore](https://apps.apple.com/app/id1586449703) / brew install --cask server-box |
35+
| Android | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid) / [F-Droid](https://f-droid.org/packages/tech.lolli.toolbox) / [OpenAPK](https://www.openapk.net/serverbox/tech.lolli.toolbox/) |
36+
| Linux / Windows | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid) |
3637

3738
Please only download pkgs from the source that **you trust**!
3839

@@ -73,17 +74,6 @@ If I forgot to add your name to the contributors list, please add a comment in t
7374
2. Clone this repo, run `flutter run` to start the app.
7475
3. Run `dart run fl_build -p PLATFORM` to build the app.
7576

76-
### Release macOS notarized DMG
77-
78-
1. Copy `.env.release.example` to `.env.release`.
79-
2. Fill in `APPLE_TEAM_ID` and `APPLE_NOTARY_KEYCHAIN_PROFILE`.
80-
3. Make sure the `Developer ID Application` certificate is already installed in Keychain.
81-
4. Make sure notarization credentials are already stored via `xcrun notarytool store-credentials`.
82-
5. Install the provisioning profile used for DMG packaging. The script defaults to `ServerBox DMG Profile`, and you can override it with `APP_PROFILE_NAME`.
83-
6. Run `bash scripts/release/release-macos-dmg.sh`.
84-
85-
This flow does not modify the default Xcode Release signing config. It injects a temporary `xcconfig` only for archive/export, builds a signed `.app`, packages a DMG, submits it to notarization, staples the result, and optionally uploads the DMG to the GitHub Release for `v<version>`.
86-
8777
### Translation
8878

8979
- [Guide](https://blog.lpkt.cn/posts/faq/) can be found in my blog.

README_zh.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030

3131
平台|下载
3232
--|--
33-
iOS / macOS | [AppStore](https://apps.apple.com/app/id1586449703)
34-
Android | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid) / [F-Droid](https://f-droid.org/packages/tech.lolli.toolbox) / [OpenAPK](https://www.openapk.net/serverbox/tech.lolli.toolbox/)
33+
| iOS | [AppStore](https://apps.apple.com/app/id1586449703) |
34+
| macOS | [AppStore](https://apps.apple.com/app/id1586449703) / brew install --cask server-box |
35+
Android | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid) / [F-Droid](https://f-droid.org/packages/tech.lolli.toolbox) / [OpenAPK](https://www.openapk.net/serverbox/tech.lolli.toolbox/)
3536
Linux / Windows | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid)
3637

3738
请从 **信任** 的来源下载!
@@ -75,17 +76,6 @@ Linux / Windows | [GitHub](https://github.com/lollipopkit/flutter_server_box/rel
7576
2. 克隆这个仓库, 运行 `flutter run` 启动应用
7677
3. 运行 `dart run fl_build -p PLATFORM` 构建应用
7778

78-
### 发布 macOS 公证 DMG
79-
80-
1. 复制 `.env.release.example``.env.release`
81-
2. 填入 `APPLE_TEAM_ID``APPLE_NOTARY_KEYCHAIN_PROFILE`
82-
3. 确保 `Developer ID Application` 证书已经安装到 Keychain
83-
4. 确保已经通过 `xcrun notarytool store-credentials` 存好了公证凭据
84-
5. 安装用于 DMG 打包的 provisioning profile。脚本默认使用 `ServerBox DMG Profile`,也可以通过 `APP_PROFILE_NAME` 覆盖
85-
6. 运行 `bash scripts/release/release-macos-dmg.sh`
86-
87-
这套流程不会修改工程默认的 Xcode Release 签名配置。脚本只会在归档和导出时注入临时 `xcconfig`,生成已签名 `.app`、打包 DMG、提交公证、回填 stapler,并可选把 DMG 上传到 `v<version>` 对应的 GitHub Release。
88-
8979
### 翻译
9080

9181
[指南](https://blog.lpkt.cn/faq/) 可在我的博客中找到。

docs/astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import starlight from '@astrojs/starlight';
44

55
// https://astro.build/config
66
export default defineConfig({
7+
base: '/docs',
78
integrations: [
89
starlight({
910
title: 'Server Box',

docs/src/content/docs/advanced/bulk-import.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Import multiple server configurations at once using a JSON file.
1010
:::danger[Security Warning]
1111
**Never store plaintext passwords in files!** This JSON example shows a password field for demonstration only, but you should:
1212

13-
- **Prefer SSH keys** (`keyId`) instead of `pwd` - they're more secure
13+
- **Prefer SSH keys** (`pubKeyId`) instead of `pwd` - they're more secure
1414
- **Use secret managers** or environment variables if you must use passwords
1515
- **Delete the file immediately** after import - don't leave credentials lying around
1616
- **Add to .gitignore** - never commit credential files to version control
@@ -24,7 +24,7 @@ Import multiple server configurations at once using a JSON file.
2424
"port": 22,
2525
"user": "root",
2626
"pwd": "password",
27-
"keyId": "",
27+
"pubKeyId": "",
2828
"tags": ["production"],
2929
"autoConnect": false
3030
}
@@ -40,9 +40,10 @@ Import multiple server configurations at once using a JSON file.
4040
| `port` | Yes | SSH port (usually 22) |
4141
| `user` | Yes | SSH username |
4242
| `pwd` | No | Password (avoid - use SSH keys instead) |
43-
| `keyId` | No | SSH key name (from Private Keys - recommended) |
43+
| `pubKeyId` | No | Private key id (from Private Keys - recommended) |
4444
| `tags` | No | Organization tags |
4545
| `autoConnect` | No | Auto-connect on startup |
46+
| `id` | No | Stable server id; omitted or empty values are generated on import |
4647

4748
## Import Steps
4849

@@ -60,15 +61,15 @@ Import multiple server configurations at once using a JSON file.
6061
"ip": "prod.example.com",
6162
"port": 22,
6263
"user": "admin",
63-
"keyId": "my-key",
64+
"pubKeyId": "my-key",
6465
"tags": ["production", "web"]
6566
},
6667
{
6768
"name": "Development",
6869
"ip": "dev.example.com",
6970
"port": 2222,
7071
"user": "dev",
71-
"keyId": "dev-key",
72+
"pubKeyId": "dev-key",
7273
"tags": ["development"]
7374
}
7475
]

docs/src/content/docs/de/advanced/bulk-import.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Importieren Sie mehrere Serverkonfigurationen gleichzeitig mithilfe einer JSON-D
1010
:::danger[Sicherheitswarnung]
1111
**Speichern Sie niemals Klartext-Passwörter in Dateien!** Dieses JSON-Beispiel zeigt ein Passwort-Feld nur zur Demonstration, aber Sie sollten:
1212

13-
- **SSH-Schlüssel bevorzugen** (`keyId`) anstelle von `pwd` - diese sind sicherer
13+
- **SSH-Schlüssel bevorzugen** (`pubKeyId`) anstelle von `pwd` - diese sind sicherer
1414
- **Passwort-Manager** oder Umgebungsvariablen verwenden, wenn Sie Passwörter verwenden müssen
1515
- **Löschen Sie die Datei sofort** nach dem Import - lassen Sie keine Anmeldedaten herumliegen
1616
- **Fügen Sie sie zur .gitignore hinzu** - checken Sie niemals Anmeldedatendateien in die Versionsverwaltung ein
@@ -24,7 +24,7 @@ Importieren Sie mehrere Serverkonfigurationen gleichzeitig mithilfe einer JSON-D
2424
"port": 22,
2525
"user": "root",
2626
"pwd": "password",
27-
"keyId": "",
27+
"pubKeyId": "",
2828
"tags": ["production"],
2929
"autoConnect": false
3030
}
@@ -40,7 +40,7 @@ Importieren Sie mehrere Serverkonfigurationen gleichzeitig mithilfe einer JSON-D
4040
| `port` | Ja | SSH-Port (normalerweise 22) |
4141
| `user` | Ja | SSH-Benutzername |
4242
| `pwd` | Nein | Passwort (vermeiden - stattdessen SSH-Schlüssel verwenden) |
43-
| `keyId` | Nein | SSH-Schlüsselname (aus Private Keys - empfohlen) |
43+
| `pubKeyId` | Nein | Private-Key-ID (aus Private Keys - empfohlen) |
4444
| `tags` | Nein | Organisations-Tags |
4545
| `autoConnect` | Nein | Automatische Verbindung beim Start |
4646

@@ -60,15 +60,15 @@ Importieren Sie mehrere Serverkonfigurationen gleichzeitig mithilfe einer JSON-D
6060
"ip": "prod.example.com",
6161
"port": 22,
6262
"user": "admin",
63-
"keyId": "my-key",
63+
"pubKeyId": "my-key",
6464
"tags": ["production", "web"]
6565
},
6666
{
6767
"name": "Entwicklung",
6868
"ip": "dev.example.com",
6969
"port": 2222,
7070
"user": "dev",
71-
"keyId": "dev-key",
71+
"pubKeyId": "dev-key",
7272
"tags": ["development"]
7373
}
7474
]

docs/src/content/docs/de/development/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Server Box folgt den Prinzipien der Clean Architecture mit einer klaren Trennung
4747
### Lokale Speicherung: Hive
4848

4949
- **hive_ce**: Community-Edition von Hive
50-
- Keine manuellen `@HiveField` oder `@HiveType` erforderlich
50+
- Folgen Sie dem bestehenden Modellmuster: Die meisten Stores verwenden `hive_ce`, einige verfolgte Modelle deklarieren weiterhin explizit `@HiveType` und `@HiveField`
5151
- Typ-Adapter werden automatisch generiert
5252
- Persistenter Key-Value-Speicher
5353

docs/src/content/docs/de/development/codegen.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ Führen Sie sie aus nach der Änderung von:
2121
# Gesamten Code generieren
2222
dart run build_runner build --delete-conflicting-outputs
2323

24-
# Bereinigen und neu generieren
25-
dart run build_runner build --delete-conflicting-outputs --clean
24+
# Generierten Build-Cache bereinigen
25+
dart run build_runner clean
26+
27+
# Dann neu generieren
28+
dart run build_runner build --delete-conflicting-outputs
2629
```
2730

2831
## Generierte Dateien
@@ -94,5 +97,5 @@ Generiert `lib/generated/l10n/` aus `lib/l10n/*.arb` Dateien.
9497
## Tipps
9598

9699
- Verwenden Sie `--delete-conflicting-outputs`, um Konflikte zu vermeiden.
97-
- Fügen Sie generierte Dateien zur `.gitignore` hinzu.
100+
- Behalten Sie generierte Dateien in der Versionsverwaltung, wenn dieses Repository sie bereits verfolgt.
98101
- Bearbeiten Sie generierte Dateien niemals manuell.

docs/src/content/docs/de/development/testing.md

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,7 @@ flutter test --coverage
1818

1919
## Teststruktur
2020

21-
Tests befinden sich im Verzeichnis `test/` und spiegeln die Struktur von `lib/` wider:
22-
23-
```
24-
test/
25-
├── data/
26-
│ ├── model/
27-
│ └── provider/
28-
├── view/
29-
│ └── widget/
30-
└── test_helpers.dart
31-
```
21+
Tests befinden sich im Verzeichnis `test/`. Die aktuelle Suite ist überwiegend flach und nach Parser-, Modell- und Utility-Verhalten gruppiert, zum Beispiel `cpu_test.dart`, `container_test.dart` und `ssh_config_test.dart`.
3222

3323
## Unit-Tests
3424

@@ -71,26 +61,13 @@ test('serverStatusProvider gibt Status zurück', () async {
7161
});
7262
```
7363

74-
## Mocking
75-
76-
Mocks für externe Abhängigkeiten verwenden:
77-
78-
```dart
79-
class MockSshService extends Mock implements SshService {}
64+
## Externe Abhängigkeiten
8065

81-
test('verbindet zum Server', () async {
82-
final mockSsh = MockSshService();
83-
when(mockSsh.connect(any)).thenAnswer((_) async => true);
84-
85-
// Test mit Mock
86-
});
87-
```
66+
Vermeiden Sie Tests, die von echten SSH-Servern abhängen. Parser-, Modell- und Command-Builder-Tests sollten deterministisch bleiben; fügen Sie gezielte Fakes oder Fixtures hinzu, wenn eine Funktion eine Service-Grenze einführt.
8867

8968
## Integrationstests
9069

91-
Komplette Benutzerabläufe testen (in `integration_test/`):
92-
93-
```dart
70+
Im aktuellen Repository gibt es keine `integration_test/`-Suite. Fügen Sie Integrationstests nur hinzu, wenn eine Funktion End-to-End-Geräte- oder App-Flow-Abdeckung benötigt.dart
9471
testWidgets('Server hinzufügen Ablauf', (tester) async {
9572
await tester.pumpWidget(MyApp());
9673

docs/src/content/docs/de/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ hero:
55
tagline: Verwalten Sie Ihre Linux-Server von überall aus
66
actions:
77
- text: Loslegen
8-
link: /de/introduction/
8+
link: /docs/de/introduction/
99
icon: right-arrow
1010
variant: primary
1111
- text: Auf GitHub ansehen
@@ -41,6 +41,6 @@ import { Card, CardGrid } from '@astrojs/starlight/components';
4141

4242
## Quick-Links
4343

44-
- **Download**: Verfügbar im [App Store](https://apps.apple.com/app/id1586449703), auf [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) und bei [F-Droid](https://f-droid.org/)
44+
- **Download**: Verfügbar im [App Store](https://apps.apple.com/app/id1586449703), auf [GitHub](https://github.com/lollipopkit/flutter_server_box/releases), bei [F-Droid](https://f-droid.org/packages/tech.lolli.toolbox), im [CDN](https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid) und bei [OpenAPK](https://www.openapk.net/serverbox/tech.lolli.toolbox/)
4545
- **Dokumentation**: Entdecken Sie die Anleitungen für den Einstieg in die Server Box
4646
- **Support**: Treten Sie unserer Community auf GitHub für Diskussionen und Probleme bei

0 commit comments

Comments
 (0)