Revert long naming for FrontlineSMS
This commit is contained in:
parent
89bd1882c0
commit
9164ea8111
@ -12,7 +12,7 @@ ${SOURCE_DIR}/basic.sh
|
||||
${SOURCE_DIR}/ckan.sh
|
||||
# ${SOURCE_DIR}/crisiscleanup.sh
|
||||
# ${SOURCE_DIR}/cts.sh
|
||||
${SOURCE_DIR}/flsms.sh
|
||||
${SOURCE_DIR}/frontlinesms.sh
|
||||
${SOURCE_DIR}/gnuhealth.sh
|
||||
${SOURCE_DIR}/kanboard.sh
|
||||
${SOURCE_DIR}/mifosx.sh
|
||||
|
21
flsms.sh
21
flsms.sh
@ -1,21 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
SOURCE_DIR=$(realpath $(dirname "${0}"))/flsms
|
||||
|
||||
# Check prerequisites
|
||||
docker image ls | grep -q java || $(realpath $(dirname "${0}"))/java.sh
|
||||
|
||||
# Build Docker container
|
||||
docker build -t flsms ${SOURCE_DIR}
|
||||
cp ${SOURCE_DIR}/etc/init.d/flsms /etc/init.d/flsms
|
||||
rc-update -u
|
||||
|
||||
# Configure FrontlineSMS
|
||||
mkdir -p /srv/flsms/data
|
||||
export FLSMS_ADMIN_USER="admin"
|
||||
export FLSMS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
|
||||
export FLSMS_ADMIN_USER_HASH=$(echo -n "${FLSMS_ADMIN_USER}" | base64)
|
||||
export FLSMS_ADMIN_PWD_HASH=$(echo -n "${FLSMS_ADMIN_PWD}" | base64)
|
||||
envsubst <${SOURCE_DIR}/srv/flsms/data/app-settings.properties >/srv/flsms/data/app-settings.properties
|
||||
chown -R 8018:8018 /srv/flsms/data
|
||||
spotter-appmgr update-login flsms "${FLSMS_ADMIN_USER}" "${FLSMS_ADMIN_PWD}"
|
@ -1,27 +0,0 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="FrontlineSMS docker container"
|
||||
|
||||
depend() {
|
||||
need docker
|
||||
}
|
||||
|
||||
start() {
|
||||
/usr/bin/docker run -d --rm \
|
||||
--name flsms \
|
||||
-h flsms \
|
||||
-v /srv/flsms/data:/srv/flsms/.frontlinesms2 \
|
||||
flsms
|
||||
}
|
||||
|
||||
start_post() {
|
||||
/usr/bin/spotter-appmgr register-proxy flsms
|
||||
}
|
||||
|
||||
stop_pre() {
|
||||
/usr/bin/spotter-appmgr unregister-proxy flsms
|
||||
}
|
||||
|
||||
stop() {
|
||||
/usr/bin/docker stop flsms
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
auth.basic.enabled=on
|
||||
auth.basic.username=${FLSMS_ADMIN_USER_HASH}
|
||||
auth.basic.password=${FLSMS_ADMIN_PWD_HASH}
|
21
frontlinesms.sh
Executable file
21
frontlinesms.sh
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
SOURCE_DIR=$(realpath $(dirname "${0}"))/frontlinesms
|
||||
|
||||
# Check prerequisites
|
||||
docker image ls | grep -q java || $(realpath $(dirname "${0}"))/java.sh
|
||||
|
||||
# Build Docker container
|
||||
docker build -t frontlinesms ${SOURCE_DIR}
|
||||
cp ${SOURCE_DIR}/etc/init.d/frontlinesms /etc/init.d/frontlinesms
|
||||
rc-update -u
|
||||
|
||||
# Configure FrontlineSMS
|
||||
mkdir -p /srv/frontlinesms/data
|
||||
export FRONTLINESMS_ADMIN_USER="admin"
|
||||
export FRONTLINESMS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
|
||||
export FRONTLINESMS_ADMIN_USER_HASH=$(echo -n "${FRONTLINESMS_ADMIN_USER}" | base64)
|
||||
export FRONTLINESMS_ADMIN_PWD_HASH=$(echo -n "${FRONTLINESMS_ADMIN_PWD}" | base64)
|
||||
envsubst <${SOURCE_DIR}/srv/frontlinesms/data/app-settings.properties >/srv/frontlinesms/data/app-settings.properties
|
||||
chown -R 8018:8018 /srv/frontlinesms/data
|
||||
spotter-appmgr update-login frontlinesms "${FRONTLINESMS_ADMIN_USER}" "${FRONTLINESMS_ADMIN_PWD}"
|
@ -5,21 +5,21 @@ RUN \
|
||||
# Install runtime dependencies
|
||||
apk --no-cache add openjdk8-jre s6 ttf-dejavu xf86-video-dummy xorg-server \
|
||||
# Create OS user
|
||||
&& addgroup -S -g 8018 flsms \
|
||||
&& adduser -S -u 8018 -h /srv/flsms -s /bin/sh -g flsms -G flsms flsms \
|
||||
&& addgroup -S -g 8018 sms \
|
||||
&& adduser -S -u 8018 -h /srv/frontlinesms -s /bin/sh -g sms -G sms sms \
|
||||
# Install FrontlineSMS
|
||||
&& wget http://download-frontlinesms.s3.amazonaws.com/frontlinesms2_unix_2.6.5.sh -O /tmp/frontlinesms2.sh \
|
||||
# Hackfix for Busybox gunzip
|
||||
&& sed -i 's/gunzip -V/echo/' /tmp/frontlinesms2.sh \
|
||||
&& echo -e 'o\n\nn\nSpotter\nSpotter\n11\n45\n\n\nadmin@example.com\n\n\n\n\n\n\n\n\n\n\n' | su - flsms -c 'sh /tmp/frontlinesms2.sh -c' \
|
||||
&& echo -e 'o\n\nn\nSpotter\nSpotter\n11\n45\n\n\nadmin@example.com\n\n\n\n\n\n\n\n\n\n\n' | su - sms -c 'sh /tmp/frontlinesms2.sh -c' \
|
||||
# Replace Jetty port
|
||||
&& sed -i 's/8130/8080/' /srv/flsms/frontlinesms2/launcher.properties \
|
||||
&& sed -i 's/8130/8080/' /srv/frontlinesms/frontlinesms2/launcher.properties \
|
||||
# Cleanup
|
||||
&& rm /tmp/frontlinesms2.sh
|
||||
|
||||
COPY docker/ /
|
||||
|
||||
VOLUME ["/srv/flsms/.frontlinesms2"]
|
||||
VOLUME ["/srv/frontlinesms/.frontlinesms2"]
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["s6-svscan", "/etc/services.d"]
|
@ -1,8 +1,8 @@
|
||||
#!/bin/execlineb -P
|
||||
|
||||
foreground { s6-svwait -t 3000 -u /etc/services.d/xorg }
|
||||
cd /srv/flsms
|
||||
cd /srv/frontlinesms
|
||||
export DISPLAY :10
|
||||
fdmove -c 2 1
|
||||
s6-setuidgid 8018:8018
|
||||
/srv/flsms/frontlinesms2/FrontlineSMS2_Launcher
|
||||
/srv/frontlinesms/frontlinesms2/FrontlineSMS2_Launcher
|
27
frontlinesms/etc/init.d/frontlinesms
Executable file
27
frontlinesms/etc/init.d/frontlinesms
Executable file
@ -0,0 +1,27 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="FrontlineSMS docker container"
|
||||
|
||||
depend() {
|
||||
need docker
|
||||
}
|
||||
|
||||
start() {
|
||||
/usr/bin/docker run -d --rm \
|
||||
--name frontlinesms \
|
||||
-h frontlinesms \
|
||||
-v /srv/frontlinesms/data:/srv/frontlinesms/.frontlinesms2 \
|
||||
frontlinesms
|
||||
}
|
||||
|
||||
start_post() {
|
||||
/usr/bin/spotter-appmgr register-proxy frontlinesms
|
||||
}
|
||||
|
||||
stop_pre() {
|
||||
/usr/bin/spotter-appmgr unregister-proxy frontlinesms
|
||||
}
|
||||
|
||||
stop() {
|
||||
/usr/bin/docker stop frontlinesms
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
auth.basic.enabled=on
|
||||
auth.basic.username=${FRONTLINESMS_ADMIN_USER_HASH}
|
||||
auth.basic.password=${FRONTLINESMS_ADMIN_PWD_HASH}
|
Loading…
Reference in New Issue
Block a user