Commit graph

95 commits

Author SHA1 Message Date
c7b4f5fa92 Render PushNotification on client only
All checks were successful
/ build (push) Successful in 1m52s
/ deploy (push) Successful in 15s
The push logic is only available on the client and causes hydration
mismatch when rendered on the server.
2025-05-23 21:35:19 +02:00
f2ab306338 Always await useAccountSession
If this is not done the session is not properly loaded during server
side rendering, making it possible for missmatch and bugs to happen.
2025-05-23 21:33:48 +02:00
7f3029aee8 Pass Set-Cookie header from session on page load
If a session is refreshed when accessed through /api/auth/session during
a SSR then the Set-Cookie header was lost.  Pass this along to the
client in this case to keep the session alive.
2025-05-23 21:32:20 +02:00
8329ff060b Update to nuxt 3.17.4 2025-05-23 21:28:58 +02:00
4444daaca9 Load secrets from files
All checks were successful
/ build (push) Successful in 1m8s
/ deploy (push) Successful in 16s
Putting secrets into environment variables is problematic due to them
being inherited by sub-processes, the ease as which these can be
leaked in logs, and the lack of support for loading secrets into
environment variables by systems such as systemd and docker.

Change the loading of secrets to be done by loading the content of a
file specified by an environment variable.
2025-05-20 00:43:29 +02:00
c9976af26b Include the name of the cookie in the signature
If a cookie is signed for one purpose, but the server also uses a
differently named signed cookie name for another purpose, then it's
possible for a malicious client to substitute the value of one signed
cookie with the value of another and have it pass the signature check.

Include the name of the cookie when computing the signature so that no
cookies signed for example for "user_session" can be used as a value for
a hypothetical "admin_session" cookie.
2025-05-20 00:36:10 +02:00
a16921f264 Read vapid subject from the environment
Load the contact details for push notifications from the
NUXT_VAPID_SUBJECT environment variable.
2025-05-20 00:25:28 +02:00
c986d939ec Read vapid details from runtime config
Use the useRuntimeConfig interface to read vapid details on the server
side.  This is a more portale way to deal with loading data from the
environment in Nuxt.js.
2025-05-20 00:22:28 +02:00
742be649eb Add /build-info page displaying
All checks were successful
/ build (push) Successful in 1m16s
/ deploy (push) Successful in 16s
Add page displaying information about the deployment for diagnostic
purposes.
2025-05-20 00:07:58 +02:00
ded212f03f Remove unused NODE_ENV variable
Nuxt forces the NODE_ENV environment variable to be set to production
when running a build, which means there's no point in specifying it
here.
2025-05-19 23:34:48 +02:00
81de90d4a6 Push container images to a private org
All checks were successful
/ build (push) Successful in 1m10s
/ deploy (push) Successful in 15s
The access permissions in Forgejo does not allow making packages
of a user private, the only options are hide the user completely
or make packages public.  Do a workaround for this by pushing to
a private org.
2025-05-19 18:55:59 +02:00
4a9a8cec85 Rewrite deployment for forge.hornwitser.no
All checks were successful
/ build (push) Successful in 1m13s
/ deploy (push) Successful in 16s
Replace docker with podman and kubernetes with the simple service
webhook in the forgejo workflow to make this compatible with my
new infrastructure.
2025-05-19 18:03:47 +02:00
399a4d2ca5 Add account based filtering of the schedule
Some checks failed
/ build (push) Has been cancelled
/ deploy (push) Has been cancelled
Implement personal filtering of the schedule based on events marked as
being interested in and filtering based on assigned crew for events.
2025-03-15 22:47:32 +01:00
89b1d2a547 Show crew on event cards when logged in as crew 2025-03-15 20:37:08 +01:00
529d640a0e Assign crew randomly in demo schedule 2025-03-15 20:26:43 +01:00
278492ad69 Fix missmatched parenthesis 2025-03-15 18:30:22 +01:00
cef6b13dd1 Add assigment of crew to events and shifts 2025-03-15 18:18:08 +01:00
0aff9cc94a Add editing of shifts 2025-03-15 17:06:23 +01:00
905ec8a38b Add editing of shift time slots 2025-03-15 16:45:02 +01:00
accc1690ff Add editing of roles for shifts 2025-03-15 15:10:42 +01:00
27d853d102 Disable editing of public events in UI for crew 2025-03-15 14:28:27 +01:00
b22d32dada Add editing of events 2025-03-15 14:20:38 +01:00
262a691ed6 Move toId to shared/utils/functions.ts 2025-03-15 13:46:13 +01:00
02be8a37a5 Implement editing of time slots
Render the timeslots as an editable table of times with associated
event.  When the event it's linked to is edited the time slot is removed
from the original event it belonged to and added to the possibly new
event it now belongs to.  This gives a somewhat intutive editing
experience when editing time slots linked to events with multiple times.
2025-03-14 18:19:58 +01:00
3cdfceb037 Reconfigure VsCode to not remove dead code
I have no idea why this is even a thing.  Removing dead code on save is
stupid.
2025-03-14 17:51:07 +01:00
d0ee6a40eb Pass schedule as a prop to Timetable 2025-03-14 17:38:01 +01:00
f550ca921b Share utility functions from Timetable
Move the genereic pairs, enumerate and setEquals functions from
Timetable to shared/utils/functions to make them available for reuse.
2025-03-12 14:44:06 +01:00
29b34deef0 Make session cookie permament
Set a max age for the session cookie to prevent it from expiring when
the browser is closed.  To prevent the age limit from being being
reached the session cookie is refreshed every time the session is
loaded.  This should fix login being lost when the browser is stopped.
2025-03-11 16:30:51 +01:00
c940f785c5 Add editable LocationsTable 2025-03-11 16:05:38 +01:00
5255ed698e Implement access controlled edit schedule endpoint
Add PATCH /api/schedule endpoint for editing the schedule in a manner
that's access controlled.
2025-03-11 14:11:05 +01:00
bb306ee938 Pass headers when server fetches the schedule
Fix the inital server side load of the schedule not including crew only
items due to headers not being passed from the client to server side
request made to fetch the schedule.
2025-03-10 20:59:22 +01:00
5256f3fcf8 Remove unused items in Timetable 2025-03-10 20:59:04 +01:00
a9ba0c55e1 Implement role based shifts for crew 2025-03-10 20:58:33 +01:00
f69ca520c0 Refetch schedule and stream if session is updated 2025-03-10 16:43:21 +01:00
4806343250 Filter crew events to only be visible for crew 2025-03-10 16:26:52 +01:00
13f344472e Move schedule fetching into useSchedule composable 2025-03-10 15:41:32 +01:00
ddecfa3805 Set seed when generating interests into events
Prevent adding accounts from changing who's interestin in what in the
generated demo schedule.
2025-03-10 14:42:40 +01:00
6c4107a1cb Fix incorrect time offset in generated schedule
When correcting for a timezone being ahead of UTC the start has to be
moved backwards in time, not forward.  Fixes the generated schodule
not using central european times.
2025-03-10 14:40:52 +01:00
db8393c3a9 Add crew designator to events
Distinguish between events for attendees to see and events that are
meant only for the crew.
2025-03-10 14:40:02 +01:00
40c25f8990 Fix logic inversion braking interested 2025-03-09 23:56:39 +01:00
e8226e0062 Implement account type restricted page
Add allowedAccountTypes page metadata which the authenticated middleware
uses to further restrict the types of accounts that can access the page.

If the account type is insufficent to access the page it will return an
HTTP 403 Forbidden status, which is rendered using the error page.
2025-03-09 22:37:07 +01:00
245169950a Fixes on reading the session object 2025-03-09 22:18:42 +01:00
41528e8193 Display time in timezone configured on the account
Use the timezone configured on the account, or the default timezone if
no timezone is confirude to display the timetable and events in local
time.
2025-03-09 18:35:38 +01:00
1ac607a712 Use unix timestamps in timetable logic
Parse the iso date strings into millseconds from the unix epoch and use
that through the timetable logic instead of reparsing the strings over
and over.
2025-03-09 16:49:57 +01:00
c4a6f6b3f9 Add per account overridable timezone setting
To make it possible to render the timetable in the user's local time we
need to know the timezone to render it in on the server.  Otherwise
there will be hydration errors and paint flashing as the client renders
a different timezone.

Add a server global default timezone that can be overriden on a
per-account bases to prepare for timezone handling the timetable.
2025-03-09 15:53:51 +01:00
264c97b586 Fix server redirectng to login when logged in
When rendering on the server the session is not eagerly loaded when the
authenticated middleware runs, causing it to think the user is not
logged in.  Fix by awaiting the session composable.
2025-03-09 15:51:00 +01:00
8c8f340553 Type false session as null
Make the typing for the session work again by telling TypeScript the
false value is actually null.
2025-03-09 15:50:18 +01:00
c71841801b Use deleteCookie to remove session cookie 2025-03-08 00:36:10 +01:00
2897542823 Cache session data
The session is always explicitly updated when it changes, cache it on
the client if it has already been loaded.
2025-03-08 00:34:46 +01:00
ed74f4bb0e Use false instead of null for empty session
The caching layer of Nuxt assumes no entry exists if it's nullish.  This
causes null to be treated as if the resource needs to be fetched.  Use
false instead.
2025-03-08 00:33:35 +01:00