Revert long naming for FrontlineSMS

This commit is contained in:
Disassembler 2018-04-21 22:43:57 +02:00
parent 89bd1882c0
commit 9164ea8111
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
12 changed files with 59 additions and 59 deletions

View File

@ -12,7 +12,7 @@ ${SOURCE_DIR}/basic.sh
${SOURCE_DIR}/ckan.sh ${SOURCE_DIR}/ckan.sh
# ${SOURCE_DIR}/crisiscleanup.sh # ${SOURCE_DIR}/crisiscleanup.sh
# ${SOURCE_DIR}/cts.sh # ${SOURCE_DIR}/cts.sh
${SOURCE_DIR}/flsms.sh ${SOURCE_DIR}/frontlinesms.sh
${SOURCE_DIR}/gnuhealth.sh ${SOURCE_DIR}/gnuhealth.sh
${SOURCE_DIR}/kanboard.sh ${SOURCE_DIR}/kanboard.sh
${SOURCE_DIR}/mifosx.sh ${SOURCE_DIR}/mifosx.sh

View File

@ -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}"

View File

@ -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
}

View File

@ -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
View 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}"

View File

@ -5,21 +5,21 @@ RUN \
# Install runtime dependencies # Install runtime dependencies
apk --no-cache add openjdk8-jre s6 ttf-dejavu xf86-video-dummy xorg-server \ apk --no-cache add openjdk8-jre s6 ttf-dejavu xf86-video-dummy xorg-server \
# Create OS user # Create OS user
&& addgroup -S -g 8018 flsms \ && addgroup -S -g 8018 sms \
&& adduser -S -u 8018 -h /srv/flsms -s /bin/sh -g flsms -G flsms flsms \ && adduser -S -u 8018 -h /srv/frontlinesms -s /bin/sh -g sms -G sms sms \
# Install FrontlineSMS # Install FrontlineSMS
&& wget http://download-frontlinesms.s3.amazonaws.com/frontlinesms2_unix_2.6.5.sh -O /tmp/frontlinesms2.sh \ && wget http://download-frontlinesms.s3.amazonaws.com/frontlinesms2_unix_2.6.5.sh -O /tmp/frontlinesms2.sh \
# Hackfix for Busybox gunzip # Hackfix for Busybox gunzip
&& sed -i 's/gunzip -V/echo/' /tmp/frontlinesms2.sh \ && 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 # Replace Jetty port
&& sed -i 's/8130/8080/' /srv/flsms/frontlinesms2/launcher.properties \ && sed -i 's/8130/8080/' /srv/frontlinesms/frontlinesms2/launcher.properties \
# Cleanup # Cleanup
&& rm /tmp/frontlinesms2.sh && rm /tmp/frontlinesms2.sh
COPY docker/ / COPY docker/ /
VOLUME ["/srv/flsms/.frontlinesms2"] VOLUME ["/srv/frontlinesms/.frontlinesms2"]
EXPOSE 8080 EXPOSE 8080
CMD ["s6-svscan", "/etc/services.d"] CMD ["s6-svscan", "/etc/services.d"]

View File

@ -1,8 +1,8 @@
#!/bin/execlineb -P #!/bin/execlineb -P
foreground { s6-svwait -t 3000 -u /etc/services.d/xorg } foreground { s6-svwait -t 3000 -u /etc/services.d/xorg }
cd /srv/flsms cd /srv/frontlinesms
export DISPLAY :10 export DISPLAY :10
fdmove -c 2 1 fdmove -c 2 1
s6-setuidgid 8018:8018 s6-setuidgid 8018:8018
/srv/flsms/frontlinesms2/FrontlineSMS2_Launcher /srv/frontlinesms/frontlinesms2/FrontlineSMS2_Launcher

View 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
}

View File

@ -0,0 +1,3 @@
auth.basic.enabled=on
auth.basic.username=${FRONTLINESMS_ADMIN_USER_HASH}
auth.basic.password=${FRONTLINESMS_ADMIN_PWD_HASH}