I am looking at this Install — Caddy Documentation
It says I should be able to do this -
curl -OL "https://github.com/caddyserver/caddy/releases/latest/download/ASSET"
What is the ‘ASSET’ name for linux-amd64 ?
From the docs:
You can download Caddy from GitHub, where new releases are immediately published.
ASSET with the filename for your platform.
Visit the GitHub page, scroll down a bit, and you’ll see all the files for download.
I get that. The problem is, that requires me to know that the “latest” is 2.0.0
The docs specifically give out a curl and wget command. I believe the documentation is wrong and needs to be fixed.
No form of the curl or wget command can be used to download the latest.
Github allows the concept of downloading the latest tagged release but I think that works if you only have 1 asset file published. In this case, since multiple asset files are published, I think the documentation is wrong. The “using curl” and “using wget” portions must be removed
That’s not true:
$ curl -OL "https://github.com/caddyserver/caddy/releases/latest/download/caddy_2.0.0_linux_amd64.tar.gz"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 158 100 158 0 0 392 0 --:--:-- --:--:-- --:--:-- 392
100 641 100 641 0 0 1050 0 --:--:-- --:--:-- --:--:-- 625k
100 11.4M 100 11.4M 0 0 1364k 0 0:00:08 0:00:08 --:--:-- 1699k
$ ls -l caddy_2.0.0_linux_amd64.tar.gz
-rw-r--r-- 1 matt staff 11968924 May 19 12:04 caddy_2.0.0_linux_amd64.tar.gz
The documentation is correct. Just replace ASSET with the filename.
ah ok. I was actually trying combinations of caddy_latest_linux_amd64.tar.gz, latest_linux_amd64.tar.gz etc.
What I had in mind was a way to simply download the latest, without actually knowing the version of the latest. In your curl for instance, you have to “know” ahead of time that 2.0.0 is indeed the latest in order to be able to download that. If you already know that, you can simply use the https://github.com/caddyserver/caddy/releases/download/v2.0.0/caddy_2.0.0_linux_amd64.tar.gz URL instead of the https://github.com/caddyserver/caddy/releases/latest/download/_____ form.
I guess you could still use api.github.com to get the version number of the latest.
Thanks for the response!
We’ll eventually have a build server which will make that easier, but for now we recommend either using a package repo (apt for debian/ubuntu, or Fedora COPR for fedora/centos) which will keep you updated, if you need auto-updates. Or you can do like you suggest and use the github API
Glad it worked for you!
Just so you know, “always downloading the latest” blindly (into production) is never a good idea.
Francis is right, we’ll probably eventually have a public API that lets you get version information. But this method of downloading Caddy (by using curl from GitHub releases) is just a command-line equivalent of using your browser to click the download link. It’s not intended for rolling installs on production systems. For that, use a proper package manager.
This topic was automatically closed after 30 days. New replies are no longer allowed.