Bug 284267 - [NEW PORT] www/codeberg-pages-server "Github Pages"-like pages server for Gitea/Forgejo
Summary: [NEW PORT] www/codeberg-pages-server "Github Pages"-like pages server for Git...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Vladimir Druzenko
URL:
Keywords:
Depends on: 284764
Blocks:
  Show dependency treegraph
 
Reported: 2025-01-22 18:20 UTC by Orville Q. Song
Modified: 2025-03-17 09:15 UTC (History)
3 users (show)

See Also:


Attachments
PATCH (8.02 KB, patch)
2025-01-22 18:20 UTC, Orville Q. Song
no flags Details | Diff
NEW PATCH for codeberg-pages-server (2025/01/25) (8.05 KB, patch)
2025-01-24 17:12 UTC, Orville Q. Song
no flags Details | Diff
PATCH (2025/01/26) (8.12 KB, patch)
2025-01-26 15:16 UTC, Orville Q. Song
no flags Details | Diff
PATCH: codeberg-pages-server V6.2.1 (8.13 KB, patch)
2025-02-28 03:07 UTC, Orville Q. Song
no flags Details | Diff
PATCH: Codeberg Pages Server v6.2.1 (7.52 KB, patch)
2025-02-28 14:37 UTC, Orville Q. Song
no flags Details | Diff
PATCH: Codeberg Pages Server v6.2.1-r1 (8.87 KB, patch)
2025-03-02 03:24 UTC, Orville Q. Song
no flags Details | Diff
PATCH: Codeberg Pages Server v6.2.1-r2 (9.08 KB, patch)
2025-03-06 15:44 UTC, Orville Q. Song
no flags Details | Diff
PATCH: Codeberg Pages Server v6.2.1-r3 (8.57 KB, patch)
2025-03-14 04:03 UTC, Orville Q. Song
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Orville Q. Song 2025-01-22 18:20:33 UTC
Created attachment 256908 [details]
PATCH

Gitea lacks the ability to host static pages from Git. The Codeberg Pages Server addresses this lack by implementing a standalone service that connects to Gitea via API. It is suitable to be deployed by other Gitea instances, too, to offer static pages hosting to their users.

https://codeberg.org/Codeberg/pages-server
Comment 1 Orville Q. Song 2025-01-24 17:12:25 UTC
Created attachment 256956 [details]
NEW PATCH for codeberg-pages-server (2025/01/25)

This new PATCH mainly modifies the rc and log file names to match the package name (using - instead of _).
Comment 2 Orville Q. Song 2025-01-26 15:16:09 UTC
Created attachment 257008 [details]
PATCH (2025/01/26)

Sorry, I am still learning how to package software for FreeBSD ports. After completing another port (devel/woodpecker-[server,agent,cli]) today, I realized that some parts of this port could be improved, so I submitt a patch version again.
Comment 3 Orville Q. Song 2025-02-28 03:07:56 UTC
Created attachment 258052 [details]
PATCH: codeberg-pages-server V6.2.1

Update to v6.2.1
Comment 4 Orville Q. Song 2025-02-28 14:37:41 UTC
Created attachment 258075 [details]
PATCH: Codeberg Pages Server v6.2.1
Comment 5 Vladimir Druzenko freebsd_committer freebsd_triage 2025-02-28 17:55:13 UTC
Build error in poudriere 14.2 amd64:
===>  Building for codeberg-pages-server-6.2.1
cd /wrkdirs/usr/ports/www/codeberg-pages-server/work/pages-server &&  PATH=/wrkdirs/usr/ports/www/codeberg-pages-server/work/bin:/wrkdirs/usr/ports/www/codeberg-pages-server/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/nonexistent/bin just build-tag v6.2.1
CGO_ENABLED=1 go build -tags 'sqlite sqlite_unlock_notify netgo' -trimpath -ldflags '-s -w -X "codeberg.org/codeberg/pages/server/version.Version=v6.2.1" -extldflags "-static" -linkmode external' -v -o build/codeberg-pages-server ./
go: go: could not create module cache: mkdir /nonexistent: permission denied
error: Recipe `build-tag` failed on line 16 with exit code 1
*** Error code 1

Stop.
make: stopped in /usr/ports/www/codeberg-pages-server
Comment 6 Vladimir Druzenko freebsd_committer freebsd_triage 2025-02-28 18:02:14 UTC
Ignore last message - it was from build not with last patch.

But this error is with last patch:
go: downloading go1.24.0 (freebsd/amd64)
Port require go 1.24.
Comment 7 Vladimir Druzenko freebsd_committer freebsd_triage 2025-02-28 18:13:24 UTC
This is go 1.24-devel, but it installs go-devel and gofmt-devel instead go124 and gofmt124.
Comment 8 Vladimir Druzenko freebsd_committer freebsd_triage 2025-02-28 19:02:59 UTC
Another build error:
/bin/sh: /usr/ports/www/codeberg-pages-server/files/config-generater.sh: Permission denied
*** Error code 126

Stop.
make: stopped in /usr/ports/www/codeberg-pages-server

About go 1.24: go1.24.0 (released 2025-02-11)
https://tip.golang.org/doc/devel/release#go1.24.0
This port require go 1.24 - you can create PR with request to create new port lang/go124 and better with patches: (1) copy from lang/go-devel to lang/go124, (2) update to release 1.24.0.
Comment 9 Yusuf Yaman freebsd_committer freebsd_triage 2025-02-28 20:41:21 UTC
(In reply to Vladimir Druzenko from comment #6)
Recenlty I created a PR for a port i want to maintain and it downloads go 1.24 during build in poudriere, isn't that allowed and should i use the go 1.24 port if it's become available?
Comment 10 Yusuf Yaman freebsd_committer freebsd_triage 2025-02-28 20:50:36 UTC
(In reply to Vladimir Druzenko from comment #8)
There is already a PR for go124.

See bug #284764
Comment 11 Vladimir Druzenko freebsd_committer freebsd_triage 2025-02-28 21:17:26 UTC
(In reply to Yusuf Yaman from comment #9)
If port exist - use from ports.

(In reply to Yusuf Yaman from comment #10)
Thanks.
Comment 12 Orville Q. Song 2025-03-02 03:24:52 UTC
Created attachment 258168 [details]
PATCH: Codeberg Pages Server v6.2.1-r1

This patch fixed:

- replace go version in go.mod from 1.24 to 1.23
- replace config-generator.sh with config-generator.go, remove bash from build dependent.
- Better commit message.
- Format Makefile with portclippy.
Comment 13 Vladimir Druzenko freebsd_committer freebsd_triage 2025-03-04 18:09:52 UTC
Is it your email: orville@anislet.dev?
Use same email in bugzilla and in MAINTAINER field.
Comment 14 Vladimir Druzenko freebsd_committer freebsd_triage 2025-03-04 18:17:03 UTC
It still downloads go 1.24.0:
[/usr/ports/www/codeberg-pages-server]$ make makesum
===>  License EUPL12 accepted by the user
===>  License EUPL12 accepted by the user
===>   codeberg-pages-server-6.2.1 depends on file: /usr/local/sbin/pkg - found
===>   codeberg-pages-server-6.2.1 depends on file: /usr/local/bin/go123 - found
===>   codeberg-pages-server-6.2.1 depends on package: ca_root_nss>0 - found
=> v6.2.1.zip doesn't seem to exist in /usr/ports/distfiles/go/www_codeberg-pages-server/codeberg-pages-server-v6.2.1.
=> Attempting to fetch https://codeberg.org/Codeberg/pages-server/archive/v6.2.1.zip
v6.2.1.zip                                             183 kB  871 kBps    00s
=> go.mod doesn't seem to exist in /usr/ports/distfiles/go/www_codeberg-pages-server/codeberg-pages-server-v6.2.1.
=> Attempting to fetch https://codeberg.org/Codeberg/pages-server/archive/go.mod
fetch: https://codeberg.org/Codeberg/pages-server/archive/go.mod: Internal Server Error
=> Attempting to fetch https://codeberg.org/Codeberg/pages-server/raw/tag/v6.2.1/go.mod
go.mod                                                  12 kB   62 MBps    00s
===> Fetching all distfiles required by codeberg-pages-server-6.2.1 for building
===> Fetching codeberg.org/codeberg/pages dependencies
go: downloading go1.24.0 (freebsd/amd64)
Comment 15 Orville Q. Song 2025-03-06 15:44:53 UTC
Created attachment 258355 [details]
PATCH: Codeberg Pages Server v6.2.1-r2
Comment 16 Orville Q. Song 2025-03-06 15:45:59 UTC
Comment on attachment 258355 [details]
PATCH: Codeberg Pages Server v6.2.1-r2

This patch fixed unwanted download of go 1.24.0 during fetch stage by add go-pre-post-fetch step to patch go.mod used by go-post-fetch step. replace "go 1.24.0" with "go 1.23.0"
Comment 17 Orville Q. Song 2025-03-06 15:49:15 UTC
(In reply to Vladimir Druzenko from comment #13)
Yes that is my email.

I haven't migrate my email server to FreeBSD yet, I'll change it soon as the server is migrated.
Comment 18 Vladimir Druzenko freebsd_committer freebsd_triage 2025-03-06 21:23:03 UTC
Once go124 is in ports, this port does not need extra patches "1.24=>1.23".
Build errors in poudriere 14.2 amd64:
codeberg.org/codeberg/pages/server/certificates
codeberg.org/codeberg/pages/server/acme
codeberg.org/codeberg/pages/server
codeberg.org/codeberg/pages
failed to initialize build cache at /nonexistent/.cache/go-build: mkdir /nonexistent: permission denied
*** Error code 1
Comment 19 Orville Q. Song 2025-03-14 02:53:17 UTC
(In reply to Vladimir Druzenko from comment #18)

Did not encounter the same error, poudriere with ccache enabled, 14.2 jail, arm64.

codeberg.org/codeberg/pages/server/certificates
codeberg.org/codeberg/pages/server/acme
codeberg.org/codeberg/pages/server
codeberg.org/codeberg/pages
===========================================================================
=>> Checking for filesystem violations... done
=======================<phase: run-depends    >============================
===== env: DEVELOPER_MODE=yes USE_PACKAGE_DEPENDS_ONLY=1 USER=root UID=0 GID=0
===========================================================================
=>> Recording filesystem state for prestage... done
=======================<phase: stage          >============================
===== env: DEVELOPER_MODE=yes STRICT_DEPENDS=yes USER=root UID=0 GID=0
===>  Staging for codeberg-pages-server-6.2.1_2
===>   Generating temporary packing list

This is really confusing...especially since I'm using the go.mk's build stage directly instead of building my own build stage.
Comment 20 Orville Q. Song 2025-03-14 03:08:56 UTC
(In reply to Orville Q. Song from comment #19)

OK I see it now. I did not enable the build with non root option.

Though it still confusing as I'm using the default build stage provided by go.mk...
Comment 21 Orville Q. Song 2025-03-14 04:03:17 UTC
Created attachment 258649 [details]
PATCH: Codeberg Pages Server v6.2.1-r3

This PATCH fix:

- using go 1.24
- fix permission issue during post-build stage with non-root user.
Comment 22 commit-hook freebsd_committer freebsd_triage 2025-03-15 18:31:33 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0397053f21db7b5f249b4c837b1a8ee9159a32f0

commit 0397053f21db7b5f249b4c837b1a8ee9159a32f0
Author:     Orville Q. Song <orville@anislet.dev>
AuthorDate: 2025-03-15 18:27:43 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2025-03-15 18:29:58 +0000

    www/codeberg-pages-server: New port: "Github Pages"-like pages server for Gitea/Forgejo

    Gitea lacks the ability to host static pages from Git. The Codeberg
    Pages Server addresses this lack by implementing a standalone service
    that connects to Gitea via API. It is suitable to be deployed by other
    Gitea instances, too, to offer static pages hosting to their users.

    https://codeberg.org/Codeberg/pages-server

    PR:     284267

 www/Makefile                                       |  1 +
 www/codeberg-pages-server/Makefile (new)           | 47 ++++++++++++
 www/codeberg-pages-server/distinfo (new)           |  5 ++
 .../files/codeberg-pages-server.in (new)           | 46 ++++++++++++
 .../files/config-generater.go (new)                | 83 ++++++++++++++++++++++
 www/codeberg-pages-server/pkg-descr (new)          |  5 ++
 www/codeberg-pages-server/pkg-plist (new)          |  4 ++
 7 files changed, 191 insertions(+)
Comment 23 Vladimir Druzenko freebsd_committer freebsd_triage 2025-03-15 18:35:46 UTC
Thanks.
Comment 24 Orville Q. Song 2025-03-17 09:15:14 UTC
(In reply to Vladimir Druzenko from comment #23)

Thank you.