From nobody Wed Sep 04 21:12:44 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzZvd0tLzz5VPCX; Wed, 04 Sep 2024 21:12:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzZvd072mz4bNG; Wed, 4 Sep 2024 21:12:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LE2EWPslcO4zisu+D9eP8Pa3yG2QY6x9qg1+ny3vc9Q=; b=AqC4QywzMR6xBPE8nNEBwxiYm6CPjgrj94czyTdxE8ygBtZiWPyxMjZh6ayVjE0RXtw1tq UGeQ8MlqEQCX3rBSJOjzDkXPh1m/MJR4FGmIJnqMoyA4bJayLdMrBVTe41alzVsuAnUaNq 2XF8tSzVBzDSIQYtZffKRDCDByztbmVjCkd2ftjzA9Wuqbe4FnTVlB0WgDXJOKh20ly3Pw /t9Vntk73GXkgH3wYaVYkH92JkkqEjF3j6tj2wgTJ1gQ+08ASIRhp67yafb6LQBUj63ZrN foqfjmSM+w0NEahaO3UHH5J/w/P9FUZoegWnfFXqesRguPDRuXV+u/eIDWkdGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725484365; a=rsa-sha256; cv=none; b=oYzBnRmTnKG82QUH/tsixfWHy8pWchRWGwoSaki5XsNvzTJSY5NiYJV91fRZn2bb/lnyyt yCYRHh4g8E/2CVp6kk7uZQxAp8ci3B+qtOJDlQjoI2X03BXKOXgXQy/GfdWN0Zhb66r+HQ hRdZoSnKNBusxuVrHms0pn72uun8U9XBbr8E8vhq3zO6Ei+BccqdkyDxWuuUau6BqR3PVR CnnpqBTPfXNhwASt401JOnrH8XHRF2l1c9q36SsBrvxt25pJdDEe1o+9wjjk/O0zNtNXbE LWa0rYnqkS0QZTjvpB5YG+kWZut5XsnyNAwrwQ6YNi+e4c5LqrJ2h9Mi5H9uIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725484365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LE2EWPslcO4zisu+D9eP8Pa3yG2QY6x9qg1+ny3vc9Q=; b=MyQCUdeWSl33gC/xhH2PHBJTMSfCR9F8WjHlJD791/esYRV/tw4cB3Bsz5B+pKr+yn0yiR aart1pMwdLIIyHTzTBPH5+njStBwkxG13uNTDAeSRBl4s3dFfvGJ/BAI1CmRcmAgtGV7To OguSw9tLbCbDxM/mV5brEhGiFQpEJVuqmJy3BW3GtuiRZqwBDC5SgHfBb1s6zHzvAtI39C bEMkXcjAXwuvba8HMCk8FzGb07uFNKxGJPUZpfCDXzYymC72ypi2/iWktwvJULFdgMb8wp j7lb+kY5QNmGZvOB5pH5xBKl50Yk6YLvPI6OAbaU5TVh9846Bb/FJkzs7aMtjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WzZvc6r26zgPD; Wed, 4 Sep 2024 21:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 484LCiAJ070025; Wed, 4 Sep 2024 21:12:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484LCifs070022; Wed, 4 Sep 2024 21:12:44 GMT (envelope-from git) Date: Wed, 4 Sep 2024 21:12:44 GMT Message-Id: <202409042112.484LCifs070022@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Vladimir Druzenko Subject: git: 4abb8e753d46 - main - www/forgejo7: New port forgejo branch 7.x, copy from www/forgejo before update to 8.x List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vvd X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4abb8e753d4635821fa9377fde9433a4d2c5527a Auto-Submitted: auto-generated The branch main has been updated by vvd: URL: https://cgit.FreeBSD.org/ports/commit/?id=4abb8e753d4635821fa9377fde9433a4d2c5527a commit 4abb8e753d4635821fa9377fde9433a4d2c5527a Author: Vladimir Druzenko AuthorDate: 2024-09-04 20:53:13 +0000 Commit: Vladimir Druzenko CommitDate: 2024-09-04 21:12:16 +0000 www/forgejo7: New port forgejo branch 7.x, copy from www/forgejo before update to 8.x Copy from www/forgejo after commit be43fb2830c94e23e0d9aa49ef9b982b0ab31e2c "update to 7.0.4 (fixes security vulnerabilities)". PR: 280532 --- www/Makefile | 1 + www/forgejo7/Makefile | 87 +++++++++++++++++++++++++++++++++ www/forgejo7/distinfo | 3 ++ www/forgejo7/files/app.ini.sample.in | 93 ++++++++++++++++++++++++++++++++++++ www/forgejo7/files/forgejo.in | 65 +++++++++++++++++++++++++ www/forgejo7/files/pkg-message.in | 27 +++++++++++ www/forgejo7/pkg-descr | 5 ++ www/forgejo7/pkg-plist | 8 ++++ 8 files changed, 289 insertions(+) diff --git a/www/Makefile b/www/Makefile index 555a3fd23c1f..ec0336715f5b 100644 --- a/www/Makefile +++ b/www/Makefile @@ -186,6 +186,7 @@ SUBDIR += flickcurl SUBDIR += foreign-cdm SUBDIR += forgejo + SUBDIR += forgejo7 SUBDIR += formication SUBDIR += foswiki SUBDIR += free-sa-devel diff --git a/www/forgejo7/Makefile b/www/forgejo7/Makefile new file mode 100644 index 000000000000..a923be71c492 --- /dev/null +++ b/www/forgejo7/Makefile @@ -0,0 +1,87 @@ +PORTNAME= forgejo +DISTVERSIONPREFIX= v +DISTVERSION= 7.0.4 +CATEGORIES= www +MASTER_SITES= https://codeberg.org/forgejo/forgejo/releases/download/${DISTVERSIONPREFIX}${DISTVERSION}/ +DISTNAME= forgejo-src-${DISTVERSION} + +MAINTAINER= stb@lassitu.de +COMMENT= Compact self-hosted Git service +WWW= https://forgejo.org/ + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +RUN_DEPENDS= git:devel/git + +USES= cpe gmake go:1.22,no_targets +USE_RC_SUBR= forgejo + +EXTRACT_AFTER_ARGS= --strip-components 1 +SUB_FILES= app.ini.sample pkg-message +SUB_LIST= GITUSER=${USERS} + +NO_WRKSUBDIR= yes + +USERS= git +GROUPS= git + +PORTDATA= * + +OPTIONS_DEFINE= BINDATA GIT_LFS PAM SQLITE +OPTIONS_DEFAULT= BINDATA GIT_LFS PAM SQLITE +OPTIONS_SUB= yes + +BINDATA_DESC= Build a single monolithic binary, with all assets included +GIT_LFS_DESC= Support for Git Large File Storage (LFS) +PAM_DESC= Enable support for PAM + +BINDATA_VARS= GO_TAGS+=bindata +GIT_LFS_RUN_DEPENDS= git-lfs:devel/git-lfs +PAM_VARS= GO_TAGS+=pam +SQLITE_VARS= GO_TAGS+="sqlite sqlite_unlock_notify" + +.include + +.if ${OPSYS} == FreeBSD +DAEMONARGS= -S -l \$${forgejo_facility} -s \$${forgejo_priority} -T \ + \$${name} +.else +DAEMONARGS= -f +.endif + +SUB_LIST+= DAEMONARGS="${DAEMONARGS}" + +SSP_UNSAFE= true +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}" \ + GOFLAGS="-buildvcs=false" +ALL_TARGET= backend +MAKE_JOBS_UNSAFE= yes + +post-patch: + ${ECHO_CMD} ${DISTVERSION} >${WRKSRC}/VERSION + +# Too lazy to figure out why go install won't work. +do-install: +# Go binary is statically linked and cannot be stripped, so use +# INSTALL_SCRIPT. + ${INSTALL_SCRIPT} ${WRKSRC}/gitea \ + ${STAGEDIR}${PREFIX}/sbin/forgejo + @${MKDIR} ${STAGEDIR}${ETCDIR}/conf + ${INSTALL_DATA} ${WRKDIR}/app.ini.sample \ + ${STAGEDIR}${ETCDIR}/conf/app.ini.sample + ${INSTALL_DATA} ${WRKSRC}/custom/conf/app.example.ini \ + ${STAGEDIR}${ETCDIR}/conf/app.ini.defaults + ${MKDIR} ${STAGEDIR}${DATADIR} + ${MKDIR} ${STAGEDIR}/var/db/forgejo/data + ${MKDIR} ${STAGEDIR}/var/db/forgejo/forgejo-repositories + ${MKDIR} ${STAGEDIR}/var/log/forgejo + +do-install-BINDATA-off: + cd ${WRKSRC} && \ + ${COPYTREE_SHARE} "options public templates" ${STAGEDIR}${DATADIR} + +.include diff --git a/www/forgejo7/distinfo b/www/forgejo7/distinfo new file mode 100644 index 000000000000..e60439031aae --- /dev/null +++ b/www/forgejo7/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1718527772 +SHA256 (forgejo-src-7.0.4.tar.gz) = 881e55d92a4145238a8e7a39dd5c64d547c7629361005ded0393f33ec9e6bba4 +SIZE (forgejo-src-7.0.4.tar.gz) = 54935871 diff --git a/www/forgejo7/files/app.ini.sample.in b/www/forgejo7/files/app.ini.sample.in new file mode 100644 index 000000000000..d625a9ebabab --- /dev/null +++ b/www/forgejo7/files/app.ini.sample.in @@ -0,0 +1,93 @@ +# +# Sample Configuration for Forgejo using SQLite +# +# For information on the available settings, consult the online +# documentation, or see the accompanying file app.ini.defaults, which +# contains the settings incorporated into the forgejo binary. +# +# This sample configuration runs Forgejo with a local database. Before +# running this configuration, make sure to change the INTERNAL_TOKEN, +# JWT_SECRET, and SECRET_KEY variables. SECRET_KEY is a password of your +# choosing, INTERNAL_TOKEN is a 64-byte random number in BASE64 encoding, +# JWT_SECRET is a 32-byte random number in BASE64 encoding. +# +# You can generate the token using for example: +# openssl rand -base64 64 +# +# You can let Forgejo add these to the config for you; you need to make +# app.ini writeable by the git user. +# +# There are no pre-configured users; the first user to register becomes an +# admin. In this sample configuration, the HTTP server only listens on +# localhost. +# +# If you'd rather use the web-based installer, remove this conf/app.ini file +# and make %%PREFIX%%/etc/forgejo/conf writeable to the git user. + +APP_NAME = Forgejo: A self-hosted lightweight software forge +RUN_MODE = prod +RUN_USER = %%GITUSER%% + +[database] +DB_TYPE = sqlite3 +HOST = 127.0.0.1:3306 +NAME = forgejo +PASSWD = +PATH = /var/db/forgejo/forgejo.db +SSL_MODE = disable +USER = root + +[indexer] +ISSUE_INDEXER_PATH = /var/db/forgejo/indexers/issues.bleve + +[log] +LEVEL = Info +MODE = file +ROOT_PATH = /var/log/forgejo + +[mailer] +ENABLED = false + +[oauth2] +JWT_SECRET = CHANGE_ME + +[picture] +AVATAR_UPLOAD_PATH = /var/db/forgejo/data/avatars +DISABLE_GRAVATAR = true +ENABLE_FEDERATED_AVATAR = false + +[repository] +ROOT = /var/db/forgejo/forgejo-repositories +# Forgejo's default is 'bash', so if you have bash installed, you can comment +# this out. +SCRIPT_TYPE = sh + +[repository.upload] +TEMP_PATH = /var/db/forgejo/data/tmp/uploads + +[security] +INSTALL_LOCK = true +INTERNAL_TOKEN = CHANGE_ME +SECRET_KEY = CHANGE_ME + +[session] +PROVIDER = file +PROVIDER_CONFIG = /var/db/forgejo/data/sessions + +[server] +APP_DATA_PATH = /var/db/forgejo/data +DISABLE_SSH = false +DOMAIN = localhost +HTTP_ADDR = 127.0.0.1 +HTTP_PORT = 3000 +OFFLINE_MODE = false +ROOT_URL = http://localhost:3000/ +SSH_DOMAIN = %(DOMAIN)s +SSH_PORT = 22 + +[service] +DISABLE_REGISTRATION = false +ENABLE_CAPTCHA = true +ENABLE_NOTIFY_MAIL = false +REGISTER_EMAIL_CONFIRM = false +REQUIRE_SIGNIN_VIEW = false diff --git a/www/forgejo7/files/forgejo.in b/www/forgejo7/files/forgejo.in new file mode 100644 index 000000000000..c635f3a9a9b1 --- /dev/null +++ b/www/forgejo7/files/forgejo.in @@ -0,0 +1,65 @@ +#!/bin/sh + +# PROVIDE: forgejo +# REQUIRE: NETWORKING SYSLOG +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable forgejo: +# +#forgejo_enable="YES" + +. /etc/rc.subr + +name="forgejo" +rcvar="forgejo_enable" + +load_rc_config $name + +: ${forgejo_user:="%%GITUSER%%"} +: ${forgejo_enable:="NO"} +: ${forgejo_configcheck_enable:="YES"} +: ${forgejo_facility:="daemon"} +: ${forgejo_priority:="info"} +: ${forgejo_shared:="%%PREFIX%%/share/${name}"} +: ${forgejo_custom:="%%PREFIX%%/etc/${name}"} + +command="%%PREFIX%%/sbin/${name} web" +procname="%%PREFIX%%/sbin/${name}" +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 + if [ ! -e "$d" ]; then + mkdir "$d" + chown ${forgejo_user} "$d" + fi + done + /usr/sbin/daemon %%DAEMONARGS%% \ + -u ${forgejo_user} -p ${pidfile} \ + /usr/bin/env -i \ + "GITEA_WORK_DIR=${forgejo_shared}" \ + "GITEA_CUSTOM=${forgejo_custom}" \ + "HOME=${githome}" \ + "PATH=%%PREFIX%%/bin:${PATH}" \ + "USER=${forgejo_user}" \ + $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" diff --git a/www/forgejo7/files/pkg-message.in b/www/forgejo7/files/pkg-message.in new file mode 100644 index 000000000000..03164efe7264 --- /dev/null +++ b/www/forgejo7/files/pkg-message.in @@ -0,0 +1,27 @@ +[ +{ type: install + message: <