diff --git a/runner.py b/runner.py index 6bf437edc..4f4ebc14e 100755 --- a/runner.py +++ b/runner.py @@ -751,12 +751,12 @@ def setup_services(self): else: raise RuntimeError('Environment variable needs to be a string with = or dict and non-empty. We do not allow the feature of forwarding variables from the host OS!') - if not self._allow_unsafe and re.search(r'^[A-Z_]+$', env_key) is None: + if not self._allow_unsafe and re.search(r'^[A-Z_]+[A-Z0-9_]*$', env_key) is None: if self._skip_unsafe: - warn_message= arrows(f"Found environment var key with wrong format. Only ^[A-Z_]+$ allowed: {env_key} - Skipping") + warn_message= arrows(f"Found environment var key with wrong format. Only ^[A-Z_]+[A-Z0-9_]*$ allowed: {env_key} - Skipping") print(TerminalColors.WARNING, warn_message, TerminalColors.ENDC) continue - raise RuntimeError(f"Docker container setup environment var key had wrong format. Only ^[A-Z_]+$ allowed: {env_key} - Maybe consider using --allow-unsafe or --skip-unsafe") + raise RuntimeError(f"Docker container setup environment var key had wrong format. Only ^[A-Z_]+[A-Z0-9_]*$ allowed: {env_key} - Maybe consider using --allow-unsafe or --skip-unsafe") if not self._allow_unsafe and \ re.search(r'^[a-zA-Z0-9_]+[a-zA-Z0-9_-]*$', env_value) is None: