Open Its4Nik opened 1 month ago
~- [ ] Apprise~
~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
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
thanks to @blackfuffey
Please see: https://github.com/Its4Nik/dockstatapi/pull/21
Idea: https://www.npmjs.com/package/@faker-js/faker
To generate sample data for unit tests
Summary of Changes and Enhancements
Code Structure Refactor:
Configuration Management:
dockerConfig.json
file to manage the configuration of multiple Docker hosts dynamically, allowing for easy updates and customizations.Logging Integration:
API Endpoints:
/api/hosts/stats
: Fetches statistics for all available Docker hosts./api/containers
: Lists all containers for a specified host./api/containers
endpoint.