Request limiting, config improvements
* Added middleware to limit concurrent request and request body size * The default configuration now has the defaults
This commit is contained in:
		@@ -50,15 +50,12 @@ if (isset($opts['C'])) {
 | 
			
		||||
    file_put_contents($file, <<<DEFAULTS
 | 
			
		||||
    server:
 | 
			
		||||
      address: 0.0.0.0:9000
 | 
			
		||||
      public_url: https://example.com
 | 
			
		||||
      websockets: false
 | 
			
		||||
      cors:
 | 
			
		||||
        allow_origin: '*'
 | 
			
		||||
        csp: "default-src * 'self' http: 'unsafe-eval' 'unsafe-inline'; connect-src * 'self'"
 | 
			
		||||
      encryption:
 | 
			
		||||
        local_cert: ~
 | 
			
		||||
        local_pk: ~
 | 
			
		||||
        passphrase: ~
 | 
			
		||||
 | 
			
		||||
    publish:
 | 
			
		||||
      overwrite_ids: false
 | 
			
		||||
@@ -78,12 +75,7 @@ if (isset($opts['C'])) {
 | 
			
		||||
if (isset($opts['c'])) {
 | 
			
		||||
    $config = Configuration::fromFile($opts['c']);
 | 
			
		||||
} else {
 | 
			
		||||
    $config = Configuration::createDefault()
 | 
			
		||||
        ->setListenAddress('127.0.0.1:8888')
 | 
			
		||||
        ->setAllowOriginHeader("*")
 | 
			
		||||
        ->setContentSecurityPolicyHeader("default-src * 'self' http: 'unsafe-eval' 'unsafe-inline'; connect-src * 'self'")
 | 
			
		||||
        ->setAllowAnonymousSubscribe(true)
 | 
			
		||||
        ->setJwtSecret("!ChangeThisMercureHubJWTSecretKey!");
 | 
			
		||||
    $config = Configuration::createDefault();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
$verbose = isset($opts['v']);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user