Compare commits
12 Commits
v1.0.0
...
v1.0.0-test
| Author | SHA1 | Date | |
|---|---|---|---|
| eb525879f1 | |||
| b1c7f10fec | |||
| da09fb2e65 | |||
| fefaf49298 | |||
| fc05ac0725 | |||
| 5bcac141d1 | |||
| c7ad30d2df | |||
| 93f6aaea76 | |||
| 7a448ffa3a | |||
| 89443f9481 | |||
| c5d3651a96 | |||
| 548e3949ad |
@@ -44,8 +44,8 @@ jobs:
|
||||
- name: Build Go binaries
|
||||
run: |
|
||||
cd app
|
||||
GOOS=linux GOARCH=amd64 go build -o ../wgrplane-linux-amd64 .
|
||||
GOOS=linux GOARCH=arm64 go build -o ../wgrplane-linux-arm64 .
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ../wgrplane-linux-amd64 .
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o ../wgrplane-linux-arm64 .
|
||||
|
||||
- name: Generate latest.json
|
||||
run: |
|
||||
@@ -79,6 +79,21 @@ jobs:
|
||||
TAG="${{ gitea.ref_name }}"
|
||||
API="${{ gitea.server_url }}/api/v1"
|
||||
|
||||
# 0. Check & Delete Existing Release
|
||||
echo "=== 0. Check & Delete Existing Release ==="
|
||||
EXISTING_RESP=$(curl -s -H "Authorization: token $TOKEN" "$API/repos/$REPO/releases/tags/$TAG")
|
||||
EXISTING_ID=$(echo "$EXISTING_RESP" | grep -o '"id":[0-9]*' | head -n 1 | cut -d':' -f2 || true)
|
||||
|
||||
if [ -n "$EXISTING_ID" ] && [ "$EXISTING_ID" != "null" ]; then
|
||||
echo "⚠️ Found existing release for tag $TAG with ID: $EXISTING_ID. Deleting..."
|
||||
DELETE_RESP=$(curl -s -w "\n%{http_code}" -X DELETE -H "Authorization: token $TOKEN" "$API/repos/$REPO/releases/$EXISTING_ID")
|
||||
echo "✅ Delete response: $DELETE_RESP"
|
||||
else
|
||||
echo "No existing release found for $TAG. Proceeding..."
|
||||
fi
|
||||
|
||||
# 1. Create Release
|
||||
echo "=== 1. Create New Release ==="
|
||||
JSON_BODY=$(printf '{"tag_name":"%s","name":"%s","body":"Release %s","draft":false,"prerelease":%s}' "$TAG" "$TAG" "$TAG" "${{ inputs.prerelease }}")
|
||||
|
||||
RELEASE_RESP=$(curl -s -X POST \
|
||||
@@ -88,7 +103,8 @@ jobs:
|
||||
"$API/repos/$REPO/releases")
|
||||
|
||||
# Ambil ID dengan lebih teliti
|
||||
RELEASE_ID=$(echo "$RELEASE_RESP" | grep -o '"id":[0-9]*' | head -n 1 | cut -d':' -f2)
|
||||
# Tambahkan || true agar grep tidak membuat script crash (karena set -e) jika id tidak ditemukan
|
||||
RELEASE_ID=$(echo "$RELEASE_RESP" | grep -o '"id":[0-9]*' | head -n 1 | cut -d':' -f2 || true)
|
||||
|
||||
if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = "null" ]; then
|
||||
echo "Gagal membuat release. Response: $RELEASE_RESP"
|
||||
|
||||
@@ -355,19 +355,36 @@ cd ../..
|
||||
# Server starts on :10087
|
||||
```
|
||||
|
||||
### Option 4: Systemd Service
|
||||
### Option 4: Native CLI / Systemd Service
|
||||
|
||||
The WGRplane binary includes a built-in CLI to manage its own systemd service.
|
||||
|
||||
```bash
|
||||
# Install service file
|
||||
sudo cp wgrplane.service /etc/systemd/system/
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable wgrplane.service
|
||||
sudo systemctl start wgrplane.service
|
||||
# Check system dependencies first
|
||||
./wgrplane doctor
|
||||
|
||||
# Install as systemd service (auto-creates unit, enables, and starts)
|
||||
sudo ./wgrplane install
|
||||
|
||||
# View logs
|
||||
journalctl -u wgrplane.service -f
|
||||
journalctl -u wgrplane -f
|
||||
|
||||
# Other available commands:
|
||||
sudo ./wgrplane stop
|
||||
sudo ./wgrplane restart
|
||||
sudo ./wgrplane uninstall
|
||||
```
|
||||
|
||||
### Manual Serve & Config
|
||||
|
||||
To run the server manually in the foreground with custom ports:
|
||||
|
||||
```bash
|
||||
./wgrplane serve --port 8080 --host 127.0.0.1
|
||||
```
|
||||
|
||||
On first run, it generates a default configuration file at `~/.config/wgrplane/config.json`.
|
||||
|
||||
---
|
||||
|
||||
## 📁 Project Structure
|
||||
|
||||
+1
-1
Submodule app updated: 57ffe45ab7...b43866d42c
Reference in New Issue
Block a user