Skip to content

TLS certificates page: ACME settings tab with challenge type selection - #1257

Merged
stephdl merged 13 commits into
mainfrom
sdl-8099
Aug 28, 2026
Merged

TLS certificates page: ACME settings tab with challenge type selection#1257
stephdl merged 13 commits into
mainfrom
sdl-8099

Conversation

@stephdl

@stephdl stephdl commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

The TLS certificates page had a separate ACME servers page reachable through a top-right button, and the ACME challenge type — already accepted by set-acme-server — was exposed nowhere, so TLS-ALPN-01 (needed when port 80 is unavailable) required editing traefik.yaml by hand.

This PR merges the two pages into two tabs, Certificates and ACME settings, and exposes the challenge type as a tag per node plus a required radio group in the edit modal. Options come from a single ACME_CHALLENGE_TYPES array, so DNS-01 is one entry plus one translation key away; it is left out here because it needs extra fields. The ACME table columns become Node, ACME directory URL, Challenge type, which also fixes the previous wrong order, and /settings/acme-servers redirects to /settings/tls-certificates?view=acme.

Settings remain per node. No backend change: set-acme-server already validates challenge and get-acme-server already returns it.

Surviving the Traefik restart

set-acme-server restarts Traefik, which serves the admin UI and its websocket, so the completion event carrying the table refresh is lost: stale values and skeleton rows until a manual reload. The Certificates tab has the same problem through cert_helpers.purge_acme_json_and_restart_traefik. Both tabs now watch the Vuex isWebsocketConnected flag and reload on reconnection; counters are clamped and ACME rows keyed by Traefik instance, so a late event cannot unbalance a counter or duplicate a row. The Reload required warning is gone, and the restart warning is no longer gated on the leader node — the restart happens on whichever node is edited. Mechanism borrowed from #1258, which fixes the same thing on HTTP routes; a shared mixin is the follow-up once both land.

Design

Mockups: Figma, design issue NethServer/dev#7973.

Refs: NethServer/dev#8099

@stephdl
stephdl requested review from andre8244 and removed request for AmaLuci August 6, 2026 15:05
Comment thread core/ui/public/i18n/en/translation.json Outdated
Comment thread core/ui/public/i18n/en/translation.json Outdated
/>
</cv-data-table-cell>
<cv-data-table-cell>
<div class="justify-flex-end">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use class="flex justify-end", these class already exist here https://github.com/NethServer/ns8-core/blob/main/core/ui/src/styles/_utils.scss

Comment thread core/ui/src/components/settings/AcmeSettings.vue Outdated
Comment thread core/ui/src/views/settings/SettingsTlsCertificates.vue Outdated
:noDefaultToFirst="true"
@tab-selected="tabSelected"
>
<cv-tab

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has become very big (~1500 loc), maybe we can try to externalize two components, e.g. TlsCertficatesPanel and AcmeSettingsPanel

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. SettingsTlsCertificates.vue is down to 289 lines: page chrome, tab state, and the list-installed-modules chain whose Traefik instance list both tabs consume. The certificates tab moved to TlsCertificatesPanel.vue, and AcmeSettings.vue is now AcmeSettingsPanel.vue for symmetry.

Two notes on the wiring:

  • The node filter is bound to a query param, and watchQueryData is bound to the view instance in beforeRouteEnter, so the view still owns selectedNodeId and passes it down with .sync.
  • The panel now runs listCertificates() from a watcher on traefikInstances instead of being called at the end of listInstalledModulesCompleted, same trigger AcmeSettingsPanel already used.

I also dropped the selectedNodeLabel computed while moving the code; it was defined and never referenced, already dead on main.

Tested on a live single-node cluster: both tabs, filters, query params, the upload modal and its error mapping, the tooltips, and the ACME edit modal.

Follow review feedback: the search box label repeated the table title, and
the restart notice did not say the page comes back on its own.
styles/_utils.scss is imported globally, so the local justify-flex-end rule
duplicated flex and justify-end. Removing it empties the style block.
The view had grown past 1500 lines. Move the certificates tab into
TlsCertificatesPanel and rename AcmeSettings to AcmeSettingsPanel, leaving
the view with the page chrome, the tab state and the shared Traefik instance
list it feeds to both panels.

The node filter stays bound to a query param, so the view owns it and passes
it down with .sync. Drop the selectedNodeLabel computed, which was never
referenced.

Also narrow the tooltip cursor rule: carbon already sets a pointer on the
tooltip trigger, only .bx--tag overrides it.
Drop comments the code already states and shorten the ones worth keeping.
@stephdl
stephdl requested a review from andre8244 August 26, 2026 12:05
@stephdl
stephdl merged commit 69a43aa into main Aug 28, 2026
2 checks passed
@stephdl
stephdl deleted the sdl-8099 branch August 28, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants