Changeset c80e78b in Klonkt for .env.example


Ignore:
Timestamp:
06/14/2026 04:39:57 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
ae924a2
Parents:
89d6536
Message:

auth: replace username/password with Google login

Listeners (and the owner) now log in via Google instead of a local
username/password account. This lowers the barrier to commenting and
removes the home-built password/registration system.

  • src/config/google.js: raw OAuth2 helpers (authorize/token/userinfo) via the built-in fetch, config-driven. Boot keeps working without credentials.
  • src/routes/auth.js: /auth/google + /auth/google/callback (find-or-create user on email, ADMIN_EMAIL -> god, set session). login/register/reset POST handlers removed; /login now shows the Google button.
  • database.js: idempotent column users.google_sub.
  • account.js + account.ejs: change-password removed.
  • auth-login.ejs / welcome.ejs: Google button instead of password form.
  • shared-styles.ejs: .btn-google styling.
  • .env.example: GOOGLE_CLIENT_ID/SECRET/REDIRECT_URI + ADMIN_EMAIL.

Existing users are matched on email (owner retains their site).
DO NOT deploy to roboburr until the Google credentials are in .env, otherwise
the owner locks themselves out.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • .env.example

    r89d6536 rc80e78b  
    44DATABASE_PATH=./storage/database.sqlite
    55MEDIA_PATH=./storage/media
     6
     7# ── Google login (OAuth2) ──────────────────────────────────────────
     8# Inloggen gaat volledig via Google. Maak een OAuth-client aan in de
     9# Google Cloud Console (APIs & Services -> Credentials -> OAuth client ID,
     10# type "Web application") en vul hieronder in. Zonder deze waarden boot de
     11# app gewoon, maar toont de loginpagina "nog niet geconfigureerd".
     12#
     13# GOOGLE_REDIRECT_URI moet EXACT overeenkomen met een "Authorized redirect
     14# URI" in de Google-client, en is per site het eigen domein + /auth/google/callback.
     15GOOGLE_CLIENT_ID=
     16GOOGLE_CLIENT_SECRET=
     17GOOGLE_REDIRECT_URI=https://example.com/auth/google/callback
     18
     19# Het Google-e-mailadres dat owner/admin (god) is op deze instance.
     20# De eerste gebruiker die inlogt wordt sowieso god als de DB nog leeg is.
     21ADMIN_EMAIL=
Note: See TracChangeset for help on using the changeset viewer.