gogs: 0.11.91 -> 0.12.3

This commit is contained in:
Sebastien Braun 2020-10-29 15:30:57 +01:00
parent 5b48bc8aae
commit 5c87a6b8ea
3 changed files with 8 additions and 34 deletions

View file

@ -25,7 +25,6 @@ let
HTTP_ADDR = ${cfg.httpAddress}
HTTP_PORT = ${toString cfg.httpPort}
ROOT_URL = ${cfg.rootUrl}
STATIC_ROOT_PATH = ${cfg.staticRootPath}
[session]
COOKIE_NAME = session
@ -179,13 +178,6 @@ in
'';
};
staticRootPath = mkOption {
type = types.str;
default = "${pkgs.gogs.data}";
example = "/var/lib/gogs/data";
description = "Upper level of template and static files path.";
};
extraConfig = mkOption {
type = types.str;
default = "";

View file

@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, makeWrapper
{ stdenv, buildGoModule, fetchFromGitHub, makeWrapper
, git, bash, gzip, openssh, pam
, sqliteSupport ? true
, pamSupport ? true
@ -6,25 +6,26 @@
with stdenv.lib;
buildGoPackage rec {
buildGoModule rec {
pname = "gogs";
version = "0.11.91";
version = "0.12.3";
src = fetchFromGitHub {
owner = "gogs";
repo = "gogs";
rev = "v${version}";
sha256 = "1yfimgjg9n773kdml17119539w9736mi66bivpv5yp3cj2hj9mlj";
sha256 = "0ix3mxy8cpqbx24qffbzyf5z88x7605icm7rk5n54r8bdsr7cckd";
};
patches = [ ./static-root-path.patch ];
vendorSha256 = "0m0g4dsiq8p2ngsbjxfi3wff7x4xpm67qlhgcgf8b48mqai4d2gc";
subPackages = [ "." ];
postPatch = ''
patchShebangs .
substituteInPlace pkg/setting/setting.go --subst-var data
'';
nativeBuildInputs = [ makeWrapper ];
nativeBuildInputs = [ makeWrapper openssh ];
buildInputs = optional pamSupport pam;
@ -34,18 +35,12 @@ buildGoPackage rec {
( optional sqliteSupport "sqlite"
++ optional pamSupport "pam");
outputs = [ "out" "data" ];
postInstall = ''
mkdir $data
cp -R $src/{public,templates} $data
wrapProgram $out/bin/gogs \
--prefix PATH : ${makeBinPath [ bash git gzip openssh ]}
'';
goPackagePath = "github.com/gogs/gogs";
meta = {
description = "A painless self-hosted Git service";
homepage = "https://gogs.io";

View file

@ -1,13 +0,0 @@
diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go
index f206592d..796da6ef 100644
--- a/pkg/setting/setting.go
+++ b/pkg/setting/setting.go
@@ -474,7 +474,7 @@ func NewContext() {
LocalURL = sec.Key("LOCAL_ROOT_URL").MustString(string(Protocol) + "://localhost:" + HTTPPort + "/")
OfflineMode = sec.Key("OFFLINE_MODE").MustBool()
DisableRouterLog = sec.Key("DISABLE_ROUTER_LOG").MustBool()
- StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString(workDir)
+ StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString("@data@")
AppDataPath = sec.Key("APP_DATA_PATH").MustString("data")
EnableGzip = sec.Key("ENABLE_GZIP").MustBool()