mockintosh
mockintosh copied to clipboard
Non-relative SSL cert path results in inaccessible exception
Environment:
mockintosh==0.13.17
Docker version 20.10.12, build e91ed57
MacOS Monterey v.12.2.1
Executing mockintosh with non-relative cert paths result in a Certificate loading error
.
Expectation: Specifying a full path to a cert file should work.
Actual:
mockintosh.exceptions.CertificateLoadingError:
Certificate loading error: Path `/my/docker/volume/config/certs/mockingjay.crt` is inaccessible!
Relative Path Restricting code: https://github.com/up9inc/mockintosh/blob/33008204dd56ec038ab5725615c9bfda0a685846/mockintosh/servers.py#L467
This is by design. Since Mockintosh allows reloading configuration via API, it requires you to explicitly expose any resource files, by putting under working directory tree. Without that, anyone would be able to access any file on the computer. The solution is to move certificate file under working directory of Mockintosh.
That is a fair point, but also feels a little PEBKAC. Are there many users that use mockintosh outside of a docker context? *Is that the suggested way of running it?
Also just wanted to update to say thanks for providing such a great tool!!
I have no data on how many users are not using Docker. There is no particular need in running it via Docker, only the ability to not deal with Python ecosystem.