Folder import aborts on unrelated files instead of just not copying them #74
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Importing a config folder aborts with "seems to contain many unrelated files" when the selected folder has >=10 files outside a small extension whitelist. Hit live 2026-08-19 trying to import a single .ovpn from ~/downloads.
The check (
update.py:sanity_check, used byadd_folder) is a heuristic band-aid over the real problem: after it passes,add_folderrunsshutil.copytree(self.folderpath, ...)-- the root service copies the entire selected tree into its temp dir, so the guard tries to guess whether the user meant it. Its defects compound:conf_filescomes fromos.listdir(top level only), butsanity_checkwalks recursively -- files in subdirectories count toward the abort threshold yet are never imported..crt(['.ovpn', '.conf', '.key', '.cert', '.pem']) -- the extension this codebase itself uses everywhere (stunnel.crt, AzireVPN.crt). A legitimate folder of 10+ configs with paired .crt certs self-aborts.cert_filesis dead code -- assigned from a comprehension copy-pasted fromconf_files(filters .ovpn/.conf, so it could never find certs), never referenced afterward.Fix direction: invert the design. Copy exactly the files the import consumes -- the top-level configs already enumerated, plus cert/key files they reference -- and drop
copytreeandsanity_checkentirely. Any source folder then works (downloads included), and the root service never touches files it wasn't asked to import.It gets worse: the GUI side (
aqomui_gui.pyimport flow) is a file picker (getOpenFileName, filtered to *.ovpn), captioned "Choose Folder", launched from a dropdown item called "Manually add config file folder" -- and then calls.absolutePath()on the chosen file, discarding the filename and importing the file's parent directory. Picking a single .ovpn in ~/downloads is doing it right, and it still detonates the sanity check because the importer substitutes the whole folder.So the redesign has an obvious UI shape:
getOpenFileNames(multi-select), import exactly the chosen files plus the cert/key files they reference, no directory semantics anywhere.