feat: Upgrade to Astro with full PDPA compliance

PDPA Features:
 Cookie consent banner
 Consent logging API
 Admin dashboard
 Privacy Policy
 Terms & Conditions

Technical:
 Astro 5.x + Tailwind v4
 Docker on port 80
 SQLite database
 15 pages built

Ready for Easypanel deployment.
This commit is contained in:
Kunthawat
2026-03-12 10:01:04 +07:00
parent 668f69048f
commit 77ac4d2d05
13719 changed files with 307487 additions and 25765 deletions

View File

@@ -0,0 +1,17 @@
import type { Logger } from '../../../core/logger/core.js';
import type { KeyGenerator } from '../definitions.js';
interface Options {
logger: Logger;
keyGenerator: KeyGenerator;
}
export declare const createKeyCommand: {
help: {
commandName: string;
tables: {
Flags: [string, string][];
};
description: string;
};
run({ logger, keyGenerator }: Options): Promise<void>;
};
export {};

View File

@@ -0,0 +1,22 @@
import { defineCommand } from "../../domain/command.js";
const createKeyCommand = defineCommand({
help: {
commandName: "astro create-key",
tables: {
Flags: [["--help (-h)", "See all available flags."]]
},
description: "Generates a key to encrypt props passed to server islands."
},
async run({ logger, keyGenerator }) {
const key = await keyGenerator.generate();
logger.info(
"crypto",
`Generated a key to encrypt props passed to server islands. To reuse the same key across builds, set this value as ASTRO_KEY in an environment variable on your build server.
ASTRO_KEY=${key}`
);
}
});
export {
createKeyCommand
};

View File

@@ -0,0 +1,3 @@
export interface KeyGenerator {
generate: () => Promise<string>;
}

View File

View File

@@ -0,0 +1,4 @@
import type { KeyGenerator } from '../definitions.js';
export declare class CryptoKeyGenerator implements KeyGenerator {
generate(): Promise<string>;
}

View File

@@ -0,0 +1,11 @@
import { createKey, encodeKey } from "../../../core/encryption.js";
class CryptoKeyGenerator {
async generate() {
const key = await createKey();
const encoded = await encodeKey(key);
return encoded;
}
}
export {
CryptoKeyGenerator
};