-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf50d21
commit ecb6f6b
Showing
12 changed files
with
470 additions
and
116 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,43 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [created] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
goos: [ linux, windows, darwin, freebsd ] | ||
goarch: [ "386", arm, amd64, arm64, mipsle ] | ||
exclude: | ||
- goarch: "386" | ||
goos: darwin | ||
- goarch: mipsle | ||
goos: windows | ||
- goarch: mipsle | ||
goos: darwin | ||
- goarch: mipsle | ||
goos: freebsd | ||
- goarch: arm | ||
goos: windows | ||
- goarch: arm | ||
goos: darwin | ||
- goarch: arm | ||
goos: freebsd | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: wangyoucao577/go-release-action@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
goos: ${{ matrix.goos }} | ||
goarch: ${{ matrix.goarch }} | ||
ldflags: "-s -w" |
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 |
---|---|---|
@@ -1,11 +1,75 @@ | ||
# rlpa-server | ||
|
||
🚧🚧🚧 Under construction 🚧🚧🚧 | ||
Another go implement of estk.me [rlpa-server.php](https://github.com/estkme-group/lpac/blob/main/src/rlpa-server.php) | ||
|
||
- [x] rlpa packet | ||
- [x] Download Profile (not tested yet) | ||
- [x] Process Notification (consistent with the behavior of `rlpa-server.php`, notifications for non "delete" operations will be removed after processing) | ||
|
||
TODO | ||
- [] json 化 http response | ||
- [] api disconnect 逻辑 | ||
- [] 日志输出 | ||
- ... | ||
Under construction: | ||
|
||
- Remote Management(http api) | ||
|
||
This feature is currently under construction. However, it is not necessary to use this feature in normal usage scenarios, and I am not sure if I should complete it | ||
|
||
## Usage | ||
|
||
Compile latest [lpac](https://github.com/estkme-group/lpac), then place the `lpac` binary program in the same directory as the `rlpa-server` program | ||
|
||
use environment variables to set port | ||
|
||
- `SOCKET_PORT`: socket port for estk rlpa, default 1888 | ||
- `API_PORT`: http management api port, default 8008 | ||
|
||
debug log output: start with `-debug` argument to enable debug log level | ||
|
||
### systemd service example | ||
|
||
Write the following content into `/etc/systemd/system/rlpa-server.service` | ||
``` | ||
[Unit] | ||
Description=rlpa server | ||
Wants=network-online.target | ||
After=network-online.target | ||
[Service] | ||
ExecStart=/path/to/rlpa-server | ||
WorkingDirectory=/path/to/rlpa-server-directory | ||
Restart=on-failure | ||
User=[your-user] | ||
[Install] | ||
WantedBy=multi-user.target | ||
``` | ||
- `ExecStart`: rlpa-server binary path | ||
- `WorkingDirectory`: The directory where rlpa server is located | ||
- `User`: Replace with actual user | ||
|
||
Then execute `sudo systemctl daemon-reload` to reload services | ||
|
||
- Start rlpa-server: `sudo systemctl start rlpa-server` | ||
- Let rlpa-server start with system: `sudo systemctl enable rlpa-server` | ||
|
||
## Public Server | ||
⚠️ No guarantee, use at your own risk | ||
|
||
| IP | Port | Location | | ||
|:------------:|:----:|:-----------------:| | ||
|205.185.117.85| 1888 | Las Vegas, NV, US | | ||
|
||
|
||
## API Document | ||
|
||
- lpac shell command | ||
|
||
Post json to `/shell/{manageID}` with header `Password: {Password}` | ||
|
||
example | ||
|
||
```bash | ||
curl -X POST -H "Content-Type: application/json" \ | ||
-H "Password: 2660" \ | ||
-d '{"type":0, "command":"chip info"}' \ | ||
http://example.com:8008/shell/rAct | ||
``` | ||
|
||
Will get lpac output |
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
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
module rlpa-server | ||
|
||
go 1.22 | ||
|
||
require github.com/gorilla/mux v1.8.1 // indirect |
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 |
---|---|---|
@@ -1,2 +0,0 @@ | ||
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= | ||
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= | ||
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
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
Oops, something went wrong.