Rework FrontlineSMS

This commit is contained in:
Disassembler 2019-10-03 20:19:13 +02:00
parent ed0c6c90a7
commit 0bc2daf4ad
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
6 changed files with 23 additions and 31 deletions

View File

@ -4,17 +4,13 @@ set -ev
cd $(realpath $(dirname "${0}"))/install cd $(realpath $(dirname "${0}"))/install
# Configure FrontlineSMS # Configure FrontlineSMS
mkdir -p /srv/frontlinesms/data mkdir -p /srv/frontlinesms/flsms_data
export FRONTLINESMS_ADMIN_USER="admin" export FRONTLINESMS_ADMIN_USER="admin"
export FRONTLINESMS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=') export FRONTLINESMS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
export FRONTLINESMS_ADMIN_USER_HASH=$(echo -n "${FRONTLINESMS_ADMIN_USER}" | base64) export FRONTLINESMS_ADMIN_USER_HASH=$(echo -n "${FRONTLINESMS_ADMIN_USER}" | base64)
export FRONTLINESMS_ADMIN_PWD_HASH=$(echo -n "${FRONTLINESMS_ADMIN_PWD}" | base64) export FRONTLINESMS_ADMIN_PWD_HASH=$(echo -n "${FRONTLINESMS_ADMIN_PWD}" | base64)
envsubst <srv/frontlinesms/data/app-settings.properties >/srv/frontlinesms/data/app-settings.properties envsubst <flsms_data/app-settings.properties >/srv/frontlinesms/flsms_data/app-settings.properties
chown -R 8018:8018 /srv/frontlinesms/data chown -R 8018:8018 /srv/frontlinesms/flsms_data
# Install service
cp etc/init.d/frontlinesms /etc/init.d/frontlinesms
rc-update -u
# Register application # Register application
vmmgr register-app frontlinesms sms "${FRONTLINESMS_ADMIN_USER}" "${FRONTLINESMS_ADMIN_PWD}" vmmgr register-app frontlinesms sms "${FRONTLINESMS_ADMIN_USER}" "${FRONTLINESMS_ADMIN_PWD}"

View File

@ -1,19 +0,0 @@
#!/sbin/openrc-run
description="FrontlineSMS container"
start() {
lxc-start frontlinesms
}
start_post() {
vmmgr register-proxy frontlinesms
}
stop_pre() {
vmmgr unregister-proxy frontlinesms
}
stop() {
lxc-stop frontlinesms
}

View File

@ -38,6 +38,4 @@ RUN EOF
chown 8018:8018 frontlinesms-core_messages_cs* chown 8018:8018 frontlinesms-core_messages_cs*
EOF EOF
MOUNT DIR /srv/frontlinesms/data srv/frontlinesms/.frontlinesms2
CMD s6-svscan /etc/services.d CMD s6-svscan /etc/services.d

View File

@ -0,0 +1,18 @@
{
"version": "0.0.1-190620",
"meta": {
"title": "FrontlineSMS",
"desc-cs": "Hromadné odesílání zpráv",
"desc-en": "Bulk SMS messaging",
"license": "GPL",
"proxy": "frontlinesms"
},
"containers": {
"frontlinesms": {
"image": "frontlinesms_0.0.1-190620",
"mounts": [
["DIR", "/srv/frontlinesms/flsms_data", "/srv/frontlinesms/.frontlinesms2"]
]
}
}
}

View File

@ -1,9 +1,8 @@
#!/bin/sh #!/bin/sh
set -ev set -ev
# Remove service # Remove persistent data
rm -f /etc/init.d/frontlinesms rm -rf /srv/frontlinesms
rc-update -u
# Unregister application # Unregister application
vmmgr unregister-app frontlinesms vmmgr unregister-app frontlinesms