Index: UPDATING =================================================================== --- UPDATING +++ UPDATING @@ -5,6 +5,20 @@ You should get into the habit of checking this file for changes each time you update your ports collection, before attempting any port upgrades. +20171212: + AFFECTS: users of devel/gogs + AUTHOR: dg@syrec.org + + Gogs user has been changed to "git" and configuration files are now + located in /usr/local/etc/gogs. Users should update ownership of the + existing Gogs directories with + + # chown -R git:git /var/db/gogs + # chown -R git:git /var/log/gogs + + and either move or merge the contents of /var/db/gogs/home/.ssh with + /usr/local/git/.ssh. After migration, /var/db/gogs/home can be removed. + 20171205: AFFECTS: users of dns/powerdns AUTHOR: krion@FreeBSD.org Index: devel/gogs/Makefile =================================================================== --- devel/gogs/Makefile +++ devel/gogs/Makefile @@ -3,6 +3,7 @@ PORTNAME= gogs DISTVERSIONPREFIX= v DISTVERSION= 0.11.34 +PORTREVISION= 1 CATEGORIES= devel www MAINTAINER= dg@syrec.org @@ -20,8 +21,8 @@ OPTIONS_DEFINE= DOCS -USERS= gogs -GROUPS= gogs +USERS= git +GROUPS= git GOGS_DBDIR?= /var/db/gogs GOGS_LOGDIR?= /var/log/gogs @@ -31,8 +32,7 @@ gogs-service \ gogs-rm-data \ pkg-message -SUB_LIST= PREFIX=${PREFIX} \ - PORTNAME=${PORTNAME} \ +SUB_LIST= PORTNAME=${PORTNAME} \ PORTNAME_FANCY=${PORTNAME_FANCY} \ GOGS_USER=${USERS} \ GOGS_DBDIR=${GOGS_DBDIR} \ @@ -46,8 +46,10 @@ post-patch: @${REINPLACE_CMD} -i '' \ - -e 's|^ROOT =$$|ROOT = ${GOGS_DBDIR}/repositories|' \ + -e '/^# \!\!\!/d' \ -e 's|^RUN_USER = git$$|RUN_USER = ${USERS}|' \ + -e 's|^RUN_MODE = dev$$|RUN_MODE = prod|' \ + -e 's|^ROOT =$$|ROOT = ${GOGS_DBDIR}/repositories|' \ -e 's|^DB_TYPE = mysql$$|DB_TYPE = sqlite3|' \ ${WRKSRC}/conf/app.ini @@ -62,10 +64,11 @@ ${INSTALL_SCRIPT} ${WRKDIR}/gogs-rm-data ${STAGEDIR}${PREFIX}/bin/ ${INSTALL_SCRIPT} ${WRKDIR}/gogs-service ${STAGEDIR}${PREFIX}/etc/rc.d/gogs @(cd ${WRKSRC} && ${COPYTREE_SHARE} "conf public templates" ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}) - @${MKDIR} ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}/custom/conf - ${INSTALL_DATA} ${WRKSRC}/conf/app.ini ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}/custom/conf/ - @${MKDIR} ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}/custom/https - @${MKDIR} ${STAGEDIR}${GOGS_DBDIR}/data ${STAGEDIR}${GOGS_DBDIR}/repositories ${STAGEDIR}${GOGS_DBDIR}/home + @${MKDIR} ${STAGEDIR}${ETCDIR}/conf + @${MKDIR} ${STAGEDIR}${ETCDIR}/https + ${INSTALL_DATA} ${WRKSRC}/conf/app.ini ${STAGEDIR}${ETCDIR}/conf/app.ini.sample + @${RLN} ${STAGEDIR}${ETCDIR} ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}/custom + @${MKDIR} ${STAGEDIR}${GOGS_DBDIR}/data ${STAGEDIR}${GOGS_DBDIR}/repositories @${LN} -sf ${GOGS_DBDIR}/data ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/data @${MKDIR} ${STAGEDIR}${GOGS_LOGDIR} @${LN} -sf ${GOGS_LOGDIR} ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/log Index: devel/gogs/files/gogs-rm-data.in =================================================================== --- devel/gogs/files/gogs-rm-data.in +++ devel/gogs/files/gogs-rm-data.in @@ -17,5 +17,4 @@ esac done -rm -rf %%GOGS_DBDIR%%/*/* %%GOGS_DBDIR%%/*/.ssh \ - %%GOGS_LOGDIR%%/* /var/log/gogs.log +rm -rf %%GOGS_DBDIR%%/*/* %%GOGS_LOGDIR%%/* /var/log/gogs.log Index: devel/gogs/files/gogs-service.in =================================================================== --- devel/gogs/files/gogs-service.in +++ devel/gogs/files/gogs-service.in @@ -24,6 +24,7 @@ load_rc_config ${name} : ${%%PORTNAME%%_enable="NO"} +: ${%%PORTNAME%%_config="%%ETCDIR%%/conf/app.ini"} is_process_running() { local pidfile=$1 @@ -43,11 +44,11 @@ return 1 fi export USER=%%GOGS_USER%% - export HOME=$(getent passwd %%GOGS_USER%% | cut -d: -f6) + export HOME=$(echo ~%%GOGS_USER%%) touch $logfile chmod 640 $logfile cd %%PREFIX%%/libexec/%%PORTNAME%% - /usr/sbin/daemon -P $pidfile -u %%GOGS_USER%% %%PREFIX%%/libexec/%%PORTNAME%%/%%PORTNAME%% web >>$logfile 2>&1 + /usr/sbin/daemon -P $pidfile -u %%GOGS_USER%% %%PREFIX%%/libexec/%%PORTNAME%%/%%PORTNAME%% web --config ${%%PORTNAME%%_config} >>$logfile 2>&1 if is_process_running $pidfile; then echo "started %%PORTNAME%% (pid=$(cat $pidfile))" else Index: devel/gogs/files/gogs.in =================================================================== --- devel/gogs/files/gogs.in +++ devel/gogs/files/gogs.in @@ -2,5 +2,5 @@ cd %%PREFIX%%/libexec/%%PORTNAME%% && USER=%%GOGS_USER%% \ -HOME=$(getent passwd %%GOGS_USER%% | cut -d: -f6) \ -su -m %%GOGS_USER%% -c './%%PORTNAME%% web' +HOME=$(echo ~%%GOGS_USER%%) \ +su -m %%GOGS_USER%% -c './%%PORTNAME%% web --config %%ETCDIR%%/conf/app.ini' Index: devel/gogs/files/pkg-message.in =================================================================== --- devel/gogs/files/pkg-message.in +++ devel/gogs/files/pkg-message.in @@ -13,7 +13,7 @@ Connect to %%PORTNAME%% on the default port 3000: http://localhost:3000 -Configuration file is %%PREFIX%%/libexec/%%PORTNAME%%/custom/conf/app.ini. +Configuration file is %%ETCDIR%%/conf/app.ini. You can only edit it when %%PORTNAME%% isn't running. %%PORTNAME_FANCY%% needs an SSH daemon, so make sure sure you execute: Index: devel/gogs/pkg-plist =================================================================== --- devel/gogs/pkg-plist +++ devel/gogs/pkg-plist @@ -1,6 +1,8 @@ bin/gogs bin/gogs-rm-data -@(%%GOGS_USER%%,%%GOGS_GROUP%%,640) libexec/gogs/custom/conf/app.ini +@dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) %%ETCDIR%%/conf +@dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) %%ETCDIR%%/https +@sample(%%GOGS_USER%%,%%GOGS_GROUP%%,640) %%ETCDIR%%/conf/app.ini.sample etc/rc.d/gogs libexec/gogs/conf/app.ini libexec/gogs/conf/gitignore/Actionscript @@ -232,6 +234,7 @@ libexec/gogs/conf/locale/TRANSLATORS libexec/gogs/conf/README.md libexec/gogs/conf/readme/Default +libexec/gogs/custom libexec/gogs/data libexec/gogs/gogs libexec/gogs/log @@ -1719,10 +1722,7 @@ libexec/gogs/templates/user/settings/sshkeys.tmpl libexec/gogs/templates/user/settings/two_factor_enable.tmpl libexec/gogs/templates/user/settings/two_factor_recovery_codes.tmpl -@dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) libexec/gogs/custom/conf -@dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) libexec/gogs/custom/https @dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) %%GOGS_DBDIR%%/data -@dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) %%GOGS_DBDIR%%/home @dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) %%GOGS_DBDIR%%/repositories @dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) %%GOGS_DBDIR%% @dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) %%GOGS_LOGDIR%%