azukaar / Cosmos-Server

☁️ The Most Secure and Easy Selfhosted Home Server. Take control of your data and privacy without sacrificing security and stability (Authentication, anti-DDOS, anti-bot)
https://cosmos-cloud.io
Other
2.97k stars 105 forks source link

[BUG]: ServApp names with `.` are breaking monitoring tables #207

Open c0derMo opened 4 months ago

c0derMo commented 4 months ago

What happened?

I've created a custom ServApp with a . in the container / App name. Afterwards, when visiting the Monitoring tab, the "Containers - Average Resources" table and the "Containers - Average Network" table show an additional column, splitting the container name at the ..

image (Container is called Wiki.js)

What should have happened?

Container name should not be splitted and no additional column should be added.

How to reproduce the bug?

  1. Add custom ServApp with . in name.
  2. Go to Monitoring tab
  3. Observe tables

Relevant log output

No response

Other details

No response

System details

BearTS commented 1 month ago

I am confused, how did you manage to create a container with name as . I always get an error

[ERROR] Rolling back changes because of -- Container creation error: Error response from daemon: Invalid container name (.), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed[OPERATION FAILED]. CHANGES HAVE BEEN ROLLEDBACK.
c0derMo commented 1 month ago

The full name of the container was Wiki.js, I think the first character can't be a ., but subsequent characters can, as indicated by the regex [a-zA-Z0-9][a-zA-Z0-9_.-] in the logs you posted

BearTS commented 1 month ago

Oh that's what you mean, let me try this locally and see if I can make a PR to fix this :)

Edit: sorry I did not see

(Container is called Wiki.js)

Gotcha

Edit 2: am able to reproduce the bug

BearTS commented 1 month ago

@c0derMo Made a PR which fixes the table 👍