For the longest time I thought the standard was to install stuff on Docker as root and not worry about typical permission/user idioms you'd practice on a classic box.
But now I am seeing more of this. Do you have any good links to read more about why using venv/non-root makes sense for Docker?
In my case, I think Docker voids the need for virtualenv. But a quick google search returns interesting results [1]
I do know setting up a proper user in Docker is just a couple lines away in a Dockerfile (As a matter of fact, I did that for the main app I develop).
For my other use cases, I just don't care. I'm using Docker to quickly bootstrap a Jupyter Labs environment, and I do that by sharing some confs (Like the Pip cache folder).
The caveat to this is that files I create are owned by root, but that again is just a command away for fixing (If I need it, that haven't yet).
> Also there is the idea that such an infastructure would scare criminals into not doing incriminating things.
Even if the criminals were afraid of the repercussion of their actions, and were aware of the system to catch them and be convinced it will work and would lead to their capture (that's already a LOT of if), this would only work on premeditated crimes, which is a minority of the ones commited in the street.
A lot of crimes are not though in advance, but done on the moment. People fighting because they are angry. Somebody stealing because they saw an opportunity.
We hear a lot about recurring pick pockets, or bank heists. But those are not the majority.
Most bad things in the street happen without being planned, and without consideration for the consequences.
Planned crimes are white colar crimes, and they don't get caught by cameras.
I still think it makes a big difference. I spent time in China and honestly I felt safer in areas where terrorists were a concern than I do in downtown SF.
I interpret it as "I didn't think about it, picked the first thing that worked in the past, and don't wish to make an argument about it, so let it go".
The average human sucks at understanding probabilities.
Until we can prove that most people handling this system are capabable of smart decision making, which the latest police scandals do not lead to believe right now, those systems should not be used.
How so? While programs themselves could have side effects, the pipe -- if its elements are deterministic which is indeed not true of everything -- is just a series of composed transformations of text.
every component is a pure function (byte strings -> byte strings) and the pipeline's results are totally deterministic [if you don't change the locale or collation order with environment variables]. No component of the pipeline makes any change to the filesystem¹.
¹ although both stat(2) and inotify(7) mechanisms could allow other processes to detect the interactions with the filesystem that are caused by running the pipeline, among other process-related mechanisms that system as a whole could use to detect how many times the pipeline has been run, so Unix itself is definitely not side-effect-free for almost any operation
Most of those changes might be seen as akin to going in to your Haskell interpreter and changing definitions in the standard library or something. (Environment variable changes are weird because they are so local and ephemeral, but you still have to do them deliberately.)
Clearly not all command lines you can type in the shell are stateless (reading the disk, network, stdin, clock, or system RNG, among other things, isn't, and none of those things are rare or hard to do) and the shell doesn't specifically encourage you to write stateless code and it doesn't have a formal way to verify whether or not a particular command like is stateless or not. All of these properties are pretty similar to most popular FP language interpreters except for the last two. I guess it is a relevant distinction that your FP interpreter would typically know (as a matter of static inference) whether an expression is stateless, while your shell would typically not know.
Unless you use some stateful program or you're writing to a file typically a unix expression that uses purely reads and pipes is deterministic meaning you run the same expression twice you get the same result.
If you want to get pedantic fine, but the majority of use cases is stateless.
It's kind of an interesting pattern to think of having the pipeline as a whole be purely deterministic, but its initial input be something from the environment (kind of like the Haskell IO monad, right?).
Probably most complex shell pipelines follow this pattern in practice, but the first counterexample I thought of was shuf, or sort -R. Also, many pipelines that include any kind of interpolation or variable substitution also don't follow it.
A different insight about reasoning about pipelines might be that the byte string (or ASCII string) type is too weak to catch most kinds of errors, and it's not uncommon for one pipeline component to not, in fact, be a total function with respect to the actual data type that you're trying to capture (I don't know the right terminology for this). This most famously happens when you do regular expression substitutions but your regular expression doesn't actually match the full grammar that you're looking for. Then the pipeline can be incorrect as a whole for some inputs, but earlier and later stages don't notice. It can also happen anywhere that different tools have a different implicit understanding of the relevant grammar or structure.
That connects up with all sorts of other ideas which are actually about type safety and parsing more than FP. For example, PowerShell has tried to take the pipeline concept in a different direction, to the consternation of us Unix purists. Its use of typed objects in this context makes more explicit what the contract between programs in the pipeline is supposed to be. There is also a LANGSEC connection in terms of the risks of informal or underspecified parsers and grammars.
I know I've personally written lots of Unix pipelines that were correct for all the inputs that I personally threw at them, but definitely not correct for every possible input. I like to use ! in vim frequently to shell out to a command line to perform a text editing task, and vim has an associated undo and redo which means that sometimes I'm trying several variants until I find the one that successfully appears to do the edit that I intended. Sometimes I do this at an almost preconscious level, which is really strange in terms of thinking about the concept of the correctness of a program (in this case, where the program is literally only going to be used once, with the programmer looking over its shoulder).
Haskell hates side effects, but not functional programming. FP has been fine with side effects for decades - even SML, the precursor the Haskell, has them, although forwned upon.
Giving my finger and face prints to the browser, the software with the biggest attack surface in the world, connected to internet no less, feels off to me.
All of that is managed by the Secure Enclave in exactly the same way that it is for all over auth on Apple devices. The browser doesn't touch it at all.
Oh the almighty Secure Enclave, bow down to the Enclave...
Do you even know what the heck an enclave is and how does it work? It's nuts that when a figure of authority uses a fancy shiny new word to describe some magic black box and the masses follow with no questions asked.
K, but that doesn't mean the person you responded to doesn't know how it works. You are the one that doesn't know how it works, so why are you expecting people to listen to your opinion about the Secure Enclave?
Native apps have long been able to use TouchID/FaceID and have never been able to access the actual finger/face print data. There's no way that iOS exposes your actual finger or face print to websites.
That's not how this works on apple. Basically your fingerprint scan is not sent to the browser, just the authenticated result of the scan (ie, yes, the fingerprint was so and so's).
There have been some past complaints here about how Apple used to tie their fingerprint sensor into the secure element (third party folks couldn't substitute them). I actually liked that rule from a security standpoint, but obviously unpopular here. Same approach with faceid / touchID for the web.