Merge pull request #306341 from adamcstephens/forgejo/7

forgejo: 1.21.11-1 -> 7.0.0

Changed files
+35 -53
nixos
tests
pkgs
+3 -3
nixos/tests/forgejo.nix
···
assert "BEGIN PGP PUBLIC KEY BLOCK" in server.succeed("curl http://localhost:3000/api/v1/signing-key.gpg")
api_version = json.loads(server.succeed("curl http://localhost:3000/api/forgejo/v1/version")).get("version")
-
assert "development" != api_version and "-gitea-" in api_version, (
"/api/forgejo/v1/version should not return 'development' "
-
+ f"but should contain a gitea compatibility version string. Got '{api_version}' instead."
)
server.succeed(
···
)
server.succeed(
"su -l forgejo -c 'GITEA_WORK_DIR=/var/lib/forgejo gitea admin user create "
-
+ "--username test --password totallysafe --email test@localhost'"
)
api_token = server.succeed(
···
assert "BEGIN PGP PUBLIC KEY BLOCK" in server.succeed("curl http://localhost:3000/api/v1/signing-key.gpg")
api_version = json.loads(server.succeed("curl http://localhost:3000/api/forgejo/v1/version")).get("version")
+
assert "development" != api_version and "${pkgs.forgejo.version}+gitea-" in api_version, (
"/api/forgejo/v1/version should not return 'development' "
+
+ f"but should contain a forgejo+gitea compatibility version string. Got '{api_version}' instead."
)
server.succeed(
···
)
server.succeed(
"su -l forgejo -c 'GITEA_WORK_DIR=/var/lib/forgejo gitea admin user create "
+
+ "--username test --password totallysafe --email test@localhost --must-change-password=false'"
)
api_token = server.succeed(
+5 -21
pkgs/applications/version-management/forgejo/default.nix pkgs/by-name/fo/forgejo/package.nix
···
pname = "forgejo-frontend";
inherit (forgejo) src version;
-
npmDepsHash = "sha256-uMPy4cqMDNZTpF+pk7YibXEJO1zxVfwlCeFzGgJBiU0=";
patches = [
./package-json-npm-build-frontend.patch
···
in
buildGoModule rec {
pname = "forgejo";
-
version = "1.21.11-1";
src = fetchFromGitea {
domain = "codeberg.org";
owner = "forgejo";
repo = "forgejo";
rev = "v${version}";
-
hash = "sha256-7oYsoZpZcNIUw3iXSi1Q5So2yYgKnT5U7GHQ4NVqVdc=";
-
# Forgejo has multiple different version strings that need to be provided
-
# via ldflags. main.ForgejoVersion for example is a combination of a
-
# hardcoded gitea compatibility version string (in the Makefile) and
-
# git describe and is easiest to get by invoking the Makefile.
-
# So we do that, store it the src FOD to then extend the ldflags array
-
# in preConfigure.
-
# The `echo -e >> Makefile` is temporary and already part of the next
-
# major release. Furthermore, the ldflags will change next major release
-
# and need to be updated accordingly.
-
leaveDotGit = true;
-
postFetch = ''
-
cd "$out"
-
echo -e 'show-version-full:\n\t@echo ''${FORGEJO_VERSION}' >> Makefile
-
make show-version-full > FULL_VERSION
-
find "$out" -name .git -print0 | xargs -0 rm -rf
-
'';
};
-
vendorHash = "sha256-OuWNF+muWM6xqwkFxLIUsn/huqXj2VKg8BN9+JHVw58=";
subPackages = [ "." ];
···
];
preConfigure = ''
-
export ldflags+=" -X code.gitea.io/gitea/routers/api/forgejo/v1.ForgejoVersion=$(cat FULL_VERSION) -X main.ForgejoVersion=$(cat FULL_VERSION)"
'';
preBuild = ''
···
pname = "forgejo-frontend";
inherit (forgejo) src version;
+
npmDepsHash = "sha256-BffoEbIzTU61bw3ECEm5eDHcav4S27MB5jQKsMprkcw=";
patches = [
./package-json-npm-build-frontend.patch
···
in
buildGoModule rec {
pname = "forgejo";
+
version = "7.0.0";
src = fetchFromGitea {
domain = "codeberg.org";
owner = "forgejo";
repo = "forgejo";
rev = "v${version}";
+
hash = "sha256-oIx1aPrHgOWx13ocA3t7N5UdTgr+64tgC0XcEnhA/eE=";
};
+
vendorHash = "sha256-UcjaMi/4XYLdaJhi2j3UWqHqkpTbZBo6EwNXxdRIKLw=";
subPackages = [ "." ];
···
];
preConfigure = ''
+
export ldflags+=" -X main.ForgejoVersion=$(GITEA_VERSION=${version} make show-version-api)"
'';
preBuild = ''
-14
pkgs/applications/version-management/forgejo/package-json-npm-build-frontend.patch
···
-
diff --git a/package.json b/package.json
-
index 57dcfc2f7..c9f23dbf7 100644
-
--- a/package.json
-
+++ b/package.json
-
@@ -79,5 +79,8 @@
-
"defaults",
-
"not ie > 0",
-
"not ie_mob > 0"
-
- ]
-
+ ],
-
+ "scripts": {
-
+ "build": "node_modules/.bin/webpack"
-
+ }
-
}
···
-13
pkgs/applications/version-management/forgejo/static-root-path.patch
···
-
diff --git a/modules/setting/server.go b/modules/setting/server.go
-
index 183906268..fa02e8915 100644
-
--- a/modules/setting/server.go
-
+++ b/modules/setting/server.go
-
@@ -319,7 +319,7 @@ func loadServerFrom(rootCfg ConfigProvider) {
-
OfflineMode = sec.Key("OFFLINE_MODE").MustBool()
-
Log.DisableRouterLog = sec.Key("DISABLE_ROUTER_LOG").MustBool()
-
if len(StaticRootPath) == 0 {
-
- StaticRootPath = AppWorkPath
-
+ StaticRootPath = "@data@"
-
}
-
StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString(StaticRootPath)
-
StaticCacheTime = sec.Key("STATIC_CACHE_TIME").MustDuration(6 * time.Hour)
···
+14
pkgs/by-name/fo/forgejo/package-json-npm-build-frontend.patch
···
···
+
diff --git a/package.json b/package.json
+
index b50c52cf43..d6aafb8775 100644
+
--- a/package.json
+
+++ b/package.json
+
@@ -98,5 +98,8 @@
+
},
+
"browserslist": [
+
"defaults"
+
- ]
+
+ ],
+
+ "scripts": {
+
+ "build": "node_modules/.bin/webpack"
+
+ }
+
}
+13
pkgs/by-name/fo/forgejo/static-root-path.patch
···
···
+
diff --git a/modules/setting/server.go b/modules/setting/server.go
+
index c20dd1949d..c9bcdce99a 100644
+
--- a/modules/setting/server.go
+
+++ b/modules/setting/server.go
+
@@ -317,7 +317,7 @@ func loadServerFrom(rootCfg ConfigProvider) {
+
RedirectorUseProxyProtocol = sec.Key("REDIRECTOR_USE_PROXY_PROTOCOL").MustBool(UseProxyProtocol)
+
OfflineMode = sec.Key("OFFLINE_MODE").MustBool(true)
+
if len(StaticRootPath) == 0 {
+
- StaticRootPath = AppWorkPath
+
+ StaticRootPath = "@data@"
+
}
+
StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString(StaticRootPath)
+
StaticCacheTime = sec.Key("STATIC_CACHE_TIME").MustDuration(6 * time.Hour)
-2
pkgs/top-level/all-packages.nix
···
gitea-actions-runner = callPackage ../development/tools/continuous-integration/gitea-actions-runner { };
-
forgejo = callPackage ../applications/version-management/forgejo { };
-
gokart = callPackage ../development/tools/gokart { };
gl2ps = callPackage ../development/libraries/gl2ps { };
···
gitea-actions-runner = callPackage ../development/tools/continuous-integration/gitea-actions-runner { };
gokart = callPackage ../development/tools/gokart { };
gl2ps = callPackage ../development/libraries/gl2ps { };