feat: move allowed cors url to configuration file

- don't set cors origins form field as readonly and add deprecation notice.
This commit is contained in:
jo 2022-05-23 17:12:40 +02:00 committed by Kyle Robbertze
parent 510e978952
commit eb8e7b3415
5 changed files with 63 additions and 26 deletions

View file

@ -44,6 +44,10 @@ class Config
$CC_CONFIG['basePort'] = $port;
$CC_CONFIG['baseDir'] = $path;
// Allowed hosts
$CC_CONFIG['allowedCorsOrigins'] = $values['general']['allowed_cors_origins'] ?? [];
$CC_CONFIG['allowedCorsOrigins'][] = strval($public_url->withPath(''));
$CC_CONFIG['dev_env'] = $values['general']['dev_env'] ?? 'production';
$CC_CONFIG['auth'] = $values['general']['auth'] ?? 'local';
$CC_CONFIG['cache_ahead_hours'] = $values['general']['cache_ahead_hours'] ?? 1;