{"id":49745362,"url":"https://github.com/serendipitynz/serenebach","last_synced_at":"2026-06-03T00:01:11.359Z","repository":{"id":353942452,"uuid":"1221512499","full_name":"serendipitynz/serenebach","owner":"serendipitynz","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-26T12:49:47.000Z","size":24209,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-26T13:33:22.838Z","etag":null,"topics":["cgi-support","markdown","single-binary","static-site-generator"],"latest_commit_sha":null,"homepage":"https://go.serenebach.net","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serendipitynz.png","metadata":{"files":{"readme":"README.ja.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"ko_fi":"takkyun"}},"created_at":"2026-04-26T10:09:40.000Z","updated_at":"2026-05-26T12:49:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/serendipitynz/serenebach","commit_stats":null,"previous_names":["serendipitynz/serenebach"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/serendipitynz/serenebach","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serendipitynz%2Fserenebach","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serendipitynz%2Fserenebach/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serendipitynz%2Fserenebach/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serendipitynz%2Fserenebach/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serendipitynz","download_url":"https://codeload.github.com/serendipitynz/serenebach/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serendipitynz%2Fserenebach/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33841996,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cgi-support","markdown","single-binary","static-site-generator"],"created_at":"2026-05-10T03:25:12.244Z","updated_at":"2026-06-03T00:01:11.352Z","avatar_url":"https://github.com/serendipitynz.png","language":"Go","funding_links":["https://ko-fi.com/takkyun"],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://go.serenebach.net/\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/serendipitynz/serenebach/main/web/templates/admin/assets/sb_logo_dark.svg?sanitize=true\" alt=\"Serene Bach\" width=\"400\"\u003e\u003c/a\u003e\n\n[![CI result](https://github.com/serendipitynz/serenebach/workflows/CI/badge.svg)](https://github.com/serendipitynz/serenebach/actions?query=workflow%3ACI)\n[![Go Report Card](https://goreportcard.com/badge/github.com/serendipitynz/serenebach)](https://goreportcard.com/report/github.com/serendipitynz/serenebach)\n\n---\n\nセルフホスト型 Go 製ウェブログエンジン。WordPress と Hugo の中間にある軽量な選択肢として位置づけています。\n\n[![管理画面ツアー (17秒、音声なし) — クリックで HD 版 mp4](docs/assets/admin-tour.webp)](https://go.serenebach.net/screenshots/admin-tour.mp4)\n\n🌐 **[go.serenebach.net](https://go.serenebach.net)** — 機能紹介・スクリーンショット\n📄 English: see [README.md](README.md)\n\n## 概要\n\n- 単一の静的 Go バイナリ (CGO 不要)\n- SQLite (Pure Go: [`modernc.org/sqlite`](https://modernc.org/sqlite)) — DB サーバ別建て不要\n- 常駐 HTTP サーバ・もしくは従来型レンタルサーバの CGI として動作\n- 管理画面 UI / MCP サーバ / 管理画面ヘルプ もすべてバイナリに同梱\n- ハイブリッド配信向けの静的サイト生成 (CDN 前段 + 動的管理画面)\n- テンプレートから JS / Web フォントファイルも参照可能（画像・CSS と同様にアップロードして利用）\n- 旧 Serene Bach v2 (テキストファイル) / v3 (SQLite) (Perl 版) からのインポートに対応。YAML front-matter 付き markdown ファイル群からの取り込みもサポート\n- Outbound Webhooks: 記事公開 / コメント受信 / 画像アップロード で Slack / Discord / Zapier / n8n に通知\n- 画像だけでなく音声・文書・動画もライブラリで管理・アップロード可能（Markdown/HTML 記事への挿入に対応）\n- `sitemap.xml` と `robots.txt` の自動生成（サイト設定で ON/OFF 切替可能）\n- 記事・固定ページ単位の SEO メタ情報: 要約（`{entry_excerpt}`、SB3 `sum` 互換。`\u003cmeta name=\"description\"\u003e` / OG に反映）、canonical URL、`noindex` トグル（`sitemap.xml` からも除外）\n- `/search?q=…` の全文検索（SQLite FTS5 + trigram トークナイザ）。任意言語の部分一致（日本語含む）に対応し、管理画面の記事一覧検索と MCP の `search_entries` ともインデックスを共有\n\n## クイックスタート\n\n[Go](https://go.dev/doc/install) と [Task](https://taskfile.dev/installation/) が必要です。\n\n```bash\ntask dev    # :8080 でサーバ起動 (DB は最初のリクエストで自動作成)\n```\n\nブラウザで \u003chttp://localhost:8080/\u003e を開くと、管理者がまだ存在しない初回起動時は **`/setup`** に自動でリダイレクトされます。フォームから管理者ユーザ名・パスワード・サイトのタイトルを設定し、サンプル記事を投入するか選んだら完了です。以降は公開サイトが `/`、管理画面が `/admin/login` で動きます。\n\n`task dev` は `SB_DEV=1` を自動で設定するため、`web/templates/admin/*.html` を編集するとサーバ再起動なしで次のリクエストから変更が反映されます。\n\nCLI 派の方は `task seed` も従来通り使えます。dev DB を作って既定値 (`admin` / `changeme`、`SB_ADMIN_NAME` / `SB_ADMIN_PASSWORD` で上書き可) で管理者を作成し、ブラウザを介さずにセットアップを終えられます。\n\n`.env` のテンプレートは `.env.example` にあります。コピーして編集してください — AI 執筆補助を使う場合は `SB_AI_SECRET` の設定が必要です。\n\nサーバモードの HTTP タイムアウトとグレースフルシャットダウンは適切な既定値が設定されており、`SB_READ_HEADER_TIMEOUT` / `SB_WRITE_TIMEOUT` / `SB_IDLE_TIMEOUT` / `SB_MAX_HEADER_BYTES` / `SB_SHUTDOWN_TIMEOUT` で調整できます。`SB_TZ`（例: `Asia/Tokyo`）を設定するとアーカイブの月／年境界や記事の日付描画に使うタイムゾーンを固定でき、ホストの時計が違ってもバイナリが同じ出力を生成します。`SB_CSRF_MULTIPART_MAX_BYTES`（バイト単位、既定 `1048576`）は no-JS フォールバックフォームに対して CSRF ミドルウェアが認証前に読み取る multipart ボディの上限を制御します。JS 経由のアップロードは `X-CSRF-Token` ヘッダでトークンを送るためこの上限は適用されません。全環境変数の一覧は [docs/configuration.md](docs/configuration.md) を参照してください。\n\n手元のバイナリのバージョンを確認したいときは `serenebach --version` を実行してください。データベースや環境変数の設定が壊れている／まだ無い状態でも動くので、新しく展開したバイナリの識別にそのまま使えます。\n\n## Docker\n\n```bash\n# ビルド\ndocker build -t serenebach .\n\n# 実行: サーバを起動して http://localhost:8080/setup で管理者を作成\ndocker run -d -p 8080:8080 -v serenebach-data:/home/nonroot/data serenebach\n\n# または CLI で seed する場合はパスワードを明示的に指定\ndocker run --rm -v serenebach-data:/home/nonroot/data -e SB_ADMIN_PASSWORD=\u003csecret\u003e serenebach seed\n```\n\n同梱の `docker-compose.yml` を使う場合:\n\n```bash\ndocker compose up -d\n```\n\n### 公式イメージ (GHCR)\n\nGitHub Container Registry (`ghcr.io/serendipitynz/serenebach`) に公式コンテナイメージを公開しています。\n\n```bash\ndocker pull ghcr.io/serendipitynz/serenebach:latest\n\ndocker run -d -p 8080:8080 -v serenebach-data:/home/nonroot/data ghcr.io/serendipitynz/serenebach:latest\n```\n\nタグの種類:\n- `latest` — デフォルトブランチの最新ビルド\n- リリースタグ (`4.0.0-beta.N`, `4.0.0`, …) — 現行バージョンは [GitHub Releases](https://github.com/serendipitynz/serenebach/releases) を参照\n- `main` — `main` ブランチの先端\n\n本番運用では `latest` よりもリリースタグ固定を推奨します。QNAP Container Station / VPS での構成例は [docs/deployment.md](docs/deployment.md) を参照してください。\n\n## 品質チェック\n\nCI でも push / PR ごとに同じコマンドが走ります:\n\n- `task lint` — `.golangci.yml` を使って `golangci-lint` を実行 (`staticcheck` に加えて gocyclo (しきい値 15、goreportcard と同値) などのプロジェクト lint セットを含む)\n- `task test` — `go test ./...` を実行\n\n## 付属ツール\n\n| ツール | 用途 |\n|---|---|\n| `./bin/serenebach mcp serve` | stdio 経由で MCP サーバを起動 (Claude Code / Cursor / Zed 向け) |\n| `./bin/serenebach backup` | DB・画像・テンプレートの整合 ZIP スナップショットを作成。`--include-analytics` / `--include-public` オプション付き |\n| `task build-proxy` | MCP OAuth プロキシ (`bin/mcp-oauth-proxy`) をビルド。ChatGPT の OAuth 専用 MCP クライアントと、Serene Bach の Bearer トークン認証 `/mcp` エンドポイントを中継します。環境変数や ChatGPT 設定方法は `cmd/mcp-oauth-proxy/README.md` を参照してください。 |\n\n## ドキュメント\n\nドキュメント本体は英語で書いています。管理画面 (`/admin/help`) のヘルプは日本語と英語の両方を用意していて、ブラウザの言語設定に追従します。\n\n| 内容 | リンク |\n|---|---|\n| 公開・管理画面の URL リファレンス | [docs/url-map.md](docs/url-map.md) |\n| 環境変数 / フラグ / `task` ショートカット | [docs/configuration.md](docs/configuration.md) |\n| 動作モード (HTTP サーバ / CGI / 静的生成 / Docker) | [docs/deployment.md](docs/deployment.md) |\n| Serene Bach v2 / v3 (Perl 版) からの移行 | [docs/importing-legacy-sb.md](docs/importing-legacy-sb.md) |\n| Markdown ファイル群からの取り込み | [docs/importing-markdown.md](docs/importing-markdown.md) |\n| アーキテクチャ + 設計ノート (CSRF, anti-spam, OG カード, アクセス解析 …) | [docs/architecture.md](docs/architecture.md) |\n| エンドユーザー向けヘルプ (管理画面 `/admin/help` で閲覧可) | [docs/help/ja/](docs/help/ja/) |\n\n## ライセンス\n\n[MIT](LICENSE)\n\n### サードパーティ素材\n\nOG カード画像のレンダラは **Noto Sans JP**（Medium、© 2014, 2015 Adobe Systems Incorporated、Reserved Font Name \"Source\"）をバイナリに埋め込んでいます。フォントは無改変で [SIL Open Font License 1.1](internal/og/assets/NotoSansJP-LICENSE.txt) のもとで再配布されます。Noto Sans JP は Adobe の Source Han Sans を基にしており、\"Noto\" は Google Inc. の商標です。ライセンス全文はフォントの隣と各リリースアーカイブに同梱しています。\n\n管理画面は **Ace** エディタ（`ajaxorg/ace`、© 2010 Ajax.org B.V.、[BSD 3-Clause](web/templates/admin/assets/ace/LICENSE)）をバイナリに同梱しています。Ace および **バイナリにコンパイルされる全 Go モジュール**（`go list -deps ./cmd/serenebach` に出る直接・間接依存すべて）の著作権表示とライセンス全文は [THIRD-PARTY-NOTICES.txt](THIRD-PARTY-NOTICES.txt) にまとめ、各リリースアーカイブに同梱しています。バイナリの依存が変わったらモジュールキャッシュから再生成してください。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserendipitynz%2Fserenebach","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserendipitynz%2Fserenebach","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserendipitynz%2Fserenebach/lists"}