From ca53cfbc3b1ba792ae792935c71256b189285419 Mon Sep 17 00:00:00 2001 From: AskIt Date: Sun, 25 Jan 2026 16:35:41 +0100 Subject: [PATCH] chore: Add environment configuration template and clean up utility scripts - Add .env.example with comprehensive configuration documentation for database, authentication, storage, and node settings - Update .gitignore to explicitly track .env.example while excluding all .env variants - Add IDE configuration directories (.vscode/, .kiro/) to .gitignore - Remove clear_bots.ts and inspect_bots.ts utility scripts that are no longer needed - Improve environment setup experience for new developers by providing a clear template with all required and optional configuration options --- .env.example | 32 ++++++++++++++++++++++++++++++++ .gitignore | 12 +++++++++++- clear_bots.ts | 11 ----------- inspect_bots.ts | 13 ------------- 4 files changed, 43 insertions(+), 25 deletions(-) create mode 100644 .env.example delete mode 100644 clear_bots.ts delete mode 100644 inspect_bots.ts diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..276abf4 --- /dev/null +++ b/.env.example @@ -0,0 +1,32 @@ +# =========================================== +# Synapsis Environment Configuration +# =========================================== +# Copy this file to .env and fill in your values + +# Database (Required) +DATABASE_URL=postgresql://user:password@localhost:5432/synapsis + +# Authentication (Required) +# Generate with: openssl rand -hex 32 +AUTH_SECRET=your-secret-key-here + +# Node Configuration (Required) +NEXT_PUBLIC_NODE_DOMAIN=your-domain.com +NEXT_PUBLIC_NODE_NAME=My Synapsis Node +NEXT_PUBLIC_NODE_DESCRIPTION=A federated social network node + +# Admin Users (Required) +# Comma-separated list of email addresses that have admin access +ADMIN_EMAILS=admin@example.com + +# S3-Compatible Storage (Required for media uploads) +STORAGE_ENDPOINT=https://s3.your-provider.com +STORAGE_REGION=us-east-1 +STORAGE_BUCKET=synapsis +STORAGE_ACCESS_KEY=your-access-key +STORAGE_SECRET_KEY=your-secret-key +STORAGE_PUBLIC_BASE_URL=https://cdn.your-domain.com + +# Optional Settings +# NEXT_PUBLIC_ACCENT_COLOR=#00D4AA +# BOT_MAX_PER_USER=5 diff --git a/.gitignore b/.gitignore index 28d5c4a..96347e6 100644 --- a/.gitignore +++ b/.gitignore @@ -31,7 +31,13 @@ yarn-error.log* .pnpm-debug.log* # env files (can opt-in for committing if needed) -.env* +.env +.env.local +.env.development.local +.env.test.local +.env.production.local +# Keep .env.example tracked +!.env.example # vercel .vercel @@ -42,3 +48,7 @@ next-env.d.ts # uploads /public/uploads/ + +# IDE +.vscode/ +.kiro/ diff --git a/clear_bots.ts b/clear_bots.ts deleted file mode 100644 index 1119125..0000000 --- a/clear_bots.ts +++ /dev/null @@ -1,11 +0,0 @@ - -import { db } from './src/db'; -import { bots } from './src/db/schema'; - -async function main() { - console.log('Deleting all bots...'); - await db.delete(bots); - console.log('Bots deleted.'); -} - -main().then(() => process.exit(0)).catch(console.error); diff --git a/inspect_bots.ts b/inspect_bots.ts deleted file mode 100644 index af8f94c..0000000 --- a/inspect_bots.ts +++ /dev/null @@ -1,13 +0,0 @@ - -import { db } from './src/db'; -import { bots } from './src/db/schema'; - -async function main() { - const allBots = await db.select().from(bots); - console.log('Bot Count:', allBots.length); - if (allBots.length > 0) { - console.log('Bot Data:', JSON.stringify(allBots, null, 2)); - } -} - -main().then(() => process.exit(0)).catch(console.error);