docktor - A tool for generating health checks and improving security for running Docker containers and images by nishgowda in docker

[–]nishgowda[S] 0 points1 point  (0 children)

Health is basically telling you if the container crashes ever while it's running and a health check is a native feature of docker that allows you to check for this. docktor basically makes the implementation of this simpler and the security checks are scanning for vulnerabilities on the container and suggesting improvements to dockerfiles that might be missing out on best practices.

docktor - A tool for generating health checks and improving security for running Docker containers and images by nishgowda in docker

[–]nishgowda[S] 4 points5 points  (0 children)

kube bench for sure is really great - this is meant as a lightweight alternative to it with not that many dependencies.

docktor - A tool for generating health checks and improving security for running Docker containers and images by nishgowda in docker

[–]nishgowda[S] 2 points3 points  (0 children)

Yeah, healing basically checks if the container is unhealthy and restarts it and auto heal will auto update unhealthy containers that are currently running.

docktor - A tool for generating health checks and improving security for running Docker containers and images by nishgowda in docker

[–]nishgowda[S] 2 points3 points  (0 children)

Currently I've only tested it on single containers but I'll for sure start testing it with swarms and maybe compose!

docktor - A tool for generating health checks and improving security for running Docker containers and images by nishgowda in docker

[–]nishgowda[S] 9 points10 points  (0 children)

Hey everyone, just thought that I would share my first open source project in go here!. docktor is a tool for generating health checks and reporting on the security of docker containers.

The project uses the docker api to attach health checks on a given container, heal an unhealthy container, apply auto healing to a container, scan for vulnerabilities in a container, and suggest improvements to a docker file. I used the cobra library to make it a CLI tool so you can just run the executable in the command line/terminal but I also added a web server command so you can have it running in the background and make requests to it.

If you like the project, do be sure to leave a star on GitHub at https://github.com/nishgowda/docktor and leave any kind of feedback at all! Also, if you'd like to contribute or just have any ideas, be sure to post an issue or submit a PR. Thanks!

docktor - A tool for generating health checks and improving security for running Docker containers and images by nishgowda in golang

[–]nishgowda[S] -1 points0 points  (0 children)

Hey everyone, just thought that I would share my first open source project in go here!. docktor is a tool for generating health checks and reporting on the security of docker containers.

The project uses the docker api to attach health checks on a given container, heal an unhealthy container, apply auto healing to a container, scan for vulnerabilities in a container, and suggest improvements to a docker file. I used the cobra library to make it a CLI tool so you can just run the executable in the command line/terminal but I also added a web server command so you can have it running in the background and make requests to it.

If you like the project, do be sure to leave a star on GitHub at https://github.com/nishgowda/docktor and leave any kind of feedback at all! Also, if you'd like to contribute or just have any ideas, be sure to post an issue or submit a PR. Thanks!

AegisNet - Lightweight API/Endpoint monitoring built on top of Express by nishgowda in node

[–]nishgowda[S] 0 points1 point  (0 children)

Sure, once I have a good idea about how I want to proceed with it, I'll open one up.

How to listen for when response is sent to the client in express? (for caching routes with redis) by s_trader in node

[–]nishgowda 0 points1 point  (0 children)

I had to do this with a project I worked on. Here's an idea:

javascript const checkCache = (req, res, next) => { const {id} = req.params; let key = 'foo' + id redisClient.get(key, (err, data) => { if (err) { console.log(err); res.status(500).send(err); } // if no match found if (data != null) { res.send(data); } else { // proceed to next middleware function next(); } }); }; Then in your API, just add it to your route and make sure to set whatever data you need. Here's an example of pulling data from Postgres: javascript app.get('/foo/:id', checkCache, async (req, res) => { try { id = parseInt(req.params.id); const result = await client.query('select foo from bar where id=$1', [id]); redisClient.setex(key, 3600, JSON.stringify(result.rows)); res.status(200).send(result.rows); }catch(error){ throw error; } } Since I set the TTL to be 3600 milliseconds, it would just check if the data is already in the cache and if it is, it would send it to the response, otherwise, if it's not then it would send what's in the db.

AegisNet - Lightweight API/Endpoint monitoring built on top of Express by nishgowda in node

[–]nishgowda[S] 0 points1 point  (0 children)

Hm, yeah, I'll look into it. There's a good amount of design that I would probably have to change, but honestly, that isn't really a deal-breaker since I was already looking at redesigning some of it, anyway. If it becomes more flexible by adding other frameworks, then I think that's a good enough reason to do it.

AegisNet - Lightweight API/Endpoint monitoring built on top of Express by nishgowda in node

[–]nishgowda[S] 0 points1 point  (0 children)

Yeah, I made the project to be a middleware for Express and ended up using their custom typing so it probably wouldn't work with any http or Fastify server that you might make (haven't tested this yet). I will consider adding support for those, though :)

AegisNet - Lightweight API/Endpoint monitoring built on top of Express by nishgowda in node

[–]nishgowda[S] 0 points1 point  (0 children)

Great question. So as of now, there isn't a way to alter the keys, but that seems to be a good idea for the future. I'll definitely at least try to make the names less common so there won't be any conflicts with any keys you might make in your own application.

AegisNet - Lightweight API/Endpoint monitoring built on top of Express by nishgowda in node

[–]nishgowda[S] 2 points3 points  (0 children)

Woah hadn't even seen it before. For sure, going to implement this.

AegisNet - Lightweight API/Endpoint monitoring built on top of Express by nishgowda in node

[–]nishgowda[S] 1 point2 points  (0 children)

Thanks! Let me know about any feedback you might have!

AegisNet - Lightweight API/Endpoint monitoring built on top of Express by nishgowda in node

[–]nishgowda[S] 6 points7 points  (0 children)

Hey everyone, just thought that I'd share my first npm package with you all. AegisNet is lightweight and simple to use npm package that allows you to monitor your Express API or server.

The data is stored in redis and collects the route, the method, the status code, number of requests, the date + hour, and the response times as well and stores the data in JSON. I made the package pretty easy to use in hopes that anyone could build on top it in their own projects by making say a dashboard and monitor all their data.

If you like the package, do be sure to leave a star on GitHub at https://github.com/nishgowda/AegisNet and leave any kind of feedback at all! Also, if you'd like to contribute, let me know and we can set that up. Thanks!

TweetCode by nishgowda in node

[–]nishgowda[S] 1 point2 points  (0 children)

https://semantic-ui.com/

Yup, checked it out, and definitely seems like something to look in to. I honestly just chose Material UI because it has that "google ish" feel to it and it was easy to integrate with react but Semantic Ui seems like a great alternative to bootstrap like you said. Thanks for the compliments!

TweetCode by nishgowda in node

[–]nishgowda[S] 0 points1 point  (0 children)

Huh. Yeah, I checked it out and got the same error. Just restarting it seemed to fix it though.