sourcehut.gitsrht: 0.77.3 -> 0.78.18
This commit is contained in:
parent
43f856ab2c
commit
b57ed0fa1d
|
@ -1086,6 +1086,11 @@ in
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
extraServices.gitsrht-api = {
|
||||||
|
serviceConfig.Restart = "always";
|
||||||
|
serviceConfig.RestartSec = "2s";
|
||||||
|
serviceConfig.ExecStart = "${pkgs.sourcehut.gitsrht}/bin/gitsrht-api -b ${cfg.listenAddress}:${toString (cfg.git.port + 100)}";
|
||||||
|
};
|
||||||
extraServices.gitsrht-fcgiwrap = mkIf cfg.nginx.enable {
|
extraServices.gitsrht-fcgiwrap = mkIf cfg.nginx.enable {
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
# Socket is passed by gitsrht-fcgiwrap.socket
|
# Socket is passed by gitsrht-fcgiwrap.socket
|
||||||
|
|
|
@ -1,47 +1,57 @@
|
||||||
{ lib
|
{ lib
|
||||||
, fetchFromSourcehut
|
, fetchFromSourcehut
|
||||||
, buildPythonPackage
|
|
||||||
, buildGoModule
|
, buildGoModule
|
||||||
|
, buildPythonPackage
|
||||||
, python
|
, python
|
||||||
, srht
|
, srht
|
||||||
, pygit2
|
, pygit2
|
||||||
, scmsrht
|
, scmsrht
|
||||||
|
, unzip
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
version = "0.77.3";
|
version = "0.78.18";
|
||||||
|
|
||||||
src = fetchFromSourcehut {
|
src = fetchFromSourcehut {
|
||||||
owner = "~sircmpwn";
|
owner = "~sircmpwn";
|
||||||
repo = "git.sr.ht";
|
repo = "git.sr.ht";
|
||||||
rev = version;
|
rev = version;
|
||||||
sha256 = "sha256-eJvXCcmdiUzTK0EqNJkLEZsAfr6toD/378HObnMbOWM=";
|
sha256 = "sha256-pGWphdFKaOIBIKWMxfNAFqXZQx/qHcrwb5Ylj9uag7s=";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildShell = src: buildGoModule {
|
gitApi = buildGoModule ({
|
||||||
inherit src version;
|
inherit src version;
|
||||||
pname = "gitsrht-shell";
|
pname = "gitsrht-api";
|
||||||
vendorSha256 = "sha256-aqUFICp0C2reqb2p6JCPAUIRsxzSv0t9BHoNWrTYfqk=";
|
modRoot = "api";
|
||||||
};
|
vendorSha256 = "sha256-0YI20liP0X1McfiSUy29zJk2UqqAPBIfIfPLoJOE1uI=";
|
||||||
|
} // import ./fix-gqlgen-trimpath.nix {inherit unzip;});
|
||||||
|
|
||||||
buildDispatcher = src: buildGoModule {
|
gitDispatch = buildGoModule {
|
||||||
inherit src version;
|
inherit src version;
|
||||||
pname = "gitsrht-dispatcher";
|
pname = "gitsrht-dispatch";
|
||||||
|
modRoot = "gitsrht-dispatch";
|
||||||
vendorSha256 = "sha256-qWXPHo86s6iuRBhRMtmD5jxnAWKdrWHtA/iSUkdw89M=";
|
vendorSha256 = "sha256-qWXPHo86s6iuRBhRMtmD5jxnAWKdrWHtA/iSUkdw89M=";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildKeys = src: buildGoModule {
|
gitKeys = buildGoModule {
|
||||||
inherit src version;
|
inherit src version;
|
||||||
pname = "gitsrht-keys";
|
pname = "gitsrht-keys";
|
||||||
|
modRoot = "gitsrht-keys";
|
||||||
vendorSha256 = "sha256-9pojS69HCKVHUceyOpGtv9ewcxFD4WsOVsEzkmWJkF4=";
|
vendorSha256 = "sha256-9pojS69HCKVHUceyOpGtv9ewcxFD4WsOVsEzkmWJkF4=";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildUpdateHook = src: buildGoModule {
|
gitShell = buildGoModule {
|
||||||
inherit src version;
|
inherit src version;
|
||||||
pname = "gitsrht-update-hook";
|
pname = "gitsrht-shell";
|
||||||
vendorSha256 = "sha256-sBlG7EFqdDm7CkAHVX50Mf4N3sl1rPNmWExG/bfbfGA=";
|
modRoot = "gitsrht-shell";
|
||||||
|
vendorSha256 = "sha256-WqfvSPuVsOHA//86u33atMfeA11+DJhjLmWy8Ivq0NI=";
|
||||||
};
|
};
|
||||||
|
|
||||||
updateHook = buildUpdateHook "${src}/gitsrht-update-hook";
|
gitUpdateHook = buildGoModule {
|
||||||
|
inherit src version;
|
||||||
|
pname = "gitsrht-update-hook";
|
||||||
|
modRoot = "gitsrht-update-hook";
|
||||||
|
vendorSha256 = "sha256-Bc3yPabS2S+qiroHFKrtkII/CfzBDYQ6xWxKHAME+Tc=";
|
||||||
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
|
@ -52,6 +62,10 @@ buildPythonPackage rec {
|
||||||
# Revert change breaking Unix socket support for Redis
|
# Revert change breaking Unix socket support for Redis
|
||||||
patches/redis-socket/git/0001-Revert-Add-webhook-queue-monitoring.patch
|
patches/redis-socket/git/0001-Revert-Add-webhook-queue-monitoring.patch
|
||||||
];
|
];
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace Makefile \
|
||||||
|
--replace "all: api gitsrht-dispatch gitsrht-keys gitsrht-shell gitsrht-update-hook" ""
|
||||||
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = srht.nativeBuildInputs;
|
nativeBuildInputs = srht.nativeBuildInputs;
|
||||||
|
|
||||||
|
@ -68,14 +82,12 @@ buildPythonPackage rec {
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
cp ${buildShell "${src}/gitsrht-shell"}/bin/gitsrht-shell $out/bin/gitsrht-shell
|
ln -s ${gitApi}/bin/api $out/bin/gitsrht-api
|
||||||
cp ${buildDispatcher "${src}/gitsrht-dispatch"}/bin/gitsrht-dispatch $out/bin/gitsrht-dispatch
|
ln -s ${gitDispatch}/bin/gitsrht-dispatch $out/bin/gitsrht-dispatch
|
||||||
cp ${buildKeys "${src}/gitsrht-keys"}/bin/gitsrht-keys $out/bin/gitsrht-keys
|
ln -s ${gitKeys}/bin/gitsrht-keys $out/bin/gitsrht-keys
|
||||||
cp ${updateHook}/bin/gitsrht-update-hook $out/bin/gitsrht-update-hook
|
ln -s ${gitShell}/bin/gitsrht-shell $out/bin/gitsrht-shell
|
||||||
|
ln -s ${gitUpdateHook}/bin/gitsrht-update-hook $out/bin/gitsrht-update-hook
|
||||||
'';
|
'';
|
||||||
passthru = {
|
|
||||||
inherit updateHook;
|
|
||||||
};
|
|
||||||
|
|
||||||
pythonImportsCheck = [ "gitsrht" ];
|
pythonImportsCheck = [ "gitsrht" ];
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,8 @@
|
||||||
From 5ccb5386304c26f25b0a9eb10ce9edb6da32f91a Mon Sep 17 00:00:00 2001
|
|
||||||
From: Julien Moutinho <julm+srht@sourcephile.fr>
|
|
||||||
Date: Sat, 12 Feb 2022 00:11:59 +0100
|
|
||||||
Subject: [PATCH git.sr.ht] Revert "Add webhook queue monitoring"
|
|
||||||
|
|
||||||
This reverts commit 7ea630b776947ab82438d0ffa263b0f9d33ebff3.
|
|
||||||
|
|
||||||
Which has broken Unix socket support for Redis.
|
|
||||||
See https://lists.sr.ht/~sircmpwn/sr.ht-dev/%3C20211208082636.65665-1-me%40ignaskiela.eu%3E#%3C20211216033723.wefibfulfjhqnhem@sourcephile.fr%3E
|
|
||||||
---
|
|
||||||
gitsrht/app.py | 3 ---
|
|
||||||
gitsrht/webhooks.py | 5 +----
|
|
||||||
2 files changed, 1 insertion(+), 7 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/gitsrht/app.py b/gitsrht/app.py
|
diff --git a/gitsrht/app.py b/gitsrht/app.py
|
||||||
index e9ccb56..4928851 100644
|
index eaae395..731bb03 100644
|
||||||
--- a/gitsrht/app.py
|
--- a/gitsrht/app.py
|
||||||
+++ b/gitsrht/app.py
|
+++ b/gitsrht/app.py
|
||||||
@@ -48,9 +48,6 @@ class GitApp(ScmSrhtFlask):
|
@@ -55,9 +55,6 @@ class GitApp(SrhtFlask):
|
||||||
self.add_template_filter(url_quote)
|
self.add_template_filter(url_quote)
|
||||||
self.add_template_filter(commit_links)
|
self.add_template_filter(commit_links)
|
||||||
|
|
||||||
|
@ -27,15 +13,15 @@ index e9ccb56..4928851 100644
|
||||||
def inject():
|
def inject():
|
||||||
notice = session.get("notice")
|
notice = session.get("notice")
|
||||||
diff --git a/gitsrht/webhooks.py b/gitsrht/webhooks.py
|
diff --git a/gitsrht/webhooks.py b/gitsrht/webhooks.py
|
||||||
index 8a203fe..6240d50 100644
|
index 36486d0..0109428 100644
|
||||||
--- a/gitsrht/webhooks.py
|
--- a/gitsrht/webhooks.py
|
||||||
+++ b/gitsrht/webhooks.py
|
+++ b/gitsrht/webhooks.py
|
||||||
@@ -7,13 +7,10 @@ if not hasattr(db, "session"):
|
@@ -7,12 +7,10 @@ if not hasattr(db, "session"):
|
||||||
db.init()
|
db.init()
|
||||||
from srht.webhook import Event
|
from srht.webhook import Event
|
||||||
from srht.webhook.celery import CeleryWebhook, make_worker
|
from srht.webhook.celery import CeleryWebhook, make_worker
|
||||||
-from srht.metrics import RedisQueueCollector
|
-from srht.metrics import RedisQueueCollector
|
||||||
from scmsrht.webhooks import UserWebhook
|
+from scmsrht.webhooks import UserWebhook
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
|
||||||
-webhook_broker = cfg("git.sr.ht", "webhooks")
|
-webhook_broker = cfg("git.sr.ht", "webhooks")
|
||||||
|
@ -43,8 +29,5 @@ index 8a203fe..6240d50 100644
|
||||||
-webhook_metrics_collector = RedisQueueCollector(webhook_broker, "srht_webhooks", "Webhook queue length")
|
-webhook_metrics_collector = RedisQueueCollector(webhook_broker, "srht_webhooks", "Webhook queue length")
|
||||||
+worker = make_worker(broker=cfg("git.sr.ht", "webhooks"))
|
+worker = make_worker(broker=cfg("git.sr.ht", "webhooks"))
|
||||||
|
|
||||||
class RepoWebhook(CeleryWebhook):
|
class UserWebhook(CeleryWebhook):
|
||||||
events = [
|
events = [
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue