forked from unimatrix/web
Validate the configured Forgejo proxy header using actual INI line syntax
This commit is contained in:
parent
6a9a0ffd67
commit
6fa811a393
1 changed files with 6 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import {request as httpRequest} from 'node:http';
|
||||
export function forgejoIdentityHeader(config){const value=String(config).match(/^REVERSE_PROXY_AUTHENTICATION_USER[ \t]*=[ \t]*([A-Za-z0-9-]+)[ \t\r]*$/mi)?.[1];if(!value)throw Error('DuneGit proxy identity header is not configured.');return value;}
|
||||
export function createForgejoProxy(settings,identityFor=async()=>null){
|
||||
if(!settings.FORGEJO_URL)return ()=>false;
|
||||
const upstream=new URL(settings.FORGEJO_URL),origin=new URL(settings.PUBLIC_ORIGIN||'https://dunerealms.com');
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff