Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forgejo: 1.21.11-1 -> 7.0.0 #306341

Merged
merged 2 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions nixos/tests/forgejo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ let
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, (
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 gitea compatibility version string. Got '{api_version}' instead."
+ f"but should contain a forgejo+gitea compatibility version string. Got '{api_version}' instead."
)

server.succeed(
Expand All @@ -152,7 +152,7 @@ let
)
server.succeed(
"su -l forgejo -c 'GITEA_WORK_DIR=/var/lib/forgejo gitea admin user create "
+ "--username test --password totallysafe --email test@localhost'"
+ "--username test --password totallysafe --email test@localhost --must-change-password=false'"
)

api_token = server.succeed(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
diff --git a/package.json b/package.json
index 57dcfc2f7..c9f23dbf7 100644
index b50c52cf43..d6aafb8775 100644
--- a/package.json
+++ b/package.json
@@ -79,5 +79,8 @@
"defaults",
"not ie > 0",
"not ie_mob > 0"
@@ -98,5 +98,8 @@
},
"browserslist": [
"defaults"
- ]
+ ],
+ "scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let
pname = "forgejo-frontend";
inherit (forgejo) src version;

npmDepsHash = "sha256-uMPy4cqMDNZTpF+pk7YibXEJO1zxVfwlCeFzGgJBiU0=";
npmDepsHash = "sha256-BffoEbIzTU61bw3ECEm5eDHcav4S27MB5jQKsMprkcw=";

patches = [
./package-json-npm-build-frontend.patch
Expand All @@ -39,33 +39,17 @@ let
in
buildGoModule rec {
pname = "forgejo";
version = "1.21.11-1";
version = "7.0.0";

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
'';
hash = "sha256-oIx1aPrHgOWx13ocA3t7N5UdTgr+64tgC0XcEnhA/eE=";
};

vendorHash = "sha256-OuWNF+muWM6xqwkFxLIUsn/huqXj2VKg8BN9+JHVw58=";
vendorHash = "sha256-UcjaMi/4XYLdaJhi2j3UWqHqkpTbZBo6EwNXxdRIKLw=";

subPackages = [ "." ];

Expand Down Expand Up @@ -93,7 +77,7 @@ buildGoModule rec {
];

preConfigure = ''
export ldflags+=" -X code.gitea.io/gitea/routers/api/forgejo/v1.ForgejoVersion=$(cat FULL_VERSION) -X main.ForgejoVersion=$(cat FULL_VERSION)"
export ldflags+=" -X main.ForgejoVersion=$(GITEA_VERSION=${version} make show-version-api)"
'';

preBuild = ''
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
diff --git a/modules/setting/server.go b/modules/setting/server.go
index 183906268..fa02e8915 100644
index c20dd1949d..c9bcdce99a 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()
@@ -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@"
Expand Down
2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8468,8 +8468,6 @@ with pkgs;

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 { };
Expand Down