Its4Nik / dockstatapi

Really simple API to query multiple docker hosts and provide all stats as json
BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

ToDo for next release: #16

Open Its4Nik opened 1 month ago

Its4Nik commented 1 month ago

Summary of Changes and Enhancements

  1. Code Structure Refactor:

    • Modularization: Split functionality into separate files for better organization and maintainability, including creating distinct routes for different functionalities.
  2. Configuration Management:

    • Implemented a dockerConfig.json file to manage the configuration of multiple Docker hosts dynamically, allowing for easy updates and customizations.
  3. Logging Integration:

    • Added a logging mechanism to track requests and errors throughout the application, providing insights into API interactions and error handling.
  4. API Endpoints:

    • Created several new endpoints:
      • /api/hosts/stats: Fetches statistics for all available Docker hosts.
      • /api/containers: Lists all containers for a specified host.
    • Expanded the functionality of the /api/containers endpoint.
Its4Nik commented 1 month ago

image

Its4Nik commented 1 month ago

image

Its4Nik commented 1 month ago
Its4Nik commented 3 weeks ago

~- [ ] Apprise~

Main goal:

get rid of bash / python script to send notifications :heavy_check_mark:

~Configurable notifications using the DockStatAPI rather then a configuration file~

custom routes to configure:

/apprise...

/add-service => put endpoint where we can add new apprise endpoints (telegram/pushbullet/...)

/remove-service => delete endpoint: removes an already existing endpoint

/get-services => get; json response as an array where you can see all configured services

/get-all => get; all supported apprise endpoints

/configure => put; here we can set the format of configuring apprise notifications, with variables

/send-test => put; sends a test notification to all configured endpoints

Its4Nik commented 3 weeks ago

image image

flowchart LR

subgraph 0["config"]
1["db.js"]
2["swaggerConfig.js"]
B["dockerConfig.json"]
end
subgraph 3["controllers"]
4["containerController.js"]
7["databaseMigration.js"]
8["fetchData.js"]
C["frontendConfiguration.js"]
D["scheduler.js"]
end
subgraph 5["utils"]
6["dockerClient.js"]
A["containerService.js"]
Q["extractHostData.js"]
R["writeOfflineLog.js"]
subgraph U["notifications"]
V["_notify.js"]
W["discord.js"]
subgraph X["data"]
Y["template.js"]
end
Z["email.js"]
10["pushbullet.js"]
11["pushover.js"]
12["slack.js"]
13["telegram.js"]
14["whatsapp.js"]
end
end
9["child_process"]
subgraph E["middleware"]
F["authMiddleware.js"]
G["rateLimiter.js"]
end
subgraph H["routes"]
subgraph I["auth"]
J["routes.js"]
end
subgraph K["data"]
L["routes.js"]
end
subgraph M["frontendController"]
N["routes.js"]
end
subgraph O["getter"]
P["routes.js"]
end
subgraph S["notifications"]
T["routes.js"]
end
subgraph 15["setter"]
16["routes.js"]
end
end
17["server.js"]
subgraph 18["swagger"]
19["swaggerDocs.js"]
end
4-->6
7-->1
8-->1
8-->A
8-->9
A-->B
A-->6
D-->1
D-->8
L-->1
N-->C
P-->B
P-->D
P-->A
P-->6
P-->Q
P-->R
T-->V
V-->W
V-->Z
V-->10
V-->11
V-->12
V-->13
V-->14
W-->Y
Z-->Y
10-->Y
11-->Y
12-->Y
13-->Y
14-->Y
16-->D
17-->D
17-->F
17-->G
17-->J
17-->L
17-->N
17-->P
17-->T
17-->16
17-->19
19-->2
Its4Nik commented 3 weeks ago

Screenshot_20241106-023559.png

Screenshot_20241106-023531.png

Screenshot_20241106-023521.png

Screenshot_20241106-023545.png

thanks to @blackfuffey

Its4Nik commented 3 weeks ago

Please see: https://github.com/Its4Nik/dockstatapi/pull/21

Its4Nik commented 2 weeks ago

TODO: https://github.com/Its4Nik/dockstatapi/pull/21#issuecomment-2474818205

Its4Nik commented 2 weeks ago

Idea: https://www.npmjs.com/package/@faker-js/faker

To generate sample data for unit tests