Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

クローズ
#1,061 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
78/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Go
スター
16.1k
フォーク
894
平均マージ
3日 16時間
マージ済み PR(30日)
10

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

gotify/server のほかの issue

gotify/server の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。