add first draft working docker setup

This commit is contained in:
JCEEE
2026-08-05 20:03:01 +01:00
parent fed2f32258
commit 0fb90de5a7
20 changed files with 318 additions and 38 deletions
+1 -3
View File
@@ -2,7 +2,5 @@ import { defineEnvVars } from '@sveltejs/kit/hooks';
export const variables = defineEnvVars({
DEBUG_RECORD_ID: {},
SERVER_IP: {public: true},
PB_PORT: {public: true},
PUBLIC_PB_URL: {public: true}
PUBLIC_PB_URL: { public: true }
});
+1 -1
View File
@@ -1,6 +1,6 @@
import type { Handle } from '@sveltejs/kit';
const COOKIE_NAME = 'session';
const COOKIE_NAME = 'famdon-sesh';
export const handle: Handle = async ({ event, resolve }) => {
const raw = event.cookies.get(COOKIE_NAME);
+7 -5
View File
@@ -1,8 +1,10 @@
import { SERVER_IP, PROXY_PORT } from '../../../../config.ts';
const BASE_URL = typeof window === 'undefined'
? `http://${SERVER_IP}:${PROXY_PORT}`
: '';
const BASE_URL =
typeof window === 'undefined'
? typeof process !== 'undefined'
? process.env.PROXY_URL ||
`http://${process.env.SERVER_IP || '192.168.1.225'}:${process.env.PROXY_PORT || '3456'}`
: ''
: '';
async function memberFetch<T = unknown>(
method: string,
+2 -2
View File
@@ -1,8 +1,8 @@
import { redirect } from '@sveltejs/kit';
import type { RequestEvent } from '@sveltejs/kit';
import { SERVER_IP, PROXY_PORT } from '../../../../config.ts';
import { PROXY_URL } from '$lib/server/env';
const HONO_URL = `http://${SERVER_IP}:${PROXY_PORT}`;
const HONO_URL = PROXY_URL;
export function getSession(event: RequestEvent) {
return event.locals.session;
+2 -2
View File
@@ -1,7 +1,7 @@
import { SERVER_IP, PROXY_PORT } from '../../../../config.ts';
import { PROXY_URL } from '$lib/server/env';
import type { RequestEvent } from '@sveltejs/kit';
const HONO_URL = `http://${SERVER_IP}:${PROXY_PORT}`;
const HONO_URL = PROXY_URL;
function sessionHeaders(event: RequestEvent): Record<string, string> {
const s = event.locals.session;
+1 -3
View File
@@ -1,6 +1,4 @@
import { SERVER_IP, PB_PORT, PB_EMAIL, PB_PASSWORD } from '../../../../config.ts';
const PB_ENDPOINT = `http://${SERVER_IP}:${PB_PORT}`;
import { PB_ENDPOINT, PB_EMAIL, PB_PASSWORD } from './env';
let token: string | null = null;
let tokenExpiry = 0;
+2 -2
View File
@@ -1,6 +1,6 @@
import { SERVER_IP, PROXY_PORT } from '../../../../config.ts';
import { PROXY_URL } from '$lib/server/env';
const HONO_URL = `http://${SERVER_IP}:${PROXY_PORT}`;
const HONO_URL = PROXY_URL;
async function paydayCheck(famId: string, headers: Record<string, string>) {
try {
@@ -1,9 +1,9 @@
import { fail, redirect } from '@sveltejs/kit';
import { hono } from '$lib/server/hono';
import { memberApi } from '$lib/client/api';
import { SERVER_IP, PROXY_PORT } from '../../../../../config.ts';
import { PROXY_URL } from '$lib/server/env';
const HONO_URL = `http://${SERVER_IP}:${PROXY_PORT}`;
const HONO_URL = PROXY_URL;
export async function load(event) {
const session = event.locals.session;
@@ -1,8 +1,8 @@
import { redirect } from '@sveltejs/kit';
import { hono } from '$lib/server/hono';
import { SERVER_IP, PROXY_PORT } from '../../../../../../config.ts';
import { PROXY_URL } from '$lib/server/env';
const HONO_URL = `http://${SERVER_IP}:${PROXY_PORT}`;
const HONO_URL = PROXY_URL;
export async function load(event) {
const session = event.locals.session;
+1 -1
View File
@@ -1,6 +1,6 @@
import { pbAdmin } from '$lib/server/pb-admin';
import { redirect, fail } from '@sveltejs/kit';
import { PB_EMAIL, PB_PASSWORD } from '../../../../config.ts';
import { PB_EMAIL, PB_PASSWORD } from '$lib/server/env';
import type { Actions, PageServerLoad } from './$types';
export const load: PageServerLoad = async ({ cookies }) => {
@@ -1,8 +1,8 @@
import { fail, redirect } from '@sveltejs/kit';
import { setDeviceTokenCookie } from '$lib/server/auth';
import { SERVER_IP, PROXY_PORT } from '../../../../../../config.ts';
import { PROXY_URL } from '$lib/server/env';
const HONO_URL = `http://${SERVER_IP}:${PROXY_PORT}`;
const HONO_URL = PROXY_URL;
export const actions = {
default: async (event) => {