3.7 KiB
3.7 KiB
WORK IN PROGRESS
Firegex-API Documentation
This is a short description of the API
TODO
- custom windows docker-compose
- fix glich change page with loading screen
- Instant refresh after an add or delete
- backend checks and errors
- frontend requests on buttons
- frontend messages on success and some failure
- back and frontend password
- volume on the database
- compile c++ -O3
Documentation
Index
- General stats
- List services
- Service info
- Stop service
- Start service
- Delete service
- Terminate service
- Regenerate public port
- Service regexes
- Regex info
- Delete regex
- Add regex
- Add service
GET /api/general-stats
Server response:
{
"services": <total number of services>,
"closed": <total number of rejected packets>,
"regex": <total number of regexes>
}
GET /api/services
Server response:
[
{
"id": <service_id>,
"status": <service status>,
"public_port": <public port>,
"internal_port": <internal port>,
"n_packets": <number of rejected packets>,
"n_regex": <number of regexes>
},
{
// Another service
}
]
GET /api/service/<serv>
Server response:
{
"id": <service_id>,
"status": <service status>,
"public_port": <public port>,
"internal_port": <internal port>,
"n_packets": <number of rejected packets>,
"n_regex": <number of regexes>
}
GET /api/service/<serv>/stop
Server response:
{
"status": "ok"
}
GET /api/service/<serv>/start
Server response:
{
"status": "ok"
}
GET /api/service/<serv>/delete
Server response:
{
"status": "ok"
}
GET /api/service/<serv>/terminate
Server response:
{
"status": "ok"
}
GET /api/service/<serv>/regen-port
Server response:
{
"status": "ok"
}
GET /api/service/<serv>/regexes
Server response:
[
{
"id": <regex id>,
"service_id": <service_id>,
"regex": <base64 encoded regex>,
"is_blacklist": <true|false>,
"n_packets": <number of blocked packets>,
"mode": <"C"|"S"|"B"> // Client to server, server to client or both
},
{
// Another regex
}
]
GET /api/regex/<regex_id>
Server response:
{
"id": <regex id>,
"service_id": <service_id>,
"regex": <base64 encoded regex>,
"is_blacklist": <true|false>,
"n_packets": <number of blocked packets>,
"mode" <"C"|"S"|"B"> // Client to server, server to client or both
}
GET /api/regex/<regex_id>/delete
Server response:
{
"status": "ok"
}
POST /api/regexes/add
Client request:
{
"service_id": <service_id>,
"regex": <base64 encoded regex>,
"is_blacklist": <true|false>,
"mode": <"C"|"S"|"B"> // Client to server, server to client or both
}
Server response:
{
"status": "ok"
}
POST /api/services/add
Client request:
{
"name": <the id used to identify the service>,
"port": <the internal port>
}
Server response:
{
"status": "ok"
}