forked from jmug/cactoide
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fefca207c5 | ||
|
|
e89c9b1843 | ||
|
|
4b14f649d6 |
@@ -4,7 +4,10 @@ POSTGRES_USER=cactoide
|
||||
POSTGRES_PASSWORD=cactoide_password
|
||||
POSTGRES_PORT=5432
|
||||
|
||||
# localhost
|
||||
DATABASE_URL="postgres://cactoide:cactoide_password@localhost:5432/cactoied_database"
|
||||
# docker
|
||||
# DATABASE_URL="postgres://cactoide:cactoide_password@postgres:5432/cactoied_database"
|
||||
|
||||
# Application configuration
|
||||
APP_VERSION=latest
|
||||
|
||||
@@ -6,11 +6,11 @@ services:
|
||||
image: postgres:15-alpine
|
||||
container_name: cactoide-db
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-cactoied_database}
|
||||
POSTGRES_DB: ${POSTGRES_DB:-cactoide_database}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-cactoide}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-cactoide_password}
|
||||
ports:
|
||||
- '${POSTGRES_PORT:-5432}:5432'
|
||||
expose:
|
||||
- '${POSTGRES_PORT:-5437}'
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||
@@ -18,7 +18,7 @@ services:
|
||||
test:
|
||||
[
|
||||
'CMD-SHELL',
|
||||
'pg_isready -U ${POSTGRES_USER:-cactoide} -d ${POSTGRES_DB:-cactoied_database}'
|
||||
'pg_isready -U ${POSTGRES_USER:-cactoide} -d ${POSTGRES_DB:-cactoide_database}'
|
||||
]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
@@ -31,9 +31,9 @@ services:
|
||||
image: ghcr.io/polaroi8d/cactoide/cactoide:${APP_VERSION:-latest}
|
||||
container_name: cactoide-app
|
||||
ports:
|
||||
- '${PORT:-3000}:3000'
|
||||
- '${PORT:-5111}:3000'
|
||||
environment:
|
||||
DATABASE_URL: postgres://${POSTGRES_USER:-cactoide}:${POSTGRES_PASSWORD:-cactoide_password}@postgres:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-cactoied_database}
|
||||
DATABASE_URL: ${DATABASE_URL}
|
||||
PORT: 3000
|
||||
HOSTNAME: ${HOSTNAME:-0.0.0.0}
|
||||
depends_on:
|
||||
|
||||
@@ -9,11 +9,11 @@ export function load({ cookies }) {
|
||||
const PATH = '/';
|
||||
|
||||
if (!cactoideUserId) {
|
||||
console.log(`There is no cactoideUserId cookie, generating new one...`);
|
||||
console.debug(`There is no cactoideUserId cookie, generating new one...`);
|
||||
cookies.set('cactoideUserId', userId, { path: PATH, maxAge: MAX_AGE });
|
||||
} else {
|
||||
console.log(`cactoideUserId: ${cactoideUserId}`);
|
||||
console.log(`cactoideUserId cookie found, using existing one...`);
|
||||
console.debug(`cactoideUserId: ${cactoideUserId}`);
|
||||
console.debug(`cactoideUserId cookie found, using existing one...`);
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -17,8 +17,6 @@ export const load = async ({ cookies }) => {
|
||||
.where(eq(events.userId, userId))
|
||||
.orderBy(desc(events.createdAt));
|
||||
|
||||
console.log(userEvents);
|
||||
|
||||
const transformedEvents = userEvents.map((event) => ({
|
||||
id: event.id,
|
||||
name: event.name,
|
||||
|
||||
@@ -75,9 +75,6 @@ export const actions: Actions = {
|
||||
const name = formData.get('newAttendeeName') as string;
|
||||
const userId = cookies.get('cactoideUserId');
|
||||
|
||||
console.log(`name: ${name}`);
|
||||
console.log(`userId: ${userId}`);
|
||||
|
||||
if (!name?.trim() || !userId) {
|
||||
return fail(400, { error: 'Name and user ID are required' });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user