Skip to content
Projekte

Über uns

A blog engine with full-text search, article versioning, microblogging, and themeable frontend/backend

Web- und App-Entwicklung

So werden diese Zahlen gemessen

Gemessener Sternzuwachs

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Verlauf wird gesammelt

Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.

README.md

Original

Solitudes

Build status

中文

A multi-user blog built with Go and chi, with full-text search, nested series, revisions, short posts, comments, a reader circle, feeds and switchable themes. It also serves as an OIDC provider for other applications.

Installation

Save this as compose.yml and replace the example database password:

services:
  db:
    image: postgres:16-alpine
    restart: always
    environment:
      POSTGRES_USER: solitudes
      POSTGRES_PASSWORD: change-this-password
      POSTGRES_DB: solitudes
    volumes:
      - ./postgres-data:/var/lib/postgresql/data
  solitudes:
    image: ghcr.io/naiba/solitudes:latest
    restart: always
    depends_on:
      - db
    ports:
      - "8080:8080"
    volumes:
      - ./blog-data:/solitudes/data

Create blog-data/conf.yml using the example. Set the database host to db and match the credentials above. Set site.domain to your public host without a scheme. Use an HTTPS reverse proxy in production.

docker compose up -d db
# Confirm PostgreSQL is ready before initializing the administrator
docker compose exec db pg_isready -U solitudes -d solitudes
docker compose run --rm solitudes /solitudes/solitudes init-admin --email [email protected] --nickname Administrator
docker compose up -d solitudes

Sign in at http://localhost:8080/login. There is no default account or password. Initialization requires an empty accounts table and displays a random password once; save it securely and change it in your account center.

blog-data/ holds configuration, uploads and the search index. Accounts, passwords and articles live in PostgreSQL. Back up both the directory and database, protecting the credentials and signing keys they contain.

Single-user and old access-policy data are not migrated automatically: back up and validate before upgrading. Unknown configuration fields are rejected; remove obsolete top-level user and configfilepath, but retain SMTP's email.user.

Usage

Accounts and publishing

  • Register at /register and verify your email. Configure SMTP through email.host, email.port, email.user, email.pass and email.ssl.
  • Use /account to edit your profile/password, link sign-in methods and manage applications. Passwords are stored in the database, not configuration.
  • Administrators manage the site; editors publish and manage their own articles; ordinary members cannot publish or edit. The account center links to the writing workspace.
  • Mark an article as a series cover, then assign its UUID to other articles to add chapters. Series can be nested.
  • Add the Topic tag for short posts; titles and slugs can be generated automatically. The dashboard also offers quick publishing.
  • Select “Major Update” when editing to preserve the previous title and body. Historical URLs look like /my-article/v1; search returns only the current version. Older revisions without a saved title show “Title not recorded”.
  • Creator and last editor are recorded separately. /my-article/compare/v1...v3 compares rendered blocks with reader permissions applied; comparison pages are noindex and canonicalize to the main article.
  • Verified users appear in the reader circle by default and can leave in their account settings. Emails remain private.

Content access

Articles can be public, members-only, editors-only or restricted to the author and administrators. Vditor's restricted-content tool inserts access:members, access:editors or access:private Markdown fences, filtered server-side. Editors cannot add or modify executable code.

Historical versions inherit the latest article's overall visibility but keep their own fragment rules: text hidden later may remain visible in older versions. Uploads are public, and hiding a link does not restrict downloads. Do not upload sensitive attachments or publish restricted raw Markdown.

Sign in to the blog with another provider

Configure GitHub, Google or upstream OIDC at /admin/auth/providers. Register the callback https://<host>/auth/{github,google,oidc}/callback. The first OAuth sign-in registers an account using the provider's verified email and connects that sign-in method, without a password. Users can set a password in the account center to enable email/password sign-in. If an account already uses that email, sign in first and link the provider from the account center.

Passkeys require HTTPS. Set auth.webauthn.rp_id to the site's host and auth.webauthn.origin to its full HTTPS address.

Sign in to other applications with your blog account

Every verified user can create clients at /account/oidc/clients. Provide an application name, homepage and exact redirect URI. Use HTTPS in production; localhost HTTP is allowed for development.

  • OIDC discovery: https://<host>/.well-known/openid-configuration.
  • OAuth metadata: https://<host>/.well-known/oauth-authorization-server.
  • Use authorization code + PKCE S256. Rotating refresh tokens are supported; implicit/password grants are not. Request openid for an ID token.
  • Public clients need no secret; confidential clients use client_secret_basic. Secrets are displayed only on creation.
  • View and revoke current access at /account/oidc/authorizations. Applications disappear when all credentials expire.
  • Signed-in users skip consent when valid access/refresh tokens cover the requested scopes. New scopes or prompt=consent require confirmation; prompt=none returns login_required or consent_required when interaction is needed. prompt=login and max_age enforce a fresh enough sign-in.

Disabling or deleting an application clears its tokens and pending requests while preserving audits. Revocation cannot erase data already copied by the application, end its own sessions or immediately invalidate an ID token's offline signature. Restart after changing the site's host.

Administration

Administrators manage users at /admin/users, inspect applications and login statistics at /admin/oidc/clients, and investigate security events at /admin/audit.

Audits retain logins, consent decisions, sensitive changes and failures. Routine browsing, successful token refresh/validation and intermediate authentication steps are not logged individually.

The default audit_retention_days: 0 keeps audit details indefinitely. A positive value permanently deletes older details, retaining only aggregate login statistics. Back up or archive important audit records separately.

Themes

Cactus and Folio site themes and one default admin theme are bundled. Switch them independently in Admin → System Settings.

Custom themes live in resource/themes/{site,admin}/<name>/, containing metadata.json, screenshot.png, templates/, static/ and translations/. The metadata id must match the directory name; see Cactus for the format.

Both site themes follow the device's light or dark appearance and let the visitor override it; the choice is kept in the shared solitudes_theme key. Cactus has one light and one dark palette and no colour-scheme setting. Folio additionally loads Tailwind 2 for utility classes in owner-written content, but its own layout does not depend on that request.

After changing a bundled site theme, regenerate its screenshot.png from the real templates:

SOLITUDES_CAPTURE_SITE_THEME=1 go test -tags 'e2e postgres_test' ./router -run TestCaptureSiteThemeScreenshots -count=1

Site themes share the permission-filtered .Queries interface; see query definitions and built-in templates for usage. Only install trusted themes. Never bypass content filtering or apply unsafe to user input.

Development and tests

Requires Go 1.26+, a C/C++ compiler and PostgreSQL. Configure data/conf.yml, then run:

go build -o solitudes cmd/web/main.go
./solitudes init-admin --email [email protected] --nickname Administrator  # First installation only
./solitudes

Use a dedicated database for integration/browser tests, which start isolated services, a local SMTP catcher and temporary schemas:

go test ./...
export SOLITUDES_TEST_POSTGRES_DSN='postgres://[email protected]:5432/solitudes_test?sslmode=disable'
go test -tags postgres_test ./...

cd e2e
bun install --frozen-lockfile
bunx playwright install chromium
cd ..
go test -tags 'e2e postgres_test' ./router -run TestBrowserThemeMatrix -count=1 -v -timeout 20m

CI builds images after tests pass. E2E covers core flows in both themes, not every feature. WebAuthn uses a virtual authenticator; real upstream OAuth providers and physical authenticators require separate testing.

Credits and license

Bleve · Lute · Vditor · Cactus

AGPL-3.0

Generative search and machine-readable content

  • /llms.txt provides a site overview, navigation and a paginated public-content directory (50 entries per page). Follow “Next page” to discover older content. It is a discovery aid, not a ranking guarantee or an additional training/content license.
  • Public articles and standalone pages advertise /read/{articleID}/article.md through HTML alternate links and HTTP Link headers. Stable IDs avoid article-slug collisions. Markdown includes the title, public author profile, publication/update timestamps, version and canonical original URL.
  • Exports always use anonymous permissions, including requests from signed-in administrators. Restricted fragments, comments, historical revisions and author email addresses are excluded. Executable HTML, forms and embeds are removed; tables, code, images and captions remain static content.
  • All exported outbound navigation links use /r/go, including reference links, autolinks and HTML anchors. External images remain media resources, not navigation links. The interstitial remains client-only: the server must not echo arbitrary request targets into HTML. Robots continues to disallow /r/, and the interstitial remains noindex. Source traversal through it requires JavaScript; this deliberate safety boundary takes precedence over agent convenience.
  • Machine endpoints send Cache-Control: no-store and recheck public visibility on every request. Do not override this with CDN caching. Markdown points to the original using canonical and sends noindex, follow to avoid indexing a duplicate representation.
  • Verify that CDN/WAF challenges do not block intended search crawlers. Search discovery, user-requested retrieval and model training are separate purposes; this feature does not change training permissions. Verify official crawler IP ranges rather than trusting User-Agent strings alone.

Prefer original experience, explicit conclusions and conditions, real software versions, verifiable evidence and references. Do not fabricate quotes, credentials, FAQs or freshness. An optional writing structure is “conclusion → environment/conditions → steps/evidence → limitations → sources”. Monitor a fixed set of real questions, recording the platform, cited URL, accuracy and useful visits. Crawls, mentions, citations and clicks are different metrics; passing technical tests does not establish AI-search inclusion.

Ähnliche Projekte entdecken

Wird geladen…