Compare commits

..

3 Commits

Author SHA1 Message Date
Elias Schneider
27ea1fc2d3 release: 0.16.0 2024-11-24 18:55:51 +01:00
Alexander Lehmann
f637a89f57 feat: improve error message for invalid callback url 2024-11-24 18:54:46 +01:00
Elias Schneider
058084ed64 feat: add health check 2024-11-24 18:53:32 +01:00
7 changed files with 40 additions and 5 deletions

View File

@@ -1 +1 @@
0.15.0
0.16.0

View File

@@ -1,3 +1,11 @@
## [](https://github.com/stonith404/pocket-id/compare/v0.15.0...v) (2024-11-24)
### Features
* add health check ([058084e](https://github.com/stonith404/pocket-id/commit/058084ed64816b12108e25bf04af988fc97772ed))
* improve error message for invalid callback url ([f637a89](https://github.com/stonith404/pocket-id/commit/f637a89f579aefb8dc3c3c16a27ef0bc453dfe40))
## [](https://github.com/stonith404/pocket-id/compare/v0.14.0...v) (2024-11-21)

View File

@@ -24,7 +24,7 @@ FROM node:20-alpine
# Delete default node user
RUN deluser --remove-home node
RUN apk add --no-cache caddy su-exec
RUN apk add --no-cache caddy curl su-exec
COPY ./reverse-proxy /etc/caddy/
WORKDIR /app

View File

@@ -58,7 +58,7 @@ func (e *OidcInvalidAuthorizationCodeError) HttpStatusCode() int { return 400 }
type OidcInvalidCallbackURLError struct{}
func (e *OidcInvalidCallbackURLError) Error() string { return "invalid callback URL" }
func (e *OidcInvalidCallbackURLError) Error() string { return "invalid callback URL, it might be necessary for an admin to fix this" }
func (e *OidcInvalidCallbackURLError) HttpStatusCode() int { return 400 }
type FileTypeNotSupportedError struct{}

View File

@@ -6,4 +6,11 @@ services:
ports:
- 3000:80
volumes:
- "./data:/app/backend/data"
- "./data:/app/backend/data"
# Optional healthcheck
healthcheck:
test: "curl -f http://localhost/health"
interval: 1m30s
timeout: 5s
retries: 2
start_period: 10s

View File

@@ -1,6 +1,6 @@
{
"name": "pocket-id-frontend",
"version": "0.15.0",
"version": "0.16.0",
"private": true,
"scripts": {
"dev": "vite dev --port 3000",

View File

@@ -0,0 +1,20 @@
import AppConfigService from '$lib/services/app-config-service';
import type { RequestHandler } from '@sveltejs/kit';
export const GET: RequestHandler = async () => {
const appConfigService = new AppConfigService();
let backendOk = true;
await appConfigService.list().catch(() => (backendOk = false));
return new Response(
JSON.stringify({
status: backendOk ? 'HEALTHY' : 'UNHEALTHY'
}),
{
status: backendOk ? 200 : 500,
headers: {
'content-type': 'application/json'
}
}
);
};