Index: head/GIDs =================================================================== --- head/GIDs +++ head/GIDs @@ -150,7 +150,6 @@ gini:*:206: _mixminion:*:207: _dnsdist:*:208: -gogs:*:209: shoutcast:*:210: git:*:211: hg:*:212: Index: head/UIDs =================================================================== --- head/UIDs +++ head/UIDs @@ -155,7 +155,6 @@ gini:*:206:206::0:0:& streaming server:/var/log/gini:/usr/sbin/nologin _mixminion:*:207:207::0:0:Mixminion server:/nonexistent:/usr/sbin/nologin _dnsdist:*:208:208::0:0:dnsdist user:/nonexistent:/usr/sbin/nologin -gogs:*:209:209::0:0:gogs user:/var/db/gogs/home:/bin/sh shoutcast:*:210:210::0:0:Shoutcast sandbox:/nonexistent:/bin/sh git:*:211:211::0:0:gitosis user:/usr/local/git:/bin/sh hg:*:212:212::0:0:mercurial-server user:/usr/local/hg:/bin/sh Index: head/UPDATING =================================================================== --- head/UPDATING +++ head/UPDATING @@ -5,6 +5,25 @@ You should get into the habit of checking this file for changes each time you update your ports collection, before attempting any port upgrades. +20171218: + 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, + and both the user "gogs" and the group "gogs" should be deleted: + + # rm -rf /var/db/gogs/home + # pw userdel gogs + # pw groupdel gogs + 20171215: AFFECTS: users of finance/gnucash AUTHOR: madpilot@FreeBSD.org Index: head/devel/gogs/Makefile =================================================================== --- head/devel/gogs/Makefile +++ head/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} \ @@ -45,9 +45,12 @@ PORTDOCS= README.md post-patch: - @${REINPLACE_CMD} -i '' \ - -e 's|^ROOT =$$|ROOT = ${GOGS_DBDIR}/repositories|' \ + @${REINPLACE_CMD} \ + -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|^ROOT_PATH =$$|ROOT_PATH = ${GOGS_LOGDIR}|' \ -e 's|^DB_TYPE = mysql$$|DB_TYPE = sqlite3|' \ ${WRKSRC}/conf/app.ini @@ -62,10 +65,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: head/devel/gogs/files/gogs-rm-data.in =================================================================== --- head/devel/gogs/files/gogs-rm-data.in +++ head/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: head/devel/gogs/files/gogs-service.in =================================================================== --- head/devel/gogs/files/gogs-service.in +++ head/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: head/devel/gogs/files/gogs.in =================================================================== --- head/devel/gogs/files/gogs.in +++ head/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: head/devel/gogs/files/patch-templates_install.tmpl =================================================================== --- head/devel/gogs/files/patch-templates_install.tmpl +++ head/devel/gogs/files/patch-templates_install.tmpl @@ -1,4 +1,4 @@ ---- templates/install.tmpl.orig 2017-11-17 23:20:54 UTC +--- templates/install.tmpl.orig 2017-11-22 19:46:14 UTC +++ templates/install.tmpl @@ -8,12 +8,9 @@
@@ -37,3 +37,12 @@ {{.i18n.Tr "install.run_user_helper"}} +@@ -115,7 +112,7 @@ + + {{.i18n.Tr "install.app_url_helper"}} +
+-
++
+ + + {{.i18n.Tr "install.log_root_path_helper"}} Index: head/devel/gogs/files/pkg-message.in =================================================================== --- head/devel/gogs/files/pkg-message.in +++ head/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: head/devel/gogs/pkg-plist =================================================================== --- head/devel/gogs/pkg-plist +++ head/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%%