added new features 3.0
This commit is contained in:
14
docker/nginx/render-config.cjs
Normal file
14
docker/nginx/render-config.cjs
Normal file
@@ -0,0 +1,14 @@
|
||||
const fs = require('node:fs');
|
||||
const { loadConfiguration } = require('/app/platform-backend/dist/config/configuration.js');
|
||||
|
||||
const configuration = loadConfiguration();
|
||||
const { hostname } = new URL(configuration.modulePublicOrigin);
|
||||
const platformOrigin = new URL(configuration.marketplace.publicUrl).origin;
|
||||
if (!/^[a-z0-9.-]+$/i.test(hostname)) {
|
||||
throw new Error('Ungültiger Modul-Hostname');
|
||||
}
|
||||
const template = fs.readFileSync('/etc/nginx/nginx.conf.template', 'utf8');
|
||||
fs.writeFileSync(
|
||||
'/tmp/mpm-nginx.conf',
|
||||
template.replaceAll('__MODULE_HOSTNAME__', hostname).replaceAll('__PLATFORM_ORIGIN__', platformOrigin),
|
||||
);
|
||||
Reference in New Issue
Block a user