14 ms·
With PHP, 1-line (no new tools): sftp user@host remoteFile localFile Joking aside, I’m a bit surprised such a tool would be developed in Python given its de
by tiffanyh 2y ago
With PHP, 1-line (no new tools):
sftp user@host remoteFile localFile
Joking aside, I’m a bit surprised such a tool would be developed in Python given its dependency’s and runtime (which is not easy on the user).
- rcarmo 2y agoTo be honest, Python made it stupendously simpler than anything else because it has a great standard library. The only dependency (click) is rock solid and made it a lot simpler to handle commands independently, but we could probably do without it and just use the built-in argparse—-but at the expense of a few more lines of code I didn’t want to maintain. Also, Python is everywhere, on every OS and Linux system, so it was a natural choice. I also wanted it to be easily hackable and extensible, and few languages would make it simpler to understand or extend.
- mlhpdx 2y agoThat’s pretty funny. You may want to look a little further field to discover that the machines with Python are far from “all the machines” out there. Particularly production servers, which, if they run responsibly, are hardened with every extraneous bit of software removed.
- jteppinette 2y agoI developed security software in Python that ran on 100k+ production nodes covering dozens of operating systems. They all had Python.
- hamandcheese 2y agoCounter-anecdote: none of my Linux PCs have python.
- jteppinette 2y agoCounter-counter-anecdote: my toaster has python.
- hamandcheese 2y agoI am sorry for your toaster.
- BbzzbB 2y agoDebian comes prepackaged with Python. If there are distros that are good enough for a server almost out of the box, surely Debian stable is one.
- skeledrew 2y agoNot sure who's to "blame", but I was super surprised a few days ago when I installed Kubuntu 24.04 (minimal), and Python was missing. Was fine though as I strictly use via pipx and miniconda only, but still surprising.
- zie 2y agoI used to run Python 2 on OpenVMS in production. Python can have a pretty wide footprint if one looks around.
- pixelmonkey 2y agoIt's actually worth taking your joke seriously to compare and contrast: - piku deploys via git rather than scp/sftp, but authenticates via ssh like those tools - piku supports a number of runtimes, including Python, Ruby, Node, Go, Clojure. The runtimes are implemented rather simply, you can add your own rather easily, see examples here in the code: https://github.com/piku/piku/blob/8777cc093a062c67d3bead9a5d7ab05cf95fe7a6/piku.py#L395-L419 https://github.com/piku/piku/blob/8777cc093a062c67d3bead9a5d... - For each runtime, a mechanism is utilized to install and isolate package dependencies (requirements.txt in Python, Gemfile in Ruby, packages.json in Node, etc.) - a Procfile and ENV file are used to declare your application entrypoints and envvars akin to Heroku / 12 Factor App ideas - a CLI (ssh shim on dev client machine) is provided for checking status and logs from the client (as well as stop/start/restart) - since all applications are managed via uwsgi on the remote, there is also support for worker/sidecar processes and cronjob-style scheduled tasks - HTTPS via Let's Encrypt (acme.sh) is handled automagically for web apps I describe more about how piku works in this tutorial: https://github.com/piku/webapp-tutorial?tab=readme-ov-file#build-a-web-app-fast-with-piku https://github.com/piku/webapp-tutorial?tab=readme-ov-file#b... You're right that PHP apps have a simple deployment story, and in a way piku brings something akin to this level of simplicity to other web programming runtimes.
- rozhok 2y agoYou still need to install nginx, php-fpm an configure certs, so php is not that easy unfortunately.
- dizhn 2y agoThat's two lines in Caddy : ) (I do get your point of course )