Add: login & sign up pages

This commit is contained in:
hyzen
2026-06-04 12:05:17 +05:30
parent b7d22114b4
commit 677b13c298
14 changed files with 1083 additions and 15 deletions

190
SERVER_SETUP.md Normal file
View File

@@ -0,0 +1,190 @@
# Server Setup: PostgreSQL + PHP Auth for freedoms4
## Overview
```
/var/www/freedoms4/ ← Hugo's published docs/ folder (static files)
/var/www/freedoms4/api/ ← PHP backend (auth.php lives here)
```
Nginx serves the static Hugo site and passes `/api/` requests to PHP-FPM.
---
## 1 · Install PostgreSQL
```bash
sudo apt update
sudo apt install -y postgresql postgresql-contrib
sudo systemctl enable --now postgresql
```
---
## 2 · Create the database and user
```bash
sudo -u postgres psql
```
Inside the psql shell:
```sql
CREATE USER freedoms4_user WITH PASSWORD 'CHANGE_THIS_PASSWORD';
CREATE DATABASE freedoms4 OWNER freedoms4_user;
\c freedoms4
CREATE TABLE users (
id BIGSERIAL PRIMARY KEY,
username VARCHAR(32) NOT NULL UNIQUE,
email VARCHAR(254) NOT NULL UNIQUE,
password_hash VARCHAR(255) NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX idx_users_username ON users (username);
CREATE INDEX idx_users_email ON users (email);
-- Optional: allow only this user to access the table
REVOKE ALL ON TABLE users FROM PUBLIC;
GRANT SELECT, INSERT ON TABLE users TO freedoms4_user;
GRANT USAGE, SELECT ON SEQUENCE users_id_seq TO freedoms4_user;
\q
```
> **Important:** use the same password you set in `DB_PASS` inside `auth.php`.
---
## 3 · Install the PHP PostgreSQL extension
```bash
# Find your PHP version first:
php -v
# Install the pgsql extension (replace 8.x with your version, e.g. 8.3):
sudo apt install -y php8.3-pgsql
# Restart PHP-FPM (replace 8.3 with your version):
sudo systemctl restart php8.3-fpm
```
Verify it loaded:
```bash
php -m | grep pgsql # should print: pgsql
```
---
## 4 · Deploy the PHP file
```bash
sudo mkdir -p /var/www/freedoms4/api
sudo cp /path/to/auth.php /var/www/freedoms4/api/auth.php
sudo chown -R www-data:www-data /var/www/freedoms4/api
sudo chmod 640 /var/www/freedoms4/api/auth.php
```
Edit the config constants at the top of `auth.php`:
```php
define('DB_PASS', 'CHANGE_THIS_PASSWORD'); // ← your actual password
```
---
## 5 · Configure Nginx
Open your site config (e.g. `/etc/nginx/sites-available/freedoms4`):
```nginx
server {
listen 443 ssl http2;
server_name freedoms4.org www.freedoms4.org;
root /var/www/freedoms4;
index index.html;
# ── Static Hugo files ───────────────────────────────────────────────
location / {
try_files $uri $uri/ $uri/index.html =404;
}
# ── PHP API ─────────────────────────────────────────────────────────
location /api/ {
# Only allow POST (OPTIONS for CORS preflight)
limit_except POST OPTIONS {
deny all;
}
# Pass to PHP-FPM (adjust socket path to match your PHP version)
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
# ── Block direct access to .php files outside /api/ ─────────────────
location ~* \.php$ {
deny all;
}
# SSL certs (already configured, adjust paths if needed)
ssl_certificate /etc/letsencrypt/live/freedoms4.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/freedoms4.org/privkey.pem;
}
```
Test and reload:
```bash
sudo nginx -t
sudo systemctl reload nginx
```
---
## 6 · Deploy the Hugo frontend changes
In your local Hugo project, apply the three file changes from the delivery package, then rebuild and sync:
```bash
# From inside the freedoms4 project directory:
hugo --minify
# Sync to server (adjust user/host):
rsync -avz --delete docs/ user@your-vps:/var/www/freedoms4/
```
Or if you use git+CI, commit and push; your pipeline handles the rest.
---
## 7 · Test
```bash
# Sign up
curl -s -X POST https://freedoms4.org/api/auth.php \
-H 'Content-Type: application/json' \
-d '{"action":"signup","username":"testuser","email":"test@example.com","password":"hunter2hunter2"}' | jq .
# Log in
curl -s -X POST https://freedoms4.org/api/auth.php \
-H 'Content-Type: application/json' \
-d '{"action":"login","username":"testuser","password":"hunter2hunter2"}' | jq .
```
Both should return `{"success":true, ...}`.
---
## Security notes
- All passwords are stored as bcrypt hashes (cost 12). Plain-text passwords are never written to disk or logs.
- Session cookies are `HttpOnly`, `Secure`, and `SameSite=Strict`.
- A simple per-IP rate limit (20 requests per 15 min) is enforced server-side via PHP sessions.
- For production, consider adding `fail2ban` rules on your Nginx access log to block repeated 429s at the firewall level.
- Keep `SESSION_SECURE = true` (requires HTTPS, which you already have).

195
api/auth.php Normal file
View File

@@ -0,0 +1,195 @@
<?php
/**
* auth.php — Login & Sign-Up backend for freedoms4
*
* Place this file at: /var/www/freedoms4/api/auth.php
*/
// ── Config ──────────────────────────────────────────────────────────────────
define('DB_HOST', '127.0.0.1');
define('DB_PORT', '5432');
define('DB_NAME', 'freedoms4');
define('DB_USER', 'freedoms4_user');
define('DB_PASS', 'CHANGE_THIS_PASSWORD'); // ← change before deploying
define('SESSION_NAME', 'f4_session');
define('SESSION_SECURE', true);
define('SESSION_SAMESITE', 'None'); // cross-origin cookies require None
// ── CORS ─────────────────────────────────────────────────────────────────────
$origin = $_SERVER['HTTP_ORIGIN'] ?? '';
$allowed_origins = ['https://freedoms4.org', 'https://www.freedoms4.org'];
if ($origin && !in_array($origin, $allowed_origins, true)) {
http_response_code(403);
header('Content-Type: application/json; charset=utf-8');
echo json_encode(['success' => false, 'message' => 'Forbidden.']);
exit;
}
if ($origin) {
header('Access-Control-Allow-Origin: ' . $origin);
header('Access-Control-Allow-Methods: POST, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type');
header('Access-Control-Allow-Credentials: true');
}
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
http_response_code(204);
exit;
}
// ── Helpers ──────────────────────────────────────────────────────────────────
function json_out(array $data, int $status = 200): never {
http_response_code($status);
header('Content-Type: application/json; charset=utf-8');
echo json_encode($data);
exit;
}
function start_session(): void {
if (session_status() === PHP_SESSION_NONE) {
session_name(SESSION_NAME);
session_set_cookie_params([
'lifetime' => 0,
'path' => '/',
'secure' => SESSION_SECURE,
'httponly' => true,
'samesite' => SESSION_SAMESITE,
]);
session_start();
}
}
function db_connect(): PDO {
static $pdo = null;
if ($pdo !== null) return $pdo;
$dsn = sprintf('pgsql:host=%s;port=%s;dbname=%s', DB_HOST, DB_PORT, DB_NAME);
try {
$pdo = new PDO($dsn, DB_USER, DB_PASS, [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false,
]);
} catch (PDOException $e) {
error_log('DB connection failed: ' . $e->getMessage());
json_out(['success' => false, 'message' => 'Database unavailable. Please try again later.'], 503);
}
return $pdo;
}
// ── Only accept POST ──────────────────────────────────────────────────────────
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
json_out(['success' => false, 'message' => 'Method not allowed.'], 405);
}
// ── Parse JSON body ───────────────────────────────────────────────────────────
$body = json_decode(file_get_contents('php://input'), true);
if (!is_array($body)) {
json_out(['success' => false, 'message' => 'Invalid request body.'], 400);
}
$action = $body['action'] ?? '';
// ── Rate limiting (per-IP via session) ────────────────────────────────────────
start_session();
$now = time();
$rl_key = 'rl_' . hash('sha256', $_SERVER['REMOTE_ADDR'] ?? '0.0.0.0');
$rl = $_SESSION[$rl_key] ?? ['count' => 0, 'window_start' => $now];
if ($now - $rl['window_start'] > 900) {
$rl = ['count' => 0, 'window_start' => $now];
}
$rl['count']++;
$_SESSION[$rl_key] = $rl;
if ($rl['count'] > 20) {
json_out(['success' => false, 'message' => 'Too many requests. Please wait a few minutes.'], 429);
}
// ════════════════════════════════════════════════════════════════════════════
// ACTION: login
// ════════════════════════════════════════════════════════════════════════════
if ($action === 'login') {
$username = trim($body['username'] ?? '');
$password = $body['password'] ?? '';
if ($username === '' || $password === '') {
json_out(['success' => false, 'message' => 'Username and password are required.']);
}
$pdo = db_connect();
$stmt = $pdo->prepare('SELECT id, username, password_hash FROM users WHERE username = :u LIMIT 1');
$stmt->execute([':u' => $username]);
$user = $stmt->fetch();
$hash = $user['password_hash'] ?? '$2y$12$invalidhashpadding000000000000000000000000000000000000000';
if (!$user || !password_verify($password, $hash)) {
json_out(['success' => false, 'message' => 'Invalid username or password.']);
}
session_regenerate_id(true);
$_SESSION['user_id'] = $user['id'];
$_SESSION['username'] = $user['username'];
json_out(['success' => true, 'redirect' => '/']);
}
// ════════════════════════════════════════════════════════════════════════════
// ACTION: signup
// ════════════════════════════════════════════════════════════════════════════
if ($action === 'signup') {
$username = trim($body['username'] ?? '');
$email = trim($body['email'] ?? '');
$password = $body['password'] ?? '';
if ($username === '') {
json_out(['success' => false, 'message' => 'Username is required.']);
}
if (!preg_match('/^[a-zA-Z0-9_\-]{3,32}$/', $username)) {
json_out(['success' => false, 'message' => 'Username must be 332 characters: letters, numbers, _ or -.']);
}
if ($email === '' || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
json_out(['success' => false, 'message' => 'A valid email address is required.']);
}
if (strlen($password) < 8) {
json_out(['success' => false, 'message' => 'Password must be at least 8 characters.']);
}
$pdo = db_connect();
$stmt = $pdo->prepare('SELECT 1 FROM users WHERE username = :u OR email = :e LIMIT 1');
$stmt->execute([':u' => $username, ':e' => $email]);
if ($stmt->fetch()) {
json_out(['success' => false, 'message' => 'Username or email is already taken.']);
}
$hash = password_hash($password, PASSWORD_BCRYPT, ['cost' => 12]);
$stmt = $pdo->prepare(
'INSERT INTO users (username, email, password_hash, created_at) VALUES (:u, :e, :h, NOW())'
);
$stmt->execute([':u' => $username, ':e' => $email, ':h' => $hash]);
json_out(['success' => true]);
}
// ════════════════════════════════════════════════════════════════════════════
// ACTION: logout
// ════════════════════════════════════════════════════════════════════════════
if ($action === 'logout') {
$_SESSION = [];
if (ini_get('session.use_cookies')) {
$p = session_get_cookie_params();
setcookie(session_name(), '', time() - 42000,
$p['path'], $p['domain'], $p['secure'], $p['httponly']);
}
session_destroy();
json_out(['success' => true, 'redirect' => '/']);
}
json_out(['success' => false, 'message' => 'Unknown action.'], 400);

View File

@@ -1,5 +1,5 @@
---
title: "Coming soon!"
title: "Login"
description: "Login to Freedoms4."
---

View File

@@ -1,5 +1,5 @@
---
title: "Coming soon!"
title: "Sign Up"
description: "Sign up for Freedoms4."
---

View File

@@ -1 +0,0 @@
freedoms4.org

195
docs/css/auth-additions.css Normal file
View File

@@ -0,0 +1,195 @@
/* ── Auth pages (login / signup) ───────────────────────────────────────── */
.auth-page {
max-width: 420px;
margin: 0 auto;
padding: 1rem 0 3rem;
}
.auth-page__title {
margin-bottom: 1.5rem;
}
.auth-card {
border: 1px solid var(--background-color1, #ccc);
border-radius: 10px;
padding: 2rem 1.75rem;
background: var(--background-color);
}
/* Message banner */
.auth-message {
border-radius: 6px;
padding: 0.65rem 0.9rem;
font-size: 0.88rem;
margin-bottom: 1.2rem;
line-height: 1.4;
}
.auth-message--error {
background: rgba(220, 53, 69, 0.12);
border: 1px solid rgba(220, 53, 69, 0.4);
color: #c0392b;
}
[data-theme='dark'] .auth-message--error {
color: #ff6b6b;
background: rgba(220, 53, 69, 0.18);
border-color: rgba(220, 53, 69, 0.5);
}
.auth-message--success {
background: rgba(39, 174, 96, 0.12);
border: 1px solid rgba(39, 174, 96, 0.4);
color: #1e8449;
}
[data-theme='dark'] .auth-message--success {
color: #58d68d;
background: rgba(39, 174, 96, 0.18);
border-color: rgba(39, 174, 96, 0.5);
}
/* Form fields */
.auth-form {
display: flex;
flex-direction: column;
gap: 1.1rem;
}
.auth-form__group {
display: flex;
flex-direction: column;
gap: 0.3rem;
}
.auth-form__label {
font-size: 0.85rem;
font-weight: 600;
color: var(--foreground-color);
}
.auth-form__input-wrap {
position: relative;
display: flex;
align-items: center;
}
.auth-form__input-wrap .auth-form__input {
padding-right: 2.5rem;
}
.auth-form__input {
width: 100%;
box-sizing: border-box;
padding: 0.5rem 0.75rem;
border: 1px solid var(--background-color1, #ccc);
border-radius: 5px;
font-size: 0.9rem;
background: var(--background-color);
color: var(--foreground-color);
transition: border-color 0.18s ease, box-shadow 0.18s ease;
outline: none;
font-family: inherit;
}
.auth-form__input:focus {
border-color: var(--accent-color);
box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb, 17, 51, 233), 0.15);
}
.auth-form__input::placeholder {
color: var(--foreground-color3, #888);
opacity: 0.7;
}
.auth-form__eye {
position: absolute;
right: 0.6rem;
background: none;
border: none;
cursor: pointer;
color: var(--foreground-color3, #888);
display: inline-flex;
align-items: center;
padding: 0.2rem;
line-height: 1;
transition: color 0.15s ease;
}
.auth-form__eye:hover {
color: var(--foreground-color);
}
.auth-form__hint {
font-size: 0.75rem;
color: var(--foreground-color3, #888);
}
/* Submit button */
.auth-form__submit {
margin-top: 0.5rem;
width: 100%;
padding: 0.6rem 1rem;
border: none;
border-radius: 5px;
background: var(--accent-color);
color: var(--background-color, #fff);
font-size: 0.92rem;
font-weight: 600;
font-family: inherit;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.4rem;
transition: opacity 0.18s ease;
}
.auth-form__submit:hover:not(:disabled) {
opacity: 0.85;
}
.auth-form__submit:disabled {
cursor: not-allowed;
opacity: 0.6;
}
.auth-form__submit-loader {
display: inline-flex;
align-items: center;
}
/* Spinner animation */
@keyframes auth-spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.spin {
animation: auth-spin 0.8s linear infinite;
}
/* Footer link */
.auth-card__footer {
margin-top: 1.4rem;
text-align: center;
font-size: 0.85rem;
color: var(--foreground-color3, #888);
}
.auth-card__link {
color: var(--accent-color);
text-decoration: none;
font-weight: 600;
}
.auth-card__link:hover {
text-decoration: underline;
}
/* Light theme override for submit button text */
[data-theme='light'] .auth-form__submit {
color: #fff;
}

View File

@@ -1,4 +1,4 @@
<!doctype html><html class=html lang=en-us dir=ltr><head><meta name=generator content="Hugo 0.161.1"><meta charset=utf-8><meta name=viewport content="width=device-width"><title>Freedoms4</title><link rel=stylesheet href=/css/style.min.34d0accb85f8ec23ceee8c29eef5907823b531d8acb9e6bdf45a3b37ad028d30.css integrity="sha256-NNCsy4X47CPO7owp7vWQeCO1Mdisuea99Fo7N60CjTA=" crossorigin=anonymous><link rel=icon href=/favicon.ico><meta name=description content="Freedoms4"><meta property="og:url" content="https://freedoms4.org/"><meta property="og:site_name" content="Freedoms4"><meta property="og:title" content="Home"><meta property="og:description" content="Freedoms4"><meta property="og:locale" content="en_us"><meta property="og:type" content="website"><meta itemprop=name content="Home"><meta itemprop=description content="Freedoms4"><meta itemprop=datePublished content="2026-03-01T18:11:14+00:00"><meta itemprop=dateModified content="2026-03-01T18:11:14+00:00"><meta itemprop=wordCount content="197"><link rel=alternate type=application/rss+xml href=/index.xml title=Freedoms4><link rel=stylesheet href=/css/custom.css><script>(function(){var e=localStorage.getItem("theme");e&&document.documentElement.setAttribute("data-theme",e)})()</script><script async src=https://plausible.freedoms4.org/js/pa-5BKl0z0RLzwrclKq4y-qk.js></script><script>(window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(e){plausible.o=e||{}}),plausible.init()</script></head><body class=body><header class=header><div class=brand><img src=/logo.png alt="Freedoms4 logo"><h1>Freedoms4</h1><div class=brand__actions><button class=theme-toggle id=theme-toggle aria-label="Toggle theme" title="Toggle dark/light mode">
<!doctype html><html class=html lang=en-us dir=ltr><head><meta name=generator content="Hugo 0.162.0"><meta charset=utf-8><meta name=viewport content="width=device-width"><title>Freedoms4</title><link rel=stylesheet href=/css/style.min.34d0accb85f8ec23ceee8c29eef5907823b531d8acb9e6bdf45a3b37ad028d30.css integrity="sha256-NNCsy4X47CPO7owp7vWQeCO1Mdisuea99Fo7N60CjTA=" crossorigin=anonymous><link rel=icon href=/favicon.ico><meta name=description content="Freedoms4"><meta property="og:url" content="https://freedoms4.org/"><meta property="og:site_name" content="Freedoms4"><meta property="og:title" content="Home"><meta property="og:description" content="Freedoms4"><meta property="og:locale" content="en_us"><meta property="og:type" content="website"><meta itemprop=name content="Home"><meta itemprop=description content="Freedoms4"><meta itemprop=datePublished content="2026-03-01T18:11:14+00:00"><meta itemprop=dateModified content="2026-03-01T18:11:14+00:00"><meta itemprop=wordCount content="197"><link rel=alternate type=application/rss+xml href=/index.xml title=Freedoms4><link rel=stylesheet href=/css/custom.css><script>(function(){var e=localStorage.getItem("theme");e&&document.documentElement.setAttribute("data-theme",e)})()</script><script async src=https://plausible.freedoms4.org/js/pa-5BKl0z0RLzwrclKq4y-qk.js></script><script>(window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(e){plausible.o=e||{}}),plausible.init()</script></head><body class=body><header class=header><div class=brand><img src=/logo.png alt="Freedoms4 logo"><h1>Freedoms4</h1><div class=brand__actions><button class=theme-toggle id=theme-toggle aria-label="Toggle theme" title="Toggle dark/light mode">
<svg class="theme-toggle__sun" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M12 7c-2.76.0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55.0 1-.45 1-1s-.45-1-1-1H2c-.55.0-1 .45-1 1s.45 1 1 1zm18 0h2c.55.0 1-.45 1-1s-.45-1-1-1h-2c-.55.0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41.0-.39.39-.39 1.03.0 1.41l1.06 1.06c.39.39 1.03.39 1.41.0s.39-1.03.0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41.0-.39.39-.39 1.03.0 1.41l1.06 1.06c.39.39 1.03.39 1.41.0.39-.39.39-1.03.0-1.41l-1.06-1.06zm1.06-12.37-1.06 1.06c-.39.39-.39 1.03.0 1.41s1.03.39 1.41.0l1.06-1.06c.39-.39.39-1.03.0-1.41s-1.03-.39-1.41.0zM7.05 18.36l-1.06 1.06c-.39.39-.39 1.03.0 1.41s1.03.39 1.41.0l1.06-1.06c.39-.39.39-1.03.0-1.41s-1.03-.39-1.41.0z"/></svg>
<svg class="theme-toggle__moon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg></button><div class="brand__auth brand__auth--desktop"><input type=checkbox id=auth-dropdown class=brand__auth-check>
<label class=brand__auth-toggle for=auth-dropdown tabindex=0 aria-label="Account options"><svg viewBox="0 0 24 24" width="12" height="12" fill="currentColor"><path d="M12 12c2.7.0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2.0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"/></svg></label><div class=brand__auth-links><a href=/login/ class="auth-link auth-link--login">Login</a>

View File

@@ -22,7 +22,7 @@
&lt;li&gt;Politics.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Education as a concept/implementation/system is good.
Academics is good only as a concept. It&amp;rsquo;s implementation and system is always the worst and corrupted.&lt;/p&gt;</description></item><item><title>Coming Soon</title><link>https://freedoms4.org/coming-soon/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><author>your-email@example.com (Freedoms4)</author><guid>https://freedoms4.org/coming-soon/</guid><description>&lt;p&gt;This feature is not yet available. Check back later!&lt;/p&gt;</description></item><item><title>Coming soon!</title><link>https://freedoms4.org/login/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><author>your-email@example.com (Freedoms4)</author><guid>https://freedoms4.org/login/</guid><description>&lt;p&gt;The feature is not available yet.&lt;/p&gt;</description></item><item><title>Coming soon!</title><link>https://freedoms4.org/signup/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><author>your-email@example.com (Freedoms4)</author><guid>https://freedoms4.org/signup/</guid><description>&lt;p&gt;The feature is not available yet.&lt;/p&gt;</description></item><item><title>Contact</title><link>https://freedoms4.org/contact/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><author>your-email@example.com (Freedoms4)</author><guid>https://freedoms4.org/contact/</guid><description>&lt;p&gt;&lt;strong&gt;Admin:&lt;/strong&gt; hyzen&lt;/p&gt;
Academics is good only as a concept. It&amp;rsquo;s implementation and system is always the worst and corrupted.&lt;/p&gt;</description></item><item><title>Coming Soon</title><link>https://freedoms4.org/coming-soon/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><author>your-email@example.com (Freedoms4)</author><guid>https://freedoms4.org/coming-soon/</guid><description>&lt;p&gt;This feature is not yet available. Check back later!&lt;/p&gt;</description></item><item><title>Contact</title><link>https://freedoms4.org/contact/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><author>your-email@example.com (Freedoms4)</author><guid>https://freedoms4.org/contact/</guid><description>&lt;p&gt;&lt;strong&gt;Admin:&lt;/strong&gt; hyzen&lt;/p&gt;
&lt;h2 class="heading" id="contacts"&gt;
Contacts&lt;span class="heading__anchor"&gt; &lt;a href="#contacts"&gt;#&lt;/a&gt;&lt;/span&gt;
&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="mailto:hyzen@freedoms4.org"&gt;Email&lt;/a&gt; and &lt;a href="xmpp:hyzen@freedoms4.org"&gt;XMPP&lt;/a&gt;:&lt;/strong&gt; &lt;a href="mailto:hyzen@freedoms4.org"&gt;hyzen@freedoms4.org&lt;/a&gt;&lt;/p&gt;
@@ -32,7 +32,7 @@ Academics is good only as a concept. It&amp;rsquo;s implementation and system is
&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://mastodon.social/@hyzen"&gt;Mastodon&lt;/a&gt;:&lt;/strong&gt; &lt;a href="mailto:hyzen@mastodon.social"&gt;hyzen@mastodon.social&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Lemmy:&lt;/strong&gt; &lt;a href="mailto:hyzen@lemmy.today"&gt;hyzen@lemmy.today&lt;/a&gt;&lt;/p&gt;</description></item><item><title>File share</title><link>https://freedoms4.org/services/file-share/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><author>your-email@example.com (Freedoms4)</author><guid>https://freedoms4.org/services/file-share/</guid><description>&lt;p&gt;Visit &lt;a href="https://share.freedoms4.org" target="_blank" rel="noopener noreferrer"&gt;
share.freedoms4.org↗
&lt;/a&gt; to quickly upload files and get sharable links.&lt;/p&gt;</description></item><item><title>Unit 1</title><link>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit1/self/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><author>your-email@example.com (Freedoms4)</author><guid>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit1/self/</guid><description>&lt;h3 class="heading" id="april-6-2026"&gt;
&lt;/a&gt; to quickly upload files and get sharable links.&lt;/p&gt;</description></item><item><title>Login</title><link>https://freedoms4.org/login/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><author>your-email@example.com (Freedoms4)</author><guid>https://freedoms4.org/login/</guid><description>&lt;p&gt;The feature is not available yet.&lt;/p&gt;</description></item><item><title>Sign Up</title><link>https://freedoms4.org/signup/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><author>your-email@example.com (Freedoms4)</author><guid>https://freedoms4.org/signup/</guid><description>&lt;p&gt;The feature is not available yet.&lt;/p&gt;</description></item><item><title>Unit 1</title><link>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit1/self/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><author>your-email@example.com (Freedoms4)</author><guid>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit1/self/</guid><description>&lt;h3 class="heading" id="april-6-2026"&gt;
&lt;em&gt;&lt;strong&gt;April 6, 2026&lt;/strong&gt;&lt;/em&gt;&lt;span class="heading__anchor"&gt; &lt;a href="#april-6-2026"&gt;#&lt;/a&gt;&lt;/span&gt;
&lt;/h3&gt;&lt;h2 class="heading" id="features-and-nature-of-business"&gt;
Features and Nature of Business&lt;span class="heading__anchor"&gt; &lt;a href="#features-and-nature-of-business"&gt;#&lt;/a&gt;&lt;/span&gt;

View File

@@ -1,4 +1,4 @@
<!doctype html><html class=html lang=en-us dir=ltr><head><meta charset=utf-8><meta name=viewport content="width=device-width"><title>Coming soon! | Freedoms4</title><link rel=stylesheet href=/css/style.min.34d0accb85f8ec23ceee8c29eef5907823b531d8acb9e6bdf45a3b37ad028d30.css integrity="sha256-NNCsy4X47CPO7owp7vWQeCO1Mdisuea99Fo7N60CjTA=" crossorigin=anonymous><link rel=icon href=/favicon.ico><meta name=description content="Login to Freedoms4."><meta property="og:url" content="https://freedoms4.org/login/"><meta property="og:site_name" content="Freedoms4"><meta property="og:title" content="Coming soon!"><meta property="og:description" content="Login to Freedoms4."><meta property="og:locale" content="en_us"><meta property="og:type" content="article"><meta itemprop=name content="Coming soon!"><meta itemprop=description content="Login to Freedoms4."><meta itemprop=wordCount content="6"><link rel=stylesheet href=/css/custom.css><script>(function(){var e=localStorage.getItem("theme");e&&document.documentElement.setAttribute("data-theme",e)})()</script><script async src=https://plausible.freedoms4.org/js/pa-5BKl0z0RLzwrclKq4y-qk.js></script><script>(window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(e){plausible.o=e||{}}),plausible.init()</script></head><body class=body><header class=header><div class=brand><img src=/logo.png alt="Freedoms4 logo"><h1>Freedoms4</h1><div class=brand__actions><button class=theme-toggle id=theme-toggle aria-label="Toggle theme" title="Toggle dark/light mode">
<!doctype html><html class=html lang=en-us dir=ltr><head><meta charset=utf-8><meta name=viewport content="width=device-width"><title>Login | Freedoms4</title><link rel=stylesheet href=/css/style.min.34d0accb85f8ec23ceee8c29eef5907823b531d8acb9e6bdf45a3b37ad028d30.css integrity="sha256-NNCsy4X47CPO7owp7vWQeCO1Mdisuea99Fo7N60CjTA=" crossorigin=anonymous><link rel=icon href=/favicon.ico><meta name=description content="Login to Freedoms4."><meta property="og:url" content="https://freedoms4.org/login/"><meta property="og:site_name" content="Freedoms4"><meta property="og:title" content="Login"><meta property="og:description" content="Login to Freedoms4."><meta property="og:locale" content="en_us"><meta property="og:type" content="article"><meta itemprop=name content="Login"><meta itemprop=description content="Login to Freedoms4."><meta itemprop=wordCount content="6"><link rel=stylesheet href=/css/custom.css><script>(function(){var e=localStorage.getItem("theme");e&&document.documentElement.setAttribute("data-theme",e)})()</script><script async src=https://plausible.freedoms4.org/js/pa-5BKl0z0RLzwrclKq4y-qk.js></script><script>(window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(e){plausible.o=e||{}}),plausible.init()</script></head><body class=body><header class=header><div class=brand><img src=/logo.png alt="Freedoms4 logo"><h1>Freedoms4</h1><div class=brand__actions><button class=theme-toggle id=theme-toggle aria-label="Toggle theme" title="Toggle dark/light mode">
<svg class="theme-toggle__sun" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M12 7c-2.76.0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55.0 1-.45 1-1s-.45-1-1-1H2c-.55.0-1 .45-1 1s.45 1 1 1zm18 0h2c.55.0 1-.45 1-1s-.45-1-1-1h-2c-.55.0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41.0-.39.39-.39 1.03.0 1.41l1.06 1.06c.39.39 1.03.39 1.41.0s.39-1.03.0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41.0-.39.39-.39 1.03.0 1.41l1.06 1.06c.39.39 1.03.39 1.41.0.39-.39.39-1.03.0-1.41l-1.06-1.06zm1.06-12.37-1.06 1.06c-.39.39-.39 1.03.0 1.41s1.03.39 1.41.0l1.06-1.06c.39-.39.39-1.03.0-1.41s-1.03-.39-1.41.0zM7.05 18.36l-1.06 1.06c-.39.39-.39 1.03.0 1.41s1.03.39 1.41.0l1.06-1.06c.39-.39.39-1.03.0-1.41s-1.03-.39-1.41.0z"/></svg>
<svg class="theme-toggle__moon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg></button><div class="brand__auth brand__auth--desktop"><input type=checkbox id=auth-dropdown class=brand__auth-check>
<label class=brand__auth-toggle for=auth-dropdown tabindex=0 aria-label="Account options"><svg viewBox="0 0 24 24" width="12" height="12" fill="currentColor"><path d="M12 12c2.7.0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2.0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"/></svg></label><div class=brand__auth-links><a href=/login/ class="auth-link auth-link--login">Login</a>
@@ -7,4 +7,10 @@
<label class=brand__mobile-toggle for=mobile-menu-check aria-label=Menu><svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg></label><div class=brand__mobile-links><a href=/login/ class=mobile-link>Login</a>
<a href=/signup/ class=mobile-link>Sign Up</a>
<a href=/index.xml class="mobile-link mobile-link--subscribe"><svg viewBox="0 0 24 24" width="12" height="12" fill="currentColor" aria-hidden="true"><path d="M6.18 15.64a2.18 2.18.0 012.18 2.18c0 1.19-.98 2.18-2.18 2.18C4.98 20 4 19.01 4 17.82a2.18 2.18.0 012.18-2.18M4 4.44A15.56 15.56.0 0119.56 20h-2.83A12.73 12.73.0 004 7.27V4.44m0 5.66a9.9 9.9.0 019.9 9.9h-2.83A7.07 7.07.0 004 12.93V10.1z"/></svg>
Subscribe</a></div></div></div></div><nav class="menu language"><ul class="menu__list language__list"><li class=menu__item><a class=menu__link href=/>Home</a></li><li class=menu__item><a class=menu__link href=/blog/>Blog</a></li><li class=menu__item><a class=menu__link href=/services/>Services</a></li><li class=menu__item><a class=menu__link href=/uninotes/>UniNotes</a></li><li class=menu__item><a class=menu__link href=/contact/>Contact</a></li></ul></nav></header><main class=main><h1>Coming soon!</h1><p>The feature is not available yet.</p></main><footer class=footer><p class=footer__copyright-notice>&copy; <a href=https://freedoms4.org>freedoms4.org</a> <a href=/changelog/>Changelog</a></p><p class=footer__theme-info>Built with <a href=https://gohugo.io>Hugo</a> and based on <a href=https://github.com/CyrusYip/hugo-theme-yue>Yue</a> theme</p></footer><script>(function(){var e=document.getElementById("theme-toggle");if(!e)return;function t(){var e=localStorage.getItem("theme");return e?e:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function n(e){document.documentElement.setAttribute("data-theme",e),localStorage.setItem("theme",e)}n(t()),e.addEventListener("click",function(){var e=document.documentElement.getAttribute("data-theme")||t();n(e==="dark"?"light":"dark")})})()</script><script>(function(){var e=document.getElementById("mobile-menu-check");if(!e)return;document.addEventListener("click",function(t){if(!e.checked)return;var n=e.closest(".brand__mobile-menu");n&&!n.contains(t.target)&&(e.checked=!1)})})()</script></body></html>
Subscribe</a></div></div></div></div><nav class="menu language"><ul class="menu__list language__list"><li class=menu__item><a class=menu__link href=/>Home</a></li><li class=menu__item><a class=menu__link href=/blog/>Blog</a></li><li class=menu__item><a class=menu__link href=/services/>Services</a></li><li class=menu__item><a class=menu__link href=/uninotes/>UniNotes</a></li><li class=menu__item><a class=menu__link href=/contact/>Contact</a></li></ul></nav></header><main class=main><div class=auth-page><h1 class=auth-page__title>Login</h1><div class=auth-card><div id=auth-message class=auth-message aria-live=polite style=display:none></div><form id=login-form class=auth-form novalidate><div class=auth-form__group><label class=auth-form__label for=login-username>Username</label>
<input class=auth-form__input type=text id=login-username name=username autocomplete=username required placeholder=your_username></div><div class=auth-form__group><label class=auth-form__label for=login-password>Password</label><div class=auth-form__input-wrap><input class=auth-form__input type=password id=login-password name=password autocomplete=current-password required placeholder=••••••••>
<button type=button class=auth-form__eye aria-label="Toggle password visibility" tabindex=-1>
<svg class="eye-show" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76.0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66.0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>
<svg class="eye-hide" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" style="display:none"><path d="M12 7c2.76.0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4.0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55.0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65.0 1.66 1.34 3 3 3 .22.0.44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76.0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg></button></div></div><button type=submit class=auth-form__submit id=login-submit>
<span class=auth-form__submit-text>Log In</span>
<span class=auth-form__submit-loader style=display:none><svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" class="spin"><path d="M12 4V1L8 5l4 4V6c3.31.0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31.0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"/></svg></span></button></form><p class=auth-card__footer>Don't have an account? <a href=/signup/ class=auth-card__link>Sign up</a></p></div></div><script>(function(){var a="https://backend.freedoms4.org/auth.php",i=document.getElementById("login-form"),t=document.getElementById("auth-message"),e=document.getElementById("login-submit"),s=i.querySelector(".auth-form__eye"),o=document.getElementById("login-password");s.addEventListener("click",function(){var e=o.type==="text";o.type=e?"password":"text",s.querySelector(".eye-show").style.display=e?"":"none",s.querySelector(".eye-hide").style.display=e?"none":""});function n(e,n){t.textContent=e,t.className="auth-message auth-message--"+n,t.style.display="block"}i.addEventListener("submit",function(s){s.preventDefault(),t.style.display="none";var i=document.getElementById("login-username").value.trim(),r=o.value;if(!i||!r){n("Please fill in all fields.","error");return}e.disabled=!0,e.querySelector(".auth-form__submit-text").style.display="none",e.querySelector(".auth-form__submit-loader").style.display="inline-flex",fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({action:"login",username:i,password:r})}).then(function(e){return e.json()}).then(function(e){e.success?(n("Logged in successfully! Redirecting…","success"),setTimeout(function(){window.location.href=e.redirect||"/"},1e3)):n(e.message||"Login failed. Please try again.","error")}).catch(function(){n("Network error. Please try again.","error")}).finally(function(){e.disabled=!1,e.querySelector(".auth-form__submit-text").style.display="",e.querySelector(".auth-form__submit-loader").style.display="none"})})})()</script></main><footer class=footer><p class=footer__copyright-notice>&copy; <a href=https://freedoms4.org>freedoms4.org</a> <a href=/changelog/>Changelog</a></p><p class=footer__theme-info>Built with <a href=https://gohugo.io>Hugo</a> and based on <a href=https://github.com/CyrusYip/hugo-theme-yue>Yue</a> theme</p></footer><script>(function(){var e=document.getElementById("theme-toggle");if(!e)return;function t(){var e=localStorage.getItem("theme");return e?e:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function n(e){document.documentElement.setAttribute("data-theme",e),localStorage.setItem("theme",e)}n(t()),e.addEventListener("click",function(){var e=document.documentElement.getAttribute("data-theme")||t();n(e==="dark"?"light":"dark")})})()</script><script>(function(){var e=document.getElementById("mobile-menu-check");if(!e)return;document.addEventListener("click",function(t){if(!e.checked)return;var n=e.closest(".brand__mobile-menu");n&&!n.contains(t.target)&&(e.checked=!1)})})()</script></body></html>

View File

@@ -1,4 +1,4 @@
<!doctype html><html class=html lang=en-us dir=ltr><head><meta charset=utf-8><meta name=viewport content="width=device-width"><title>Coming soon! | Freedoms4</title><link rel=stylesheet href=/css/style.min.34d0accb85f8ec23ceee8c29eef5907823b531d8acb9e6bdf45a3b37ad028d30.css integrity="sha256-NNCsy4X47CPO7owp7vWQeCO1Mdisuea99Fo7N60CjTA=" crossorigin=anonymous><link rel=icon href=/favicon.ico><meta name=description content="Sign up for Freedoms4."><meta property="og:url" content="https://freedoms4.org/signup/"><meta property="og:site_name" content="Freedoms4"><meta property="og:title" content="Coming soon!"><meta property="og:description" content="Sign up for Freedoms4."><meta property="og:locale" content="en_us"><meta property="og:type" content="article"><meta itemprop=name content="Coming soon!"><meta itemprop=description content="Sign up for Freedoms4."><meta itemprop=wordCount content="6"><link rel=stylesheet href=/css/custom.css><script>(function(){var e=localStorage.getItem("theme");e&&document.documentElement.setAttribute("data-theme",e)})()</script><script async src=https://plausible.freedoms4.org/js/pa-5BKl0z0RLzwrclKq4y-qk.js></script><script>(window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(e){plausible.o=e||{}}),plausible.init()</script></head><body class=body><header class=header><div class=brand><img src=/logo.png alt="Freedoms4 logo"><h1>Freedoms4</h1><div class=brand__actions><button class=theme-toggle id=theme-toggle aria-label="Toggle theme" title="Toggle dark/light mode">
<!doctype html><html class=html lang=en-us dir=ltr><head><meta charset=utf-8><meta name=viewport content="width=device-width"><title>Sign Up | Freedoms4</title><link rel=stylesheet href=/css/style.min.34d0accb85f8ec23ceee8c29eef5907823b531d8acb9e6bdf45a3b37ad028d30.css integrity="sha256-NNCsy4X47CPO7owp7vWQeCO1Mdisuea99Fo7N60CjTA=" crossorigin=anonymous><link rel=icon href=/favicon.ico><meta name=description content="Sign up for Freedoms4."><meta property="og:url" content="https://freedoms4.org/signup/"><meta property="og:site_name" content="Freedoms4"><meta property="og:title" content="Sign Up"><meta property="og:description" content="Sign up for Freedoms4."><meta property="og:locale" content="en_us"><meta property="og:type" content="article"><meta itemprop=name content="Sign Up"><meta itemprop=description content="Sign up for Freedoms4."><meta itemprop=wordCount content="6"><link rel=stylesheet href=/css/custom.css><script>(function(){var e=localStorage.getItem("theme");e&&document.documentElement.setAttribute("data-theme",e)})()</script><script async src=https://plausible.freedoms4.org/js/pa-5BKl0z0RLzwrclKq4y-qk.js></script><script>(window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(e){plausible.o=e||{}}),plausible.init()</script></head><body class=body><header class=header><div class=brand><img src=/logo.png alt="Freedoms4 logo"><h1>Freedoms4</h1><div class=brand__actions><button class=theme-toggle id=theme-toggle aria-label="Toggle theme" title="Toggle dark/light mode">
<svg class="theme-toggle__sun" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M12 7c-2.76.0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55.0 1-.45 1-1s-.45-1-1-1H2c-.55.0-1 .45-1 1s.45 1 1 1zm18 0h2c.55.0 1-.45 1-1s-.45-1-1-1h-2c-.55.0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41.0-.39.39-.39 1.03.0 1.41l1.06 1.06c.39.39 1.03.39 1.41.0s.39-1.03.0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41.0-.39.39-.39 1.03.0 1.41l1.06 1.06c.39.39 1.03.39 1.41.0.39-.39.39-1.03.0-1.41l-1.06-1.06zm1.06-12.37-1.06 1.06c-.39.39-.39 1.03.0 1.41s1.03.39 1.41.0l1.06-1.06c.39-.39.39-1.03.0-1.41s-1.03-.39-1.41.0zM7.05 18.36l-1.06 1.06c-.39.39-.39 1.03.0 1.41s1.03.39 1.41.0l1.06-1.06c.39-.39.39-1.03.0-1.41s-1.03-.39-1.41.0z"/></svg>
<svg class="theme-toggle__moon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg></button><div class="brand__auth brand__auth--desktop"><input type=checkbox id=auth-dropdown class=brand__auth-check>
<label class=brand__auth-toggle for=auth-dropdown tabindex=0 aria-label="Account options"><svg viewBox="0 0 24 24" width="12" height="12" fill="currentColor"><path d="M12 12c2.7.0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2.0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"/></svg></label><div class=brand__auth-links><a href=/login/ class="auth-link auth-link--login">Login</a>
@@ -7,4 +7,12 @@
<label class=brand__mobile-toggle for=mobile-menu-check aria-label=Menu><svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg></label><div class=brand__mobile-links><a href=/login/ class=mobile-link>Login</a>
<a href=/signup/ class=mobile-link>Sign Up</a>
<a href=/index.xml class="mobile-link mobile-link--subscribe"><svg viewBox="0 0 24 24" width="12" height="12" fill="currentColor" aria-hidden="true"><path d="M6.18 15.64a2.18 2.18.0 012.18 2.18c0 1.19-.98 2.18-2.18 2.18C4.98 20 4 19.01 4 17.82a2.18 2.18.0 012.18-2.18M4 4.44A15.56 15.56.0 0119.56 20h-2.83A12.73 12.73.0 004 7.27V4.44m0 5.66a9.9 9.9.0 019.9 9.9h-2.83A7.07 7.07.0 004 12.93V10.1z"/></svg>
Subscribe</a></div></div></div></div><nav class="menu language"><ul class="menu__list language__list"><li class=menu__item><a class=menu__link href=/>Home</a></li><li class=menu__item><a class=menu__link href=/blog/>Blog</a></li><li class=menu__item><a class=menu__link href=/services/>Services</a></li><li class=menu__item><a class=menu__link href=/uninotes/>UniNotes</a></li><li class=menu__item><a class=menu__link href=/contact/>Contact</a></li></ul></nav></header><main class=main><h1>Coming soon!</h1><p>The feature is not available yet.</p></main><footer class=footer><p class=footer__copyright-notice>&copy; <a href=https://freedoms4.org>freedoms4.org</a> <a href=/changelog/>Changelog</a></p><p class=footer__theme-info>Built with <a href=https://gohugo.io>Hugo</a> and based on <a href=https://github.com/CyrusYip/hugo-theme-yue>Yue</a> theme</p></footer><script>(function(){var e=document.getElementById("theme-toggle");if(!e)return;function t(){var e=localStorage.getItem("theme");return e?e:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function n(e){document.documentElement.setAttribute("data-theme",e),localStorage.setItem("theme",e)}n(t()),e.addEventListener("click",function(){var e=document.documentElement.getAttribute("data-theme")||t();n(e==="dark"?"light":"dark")})})()</script><script>(function(){var e=document.getElementById("mobile-menu-check");if(!e)return;document.addEventListener("click",function(t){if(!e.checked)return;var n=e.closest(".brand__mobile-menu");n&&!n.contains(t.target)&&(e.checked=!1)})})()</script></body></html>
Subscribe</a></div></div></div></div><nav class="menu language"><ul class="menu__list language__list"><li class=menu__item><a class=menu__link href=/>Home</a></li><li class=menu__item><a class=menu__link href=/blog/>Blog</a></li><li class=menu__item><a class=menu__link href=/services/>Services</a></li><li class=menu__item><a class=menu__link href=/uninotes/>UniNotes</a></li><li class=menu__item><a class=menu__link href=/contact/>Contact</a></li></ul></nav></header><main class=main><div class=auth-page><h1 class=auth-page__title>Sign Up</h1><div class=auth-card><div id=auth-message class=auth-message aria-live=polite style=display:none></div><form id=signup-form class=auth-form novalidate><div class=auth-form__group><label class=auth-form__label for=signup-username>Username</label>
<input class=auth-form__input type=text id=signup-username name=username autocomplete=username required placeholder=choose_a_username minlength=3 maxlength=32 pattern=[a-zA-Z0-9_\-]+>
<span class=auth-form__hint>332 characters; letters, numbers, _ and - only.</span></div><div class=auth-form__group><label class=auth-form__label for=signup-email>Email</label>
<input class=auth-form__input type=email id=signup-email name=email autocomplete=email required placeholder=you@example.com></div><div class=auth-form__group><label class=auth-form__label for=signup-password>Password</label><div class=auth-form__input-wrap><input class=auth-form__input type=password id=signup-password name=password autocomplete=new-password required placeholder=•••••••• minlength=8>
<button type=button class=auth-form__eye aria-label="Toggle password visibility" tabindex=-1>
<svg class="eye-show" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76.0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66.0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>
<svg class="eye-hide" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" style="display:none"><path d="M12 7c2.76.0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4.0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55.0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65.0 1.66 1.34 3 3 3 .22.0.44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76.0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg></button></div><span class=auth-form__hint>At least 8 characters.</span></div><div class=auth-form__group><label class=auth-form__label for=signup-confirm>Confirm Password</label><div class=auth-form__input-wrap><input class=auth-form__input type=password id=signup-confirm name=confirm_password autocomplete=new-password required placeholder=••••••••></div></div><button type=submit class=auth-form__submit id=signup-submit>
<span class=auth-form__submit-text>Create Account</span>
<span class=auth-form__submit-loader style=display:none><svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" class="spin"><path d="M12 4V1L8 5l4 4V6c3.31.0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31.0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"/></svg></span></button></form><p class=auth-card__footer>Already have an account? <a href=/login/ class=auth-card__link>Log in</a></p></div></div><script>(function(){var a="https://backend.freedoms4.org/auth.php",i=document.getElementById("signup-form"),n=document.getElementById("auth-message"),t=document.getElementById("signup-submit"),s=document.getElementById("signup-password"),o=i.querySelector(".auth-form__eye");o.addEventListener("click",function(){var e=s.type==="text";s.type=e?"password":"text",o.querySelector(".eye-show").style.display=e?"":"none",o.querySelector(".eye-hide").style.display=e?"none":""});function e(e,t){n.textContent=e,n.className="auth-message auth-message--"+t,n.style.display="block"}i.addEventListener("submit",function(o){o.preventDefault(),n.style.display="none";var r=document.getElementById("signup-username").value.trim(),c=document.getElementById("signup-email").value.trim(),i=s.value,l=document.getElementById("signup-confirm").value;if(!r||!c||!i||!l){e("Please fill in all fields.","error");return}if(!/^[a-zA-Z0-9_-]{3,32}$/.test(r)){e("Username must be 332 characters: letters, numbers, _ or -.","error");return}if(i.length<8){e("Password must be at least 8 characters.","error");return}if(i!==l){e("Passwords do not match.","error");return}t.disabled=!0,t.querySelector(".auth-form__submit-text").style.display="none",t.querySelector(".auth-form__submit-loader").style.display="inline-flex",fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({action:"signup",username:r,email:c,password:i})}).then(function(e){return e.json()}).then(function(t){t.success?(e("Account created! Redirecting to login…","success"),setTimeout(function(){window.location.href="/login/"},1500)):e(t.message||"Sign-up failed. Please try again.","error")}).catch(function(){e("Network error. Please try again.","error")}).finally(function(){t.disabled=!1,t.querySelector(".auth-form__submit-text").style.display="",t.querySelector(".auth-form__submit-loader").style.display="none"})})})()</script></main><footer class=footer><p class=footer__copyright-notice>&copy; <a href=https://freedoms4.org>freedoms4.org</a> <a href=/changelog/>Changelog</a></p><p class=footer__theme-info>Built with <a href=https://gohugo.io>Hugo</a> and based on <a href=https://github.com/CyrusYip/hugo-theme-yue>Yue</a> theme</p></footer><script>(function(){var e=document.getElementById("theme-toggle");if(!e)return;function t(){var e=localStorage.getItem("theme");return e?e:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function n(e){document.documentElement.setAttribute("data-theme",e),localStorage.setItem("theme",e)}n(t()),e.addEventListener("click",function(){var e=document.documentElement.getAttribute("data-theme")||t();n(e==="dark"?"light":"dark")})})()</script><script>(function(){var e=document.getElementById("mobile-menu-check");if(!e)return;document.addEventListener("click",function(t){if(!e.checked)return;var n=e.closest(".brand__mobile-menu");n&&!n.contains(t.target)&&(e.checked=!1)})})()</script></body></html>

View File

@@ -1 +1 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://freedoms4.org/tags/academics/</loc><lastmod>2026-03-01T18:11:14+00:00</lastmod></url><url><loc>https://freedoms4.org/blog/</loc><lastmod>2026-03-01T18:11:14+00:00</lastmod></url><url><loc>https://freedoms4.org/categories/</loc><lastmod>2026-03-01T18:11:14+00:00</lastmod></url><url><loc>https://freedoms4.org/tags/education/</loc><lastmod>2026-03-01T18:11:14+00:00</lastmod></url><url><loc>https://freedoms4.org/</loc><lastmod>2026-03-01T18:11:14+00:00</lastmod></url><url><loc>https://freedoms4.org/categories/philosophy/</loc><lastmod>2026-03-01T18:11:14+00:00</lastmod></url><url><loc>https://freedoms4.org/tags/system/</loc><lastmod>2026-03-01T18:11:14+00:00</lastmod></url><url><loc>https://freedoms4.org/tags/</loc><lastmod>2026-03-01T18:11:14+00:00</lastmod></url><url><loc>https://freedoms4.org/blog/what-is-education/</loc><lastmod>2026-03-01T18:11:14+00:00</lastmod></url><url><loc>https://freedoms4.org/uninotes/</loc><lastmod>2025-11-11T23:15:44+05:30</lastmod></url><url><loc>https://freedoms4.org/uninotes/s1/bo-dcm1109/</loc></url><url><loc>https://freedoms4.org/changelog/</loc></url><url><loc>https://freedoms4.org/coming-soon/</loc></url><url><loc>https://freedoms4.org/login/</loc></url><url><loc>https://freedoms4.org/signup/</loc></url><url><loc>https://freedoms4.org/contact/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/fa-dcm1108/</loc></url><url><loc>https://freedoms4.org/services/file-share/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/ge-dcm1106/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/</loc></url><url><loc>https://freedoms4.org/uninotes/s2/</loc></url><url><loc>https://freedoms4.org/uninotes/s3/</loc></url><url><loc>https://freedoms4.org/uninotes/s4/</loc></url><url><loc>https://freedoms4.org/uninotes/s5/</loc></url><url><loc>https://freedoms4.org/uninotes/s6/</loc></url><url><loc>https://freedoms4.org/semester/</loc></url><url><loc>https://freedoms4.org/services/</loc></url><url><loc>https://freedoms4.org/subjectcode/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit1/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit1/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit1/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit1/live/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit1/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/ge-dcm1106/unit1/live/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit1/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit1/live/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit1/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit11/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit11/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit12/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit12/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit2/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit2/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit2/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit2/live/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit2/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit2/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit3/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit3/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit3/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit3/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit4/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit4/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit5/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit5/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit6/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit6/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit7/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit7/self/</loc></url><url><loc>https://freedoms4.org/services/xmpp-account/</loc></url></urlset>
<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://freedoms4.org/tags/academics/</loc><lastmod>2026-03-01T18:11:14+00:00</lastmod></url><url><loc>https://freedoms4.org/blog/</loc><lastmod>2026-03-01T18:11:14+00:00</lastmod></url><url><loc>https://freedoms4.org/categories/</loc><lastmod>2026-03-01T18:11:14+00:00</lastmod></url><url><loc>https://freedoms4.org/tags/education/</loc><lastmod>2026-03-01T18:11:14+00:00</lastmod></url><url><loc>https://freedoms4.org/</loc><lastmod>2026-03-01T18:11:14+00:00</lastmod></url><url><loc>https://freedoms4.org/categories/philosophy/</loc><lastmod>2026-03-01T18:11:14+00:00</lastmod></url><url><loc>https://freedoms4.org/tags/system/</loc><lastmod>2026-03-01T18:11:14+00:00</lastmod></url><url><loc>https://freedoms4.org/tags/</loc><lastmod>2026-03-01T18:11:14+00:00</lastmod></url><url><loc>https://freedoms4.org/blog/what-is-education/</loc><lastmod>2026-03-01T18:11:14+00:00</lastmod></url><url><loc>https://freedoms4.org/uninotes/</loc><lastmod>2025-11-11T23:15:44+05:30</lastmod></url><url><loc>https://freedoms4.org/uninotes/s1/bo-dcm1109/</loc></url><url><loc>https://freedoms4.org/changelog/</loc></url><url><loc>https://freedoms4.org/coming-soon/</loc></url><url><loc>https://freedoms4.org/contact/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/fa-dcm1108/</loc></url><url><loc>https://freedoms4.org/services/file-share/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/ge-dcm1106/</loc></url><url><loc>https://freedoms4.org/login/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/</loc></url><url><loc>https://freedoms4.org/uninotes/s2/</loc></url><url><loc>https://freedoms4.org/uninotes/s3/</loc></url><url><loc>https://freedoms4.org/uninotes/s4/</loc></url><url><loc>https://freedoms4.org/uninotes/s5/</loc></url><url><loc>https://freedoms4.org/uninotes/s6/</loc></url><url><loc>https://freedoms4.org/semester/</loc></url><url><loc>https://freedoms4.org/services/</loc></url><url><loc>https://freedoms4.org/signup/</loc></url><url><loc>https://freedoms4.org/subjectcode/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit1/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit1/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit1/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit1/live/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit1/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/ge-dcm1106/unit1/live/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit1/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit1/live/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit1/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit11/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit11/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit12/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit12/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit2/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit2/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit2/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit2/live/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit2/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit2/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit3/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/bo-dcm1109/unit3/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit3/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit3/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit4/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/pbm-dcm1110/unit4/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit5/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit5/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit6/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit6/self/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit7/</loc></url><url><loc>https://freedoms4.org/uninotes/s1/et-dcm1107/unit7/self/</loc></url><url><loc>https://freedoms4.org/services/xmpp-account/</loc></url></urlset>

View File

@@ -1,4 +1,120 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ .Content }}
<div class="auth-page">
<h1 class="auth-page__title">{{ .Title }}</h1>
<div class="auth-card">
<div id="auth-message" class="auth-message" aria-live="polite" style="display:none"></div>
<form id="login-form" class="auth-form" novalidate>
<div class="auth-form__group">
<label class="auth-form__label" for="login-username">Username</label>
<input
class="auth-form__input"
type="text"
id="login-username"
name="username"
autocomplete="username"
required
placeholder="your_username"
/>
</div>
<div class="auth-form__group">
<label class="auth-form__label" for="login-password">Password</label>
<div class="auth-form__input-wrap">
<input
class="auth-form__input"
type="password"
id="login-password"
name="password"
autocomplete="current-password"
required
placeholder="••••••••"
/>
<button type="button" class="auth-form__eye" aria-label="Toggle password visibility" tabindex="-1">
<svg class="eye-show" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>
<svg class="eye-hide" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" style="display:none"><path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg>
</button>
</div>
</div>
<button type="submit" class="auth-form__submit" id="login-submit">
<span class="auth-form__submit-text">Log In</span>
<span class="auth-form__submit-loader" style="display:none">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" class="spin"><path d="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"/></svg>
</span>
</button>
</form>
<p class="auth-card__footer">
Don't have an account? <a href="/signup/" class="auth-card__link">Sign up</a>
</p>
</div>
</div>
<script>
(function () {
var BACKEND = 'https://backend.freedoms4.org/auth.php';
var form = document.getElementById('login-form');
var msgBox = document.getElementById('auth-message');
var submitBtn = document.getElementById('login-submit');
var eyeBtn = form.querySelector('.auth-form__eye');
var pwdInput = document.getElementById('login-password');
eyeBtn.addEventListener('click', function () {
var isText = pwdInput.type === 'text';
pwdInput.type = isText ? 'password' : 'text';
eyeBtn.querySelector('.eye-show').style.display = isText ? '' : 'none';
eyeBtn.querySelector('.eye-hide').style.display = isText ? 'none' : '';
});
function showMsg(text, type) {
msgBox.textContent = text;
msgBox.className = 'auth-message auth-message--' + type;
msgBox.style.display = 'block';
}
form.addEventListener('submit', function (e) {
e.preventDefault();
msgBox.style.display = 'none';
var username = document.getElementById('login-username').value.trim();
var password = pwdInput.value;
if (!username || !password) {
showMsg('Please fill in all fields.', 'error');
return;
}
submitBtn.disabled = true;
submitBtn.querySelector('.auth-form__submit-text').style.display = 'none';
submitBtn.querySelector('.auth-form__submit-loader').style.display = 'inline-flex';
fetch(BACKEND, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({ action: 'login', username: username, password: password })
})
.then(function (r) { return r.json(); })
.then(function (data) {
if (data.success) {
showMsg('Logged in successfully! Redirecting\u2026', 'success');
setTimeout(function () { window.location.href = data.redirect || '/'; }, 1000);
} else {
showMsg(data.message || 'Login failed. Please try again.', 'error');
}
})
.catch(function () {
showMsg('Network error. Please try again.', 'error');
})
.finally(function () {
submitBtn.disabled = false;
submitBtn.querySelector('.auth-form__submit-text').style.display = '';
submitBtn.querySelector('.auth-form__submit-loader').style.display = 'none';
});
});
})();
</script>
{{ end }}

View File

@@ -1,4 +1,168 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ .Content }}
<div class="auth-page">
<h1 class="auth-page__title">{{ .Title }}</h1>
<div class="auth-card">
<div id="auth-message" class="auth-message" aria-live="polite" style="display:none"></div>
<form id="signup-form" class="auth-form" novalidate>
<div class="auth-form__group">
<label class="auth-form__label" for="signup-username">Username</label>
<input
class="auth-form__input"
type="text"
id="signup-username"
name="username"
autocomplete="username"
required
placeholder="choose_a_username"
minlength="3"
maxlength="32"
pattern="[a-zA-Z0-9_\-]+"
/>
<span class="auth-form__hint">332 characters; letters, numbers, _ and - only.</span>
</div>
<div class="auth-form__group">
<label class="auth-form__label" for="signup-email">Email</label>
<input
class="auth-form__input"
type="email"
id="signup-email"
name="email"
autocomplete="email"
required
placeholder="you@example.com"
/>
</div>
<div class="auth-form__group">
<label class="auth-form__label" for="signup-password">Password</label>
<div class="auth-form__input-wrap">
<input
class="auth-form__input"
type="password"
id="signup-password"
name="password"
autocomplete="new-password"
required
placeholder="••••••••"
minlength="8"
/>
<button type="button" class="auth-form__eye" aria-label="Toggle password visibility" tabindex="-1">
<svg class="eye-show" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>
<svg class="eye-hide" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" style="display:none"><path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg>
</button>
</div>
<span class="auth-form__hint">At least 8 characters.</span>
</div>
<div class="auth-form__group">
<label class="auth-form__label" for="signup-confirm">Confirm Password</label>
<div class="auth-form__input-wrap">
<input
class="auth-form__input"
type="password"
id="signup-confirm"
name="confirm_password"
autocomplete="new-password"
required
placeholder="••••••••"
/>
</div>
</div>
<button type="submit" class="auth-form__submit" id="signup-submit">
<span class="auth-form__submit-text">Create Account</span>
<span class="auth-form__submit-loader" style="display:none">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" class="spin"><path d="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"/></svg>
</span>
</button>
</form>
<p class="auth-card__footer">
Already have an account? <a href="/login/" class="auth-card__link">Log in</a>
</p>
</div>
</div>
<script>
(function () {
var BACKEND = 'https://backend.freedoms4.org/auth.php';
var form = document.getElementById('signup-form');
var msgBox = document.getElementById('auth-message');
var submitBtn = document.getElementById('signup-submit');
var pwdInput = document.getElementById('signup-password');
var eyeBtn = form.querySelector('.auth-form__eye');
eyeBtn.addEventListener('click', function () {
var isText = pwdInput.type === 'text';
pwdInput.type = isText ? 'password' : 'text';
eyeBtn.querySelector('.eye-show').style.display = isText ? '' : 'none';
eyeBtn.querySelector('.eye-hide').style.display = isText ? 'none' : '';
});
function showMsg(text, type) {
msgBox.textContent = text;
msgBox.className = 'auth-message auth-message--' + type;
msgBox.style.display = 'block';
}
form.addEventListener('submit', function (e) {
e.preventDefault();
msgBox.style.display = 'none';
var username = document.getElementById('signup-username').value.trim();
var email = document.getElementById('signup-email').value.trim();
var password = pwdInput.value;
var confirm = document.getElementById('signup-confirm').value;
if (!username || !email || !password || !confirm) {
showMsg('Please fill in all fields.', 'error');
return;
}
if (!/^[a-zA-Z0-9_\-]{3,32}$/.test(username)) {
showMsg('Username must be 3\u201332 characters: letters, numbers, _ or -.', 'error');
return;
}
if (password.length < 8) {
showMsg('Password must be at least 8 characters.', 'error');
return;
}
if (password !== confirm) {
showMsg('Passwords do not match.', 'error');
return;
}
submitBtn.disabled = true;
submitBtn.querySelector('.auth-form__submit-text').style.display = 'none';
submitBtn.querySelector('.auth-form__submit-loader').style.display = 'inline-flex';
fetch(BACKEND, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({ action: 'signup', username: username, email: email, password: password })
})
.then(function (r) { return r.json(); })
.then(function (data) {
if (data.success) {
showMsg('Account created! Redirecting to login\u2026', 'success');
setTimeout(function () { window.location.href = '/login/'; }, 1500);
} else {
showMsg(data.message || 'Sign-up failed. Please try again.', 'error');
}
})
.catch(function () {
showMsg('Network error. Please try again.', 'error');
})
.finally(function () {
submitBtn.disabled = false;
submitBtn.querySelector('.auth-form__submit-text').style.display = '';
submitBtn.querySelector('.auth-form__submit-loader').style.display = 'none';
});
});
})();
</script>
{{ end }}

View File

@@ -0,0 +1,195 @@
/* ── Auth pages (login / signup) ───────────────────────────────────────── */
.auth-page {
max-width: 420px;
margin: 0 auto;
padding: 1rem 0 3rem;
}
.auth-page__title {
margin-bottom: 1.5rem;
}
.auth-card {
border: 1px solid var(--background-color1, #ccc);
border-radius: 10px;
padding: 2rem 1.75rem;
background: var(--background-color);
}
/* Message banner */
.auth-message {
border-radius: 6px;
padding: 0.65rem 0.9rem;
font-size: 0.88rem;
margin-bottom: 1.2rem;
line-height: 1.4;
}
.auth-message--error {
background: rgba(220, 53, 69, 0.12);
border: 1px solid rgba(220, 53, 69, 0.4);
color: #c0392b;
}
[data-theme='dark'] .auth-message--error {
color: #ff6b6b;
background: rgba(220, 53, 69, 0.18);
border-color: rgba(220, 53, 69, 0.5);
}
.auth-message--success {
background: rgba(39, 174, 96, 0.12);
border: 1px solid rgba(39, 174, 96, 0.4);
color: #1e8449;
}
[data-theme='dark'] .auth-message--success {
color: #58d68d;
background: rgba(39, 174, 96, 0.18);
border-color: rgba(39, 174, 96, 0.5);
}
/* Form fields */
.auth-form {
display: flex;
flex-direction: column;
gap: 1.1rem;
}
.auth-form__group {
display: flex;
flex-direction: column;
gap: 0.3rem;
}
.auth-form__label {
font-size: 0.85rem;
font-weight: 600;
color: var(--foreground-color);
}
.auth-form__input-wrap {
position: relative;
display: flex;
align-items: center;
}
.auth-form__input-wrap .auth-form__input {
padding-right: 2.5rem;
}
.auth-form__input {
width: 100%;
box-sizing: border-box;
padding: 0.5rem 0.75rem;
border: 1px solid var(--background-color1, #ccc);
border-radius: 5px;
font-size: 0.9rem;
background: var(--background-color);
color: var(--foreground-color);
transition: border-color 0.18s ease, box-shadow 0.18s ease;
outline: none;
font-family: inherit;
}
.auth-form__input:focus {
border-color: var(--accent-color);
box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb, 17, 51, 233), 0.15);
}
.auth-form__input::placeholder {
color: var(--foreground-color3, #888);
opacity: 0.7;
}
.auth-form__eye {
position: absolute;
right: 0.6rem;
background: none;
border: none;
cursor: pointer;
color: var(--foreground-color3, #888);
display: inline-flex;
align-items: center;
padding: 0.2rem;
line-height: 1;
transition: color 0.15s ease;
}
.auth-form__eye:hover {
color: var(--foreground-color);
}
.auth-form__hint {
font-size: 0.75rem;
color: var(--foreground-color3, #888);
}
/* Submit button */
.auth-form__submit {
margin-top: 0.5rem;
width: 100%;
padding: 0.6rem 1rem;
border: none;
border-radius: 5px;
background: var(--accent-color);
color: var(--background-color, #fff);
font-size: 0.92rem;
font-weight: 600;
font-family: inherit;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.4rem;
transition: opacity 0.18s ease;
}
.auth-form__submit:hover:not(:disabled) {
opacity: 0.85;
}
.auth-form__submit:disabled {
cursor: not-allowed;
opacity: 0.6;
}
.auth-form__submit-loader {
display: inline-flex;
align-items: center;
}
/* Spinner animation */
@keyframes auth-spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.spin {
animation: auth-spin 0.8s linear infinite;
}
/* Footer link */
.auth-card__footer {
margin-top: 1.4rem;
text-align: center;
font-size: 0.85rem;
color: var(--foreground-color3, #888);
}
.auth-card__link {
color: var(--accent-color);
text-decoration: none;
font-weight: 600;
}
.auth-card__link:hover {
text-decoration: underline;
}
/* Light theme override for submit button text */
[data-theme='light'] .auth-form__submit {
color: #fff;
}