~dricottone/huttese-apk

56b212362486f3e3b5ecfb635e308eeedff1fe2b — Drew DeVault 5 years ago c972947
Make local redis service optional
M sr.ht/builds.sr.ht/builds.sr.ht.init => sr.ht/builds.sr.ht/builds.sr.ht.init +3 -2
@@ 7,12 7,13 @@ BUILDS_USER=${BUILDS_USER:-builds}
BUILDS_BIND=${BUILDS_BIND:-127.0.0.1:5000}
BUILDS_ARGS=${BUILDS_ARGS:-}
LOCAL_PG=${LOCAL_PG:-yes}
LOCAL_REDIS=${LOCAL_REDIS:-yes}
LOGS=/var/log/builds.sr.ht.log

depend() {
	need net
	need redis
	[ "$LOCAL_PG" == "yes" ] && need postgresql
	[ "$LOCAL_REDIS" = "yes" ] && need redis
	[ "$LOCAL_PG" = "yes" ] && need postgresql
}

start() {

M sr.ht/dispatch.sr.ht/dispatch.sr.ht.init => sr.ht/dispatch.sr.ht/dispatch.sr.ht.init +5 -3
@@ 5,13 5,15 @@ description="dispatch.sr.ht service"
# Override these with /etc/conf.d/dispatch.sr.ht
DISPATCH_USER=${DISPATCH_USER:-dispatch}
DISPATCH_BIND=${DISPATCH_BIND:-127.0.0.1:5000}
DISPATCH_ARGS=${DISPATCH_ARGS:-}
LOCAL_PG=${LOCAL_PG:-yes}
LOCAL_REDIS=${LOCAL_REDIS:-yes}
LOGS=/var/log/dispatch.sr.ht.log

depend() {
	need net
	need redis
	[ "$LOCAL_PG" == "yes" ] && need postgresql
	[ "$LOCAL_REDIS" = "yes" ] && need redis
	[ "$LOCAL_PG" = "yes" ] && need postgresql
}

start() {


@@ 26,7 28,7 @@ start() {
		--make-pidfile \
		--pidfile /run/$name.pid \
		--exec /usr/bin/gunicorn -- \
			dispatchsrht.app:app -b ${DISPATCH_BIND}
			dispatchsrht.app:app -b ${DISPATCH_BIND} ${DISPATCH_ARGS}
	eend $?
}


M sr.ht/git.sr.ht/git.sr.ht.init => sr.ht/git.sr.ht/git.sr.ht.init +3 -2
@@ 7,12 7,13 @@ GIT_USER=${GIT_USER:-gitsrht}
GIT_BIND=${GIT_BIND:-127.0.0.1:5001}
GIT_ARGS=${GIT_ARGS:-}
LOCAL_PG=${LOCAL_PG:-yes}
LOCAL_REDIS=${LOCAL_REDIS:-yes}
LOGS=/var/log/git.sr.ht.log

depend() {
	need net
	need redis
	[ "$LOCAL_PG" == "yes" ] && need postgresql
	[ "$LOCAL_REDIS" = "yes" ] && need redis
	[ "$LOCAL_PG" = "yes" ] && need postgresql
}

start() {

M sr.ht/hg.sr.ht/hg.sr.ht.init => sr.ht/hg.sr.ht/hg.sr.ht.init +3 -2
@@ 7,12 7,13 @@ HG_USER=${HG_USER:-hg}
HG_BIND=${HG_BIND:-127.0.0.1:5001}
HG_ARGS=${HG_ARGS:-}
LOCAL_PG=${LOCAL_PG:-yes}
LOCAL_REDIS=${LOCAL_REDIS:-yes}
LOGS=/var/log/hg.sr.ht.log

depend() {
	need net
	need redis
	[ "$LOCAL_PG" == "yes" ] && need postgresql
	[ "$LOCAL_REDIS" = "yes" ] && need redis
	[ "$LOCAL_PG" = "yes" ] && need postgresql
}

start() {

M sr.ht/lists.sr.ht/lists.sr.ht.init => sr.ht/lists.sr.ht/lists.sr.ht.init +3 -2
@@ 7,12 7,13 @@ LISTS_USER=${LISTS_USER:-listssrht}
LISTS_BIND=${LISTS_BIND:-127.0.0.1:5001}
LISTS_ARGS=${LISTS_ARGS:-}
LOCAL_PG=${LOCAL_PG:-yes}
LOCAL_REDIS=${LOCAL_REDIS:-yes}
LOGS=/var/log/lists.sr.ht.log

depend() {
	need net
	need redis
	[ "$LOCAL_PG" == "yes" ] && need postgresql
	[ "$LOCAL_REDIS" = "yes" ] && need redis
	[ "$LOCAL_PG" = "yes" ] && need postgresql
}

start() {

M sr.ht/man.sr.ht/man.sr.ht.init => sr.ht/man.sr.ht/man.sr.ht.init +3 -2
@@ 7,12 7,13 @@ MAN_USER=${MAN_USER:-man}
MAN_BIND=${MAN_BIND:-127.0.0.1:5004}
MAN_ARGS=${MAN_ARGS:-}
LOCAL_PG=${LOCAL_PG:-yes}
LOCAL_REDIS=${LOCAL_REDIS:-yes}
LOGS=/var/log/man.sr.ht.log

depend() {
	need net
	need redis
	[ "$LOCAL_PG" == "yes" ] && need postgresql
	[ "$LOCAL_REDIS" = "yes" ] && need redis
	[ "$LOCAL_PG" = "yes" ] && need postgresql
}

start() {

M sr.ht/meta.sr.ht/meta.sr.ht.init => sr.ht/meta.sr.ht/meta.sr.ht.init +3 -2
@@ 7,12 7,13 @@ META_USER=${META_USER:-meta}
META_BIND=${META_BIND:-127.0.0.1:5000}
META_ARGS=${META_ARGS:-}
LOCAL_PG=${LOCAL_PG:-yes}
LOCAL_REDIS=${LOCAL_REDIS:-yes}
LOGS=/var/log/meta.sr.ht.log

depend() {
	need net
	need redis
	[ "$LOCAL_PG" == "yes" ] && need postgresql
	[ "$LOCAL_REDIS" = "yes" ] && need redis
	[ "$LOCAL_PG" = "yes" ] && need postgresql
}

start() {

M sr.ht/todo.sr.ht/todo.sr.ht.init => sr.ht/todo.sr.ht/todo.sr.ht.init +3 -2
@@ 7,12 7,13 @@ TODO_USER=${TODO_USER:-todo}
TODO_BIND=${TODO_BIND:-127.0.0.1:5000}
TODO_ARGS=${TODO_ARGS:-}
LOCAL_PG=${LOCAL_PG:-yes}
LOCAL_REDIS=${LOCAL_REDIS:-yes}
LOGS=/var/log/todo.sr.ht.log

depend() {
	need net
	need redis
	[ "$LOCAL_PG" == "yes" ] && need postgresql
	[ "$LOCAL_REDIS" = "yes" ] && need redis
	[ "$LOCAL_PG" = "yes" ] && need postgresql
}

start() {