feat(docker): 🚀 Update server port to 8025
Some checks failed
CI / Test (1.22) (push) Failing after -24m19s
CI / Test (1.23) (push) Failing after -24m15s
CI / Lint (push) Successful in -26m35s
CI / Build (push) Successful in -26m34s

- Change default server port from 8080 to 8025 across all configurations.
- Update Dockerfile, docker-compose.yml, and related documentation.
- Ensure all CLI commands and API endpoints reflect the new port.
- Adjust example configurations and health check URLs accordingly.
This commit is contained in:
Hein
2026-02-04 13:37:38 +02:00
parent 947761313b
commit c1dbff318d
16 changed files with 270 additions and 125 deletions

View File

@@ -18,6 +18,7 @@ Get a list of all configured WhatsApp accounts.
**Endpoint:** `GET /api/accounts`
**Response:**
```json
[
{
@@ -45,6 +46,7 @@ Add a new WhatsApp account to the system.
**Endpoint:** `POST /api/accounts/add`
**Request Body (WhatsApp Web/WhatsMe ow):**
```json
{
"id": "my-account",
@@ -57,6 +59,7 @@ Add a new WhatsApp account to the system.
```
**Request Body (Business API):**
```json
{
"id": "business-account",
@@ -74,6 +77,7 @@ Add a new WhatsApp account to the system.
```
**Response:**
```json
{
"status": "ok",
@@ -82,6 +86,7 @@ Add a new WhatsApp account to the system.
```
**Status Codes:**
- `201 Created` - Account added successfully
- `400 Bad Request` - Invalid request body
- `500 Internal Server Error` - Failed to connect or save config
@@ -95,6 +100,7 @@ Update an existing WhatsApp account configuration.
**Endpoint:** `POST /api/accounts/update` or `PUT /api/accounts/update`
**Request Body:**
```json
{
"id": "business-account",
@@ -112,6 +118,7 @@ Update an existing WhatsApp account configuration.
```
**Response:**
```json
{
"status": "ok",
@@ -120,12 +127,14 @@ Update an existing WhatsApp account configuration.
```
**Notes:**
- The `id` field is required to identify which account to update
- The `type` field cannot be changed (preserved from original)
- If the account is enabled, it will be disconnected and reconnected with new settings
- Configuration is saved to disk after successful update
**Status Codes:**
- `200 OK` - Account updated successfully
- `400 Bad Request` - Invalid request or missing ID
- `404 Not Found` - Account not found
@@ -140,6 +149,7 @@ Disable a WhatsApp account (disconnect and prevent auto-connect on restart).
**Endpoint:** `POST /api/accounts/disable`
**Request Body:**
```json
{
"id": "my-account"
@@ -147,6 +157,7 @@ Disable a WhatsApp account (disconnect and prevent auto-connect on restart).
```
**Response:**
```json
{
"status": "ok",
@@ -155,12 +166,14 @@ Disable a WhatsApp account (disconnect and prevent auto-connect on restart).
```
**Behavior:**
- Disconnects the account immediately
- Sets `disabled: true` in config
- Account will not auto-connect on server restart
- Account remains in config (can be re-enabled)
**Status Codes:**
- `200 OK` - Account disabled successfully
- `400 Bad Request` - Invalid request body
- `404 Not Found` - Account not found
@@ -175,6 +188,7 @@ Enable a previously disabled WhatsApp account.
**Endpoint:** `POST /api/accounts/enable`
**Request Body:**
```json
{
"id": "my-account"
@@ -182,6 +196,7 @@ Enable a previously disabled WhatsApp account.
```
**Response:**
```json
{
"status": "ok",
@@ -190,12 +205,14 @@ Enable a previously disabled WhatsApp account.
```
**Behavior:**
- Sets `disabled: false` in config
- Connects the account immediately
- Account will auto-connect on server restart
- If connection fails, account remains disabled
**Status Codes:**
- `200 OK` - Account enabled and connected successfully
- `400 Bad Request` - Invalid request body
- `404 Not Found` - Account not found
@@ -210,6 +227,7 @@ Permanently remove a WhatsApp account from the system.
**Endpoint:** `POST /api/accounts/remove` or `DELETE /api/accounts/remove`
**Request Body:**
```json
{
"id": "my-account"
@@ -217,6 +235,7 @@ Permanently remove a WhatsApp account from the system.
```
**Response:**
```json
{
"status": "ok"
@@ -224,11 +243,13 @@ Permanently remove a WhatsApp account from the system.
```
**Behavior:**
- Disconnects the account
- Removes from config permanently
- Session data is NOT deleted (manual cleanup required)
**Status Codes:**
- `200 OK` - Account removed successfully
- `400 Bad Request` - Invalid request body
- `404 Not Found` - Account not found
@@ -270,25 +291,25 @@ Account settings are stored in `config.json`:
### Configuration Fields
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `id` | string | Yes | Unique identifier for the account |
| `type` | string | Yes | Account type: `whatsmeow` or `business-api` |
| `phone_number` | string | Yes | Phone number with country code |
| `disabled` | boolean | No | If `true`, account won't connect (default: `false`) |
| `session_path` | string | No | Session storage path (whatsmeow only) |
| `show_qr` | boolean | No | Display QR code in logs (whatsmeow only) |
| `business_api` | object | Conditional | Required for `business-api` type |
| Field | Type | Required | Description |
| -------------- | ------- | ----------- | --------------------------------------------------- |
| `id` | string | Yes | Unique identifier for the account |
| `type` | string | Yes | Account type: `whatsmeow` or `business-api` |
| `phone_number` | string | Yes | Phone number with country code |
| `disabled` | boolean | No | If `true`, account won't connect (default: `false`) |
| `session_path` | string | No | Session storage path (whatsmeow only) |
| `show_qr` | boolean | No | Display QR code in logs (whatsmeow only) |
| `business_api` | object | Conditional | Required for `business-api` type |
### Business API Configuration
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `phone_number_id` | string | Yes | WhatsApp Business phone number ID |
| `access_token` | string | Yes | Meta Graph API access token |
| `business_account_id` | string | No | Business account ID |
| `api_version` | string | No | API version (default: `v21.0`) |
| `verify_token` | string | No | Webhook verification token |
| Field | Type | Required | Description |
| --------------------- | ------ | -------- | --------------------------------- |
| `phone_number_id` | string | Yes | WhatsApp Business phone number ID |
| `access_token` | string | Yes | Meta Graph API access token |
| `business_account_id` | string | No | Business account ID |
| `api_version` | string | No | API version (default: `v21.0`) |
| `verify_token` | string | No | Webhook verification token |
---
@@ -297,11 +318,13 @@ Account settings are stored in `config.json`:
### cURL Examples
**List accounts:**
```bash
curl -u username:password http://localhost:8080/api/accounts
curl -u username:password http://localhost:8025/api/accounts
```
**Add account:**
```bash
curl -u username:password \
-X POST \
@@ -313,10 +336,11 @@ curl -u username:password \
"session_path": "./sessions/new-account",
"show_qr": true
}' \
http://localhost:8080/api/accounts/add
http://localhost:8025/api/accounts/add
```
**Update account:**
```bash
curl -u username:password \
-X POST \
@@ -331,34 +355,37 @@ curl -u username:password \
"api_version": "v21.0"
}
}' \
http://localhost:8080/api/accounts/update
http://localhost:8025/api/accounts/update
```
**Disable account:**
```bash
curl -u username:password \
-X POST \
-H "Content-Type: application/json" \
-d '{"id": "my-account"}' \
http://localhost:8080/api/accounts/disable
http://localhost:8025/api/accounts/disable
```
**Enable account:**
```bash
curl -u username:password \
-X POST \
-H "Content-Type: application/json" \
-d '{"id": "my-account"}' \
http://localhost:8080/api/accounts/enable
http://localhost:8025/api/accounts/enable
```
**Remove account:**
```bash
curl -u username:password \
-X POST \
-H "Content-Type: application/json" \
-d '{"id": "my-account"}' \
http://localhost:8080/api/accounts/remove
http://localhost:8025/api/accounts/remove
```
---
@@ -419,11 +446,13 @@ All endpoints return proper HTTP status codes and JSON error messages:
```
Or plain text for simple errors:
```
Account ID required in path
```
Common error scenarios:
- Account already exists (when adding)
- Account not found (when updating/removing)
- Connection failed (when enabling)