Skip to content
Snippets Groups Projects
Unverified Commit bfcf765a authored by Stefan Bethke's avatar Stefan Bethke Committed by Li-Wen Hsu
Browse files

www/forgejo: Update to 7.0.2

Also improve diagnostics prior to starting the service, add information
to pkg-message, and enable running the forgejo binary on the command
line more easily.

Release notes:
  https://codeberg.org/forgejo/forgejo/src/branch/forgejo/RELEASE-NOTES.md#7-0-2

PR:		278876
parent fa16f0ce
No related branches found
No related tags found
No related merge requests found
PORTNAME= forgejo
DISTVERSIONPREFIX= v
DISTVERSION= 1.21.10-0
PORTREVISION= 2
DISTVERSION= 7.0.2
CATEGORIES= www
MASTER_SITES= https://codeberg.org/forgejo/forgejo/releases/download/${DISTVERSIONPREFIX}${DISTVERSION}/
DISTNAME= forgejo-src-${DISTVERSION}
......@@ -15,12 +14,12 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= git:devel/git
USES= cpe gmake go:1.21,no_targets
USES= cpe gmake go:1.22,no_targets
USE_RC_SUBR= forgejo
EXTRACT_AFTER_ARGS= --strip-components 1
SUB_FILES+= app.ini.sample
SUB_LIST+= GITUSER=${USERS}
SUB_FILES= app.ini.sample pkg-message
SUB_LIST= GITUSER=${USERS}
NO_WRKSUBDIR= yes
......@@ -54,10 +53,11 @@ DAEMONARGS= -f
SUB_LIST+= DAEMONARGS="${DAEMONARGS}"
SSP_UNSAFE= true
# Default LDFLAGS are incompatible with build
MAKE_ENV= LDFLAGS="${LDFLAGS} ${EXTRA_LDFLAGS}"
LDFLAGS+= "'-X "code.gitea.io/gitea/modules/setting.CustomPath=${PREFIX}/etc/forgejo"'"
LDFLAGS+= "'-X "code.gitea.io/gitea/modules/setting.AppWorkPath=${PREFIX}/share/forgejo"'"
MAKE_ARGS= GOPATH=${WRKDIR} \
TAGS="${GO_TAGS}"
TAGS="${GO_TAGS}" \
GOFLAGS="-buildvcs=false"
ALL_TARGET= backend
MAKE_JOBS_UNSAFE= yes
......
TIMESTAMP = 1712360403
SHA256 (forgejo-src-1.21.10-0.tar.gz) = 0cc21835404e40355cf7125b479efebb1fecf2cc17d018d4d54521d75943caf5
SIZE (forgejo-src-1.21.10-0.tar.gz) = 58820868
TIMESTAMP = 1715265831
SHA256 (forgejo-src-7.0.2.tar.gz) = 39b2079be7671f2248dcc36377ae20be65f20695d7f968ae227c0fc55dacca06
SIZE (forgejo-src-7.0.2.tar.gz) = 54862292
......@@ -17,8 +17,9 @@ load_rc_config $name
: ${forgejo_user:="%%GITUSER%%"}
: ${forgejo_enable:="NO"}
: ${forgejo_configcheck_enable:="YES"}
: ${forgejo_facility:="daemon"}
: ${forgejo_priority:="debug"}
: ${forgejo_priority:="info"}
: ${forgejo_shared:="%%PREFIX%%/share/${name}"}
: ${forgejo_custom:="%%PREFIX%%/etc/${name}"}
......@@ -29,6 +30,7 @@ githome="$(eval echo ~${forgejo_user})"
pidfile="/var/run/${name}.pid"
start_cmd="${name}_start"
start_precmd="${name}_prestart"
forgejo_start() {
for d in /var/db/forgejo /var/log/forgejo; do
......@@ -48,4 +50,16 @@ forgejo_start() {
$command
}
forgejo_prestart() {
if checkyesno forgejo_configcheck_enable; then
if su -m ${forgejo_user} -c "%%PREFIX%%/sbin/${name} doctor check >/dev/null"; then
else
echo "cannot start ${name} because of configuration errors. Run" >&2
echo " su -m git -c '${name} doctor check'" >&2
echo "for further details"
return 1
fi
fi
}
run_rc_command "$1"
[
{ type: install
message: <<EOM
Before starting forgejo for the first time, you must set a number of
secrets in the configuration file. For your convenience, a sample file
has been copied to %%PREFIX%%/etc/forgejo/conf/app.ini.
You need to replace every occurence of CHANGE_ME in the file with
sensible values. Please refer to the official documentation at
https://forgejo.org for details.
You will also likely need to create directories for persistent storage.
Run
su -m git -c 'forgejo doctor check'
to check if all prerequisites have been met.
EOM
}
{ type: upgrade
maximum_version: "1.21"
message: <<EOM
Since forgejo version 7, the startup script will run forgejo doctor check
to verify that forgejo can be started successfully. If you are sure that
forgejo will start even if doctor has identified an issue, you can disable
the check by setting forgejo_configcheck_enabled=NO in rc.conf.
EOM
}
]
[
{ type: install
message: <<EOM
Before starting forgejo you must create the main configuration file.
cp /usr/local/etc/forgejo/conf/app.ini.sample /usr/local/etc/forgejo/conf/app.ini
${EDITOR} /usr/local/etc/forgejo/conf/app.ini
You need to replace every occurence of CHANGE_ME in the file with sensitive
values. Please refer to the official documentation for details.
EOM
}
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment