Changes
6 changed files (+190/-6)
-
-
@@ -16,6 +16,7 @@ const builtin = @import("builtin");const std = @import("std"); const pages: []const []const u8 = @import("./pages.zon"); const diagrams: []const []const u8 = @import("./diagrams.zon"); pub fn build(b: *std.Build) !void { const pandoc_exe = pandoc_exe: {
-
@@ -65,6 +66,29 @@ pub fn build(b: *std.Build) !void {_ = dir.addCopyFile(output, b.fmt("{s}.html", .{page["src/".len .. page.len - ext.len]})); } for (diagrams) |diagram| { if (!std.mem.startsWith(u8, diagram, "src/")) { @panic(b.fmt("図形ファイルは src/ 配下に置いてください: {s}", .{diagram})); } const ext = std.fs.path.extension(diagram); if (!std.mem.eql(u8, ext, ".d2")) { @panic(b.fmt("図形ファイルは d2 形式のみ対応しています: {s}", .{diagram})); } const d2 = b.addSystemCommand(&.{ "d2", "--dark-theme", "200", "--layout", "elk" }); // d2 は成功時でも stderr にメッセージを表示し、かつこの挙動を無効化することが // できない。 "expectStdErrMatch" を使うと、出力された stderr がビルド成果物に // なるのか zig build の結果に表示されなくなる。 d2.expectStdErrMatch("success: successfully compiled"); d2.addFileArg(b.path(diagram)); const svg = d2.addOutputFileArg("out.svg"); _ = dir.addCopyFile(svg, b.fmt("{s}.svg", .{diagram["src/".len .. diagram.len - ext.len]})); } break :dist dir; };
-
-
-
@@ -15,13 +15,17 @@{ stdenvNoCC, lib, d2, zig_0_16, runCommand, }: stdenvNoCC.mkDerivation { name = "yamori-docs"; nativeBuildInputs = [ zig_0_16 ]; nativeBuildInputs = [ d2 zig_0_16 ]; src = with lib.fileset;
-
-
docs/diagrams.zon (new)
-
@@ -0,0 +1,21 @@// SPDX-License-Identifier: AGPL-3.0-only // Copyright 2026 Shota FUJI // // This program is free software: you can redistribute it and/or modify it under the terms // of the GNU Affero General Public License as published by the Free Software Foundation, // either version 3 of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A // PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License along // with this program. If not, see <http://www.gnu.org/licenses/>. // このディレクトリを基点としたファイルパス。 "src/" 以外のパスは未サポート。 // "*.d2" ファイルは ".svg" ファイルとして出力される。 // ex) "src/foo/bar.d2" -> "src/foo/bar.svg" .{ "src/admin/overview-architecture.d2", "src/admin/overview-reverse-proxy.d2", }
-
-
-
@@ -0,0 +1,79 @@# SPDX-License-Identifier: AGPL-3.0-only # Copyright 2026 Shota FUJI # # This program is free software: you can redistribute it and/or modify it under the terms # of the GNU Affero General Public License as published by the Free Software Foundation, # either version 3 of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License along # with this program. If not, see <http://www.gnu.org/licenses/>. direction: right classes: { base: { style: { bold: true font-size: 28 } } person: { shape: person } multiple: { style: { multiple: true } } database: { shape: cylinder } } worker: { label: 労働者 class: [base; person; multiple] } employer: { label: 使用者 class: [base; person; multiple] } system: { label: Yamori Server direction: right spa: { label: SPA class: [base; multiple] } api: { label: API class: base } sqlite3: { class: [base; database] } wasm_auth: { label: WASM (auth) class: [base] } spa -> api: {} api -> sqlite3: {} api -> wasm_auth: {} } worker -> system.spa: {} employer -> system.spa: {}
-
-
-
@@ -0,0 +1,51 @@# SPDX-License-Identifier: AGPL-3.0-only # Copyright 2026 Shota FUJI # # This program is free software: you can redistribute it and/or modify it under the terms # of the GNU Affero General Public License as published by the Free Software Foundation, # either version 3 of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License along # with this program. If not, see <http://www.gnu.org/licenses/>. direction: down classes: { base: { style: { bold: true font-size: 28 } } } user: { label: User class: base shape: person style: { multiple: true } } proxy: { label: Reverse Proxy class: base } server: { label: Yamori Server class: base } user <-> proxy: { label: TLS 証明書 (ユーザアクセス用) } proxy <-> server: { label: TLS 証明書 (オリジンアクセス用) }
-
-
-
@@ -18,16 +18,21 @@ with this program. If not, see <http://www.gnu.org/licenses/>.== 全体構成 Yamori はブラウザ上で動作する SPA 、 SPA 向けの静的ファイルと HTTP API を提供するサーバから成り立ちます。 Yamori はブラウザ上で動作する SPA 、 SPA 向けの静的ファイルと API を提供する HTTP/2 サーバから成り立ちます。 サーバは SQLite3 データベースにアプリケーションデータを読み書きします。 HTTP/1.1 で配信されるため**必ず前段に HTTP/2 or HTTP/3 のプロキシを置いてください**。 image::overview-architecture.svg[構成図] アプリケーション側で TLS の終端を担うため、リバースプロキシを前段に設置する際は Yamori サーバ起動時にリバースプロキシが信頼する証明書を指定してください。 image::overview-reverse-proxy.svg[リバースプロキシ設置例] == アクセス制御 アクセス制御は全て https://webassembly.org/:[WebAssembly] プログラムとしてサーバに登録されます。 アクセス制御は全て https://webassembly.org/[WebAssembly] プログラムとしてサーバに登録されます。 HTTP リクエストが来るとサーバは対応する WebAssembly ファイル・関数を実行して返り値を基にアクセスの許可・拒否を行います。 関数は https://flatbuffers.dev/:[FlatBuffers] のバイト文字列を受け取ります。 HTTP リクエストが来るとサーバは対応する WebAssembly 関数を実行し、返り値を基にアクセス許可判断を行います。 関数は https://flatbuffers.dev/[FlatBuffers] のバイト文字列を受け取ります。 FlatBuffers のメッセージにはログインユーザとリクエスト、サーバの状態を含むコンテキストオブジェクトが含まれています。 [source,zig]
-