Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

/docs does not work offline: allow a configurable swagger-ui asset URL

Chiusa
#1,061 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
78/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go

Direzione di ricerca

Start in docs/ui.go and inspect how configuration fields are defined and exposed through config.yml. Add the optional Swagger UI asset URL while preserving the current cdnjs default and integrity hashes, then verify that /docs uses the configured base URL and retains the existing default behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Split out of #1053. That issue is now SRI and version only, fixed by #1060.

/docs loads swagger-ui's CSS and JS from cdnjs. On an air-gapped or LAN-only install the page stays blank. The rest of the web UI is embedded with go:embed, so /docs is the only page that needs internet access.

Bundling swagger-ui-dist was turned down in #114 because of binary size (about 1.5 MB gzipped), and so were build tags. This proposal needs neither.

Proposal: an optional setting for where /docs loads the swagger-ui assets from, e.g. GOTIFY_SERVER_SWAGGERUIURL / server.swaggeruiurl in config.yml. It defaults to the current cdnjs path. docs/ui.go would put the setting in front of the three filenames and keep the same integrity hashes. A local mirror would then have to serve byte-identical files for the pinned version, so a changed or wrong-version mirror fails closed rather than running in the app origin.

  • No change to binary size or default behaviour.
  • An offline user runs something like npm pack swagger-ui-dist@<pinned> once, hosts the three files on any internal static server (or a reverse proxy path) and sets the URL.
  • About ten lines in docs/ui.go plus a config field.

Workaround until then: /swagger still serves the spec JSON, so an offline Swagger/OpenAPI viewer can load it directly.

If you're open to it I can send the PR or just close this if its still off the table.

Lingua principale
Go
Stelle
16.1k
Fork
894
Merge medio
3g 16h
PR unite (30g)
10

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di gotify/server

Tutte le issue di gotify/server

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.