diff options
-rw-r--r-- | .SRCINFO | 19 | ||||
-rw-r--r-- | Caddyfile | 37 | ||||
-rw-r--r-- | Caddyfile.dev | 46 | ||||
-rw-r--r-- | PKGBUILD | 25 | ||||
-rw-r--r-- | mercure.service | 5 | ||||
-rw-r--r-- | mercure.sysusers | 1 | ||||
-rw-r--r-- | mercure.tmpfiles | 2 |
7 files changed, 121 insertions, 14 deletions
@@ -1,15 +1,24 @@ pkgbase = mercure pkgdesc = Server-sent live updates: protocol and reference implementation pkgver = 0.11.1 - pkgrel = 2 + pkgrel = 3 url = https://mercure.rocks - install = mercure.install arch = x86_64 - license = AGPL-3.0 + license = AGPL3 + backup = etc/mercure/Caddyfile + backup = etc/mercure/Caddyfile.dev source = mercure.service - sha256sums = 277572c9cbc93b74b368aec4fd40a8a9542d220e74b14383ef68e24630b2a4dc + source = mercure.sysusers + source = mercure.tmpfiles + source = Caddyfile + source = Caddyfile.dev + sha512sums = cdfcab53d5ae52395b10afe6fe9a2dbb6a1dddb6535773dde94c7f29aa05e316e714a7dddf9b4f345db6fa4226c83a17f2c7f7bd1300711100b8a712afb10324 + sha512sums = 9dd5104f850e8aca3b420de6ac407e42fd32bde145d9ac9d47fa00e101a4f5f64136b745bb467ea8b250099bc80ae84baf1fa46b972cdc37a61aa5057c02ad67 + sha512sums = 68236e714ba954332f4ee2a9f558795cfcdfd32d2162fa5f369a1d0f38d8524c23199f1b14df39670d001a769bb460f1431caa84dec108f37129ead5d3d04391 + sha512sums = f0a2e107a2d3977e037862a6b5a964c5051452040ae64ab997a3948b80e67c191672dca04703c83dfc4a866d782ecb83ae334dfe44553bc134553975fbd8dc8b + sha512sums = 66d5f99fe323ef91058d73d083ef6201b2129720dda36709b6a04789f4f0d08c8e959e27113668d09e07f012eb324cb5ec9a79724923329a8ca007800ab677e5 source_x86_64 = mercure-0.11.1_x86_64::https://github.com/dunglas/mercure/releases/download/v0.11.1/mercure_0.11.1_Linux_x86_64.tar.gz - sha256sums_x86_64 = 046d9e3374ddf3d52563a33ecadc2e9f85e18f6a397559a28210d6ddfc329aa6 + sha512sums_x86_64 = 0c90082124fed1ac6906a2b7f9e3c2dd527efc9f62c580aff9a9d52b5b7cd859cf4edd90ae2ddc312c7bf52b51b513fef9eb869cafa469045c59414e9ba0a11d pkgname = mercure diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 000000000000..d4d2fabb4ad1 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,37 @@ +# Learn how to configure the Mercure.rocks Hub on https://mercure.rocks/docs/hub/config +{ + http_port 3000 + https_port 3001 + + # HTTP/3 support + servers { + protocol { + experimental_http3 + } + } +} + +# Automatic HTTPS does not work with the systemd service unit. +# Change port to your https_port and enable the tls setting, if you want to use HTTPS. +:3000 + +#tls /etc/ssl/certs/cert.pem /etc/ssl/private/key.pem + +log + +route { + encode zstd gzip + + mercure { + # Transport to use (default to Bolt) + transport_url bolt:///run/mercure/mercure.db + # Publisher JWT key + publisher_jwt !ChangeMe! + # Subscriber JWT key + subscriber_jwt !ChangeMe! + } + + respond /healthz 200 + + respond "Not Found" 404 +} diff --git a/Caddyfile.dev b/Caddyfile.dev new file mode 100644 index 000000000000..b53a3970b5dc --- /dev/null +++ b/Caddyfile.dev @@ -0,0 +1,46 @@ +# Learn how to configure the Mercure.rocks Hub on https://mercure.rocks/docs/hub/config +{ + http_port 3000 + https_port 3001 + + # Debug mode (disable it in production!) + debug + + # HTTP/3 support + servers { + protocol { + experimental_http3 + } + } +} + +# Automatic HTTPS does not work with the systemd service unit. +# Change port to your https_port and enable the tls setting, if you want to use HTTPS. +:3000 + +#tls /etc/ssl/certs/cert.pem /etc/ssl/private/key.pem + +log + +route { + encode zstd gzip + + mercure { + # Transport to use (default to Bolt) + transport_url bolt:///run/mercure/mercure.db + # Publisher JWT key + publisher_jwt !ChangeMe! + # Subscriber JWT key + subscriber_jwt !ChangeMe! + # Permissive configuration for the development environment + cors_origins * + publish_origins * + demo + anonymous + subscriptions + } + + respond /healthz 200 + + respond "Not Found" 404 +} @@ -1,21 +1,30 @@ # Maintainer: Jérôme Deuchnord <jerome@deuchnord.fr> +# Contributor: Marc Straube <email@marcstraube.de> pkgname=mercure pkgver=0.11.1 -pkgrel=2 +pkgrel=3 pkgdesc='Server-sent live updates: protocol and reference implementation' arch=('x86_64') url='https://mercure.rocks' -install='mercure.install' -license=('AGPL-3.0') +license=('AGPL3') +backup=('etc/mercure/Caddyfile' 'etc/mercure/Caddyfile.dev') -source=('mercure.service') +source=('mercure.service' 'mercure.sysusers' 'mercure.tmpfiles' 'Caddyfile' 'Caddyfile.dev') source_x86_64=("mercure-${pkgver}_x86_64::https://github.com/dunglas/mercure/releases/download/v${pkgver}/mercure_${pkgver}_Linux_x86_64.tar.gz") -sha256sums=('277572c9cbc93b74b368aec4fd40a8a9542d220e74b14383ef68e24630b2a4dc') -sha256sums_x86_64=('046d9e3374ddf3d52563a33ecadc2e9f85e18f6a397559a28210d6ddfc329aa6') +sha512sums=('cdfcab53d5ae52395b10afe6fe9a2dbb6a1dddb6535773dde94c7f29aa05e316e714a7dddf9b4f345db6fa4226c83a17f2c7f7bd1300711100b8a712afb10324' + '9dd5104f850e8aca3b420de6ac407e42fd32bde145d9ac9d47fa00e101a4f5f64136b745bb467ea8b250099bc80ae84baf1fa46b972cdc37a61aa5057c02ad67' + '68236e714ba954332f4ee2a9f558795cfcdfd32d2162fa5f369a1d0f38d8524c23199f1b14df39670d001a769bb460f1431caa84dec108f37129ead5d3d04391' + 'f0a2e107a2d3977e037862a6b5a964c5051452040ae64ab997a3948b80e67c191672dca04703c83dfc4a866d782ecb83ae334dfe44553bc134553975fbd8dc8b' + '66d5f99fe323ef91058d73d083ef6201b2129720dda36709b6a04789f4f0d08c8e959e27113668d09e07f012eb324cb5ec9a79724923329a8ca007800ab677e5') +sha512sums_x86_64=('0c90082124fed1ac6906a2b7f9e3c2dd527efc9f62c580aff9a9d52b5b7cd859cf4edd90ae2ddc312c7bf52b51b513fef9eb869cafa469045c59414e9ba0a11d') package(){ - install -Dm 755 mercure "$pkgdir/usr/bin/mercure" - install -Dm 755 mercure.service "$pkgdir"/usr/lib/systemd/system/mercure.service + install -Dm 755 mercure "${pkgdir}"/usr/bin/mercure + install -Dm 755 mercure.service "${pkgdir}"/usr/lib/systemd/system/mercure.service + install -Dm 644 mercure.sysusers "${pkgdir}"/usr/lib/sysusers.d/mercure.conf + install -Dm 644 mercure.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/mercure.conf + install -Dm 644 Caddyfile "${pkgdir}"/etc/mercure/Caddyfile + install -Dm 644 Caddyfile.dev "${pkgdir}"/etc/mercure/Caddyfile.dev } diff --git a/mercure.service b/mercure.service index eb9854d55235..1f9712cb6175 100644 --- a/mercure.service +++ b/mercure.service @@ -3,7 +3,10 @@ Description=Mercure - Server-sent live updates After=network.target [Service] -ExecStart=/usr/bin/mercure start +Environment=XDG_DATA_HOME=/var/lib/mercure +Environment=XDG_CONFIG_HOME=/var/lib/mercure +ExecStart=/usr/bin/mercure run -config /etc/mercure/Caddyfile +ExecReload=/usr/bin/mercure reload -config /etc/mercure/Caddyfile User=mercure Group=mercure RuntimeDirectory=mercure diff --git a/mercure.sysusers b/mercure.sysusers new file mode 100644 index 000000000000..cf4c8e16c0ff --- /dev/null +++ b/mercure.sysusers @@ -0,0 +1 @@ +u mercure - "Mercure.rocks daemon" /var/lib/mercure
\ No newline at end of file diff --git a/mercure.tmpfiles b/mercure.tmpfiles new file mode 100644 index 000000000000..ad63bfdf1cb8 --- /dev/null +++ b/mercure.tmpfiles @@ -0,0 +1,2 @@ +d /run/mercure 0750 mercure mercure - - +d /var/lib/mercure 0750 mercure mercure - -
\ No newline at end of file |