DSM 7.1 Auto Tidy-up old Docker connections?

Currently reading
DSM 7.1 Auto Tidy-up old Docker connections?

3
0
NAS
DS918+
Operating system
  1. Linux
  2. macOS
Mobile operating system
  1. iOS
I have Web Station fronting Docker, and previously when I had my router port forward straight to hitch/ varnish, I could easily use watchtower to update all the images/ containers... However, since moving to Web Station, when watchtower runs - all the service links break in Web Station (which TBH, isn't overly surprising) due to how watchtower destroys each container to point to the new images.

My question isn't how to fix that (although if anyone has any workaround, I'd love to hear it!) it's really, how do I remove the old service links which have piled up in Web Station? It's getting confusing, as they're all named the same thing - obviously the newer ones appear at the bottom of the list, but in the UI list of services it's impossible to tell which is which without clicking through...
 
Solution
Just an update to this, I see a bunch of config files (in an expected place) but it looks convoluted to manually tidy up the IDs that show (they're in many other files too):
Code:
# cd /var/packages/WebStation/etc
# grep -irn -A16 -B4 'gitea' *
Service.json-68-        {
Service.json-69-            "category" : "Docker",
Service.json-70-            "connect_timeout" : 60,
Service.json-71-            "custom_rule" : {},
Service.json:72:            "display_name" : "Docker gitea 3000",
Service.json-73-            "display_name_i18n" : null,
Service.json-74-            "enable" : true,
Service.json-75-            "icon" : "/var/packages/WebStation/target/ui/images/WebStation_{0}.png",
Service.json-76-            "id" ...
Screenshot 2023-03-06 at 18.29.28.png

For context ...
 
Upvote 0
Just an update to this, I see a bunch of config files (in an expected place) but it looks convoluted to manually tidy up the IDs that show (they're in many other files too):
Code:
# cd /var/packages/WebStation/etc
# grep -irn -A16 -B4 'gitea' *
Service.json-68-        {
Service.json-69-            "category" : "Docker",
Service.json-70-            "connect_timeout" : 60,
Service.json-71-            "custom_rule" : {},
Service.json:72:            "display_name" : "Docker gitea 3000",
Service.json-73-            "display_name_i18n" : null,
Service.json-74-            "enable" : true,
Service.json-75-            "icon" : "/var/packages/WebStation/target/ui/images/WebStation_{0}.png",
Service.json-76-            "id" : "Docker-e536e1e766bb20470b79f85a269abb33f86046df55c986e813cb5dcf44137346-3000",
Service.json-77-            "managed_by_web_service" : true,
Service.json-78-            "proxy_headers" : [],
Service.json-79-            "proxy_http_version" : 1,
Service.json-80-            "proxy_intercept_errors" : false,
Service.json-81-            "proxy_target" : "http://172.17.0.12:3000",
Service.json-82-            "read_timeout" : 60,
Service.json-83-            "send_timeout" : 60,
Service.json-84-            "service" : "Docker-e536e1e766bb20470b79f85a269abb33f86046df55c986e813cb5dcf44137346-3000",
Service.json-85-            "support_alias" : true,
Service.json-86-            "support_server" : true,
Service.json-87-            "type" : "reverse_proxy"
Service.json-88-        },
--
Service.json-156-        {
Service.json-157-            "category" : "Docker",
Service.json-158-            "connect_timeout" : 60,
Service.json-159-            "custom_rule" : {},
Service.json:160:            "display_name" : "Docker gitea 3000",
Service.json-161-            "display_name_i18n" : null,
Service.json-162-            "enable" : true,
Service.json-163-            "icon" : "/var/packages/WebStation/target/ui/images/WebStation_{0}.png",
Service.json-164-            "id" : "Docker-a3ae535bf52e54c7394785dab78a4f85155e527b2363308e88a0eaa763159d6a-3000",
Service.json-165-            "managed_by_web_service" : true,
Service.json-166-            "proxy_headers" : [],
Service.json-167-            "proxy_http_version" : 1,
Service.json-168-            "proxy_intercept_errors" : false,
Service.json-169-            "proxy_target" : "http://172.17.0.19:3000",
Service.json-170-            "read_timeout" : 60,
Service.json-171-            "send_timeout" : 60,
Service.json-172-            "service" : "Docker-a3ae535bf52e54c7394785dab78a4f85155e527b2363308e88a0eaa763159d6a-3000",
Service.json-173-            "support_alias" : true,
Service.json-174-            "support_server" : true,
Service.json-175-            "type" : "reverse_proxy"
Service.json-176-        },

So instead, I've opted to just alter:
Code:
# vi Service.json

; Changed for each "bad" service:
"enable" : true,

; To:
"enable" : false,

It didn't even need a reload, they're instantly not visible/ selectable in the UI.

Not entirely happy about the cruft left behind - I attempted to look at the Docker package as it does (likely) a POST to remove Web Station services. I know this as I've previously seen "network is unstable" messaging when trying to uncheck the "Use Web Station Ports" box... So something exists to do it somewhere, but I couldn't easily uncover it. Still, this is fine enough - it's just good to remove the confusion when selecting an option in the box.

Here it is, nice and clean now:
Screenshot 2023-03-07 at 11.25.44.png
 
Upvote 0
Solution

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Back
Top