aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryuri <yuri@FreeBSD.org>2017-12-19 07:57:06 +0800
committeryuri <yuri@FreeBSD.org>2017-12-19 07:57:06 +0800
commit7a836f36fe6daa41edf2fba999f1f8ad11dccfc0 (patch)
tree71d452220ed60941fcb614e18df12d074d85001f
parenta3cd1e1db9594dadc32652ac4590399b171beed4 (diff)
downloadfreebsd-ports-gnome-7a836f36fe6daa41edf2fba999f1f8ad11dccfc0.tar.gz
freebsd-ports-gnome-7a836f36fe6daa41edf2fba999f1f8ad11dccfc0.tar.zst
freebsd-ports-gnome-7a836f36fe6daa41edf2fba999f1f8ad11dccfc0.zip
devel/gogs: Changed user from gogs to git; Moved ini file under /usr/local/etc
PR: 224113 Submitted by: Dmitri Goutnik <dg@syrec.org> (maintainer) Approved by: adamw (mentor) Differential Revision: https://reviews.freebsd.org/D13469
-rw-r--r--GIDs1
-rw-r--r--UIDs1
-rw-r--r--UPDATING19
-rw-r--r--devel/gogs/Makefile24
-rw-r--r--devel/gogs/files/gogs-rm-data.in3
-rw-r--r--devel/gogs/files/gogs-service.in5
-rw-r--r--devel/gogs/files/gogs.in4
-rw-r--r--devel/gogs/files/patch-templates_install.tmpl11
-rw-r--r--devel/gogs/files/pkg-message.in2
-rw-r--r--devel/gogs/pkg-plist8
10 files changed, 54 insertions, 24 deletions
diff --git a/GIDs b/GIDs
index 927b64ebf180..d964adae7e17 100644
--- a/GIDs
+++ b/GIDs
@@ -150,7 +150,6 @@ gnugk:*:205:
gini:*:206:
_mixminion:*:207:
_dnsdist:*:208:
-gogs:*:209:
shoutcast:*:210:
git:*:211:
hg:*:212:
diff --git a/UIDs b/UIDs
index f697cb638bd2..c8e7e7809bba 100644
--- a/UIDs
+++ b/UIDs
@@ -155,7 +155,6 @@ gnugk:*:205:205::0:0:GNU GateKeeper pseudo-user:/nonexistent:/usr/sbin/nologin
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
diff --git a/UPDATING b/UPDATING
index e1c248da09c4..f4a374ebb049 100644
--- a/UPDATING
+++ b/UPDATING
@@ -5,6 +5,25 @@ they are unavoidable.
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
diff --git a/devel/gogs/Makefile b/devel/gogs/Makefile
index 7591244884f7..74cfbbcf4c07 100644
--- a/devel/gogs/Makefile
+++ b/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 @@ GH_SUBDIR= src/github.com/${GH_ACCOUNT}/${PORTNAME}
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 @@ SUB_FILES= gogs \
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 @@ PLIST_SUB= GOGS_USER=${USERS} \
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 @@ do-install:
${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
diff --git a/devel/gogs/files/gogs-rm-data.in b/devel/gogs/files/gogs-rm-data.in
index a719903d16e7..4f27af6953e9 100644
--- a/devel/gogs/files/gogs-rm-data.in
+++ b/devel/gogs/files/gogs-rm-data.in
@@ -17,5 +17,4 @@ while true; do
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
diff --git a/devel/gogs/files/gogs-service.in b/devel/gogs/files/gogs-service.in
index 9b9af0a01f83..b2413725184c 100644
--- a/devel/gogs/files/gogs-service.in
+++ b/devel/gogs/files/gogs-service.in
@@ -24,6 +24,7 @@ stop_cmd="%%PORTNAME%%_stop"
load_rc_config ${name}
: ${%%PORTNAME%%_enable="NO"}
+: ${%%PORTNAME%%_config="%%ETCDIR%%/conf/app.ini"}
is_process_running() {
local pidfile=$1
@@ -43,11 +44,11 @@ stop_daemon() {
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
diff --git a/devel/gogs/files/gogs.in b/devel/gogs/files/gogs.in
index dbcd5fc2ea62..8ca814466134 100644
--- a/devel/gogs/files/gogs.in
+++ b/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'
diff --git a/devel/gogs/files/patch-templates_install.tmpl b/devel/gogs/files/patch-templates_install.tmpl
index a48fb3eddac0..3c192233064e 100644
--- a/devel/gogs/files/patch-templates_install.tmpl
+++ b/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 @@
<div class="ui attached segment">
@@ -37,3 +37,12 @@
<label for="run_user">{{.i18n.Tr "install.run_user"}}</label>
<input id="run_user" name="run_user" value="{{.run_user}}" required>
<span class="help">{{.i18n.Tr "install.run_user_helper"}}</span>
+@@ -115,7 +112,7 @@
+ <input id="app_url" name="app_url" value="{{.app_url}}" placeholder="e.g. https://try.gogs.io" required>
+ <span class="help">{{.i18n.Tr "install.app_url_helper"}}</span>
+ </div>
+- <div class="inline required field">
++ <div class="disabled inline required field">
+ <label for="log_root_path">{{.i18n.Tr "install.log_root_path"}}</label>
+ <input id="log_root_path" name="log_root_path" value="{{.log_root_path}}" placeholder="log" required>
+ <span class="help">{{.i18n.Tr "install.log_root_path_helper"}}</span>
diff --git a/devel/gogs/files/pkg-message.in b/devel/gogs/files/pkg-message.in
index 4a8c6873d9d7..74418c6bd9c2 100644
--- a/devel/gogs/files/pkg-message.in
+++ b/devel/gogs/files/pkg-message.in
@@ -13,7 +13,7 @@ You can also run %%PORTNAME%% manually with a command:
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:
diff --git a/devel/gogs/pkg-plist b/devel/gogs/pkg-plist
index f10d059259c6..61b01f9d2ae1 100644
--- a/devel/gogs/pkg-plist
+++ b/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/locale_zh-TW.ini
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/security.tmpl
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%%