From fc86b25587c611b239cbabed7edb9f93d44a697a Mon Sep 17 00:00:00 2001 From: Dan Ponte Date: Mon, 1 Aug 2022 21:11:09 -0400 Subject: [PATCH] add gitea --- www/gitea/Makefile | 75 ++++++++++++++++++++++++ www/gitea/Makefile.orig | 75 ++++++++++++++++++++++++ www/gitea/Makefile.rej | 13 +++++ www/gitea/attachment.cgi?id=235569 | 67 +++++++++++++++++++++ www/gitea/distinfo | 3 + www/gitea/distinfo.orig | 3 + www/gitea/files/app.ini.sample.in | 93 ++++++++++++++++++++++++++++++ www/gitea/files/gitea.in | 51 ++++++++++++++++ www/gitea/pkg-descr | 6 ++ www/gitea/pkg-message | 30 ++++++++++ www/gitea/pkg-plist | 3 + 11 files changed, 419 insertions(+) create mode 100644 www/gitea/Makefile create mode 100644 www/gitea/Makefile.orig create mode 100644 www/gitea/Makefile.rej create mode 100644 www/gitea/attachment.cgi?id=235569 create mode 100644 www/gitea/distinfo create mode 100644 www/gitea/distinfo.orig create mode 100644 www/gitea/files/app.ini.sample.in create mode 100644 www/gitea/files/gitea.in create mode 100644 www/gitea/pkg-descr create mode 100644 www/gitea/pkg-message create mode 100644 www/gitea/pkg-plist diff --git a/www/gitea/Makefile b/www/gitea/Makefile new file mode 100644 index 0000000..a97b896 --- /dev/null +++ b/www/gitea/Makefile @@ -0,0 +1,75 @@ +PORTNAME= gitea +DISTVERSIONPREFIX= v +DISTVERSION= 1.17.0 +CATEGORIES= www +MASTER_SITES= https://github.com/go-gitea/gitea/releases/download/${DISTVERSIONPREFIX}${DISTVERSION}/ +DISTNAME= gitea-src-${DISTVERSION} +EXTRACT_AFTER_ARGS= --strip-components 1 # since 1.17.0, archive includes gitea-src-VERSION directory + +MAINTAINER= stb@lassitu.de +COMMENT= Compact self-hosted Git service + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +RUN_DEPENDS= git:devel/git + +USES= cpe gmake go:no_targets +USE_RC_SUBR= gitea + +SUB_FILES+= app.ini.sample +SUB_LIST+= GITUSER=${USERS} + +NO_WRKSUBDIR= yes + +USERS= git +GROUPS= git + +PORTDATA= * + +OPTIONS_DEFINE= BINDATA GIT_LFS PAM SQLITE +OPTIONS_DEFAULT= 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 \$${gitea_facility} -s \$${gitea_priority} -T \$${name} +.else +DAEMONARGS= -f +.endif + +SUB_LIST+= DAEMONARGS="${DAEMONARGS}" + +SSP_UNSAFE= true +# Default LDFLAGS are incompatible with build +MAKE_ENV= LDFLAGS="${LDFLAGS} ${EXTRA_LDFLAGS}" +MAKE_ARGS= GOPATH=${WRKDIR} TAGS="${GO_TAGS}" +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 + @${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 + +do-install-BINDATA-off: + cd ${WRKSRC} && ${COPYTREE_SHARE} "options public templates" ${STAGEDIR}${DATADIR} + +.include diff --git a/www/gitea/Makefile.orig b/www/gitea/Makefile.orig new file mode 100644 index 0000000..f14bf24 --- /dev/null +++ b/www/gitea/Makefile.orig @@ -0,0 +1,75 @@ +PORTNAME= gitea +DISTVERSIONPREFIX= v +DISTVERSION= 1.16.8 +PORTREVISION= 2 +CATEGORIES= www +MASTER_SITES= https://github.com/go-gitea/gitea/releases/download/${DISTVERSIONPREFIX}${DISTVERSION}/ +DISTNAME= gitea-src-${DISTVERSION} + +MAINTAINER= stb@lassitu.de +COMMENT= Compact self-hosted Git service + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +RUN_DEPENDS= git:devel/git + +USES= cpe gmake go:no_targets +USE_RC_SUBR= gitea + +SUB_FILES+= app.ini.sample +SUB_LIST+= GITUSER=${USERS} + +NO_WRKSUBDIR= yes + +USERS= git +GROUPS= git + +PORTDATA= * + +OPTIONS_DEFINE= BINDATA GIT_LFS PAM SQLITE +OPTIONS_DEFAULT= 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 \$${gitea_facility} -s \$${gitea_priority} -T \$${name} +.else +DAEMONARGS= -f +.endif + +SUB_LIST+= DAEMONARGS="${DAEMONARGS}" + +SSP_UNSAFE= true +# Default LDFLAGS are incompatible with build +MAKE_ENV= LDFLAGS="${LDFLAGS} ${EXTRA_LDFLAGS}" +MAKE_ARGS= GOPATH=${WRKDIR} TAGS="${GO_TAGS}" +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 + @${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 + +do-install-BINDATA-off: + cd ${WRKSRC} && ${COPYTREE_SHARE} "options public templates" ${STAGEDIR}${DATADIR} + +.include diff --git a/www/gitea/Makefile.rej b/www/gitea/Makefile.rej new file mode 100644 index 0000000..f126728 --- /dev/null +++ b/www/gitea/Makefile.rej @@ -0,0 +1,13 @@ +@@ -1,10 +1,10 @@ + PORTNAME= gitea + DISTVERSIONPREFIX= v +-DISTVERSION= 1.16.8 +-PORTREVISION= 2 ++DISTVERSION= 1.17.0 + CATEGORIES= www + MASTER_SITES= https://github.com/go-gitea/gitea/releases/download/${DISTVERSIONPREFIX}${DISTVERSION}/ + DISTNAME= gitea-src-${DISTVERSION} ++EXTRACT_AFTER_ARGS= --strip-components 1 # since 1.17.0, archive includes gitea-src-VERSION directory + + MAINTAINER= stb@lassitu.de + COMMENT= Compact self-hosted Git service diff --git a/www/gitea/attachment.cgi?id=235569 b/www/gitea/attachment.cgi?id=235569 new file mode 100644 index 0000000..ea962b2 --- /dev/null +++ b/www/gitea/attachment.cgi?id=235569 @@ -0,0 +1,67 @@ +diff --git a/security/vuxml/vuln-2022.xml b/security/vuxml/vuln-2022.xml +index c7e15af99..95eac5d3e 100644 +--- a/security/vuxml/vuln-2022.xml ++++ b/security/vuxml/vuln-2022.xml +@@ -1,3 +1,34 @@ ++ ++ gitea -- multiple issues ++ ++ ++ gitea ++ 1.17.0 ++ ++ ++ ++ ++

The Gitea team reports:

++
++

Use git.HOME_PATH for Git HOME directory

++
++
++

Add write check for creating Commit status

++
++
++

Remove deprecated SSH ciphers from default

++
++ ++
++ ++ https://github.com/go-gitea/gitea/releases/tag/v1.16.9 ++ ++ ++ 2022-07-12 ++ 2022-07-30 ++ ++
++ + + Gitlab -- multiple vulnerabilities + +diff --git a/www/gitea/Makefile b/www/gitea/Makefile +index f14bf2435..a97b896e5 100644 +--- a/www/gitea/Makefile ++++ b/www/gitea/Makefile +@@ -1,10 +1,10 @@ + PORTNAME= gitea + DISTVERSIONPREFIX= v +-DISTVERSION= 1.16.8 +-PORTREVISION= 2 ++DISTVERSION= 1.17.0 + CATEGORIES= www + MASTER_SITES= https://github.com/go-gitea/gitea/releases/download/${DISTVERSIONPREFIX}${DISTVERSION}/ + DISTNAME= gitea-src-${DISTVERSION} ++EXTRACT_AFTER_ARGS= --strip-components 1 # since 1.17.0, archive includes gitea-src-VERSION directory + + MAINTAINER= stb@lassitu.de + COMMENT= Compact self-hosted Git service +diff --git a/www/gitea/distinfo b/www/gitea/distinfo +index 384d09b62..3880cbee1 100644 +--- a/www/gitea/distinfo ++++ b/www/gitea/distinfo +@@ -1,3 +1,3 @@ +-TIMESTAMP = 1652939095 +-SHA256 (gitea-src-1.16.8.tar.gz) = 5bf01b45f9c441f9d38d727cc1328414e4e5778ac5b01bc98979d82bc520a23d +-SIZE (gitea-src-1.16.8.tar.gz) = 53659731 ++TIMESTAMP = 1659214174 ++SHA256 (gitea-src-1.17.0.tar.gz) = a016c0836c50e7c74b0428e170a32851fdf6724a057e71501cbdf3de900a5b56 ++SIZE (gitea-src-1.17.0.tar.gz) = 52642977 diff --git a/www/gitea/distinfo b/www/gitea/distinfo new file mode 100644 index 0000000..3880cbe --- /dev/null +++ b/www/gitea/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1659214174 +SHA256 (gitea-src-1.17.0.tar.gz) = a016c0836c50e7c74b0428e170a32851fdf6724a057e71501cbdf3de900a5b56 +SIZE (gitea-src-1.17.0.tar.gz) = 52642977 diff --git a/www/gitea/distinfo.orig b/www/gitea/distinfo.orig new file mode 100644 index 0000000..384d09b --- /dev/null +++ b/www/gitea/distinfo.orig @@ -0,0 +1,3 @@ +TIMESTAMP = 1652939095 +SHA256 (gitea-src-1.16.8.tar.gz) = 5bf01b45f9c441f9d38d727cc1328414e4e5778ac5b01bc98979d82bc520a23d +SIZE (gitea-src-1.16.8.tar.gz) = 53659731 diff --git a/www/gitea/files/app.ini.sample.in b/www/gitea/files/app.ini.sample.in new file mode 100644 index 0000000..f0e6c81 --- /dev/null +++ b/www/gitea/files/app.ini.sample.in @@ -0,0 +1,93 @@ +# +# Sample Configuration for Gitea 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 gitea binary. +# +# This sample configuration runs Gitea 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 Gitea 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/gitea/conf writeable to the git user. + +APP_NAME = Gitea: Git with a cup of tea +RUN_USER = %%GITUSER%% +RUN_MODE = prod + +[database] +DB_TYPE = sqlite3 +HOST = 127.0.0.1:3306 +NAME = gitea +PASSWD = +PATH = /var/db/gitea/gitea.db +SSL_MODE = disable +USER = root + +[indexer] +ISSUE_INDEXER_PATH = /var/db/gitea/indexers/issues.bleve + +[log] +ROOT_PATH = /var/log/gitea +MODE = file +LEVEL = Info + +[mailer] +ENABLED = false + +[oauth2] +JWT_SECRET = D56bmu6xCtEKs9vKKgMKnsa4X9FDwo64HVyaS4fQ4mY + +[picture] +AVATAR_UPLOAD_PATH = /var/db/gitea/data/avatars +DISABLE_GRAVATAR = false +ENABLE_FEDERATED_AVATAR = false + +[repository] +ROOT = /var/db/gitea/gitea-repositories +# Gitea's default is 'bash', so if you have bash installed, you can comment +# this out. +SCRIPT_TYPE = sh + +[repository.upload] +TEMP_PATH = /var/db/gitea/data/tmp/uploads + +[security] +INSTALL_LOCK = true +INTERNAL_TOKEN = 1FFhAklka01JhgJTRUrFujWYiv4ijqcTIfXJ9o4n1fWxz+XVQdXhrqDTlsnD7fvz7gugdhgkx0FY2Lx6IBdPQw== +SECRET_KEY = ChangeMeBeforeRunning + +[session] +PROVIDER = file +PROVIDER_CONFIG = /var/db/gitea/data/sessions + +[server] +DOMAIN = localhost +HTTP_ADDR = 127.0.0.1 +HTTP_PORT = 3000 +ROOT_URL = http://localhost:3000/ +DISABLE_SSH = false +SSH_DOMAIN = %(DOMAIN)s +SSH_PORT = 22 +OFFLINE_MODE = false +APP_DATA_PATH = /var/db/gitea/data + +[service] +REGISTER_EMAIL_CONFIRM = false +ENABLE_NOTIFY_MAIL = false +DISABLE_REGISTRATION = false +ENABLE_CAPTCHA = true +REQUIRE_SIGNIN_VIEW = false diff --git a/www/gitea/files/gitea.in b/www/gitea/files/gitea.in new file mode 100644 index 0000000..5e75ad5 --- /dev/null +++ b/www/gitea/files/gitea.in @@ -0,0 +1,51 @@ +#!/bin/sh + +# PROVIDE: gitea +# REQUIRE: NETWORKING SYSLOG +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable gitea: +# +#gitea_enable="YES" + +. /etc/rc.subr + +name="gitea" +rcvar="gitea_enable" + +load_rc_config $name + +: ${gitea_user:="%%GITUSER%%"} +: ${gitea_enable:="NO"} +: ${gitea_facility:="daemon"} +: ${gitea_priority:="debug"} +: ${gitea_shared:="%%PREFIX%%/share/${name}"} +: ${gitea_custom:="%%PREFIX%%/etc/${name}"} + +command="%%PREFIX%%/sbin/${name} web" +procname="%%PREFIX%%/sbin/${name}" +githome="$(eval echo ~${gitea_user})" + +pidfile="/var/run/${name}.pid" + +start_cmd="${name}_start" + +gitea_start() { + for d in /var/db/gitea /var/log/gitea; do + if [ ! -e "$d" ]; then + mkdir "$d" + chown ${gitea_user} "$d" + fi + done + /usr/sbin/daemon %%DAEMONARGS%% \ + -u ${gitea_user} -p ${pidfile} \ + /usr/bin/env -i \ + "GITEA_WORK_DIR=${gitea_shared}" \ + "GITEA_CUSTOM=${gitea_custom}" \ + "HOME=${githome}" \ + "PATH=%%PREFIX%%/bin:${PATH}" \ + "USER=${gitea_user}" \ + $command +} + +run_rc_command "$1" diff --git a/www/gitea/pkg-descr b/www/gitea/pkg-descr new file mode 100644 index 0000000..b9def9d --- /dev/null +++ b/www/gitea/pkg-descr @@ -0,0 +1,6 @@ +A self-hosted Git service. + +Gitea is a community managed fork of Gogs, lightweight code hosting solution +written in Go and published under the MIT license. + +WWW: https://gitea.io/en-US/ diff --git a/www/gitea/pkg-message b/www/gitea/pkg-message new file mode 100644 index 0000000..7f10083 --- /dev/null +++ b/www/gitea/pkg-message @@ -0,0 +1,30 @@ +[ +{ type: upgrade + maximum_version: 1.7.6 + message: <