-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from 1eof/master
增加macOS手动安装的文档
- Loading branch information
Showing
2 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# 安装器 | ||
|
||
## 下载和安装 | ||
|
||
打开 [GitHub Releases](https://github.com/PBH-BTN/PeerBanHelper/releases/latest)。你会找到两个以 `.dmg` 结尾的安装程序。 | ||
|
||
其中,一种带有 `nojava` 标记,另一种不带。如果你对什么是 Java 不熟悉,请选择**不带**nojava标记的下载。 | ||
|
||
双击打开刚刚下载的`.dmg`文件,再双击`PeerBanHelper安装程序.app`,选择打开,进行安装流程。 | ||
|
||
### 开机启动 | ||
|
||
勾选随系统启动时,当您登录到 macOS 桌面,PBH 就会静默启动到系统托盘。 | ||
|
||
## GUI/GUI Silent/NoGUI | ||
|
||
### GUI | ||
|
||
顾名思义,以图形窗口启动 PeerBanHelper。会有一个窗口可以查看日志,以及一个可以打开数据文件夹和免登录打开 WebUI 的菜单。 | ||
点击窗口的关闭按钮,就可以最小化到系统托盘图标。 | ||
|
||
### GUI Silent | ||
|
||
以图形窗口启动 PeerBanHelper。但只显示系统托盘图标。 | ||
|
||
### NoGUI | ||
|
||
以控制台的模式情况,最节约资源。适合硬核用户。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
# 手动安装 | ||
## 安装依赖 | ||
使用homebrew安装jdk: | ||
|
||
```shell | ||
brew install --cask zulu | ||
``` | ||
|
||
验证安装是否成功: | ||
|
||
```shell | ||
java -version | ||
``` | ||
|
||
如果安装成功,则会输出类似下列的版本号: | ||
|
||
```plain | ||
openjdk version "23.0.1" 2024-10-15 | ||
OpenJDK Runtime Environment Zulu23.30+13-CA (build 23.0.1+11) | ||
OpenJDK 64-Bit Server VM Zulu23.30+13-CA (build 23.0.1+11, mixed mode, sharing) | ||
``` | ||
|
||
## 运行 | ||
访问 Github Release 下载 [JAR 文件](https://github.com/PBH-BTN/PeerBanHelper/releases/latest/download/PeerBanHelper.jar)。 | ||
|
||
使用命令启动 PBH: | ||
```shell | ||
java -Djava.awt.headless=true -Xmx512M -Xss512k -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+ShrinkHeapInSteps -jar PeerBanHelper.jar nogui | ||
``` | ||
|
||
## 服务 | ||
创建`~/Library/LaunchAgents/peerbanhelper.plist`文件,并写入: | ||
|
||
```xml | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>Label</key> | ||
<string>peerbanhelper</string> | ||
<key>ProgramArguments</key> | ||
<array> | ||
<string>/usr/bin/java</string> | ||
<string>-Djava.awt.headless=true</string> | ||
<string>-jar</string> | ||
<string>-Xmx512M</string> | ||
<string>-Xms512k</string> | ||
<string>-XX:+UseG1GC</string> | ||
<string>-XX:+UseStringDeduplication</string> | ||
<string>-XX:+ShrinkHeapInSteps</string> | ||
<string>PeerBanHelper.jar</string> | ||
<string>nogui</string> | ||
</array> | ||
<key>RunAtLoad</key> | ||
<true/> | ||
<key>KeepAlive</key> | ||
<true/> | ||
<key>WorkingDirectory</key> | ||
<string>/path/to/PBH</string> | ||
</dict> | ||
</plist> | ||
``` | ||
|
||
注意替换`/path/to/PBH`为jar文件的目录,完成后使用以下命令启动: | ||
|
||
```shell | ||
launchctl load -w ~/Library/LaunchAgents/peerbanhelper.plist | ||
``` |