mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	simple dedicated health check endpoint for docker
This commit is contained in:
		@@ -1,5 +1,5 @@
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
if wget --spider -S "127.0.0.1:8080/login" 2>&1 | awk 'NR==2' | grep -w "HTTP/1.1 200 OK" ; then
 | 
			
		||||
if wget --spider -S "127.0.0.1:8080/api/health-check" 2>&1 | awk 'NR==2' | grep -w "HTTP/1.1 200 OK" ; then
 | 
			
		||||
    exit 0
 | 
			
		||||
else
 | 
			
		||||
    exit 1
 | 
			
		||||
 
 | 
			
		||||
@@ -318,6 +318,9 @@ function register(app) {
 | 
			
		||||
    apiRoute(POST, '/api/recent-notes', recentNotesRoute.addRecentNote);
 | 
			
		||||
    apiRoute(GET, '/api/app-info', appInfoRoute.getAppInfo);
 | 
			
		||||
 | 
			
		||||
    // docker health check
 | 
			
		||||
    route(GET, '/api/health-check', [], () => ({"status": "ok"}), apiResultHandler);
 | 
			
		||||
 | 
			
		||||
    // group of services below are meant to be executed from outside
 | 
			
		||||
    route(GET, '/api/setup/status', [], setupApiRoute.getStatus, apiResultHandler);
 | 
			
		||||
    route(POST, '/api/setup/new-document', [auth.checkAppNotInitialized], setupApiRoute.setupNewDocument, apiResultHandler, false);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user