Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli/pack: add possibility to pack many files #147

Closed
wants to merge 2 commits into from

Conversation

pleshevskiy
Copy link
Contributor

@pleshevskiy pleshevskiy commented Jul 20, 2022

Some improvement from me... I currently have the following makefile:

pack:
	$(MAKE) DEXIOS_KEY=$$(pass show dexios/business_documents) pack-unchecked

pack-unchecked:
	dexios -py companies companies.enc
	dexios -py my_contracts my_contracts.enc
	dexios -py my_courses my_courses.enc
	dexios -py nalog nalog.enc
	dexios -py assets assets.enc

unpack:
	$(MAKE) DEXIOS_KEY=$$(pass show dexios/business_documents) unpack-unchecked

unpack-unchecked:
	dexios -uy companies.enc .
	dexios -uy my_contracts.enc .
	dexios -uy my_courses.enc .
	dexios -uy nalog.enc .
	dexios -uy assets.enc .

these changes allow me to make things easier!

pack:
	pass show dexios/business_documents | dexios -pyk - companies my_contracts my_courses nalog assets all.enc

unpack:
	pass show dexios/business_documents | dexios -uyk - all.enc .

@pleshevskiy
Copy link
Contributor Author

pleshevskiy commented Jul 20, 2022

@brxken128 the tests are down... Cannot reproduce the error locally --aead 1 breaks the params

@pleshevskiy
Copy link
Contributor Author

Clap is confused and can't define boundaries. The only solution is to swap input and output params. And we can now use the pattern...

dexios pack -y flake.enc flake.*

@pleshevskiy
Copy link
Contributor Author

Maybe there is another solution, but I have not found it.

@brxken128
Copy link
Owner

brxken128 commented Jul 20, 2022

Maybe there is another solution, but I have not found it.

Does this issue affect all other parameters, or just --aead 1? If it's the latter, we can just force --aead=1 instead :)

We could instead require explicit marking of the output file, with -o (and if none is set, we append the extension .dx to the end). I originally planned to do this in order to support encrypting multiple files at once (individually, not packed), but got annoyed with the clunkiness of the decryption function (if names were changed, we'd likely need to append an additional extension and stuff) - it just got messy.

@pleshevskiy
Copy link
Contributor Author

@brxken128 I've tried both
image

@brxken128
Copy link
Owner

@brxken128 I've tried both image

Could this be down to the rogue - in your testing? After -yk :)

@pleshevskiy
Copy link
Contributor Author

nope
image

@brxken128
Copy link
Owner

We could instead require explicit marking of the output file, with -o (and if none is set, we append the extension .dx to the end). I originally planned to do this in order to support encrypting multiple files at once (individually, not packed), but got annoyed with the clunkiness of the decryption function (if names were changed, we'd likely need to append an additional extension and stuff) - it just got messy.

We could just do this for only pack, for now at least. Require a manually specified output file, and if none is set, just default to a random word, some numbers and .dx. It will then be able to treat all lose text as input file names.

I don't think swapping input/output files around is a good solution, and if we can't find an alternative we could always open an issue upstream - I'm not too sure this is an issue with clap, and it may just be our usage.

@pleshevskiy
Copy link
Contributor Author

I'll try to reproduce it with smaller parameters... I will create a separate repository. At least I could ask a question in clap

@brxken128

This comment was marked as off-topic.

@pleshevskiy
Copy link
Contributor Author

@brxken128 I've created a related issue clap-rs/clap#3959

@brxken128
Copy link
Owner

@brxken128 I've created a related issue clap-rs/clap#3959

Looks good! Hopefully we can get to the bottom of this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants