Ubuntu 20.04 is no longer supported.
Agate may require a newer version of glibc after this change, and may
not run on versions of Linux older than Ubuntu 22.04.
This Github workflow builds & publishes an OCI/Docker container image to Github/s Container Registry (ghcr.io).
It also adds a brief intro for how to use it in the README, and removes the (now outdated) `tools/docker/README.md`.
@ -5,18 +5,66 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
Updates to dependencies are not considered notable changes for the purpose of this changelog.
This may lead to no listed changes for a version.
## [Unreleased]
## [3.3.19] - 2025-09-18
### Fixed
* Update dependencies.
* Document commands for converting PEM to DER.
## [3.3.18] - 2025-08-05
## [3.3.17] - 2025-06-27
## [3.3.16] - 2025-05-06
### Changed
* Build release artifacts with Ubuntu 22.04, because Ubuntu 20.04 is no longer supported
* pre-built binaries may no longer run on Linux distributions older than Ubuntu 22.04 (glibc 2.35)
* users with older glibc versions will need to build from source
## [3.3.15] - 2025-05-06
## [3.3.14] - 2025-03-24
## [3.3.13] - 2025-02-24
Thank you to @luineth for contributing to this release.
### Added
* aarch64 support for Docker image (#376)
## [3.3.12] - 2025-02-18
## [3.3.11] - 2024-11-29
Thank you to @geraldwuhoo and @jphastings for contributing to this release.
### Added
* Automatically publish docker images to GHCR (#366)
### Fixed
* Refactor Dockerfile for multi-stage build (#144)
## [3.3.10] - 2024-11-04
## [3.3.9] - 2024-09-10
## [3.3.8] - 2024-07-24
## [3.3.7] - 2024-04-01
## [3.3.6] - 2024-03-22
## [3.3.5] - 2024-03-15
### Fixed
* updated and simplified dependencies
* fix syntax of license field in Cargo manifest
## [3.3.4] - 2024-01-16
### Fixed
* cleaned up documentation
## [3.3.3] - 2023-12-27
### Fixed
* fixed release automation
## [3.3.2] - 2023-12-27
### Fixed
* updated dependencies
## [3.3.1] - 2023-08-05
Thank you to Jan Stępień and @michaelnordmeyer for contributing to this release.
@ -31,7 +79,6 @@ Thank you to @equalsraf, @michaelnordmeyer and @wanderer1988 for contributing to
* listening on unix sockets (#244)
### Fixed
* updated dependencies
* misstyped email address in section on how to report security vulnerabilities (#239)
* wrong language code in README (#189)
@ -41,14 +88,12 @@ Thank you to @06kellyjac, @albertlarsan68 and @kahays for contributing to this r
### Fixed
* removed port collisions in tests, for the last time (#143)
* fixed Dockerfile startup command (#169)
* upated dependencies
## [3.2.3] - 2022-02-04
Thank you to T. Spivey for contributing to this release.
### Fixed
* improper IRIs are handled instead of crashing (bug reported via email)
* updated dependencies
## [3.2.2] - 2022-01-25
Thank you to @Suzie97 for contributing to this release.
@ -56,16 +101,12 @@ Thank you to @Suzie97 for contributing to this release.
### Added
* CI build for `aarch64-apple-darwin` target (#137)
### Fixed
* updated dependencies
## [3.2.1] - 2021-12-02
Thank you to @MatthiasPortzel for contributing to this release.
### Fixed
* host name comparisons are now case insensitive (#115)
* made automatic certificate configuration more prominent in the README
* updated dependencies
## [3.2.0] - 2021-11-15
Thank you to @balazsbtond and @joseph-marques for contributing to this release.
@ -74,7 +115,6 @@ Thank you to @balazsbtond and @joseph-marques for contributing to this release.
* you can add header text to a directory listing. See the updated readme for details. (#98)
### Fixed
* updated dependencies
* error pages also send close_notify (#100)
## [3.1.3] - 2021-10-25
@ -103,7 +143,6 @@ Thank you to @jgarte and @alvaro-cuesta for contributing to this release.
### Fixed
* actually bind to multiple IP addresses. Despite the documentation saying so,
Agate would only bind to the first address that did not result in an error. (#63)
* updated dependencies
## [3.1.0] - 2021-06-08
Thank you to Matthew Ingwersen and Oliver Simmons (@GoodClover) for contributing to this release.
@ -133,7 +172,6 @@ Thank you to @06kellyjac, @cpnfeeny, @lifelike, @skittlesvampir and @steko for c
The previous handling could be exploited as a DoS attack vector. (#59)
* Two tests were running on the same port, causing them to fail nondeterministically. (#51)
* Rephrased the changelog for 3.0.0 on continuing to use older certificates. (#55)
* Updated dependencies.
## [3.0.2] - 2021-04-08
Thank you to @kvibber, @lifelike and @pasdechance for contributing to this release.
@ -196,7 +234,6 @@ Thank you to @littleli and @06kellyjac for contributing to this release.
* The GitHub workflow has been fixed so Windows binaries are compressed correctly (#36).
* Split out install steps to allow for more options in the future.
* Add install notes for nix/NixOS to the README (#38).
* Updated dependencies.
## [2.5.2] - 2021-02-12
@ -293,9 +330,6 @@ Thank you to @Johann150 and @KilianKemps for contributing to this release.
### Added
* Optional directory listings (#8, #9).
### Fixed
* Updated dependencies.
## [2.0.0] - 2020-12-23
Thank you to @bortzmeyer, @KillianKemps, and @Ylhp for contributing to this release.
@ -326,7 +360,6 @@ Thank you @Johann150, @jonhiggs and @tronje for contributing to this release!
* verify hostname and port in request URL (#4).
* improved logging (#2, #3).
* Don't redirect to "/" when the path is empty (#5).
* Update dependencies.
## [1.2.2] - 2020-09-21
Thank you to @m040601 for contributing to this release.
@ -336,13 +369,11 @@ Thank you to @m040601 for contributing to this release.
* Built both x86_64 and ARM binaries. These binaries are built for Linux operating systems with glibc 2.28 or later, such as Debian 10 ("buster") or newer, Ubuntu 18.10 or newer, and Raspberry Pi OS 2019-06-20 or newer (#1).
### Fixed
* Update dependencies.
* Minor internal code cleanup.
## [1.2.1] - 2020-06-20
### Fixed
* Reduce memory usage when serving large files.
* Update dependencies.
## [1.2.0] - 2020-06-10
### Changed
@ -351,7 +382,6 @@ Thank you to @m040601 for contributing to this release.
### Fixed
* Handling for requests that exceed 1KB.
* Reduce memory allocations and speed up request parsing.
* Update dependencies.
## [1.1.0] - 2020-05-22
### Added
@ -364,7 +394,24 @@ Thank you to @m040601 for contributing to this release.
@ -38,6 +38,23 @@ Install the package [`agate-bin`](https://aur.archlinux.org/packages/agate-bin/)
If you have the Rust toolchain installed, run `cargo install agate` to install agate from crates.io.
### Docker
Recent builds have also been released as OCI/Docker images on Github's Container Registry (ghcr.io). Most people will need to mount two volumes, one for your content, one for your certificates (this can be empty, they will be automatically generated if needed):
```sh
$ docker run \
-p 1965:1965 \
-v your/path/to/gmi:/gmi \
-v your/path/to/certs:/certs \
ghcr.io/mbrubeck/agate:latest \
--hostname example.org
```
This container will run without a mounted certificates directory, but new certificates will be lost when it shuts down and re-generated every time it boots, showing your site's visitors a certificate warning each time your server restarts.
Each release is tagged with `major`, `major.minor`, `major.minor.patch`, as well as the full version string and "latest". This means `docker pull ghcr.io/mbrubeck/agate:3` will always retrieve the latest `v3.*` image, `…:3.3` the latest `v3.3.*` image, and `…:latest` the most recent release of any version.
### Source
Download the source code and run `cargo build --release` inside the source repository, then find the binary at `target/release/agate`.
@ -178,6 +195,13 @@ Using a directory named just `.` causes undefined behaviour as this would have t
The files for a certificate/key pair have to be named `cert.der` and `key.der` respectively. The certificate has to be a X.509 certificate in a DER format file and has to include a subject alt name of the domain name. The private key has to be in DER format and must be either an RSA, ECDSA or Ed25519 key.
If you have an existing certificate/key pair in PEM format, you can use these commands to convert them to the DER format:
```shell
openssl x509 -inform pem -in cert.pem -outform der -out cert.der
openssl rsa -inform pem -in privkey.pem -outform der -out key.der
```
## Logging
All requests via TCP sockets will be logged using this format:
/// The requested resource could not be found but may be available in the future. (cf HTTP 404)
pubconstNOT_FOUND: u8=51;
/// The resource requested is no longer available and will not be available again. Search engines and similar tools should remove this resource from their indices. Content aggrefators should stop requesting the resource and convey to their human users that the subscribed resource is gone. (cf HTTP 410)
/// The resource requested is no longer available and will not be available again. Search engines and similar tools should remove this resource from their indices. Content aggregators should stop requesting the resource and convey to their human users that the subscribed resource is gone. (cf HTTP 410)
pubconstGONE: u8=52;
/// The requested resource should be consistently requested from the new URL provided in the future. Tools loke search engine indexers or content aggregators should update their configurations to avoid requesting the old URL, and end-user clients may automatically update bookmarks, etc. Note that clients that only pay attention to the initial digit of status codes will treat this as a temporary redirect. They will still end up at the right place, they just won't be able to make use of the knowledge that this redirect is permanent, so they'll pay a small performance penality by having to follow the redirect each time.
// already listening on the other unspecified address
log::warn!("Could not start listener on {}, but already listening on another unspecified address. Probably your system automatically listens in dual stack?",addr);
log::warn!("Could not start listener on {addr}, but already listening on another unspecified address. Probably your system automatically listens in dual stack?");
(these instructions assume you use linux and have some experience with both docker and the command line)
## obtain the source code
There are currently no container images online so you have to build the image yourself before you can use it.
There are two options available for this: downloading a release or cloning the repository with `git`.
I will explain both methods but if you're unsure which method to use, I would recommend the release for new comers because it's probably more tested so you'll encounter less problems.
### downloading the release tarball
Download the tarball. Go to [https://github.com/mbrubeck/agate/releases/latest](https://github.com/mbrubeck/agate/releases/latest), and copy the url of the source code tarball.
```
wget URL
```
Then unpack the tarball and remove it afterwards:
```
tar -xzf tarball.tar.gz
rm tarball.tar.gz
```
### clone the repository with git
I assume you have git already installed. If not, please search on how to do it in the internet.
```
git clone https://github.com/mbrubeck/agate
cd agate
```
## build the image
Enter the `tools/docker` directory:
```
cd tools/docker
```
And now build the docker image:
```
docker build -t agate .
```
This process will take a few minutes because all the rust modules have to be compiled from source.
You have to replace `/var/www/gmi/` with the folder where you'd like to have gemtext files and `/var/www/gmi/.certificates/` with the folder where you'd like to have your certificates stored. You also have to have to replace `example.org` with your domain name and if plan to speak in a different language than english in your gemini space than you should replace `en-US` with your countries language code (for example de-DE or fr-CA).
## That's it! Now have agate running in a docker container!