GitHub mirror: Av0idD4rk/firegex
Go to file
2022-06-27 09:31:18 +02:00
backend Restructuring docker project 2022-06-27 09:31:18 +02:00
config Restructuring docker project 2022-06-27 09:31:18 +02:00
frontend Restructuring docker project 2022-06-27 09:31:18 +02:00
.dockerignore Restructuring docker project 2022-06-27 09:31:18 +02:00
.gitignore Restructuring docker project 2022-06-27 09:31:18 +02:00
docker-compose.yml Restructuring docker project 2022-06-27 09:31:18 +02:00
Dockerfile Restructuring docker project 2022-06-27 09:31:18 +02:00
README.md Restructuring docker project 2022-06-27 09:31:18 +02:00

WORK IN PROGRESS

Firegex-API Documentation

This is a short description of the API

TODO

  1. custom windows docker-compose
  2. fix glich change page with loading screen
  3. Instant refresh after an add or delete
  4. backend checks and errors
  5. frontend requests on buttons
  6. frontend messages on success and some failure
  7. back and frontend password
  8. volume on the database
  9. compile c++ -O3

Documentation

Index

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"
}