diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..f9b5d352 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,130 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Scrappy deploy", + "type": "shell", + "command": "node utils/deploy.js", + "problemMatcher": [], + "options": { + "cwd": "services/pocketbase" + }, + "isBackground": false + }, + { + "label": "Run Tailscale", + "type": "shell", + "command": "tailscale funnel 8090", + "problemMatcher": [], + "isBackground": true + }, + { + "label": "Run postgres", + "type": "shell", + "command": "docker run -it -p 5439:5432 --rm --name futureporn-postgres -e POSTGRES_PASSWORD=password -e POSTGRES_USER=postgres -e POSTGRES_DB=future_porn postgres:17", + "problemMatcher": [], + "isBackground": true + }, + { + "label": "Run pgadmin", + "type": "shell", + "command": "docker run -it -p 5050:5050 --rm --name futureporn-pgadmin -e PGADMIN_LISTEN_PORT=5050 -e PGADMIN_DISABLE_POSTFIX=1 -e PGADMIN_DEFAULT_EMAIL=cj@futureporn.net -e PGADMIN_DEFAULT_PASSWORD=password dpage/pgadmin4", + "problemMatcher": [], + "isBackground": true, + }, + { + "label": "Run Docker Compose", + "type": "shell", + "command": "docker compose up", + "problemMatcher": [], + "options": { + "cwd": "services/our" + }, + "isBackground": true + }, + { + "label": "Run All Dev Terminals", + "dependsOn": [ + "Run Tailscale", + "Run Docker Compose", + "Run PNPM Dev" + ], + "problemMatcher": [] + }, + { + "label": "Run PNPM Dev", + "type": "shell", + "command": "pnpm run dev", + "options": { + "cwd": "services/our" + }, + "problemMatcher": [] + }, + { + "label": "Run MinIO", + "type": "shell", + "command": "docker run -it --name clipsterpro-minio --rm -p 9000:9000 -p 9001:9001 -e MINIO_ROOT_USER=user -e MINIO_ROOT_PASSWORD=password quay.io/minio/minio server /data --console-address \":9001\"", + "problemMatcher": [], + "isBackground": true, + "runOptions": { + "runOn": "folderOpen" + } + }, + { + "label": "Create MinIO Buckets", + "type": "shell", + "command": "until curl -s http://localhost:9000/minio/health/live; do echo 'Waiting for MinIO...'; sleep 1; done; bunx @dotenvx/dotenvx run -f .env.development.local -- ./packages/scripts/create_minio_buckets.sh", + "problemMatcher": [], + "isBackground": false, + "runOptions": { + "runOn": "folderOpen" + } + }, + { + "label": "Run Pocketbase", + "type": "shell", + "command": "npx @dotenvx/dotenvx run -f ./.env.development.local -- pocketbase serve --dev --dir ./pb_data", + "problemMatcher": [], + "isBackground": true, + "options": { + "cwd": "${workspaceFolder}/services/pocketbase" + }, + "runOptions": { + "runOn": "folderOpen" + } + }, + { + "label": "Run Worker", + "type": "shell", + "command": "npx @dotenvx/dotenvx run -f .env.development.local -- npx tsx --watch ./src/index.ts", + "problemMatcher": [], + "isBackground": true, + "options": { + "cwd": "${workspaceFolder}/services/worker" + }, + "runOptions": { + "runOn": "folderOpen" + } + }, + { + "label": "Run valkey", + "type": "shell", + "command": "docker run --name futureporn-valkey --rm -p 6379:6379 valkey/valkey", + "isBackground": true, + "problemMatcher": [], + "options": { + "cwd": "${workspaceFolder}/services/worker" + }, + "runOptions": { + "runOn": "folderOpen" + } + }, + { + "label": "Create test task via curl", + "type": "shell", + "command": "curl http://localhost:3000/task?title=fmv", + "isBackground": false, + "problemMatcher": [], + } + ] +} \ No newline at end of file diff --git a/services/pocketbase/package.json b/services/pocketbase/package.json index 45d80348..d1c23b40 100644 --- a/services/pocketbase/package.json +++ b/services/pocketbase/package.json @@ -1,6 +1,6 @@ { "name": "futureporn", - "version": "3.1.0", + "version": "3.1.3", "private": true, "description": "Dedication to the preservation of lewdtuber history", "license": "Unlicense", diff --git a/services/pocketbase/pb_hooks/pages/(site)/+layout.ejs b/services/pocketbase/pb_hooks/pages/(site)/+layout.ejs index 1d9b6e6c..1f0e799b 100644 --- a/services/pocketbase/pb_hooks/pages/(site)/+layout.ejs +++ b/services/pocketbase/pb_hooks/pages/(site)/+layout.ejs @@ -5,7 +5,7 @@ - <%=meta('title') || '~~~~~' %> + <%= meta('title') %> @@ -71,8 +71,11 @@ diff --git a/services/pocketbase/pb_hooks/pages/(site)/+middleware.js b/services/pocketbase/pb_hooks/pages/(site)/+middleware.js index a47fc53d..276b84e8 100644 --- a/services/pocketbase/pb_hooks/pages/(site)/+middleware.js +++ b/services/pocketbase/pb_hooks/pages/(site)/+middleware.js @@ -1,31 +1,18 @@ /** @type {import('pocketpages').PageDataLoaderFunc} */ -module.exports = function ({ meta, redirect, request, auth }) { - meta('title', 'Futureporn.net') - meta('description', 'Dedication to the preservation of Lewdtuber history') - meta('image', 'https://example.com/about-preview.jpg') - const cookies = request.cookies() - // console.log('cookies as follows') - // console.log(JSON.stringify(cookies)) - // console.log('auth as follows') - // console.log(auth) + +/** + * + * This middleware handles setting data.user for auth purposes + */ + +module.exports = function ({ meta, redirect, request, auth }) { let user; if (auth) { - console.log('request.auth is present id:', auth.get('id')) user = $app.findFirstRecordByData('users', 'id', auth.id); } - return { user, version: require(`../../../package.json`).version } + return { user } } - -// module.exports = (api, next) => { -// const { auth, redirect } = api -// if (!auth) { -// return redirect('/auth/login', { -// message: 'You must be logged in to access this page', -// }) -// } -// next() -// } diff --git a/services/pocketbase/pb_hooks/pages/(site)/account/index.ejs b/services/pocketbase/pb_hooks/pages/(site)/account/index.ejs index 01f4028f..306a7659 100644 --- a/services/pocketbase/pb_hooks/pages/(site)/account/index.ejs +++ b/services/pocketbase/pb_hooks/pages/(site)/account/index.ejs @@ -23,7 +23,7 @@

Account Settings

-