Fix ZIP dependency and allow imports into owned multisite workspaces
DC CMS qualification / qualify (push) Successful in 1m54s
DC CMS qualification / qualify (push) Successful in 1m54s
This commit is contained in:
+3
-3
@@ -17,11 +17,11 @@ STEPS = ['frozen-install', 'syntax', 'multisite-tests']
|
||||
def digest(data): return hashlib.sha256(data).hexdigest()
|
||||
def run(args): subprocess.run(args, cwd=ROOT, check=True)
|
||||
def tracked_payload():
|
||||
names = subprocess.check_output(['git','ls-files','-z','admin','server'], cwd=ROOT).decode().split('\0')
|
||||
names = subprocess.check_output(['git','ls-files','-z','admin','server','package.json','package-lock.json'], cwd=ROOT).decode().split('\0')
|
||||
files = {}
|
||||
for name in sorted(filter(None,names)):
|
||||
path=ROOT/name
|
||||
if path.is_symlink() or not path.is_file() or path.suffix not in ('.js','.mjs','.html','.css','.svg'):
|
||||
if path.is_symlink() or not path.is_file() or (name not in ('package.json','package-lock.json') and path.suffix not in ('.js','.mjs','.html','.css','.svg')):
|
||||
raise ValueError('unsupported runtime path: '+name)
|
||||
files[name]=path.read_bytes()
|
||||
if not {'admin/index.html','admin/admin.js','admin/admin.css','server/admin-server.mjs'} <= set(files):
|
||||
@@ -32,7 +32,7 @@ def bundle(files, commit, run_id, run_number, foundation):
|
||||
if not re.fullmatch('[a-f0-9]{40}',commit) or any(type(n) is not int or n<=0 for n in (run_id,run_number)):
|
||||
raise ValueError('full source and positive run identity required')
|
||||
for name, data in files.items():
|
||||
if not re.fullmatch(r'(?:admin|server)/[a-zA-Z0-9_-]+\.(?:mjs|js|css|html|svg)', name) or not isinstance(data, bytes):
|
||||
if (name not in ('package.json','package-lock.json') and not re.fullmatch(r'(?:admin|server)/[a-zA-Z0-9_-]+\.(?:mjs|js|css|html|svg)', name)) or not isinstance(data, bytes):
|
||||
raise ValueError('unsupported application payload: '+name)
|
||||
if not files:
|
||||
raise ValueError('empty application payload')
|
||||
|
||||
Reference in New Issue
Block a user