handler

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2026 License: AGPL-3.0 Imports: 44 Imported by: 0

Documentation

Overview

Package handler — JSON API helpers. JSON API 用のヘルパー関数群。

Package handler provides the root HTTP handler and route registration for murlog. murlog のルート HTTP ハンドラとルーティング登録を提供するパッケージ。

Package handler — JSON-RPC 2.0 dispatcher. JSON-RPC 2.0 ディスパッチャー。

Index

Constants

View Source
const (
	SettingDomain            = "domain"
	SettingProtocol          = "protocol"
	SettingPasswordHash      = "password_hash"
	SettingSetupComplete     = "setup_complete"
	SettingLastPasswordReset = "last_password_reset_at"
	SettingWorkerSecret      = "worker_secret"
	SettingTOTPSecret        = "totp_secret"
	SettingRobotsNoIndex     = "robots_noindex" // "true" = noindex / クローラーインデックス拒否
	SettingRobotsNoAI        = "robots_noai"    // "true" = noai / AI学習拒否
)

DB settings keys used by handler. handler が使用する DB settings のキー。

View Source
const MaxBioLength = 3000

MaxBioLength is the maximum character count for profile bios/summaries. プロフィール bio/summary の最大文字数。

View Source
const MaxDisplayNameLength = 100

MaxDisplayNameLength is the maximum character count for display names. 表示名の最大文字数。

View Source
const MaxPostContentLength = 3000

MaxPostContentLength is the maximum character count for post content (Misskey-compatible). 投稿本文の最大文字数 (Misskey 準拠)。

Variables

This section is empty.

Functions

func SanitizeContentHTML

func SanitizeContentHTML(s string) string

SanitizeContentHTML sanitizes untrusted HTML content (posts, bios). Used at Inbox receive time (store) and SSR output time (defense in depth). 信頼できない HTML コンテンツ (投稿, bio) をサニタイズする。 Inbox 受信時 (保存) と SSR 出力時 (多層防御) の両方で使用。

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func New

func New(cfg *config.Config, s store.Store, q queue.Queue, w *worker.Worker, m media.Store) *Handler

New creates a new Handler with the given dependencies. 依存を受け取って新しい Handler を生成する。

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler. Setup guard → server routes (API/ActivityPub/Admin) → SPA fallback の順で処理。

type SetupPhase

type SetupPhase int

SetupPhase represents the current state of the setup wizard. セットアップウィザードの現在のフェーズ。

const (
	SetupDone  SetupPhase = iota // Setup complete / セットアップ完了
	SetupStep1                   // murlog.ini not found / murlog.ini 未作成
	SetupStep2                   // toml exists, DB not initialized / toml あり、DB 未初期化
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL