forked from unimatrix/web
Build the new public staff directory and audited Great Migration appointments
This commit is contained in:
parent
04532cb7ec
commit
fc9549ee71
1 changed files with 181 additions and 29 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import {startNativeSyncRetryWorker} from './native-sync-outbox.mjs';
|
||||
import {initializeOrganisation} from './organisation-model.mjs';
|
||||
import {createGitIdentityRoute,initializeGitIdentities,gitProxyIdentity} from './git-identity.mjs';
|
||||
import {createPublicExchange} from './exchange-public.mjs';
|
||||
|
|
@ -94,6 +95,7 @@ export async function start(settings=process.env) {
|
|||
const result=await handle(request),outgoing=new Headers(security);for(const [key,value]of result.headers)outgoing.set(key,value);outgoing.set('Content-Security-Policy',path.startsWith('/git/sso/')?(result.headers.get('Content-Security-Policy')||security['Content-Security-Policy']):security['Content-Security-Policy']);res.writeHead(result.status,Object.fromEntries(outgoing));res.end(Buffer.from(await result.arrayBuffer()));
|
||||
}catch(error){console.error('Request failed:',error.code||error.name);if(!res.headersSent)res.writeHead(503,{'Content-Type':'application/json','Cache-Control':'no-store'});res.end(JSON.stringify({message:'The website is temporarily unavailable.'}));}
|
||||
});
|
||||
const stopOrganisationSync=db.organisationAccessEnabled?startNativeSyncRetryWorker(db):()=>{};server.once('close',stopOrganisationSync);
|
||||
server.requestTimeout=300000;server.headersTimeout=10000;
|
||||
await new Promise((resolve,reject)=>{server.once('error',reject);server.listen(Number(settings.PORT||3000),'127.0.0.1',resolve);});
|
||||
console.log('DuneRealms website running on localhost:'+Number(settings.PORT||3000)+'; MySQL connected.');
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff