De-brand AppMgr and scripts

This commit is contained in:
Disassembler 2018-09-03 17:24:48 +02:00
parent cc20132a1f
commit bf94306e25
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
96 changed files with 87 additions and 87 deletions

View File

@ -81,8 +81,8 @@ chroot /mnt update-extlinux
chroot /mnt setup-timezone -z Europe/Prague chroot /mnt setup-timezone -z Europe/Prague
# Set hostname # Set hostname
echo 'spottervm' >/mnt/etc/hostname echo 'spotter.vm' >/mnt/etc/hostname
echo '127.0.0.1 spottervm localhost localhost.localdomain' >/mnt/etc/hosts echo '127.0.0.1 spotter.vm localhost localhost.localdomain' >/mnt/etc/hosts
sed -i '/hostname/d' /mnt/etc/network/interfaces sed -i '/hostname/d' /mnt/etc/network/interfaces
# Enable services on boot # Enable services on boot

View File

@ -23,7 +23,7 @@ cp ${SOURCE_DIR}/boot/extlinux.conf /boot/extlinux.conf
cp ${SOURCE_DIR}/boot/vm.txt /boot/vm.txt cp ${SOURCE_DIR}/boot/vm.txt /boot/vm.txt
cp ${SOURCE_DIR}/etc/inittab /etc/inittab cp ${SOURCE_DIR}/etc/inittab /etc/inittab
cp ${SOURCE_DIR}/sbin/extend-disk /sbin/extend-disk cp ${SOURCE_DIR}/sbin/extend-disk /sbin/extend-disk
cp ${SOURCE_DIR}/sbin/spotty /sbin/spotty cp ${SOURCE_DIR}/sbin/vmtty /sbin/vmtty
>/etc/motd >/etc/motd
# Enable support for Czech characters # Enable support for Czech characters
@ -39,20 +39,20 @@ wget https://raw.githubusercontent.com/Neilpang/acme.sh/master/acme.sh -O /usr/b
sed -i 's|$HOME/.$PROJECT_NAME|/etc/acme.sh.d|' /usr/bin/acme.sh sed -i 's|$HOME/.$PROJECT_NAME|/etc/acme.sh.d|' /usr/bin/acme.sh
chmod +x /usr/bin/acme.sh chmod +x /usr/bin/acme.sh
# Copy Spotter AppMgr resources # Copy AppMgr resources
cp ${SOURCE_DIR}/etc/init.d/spotter-appmgr /etc/init.d/spotter-appmgr cp ${SOURCE_DIR}/etc/init.d/vm-appmgr /etc/init.d/vm-appmgr
rc-update -u rc-update -u
cp -r ${SOURCE_DIR}/srv/spotter /srv/spotter cp -r ${SOURCE_DIR}/srv/vm /srv/vm
ln -s /srv/spotter/cli.py /usr/bin/spotter-appmgr ln -s /srv/vm/cli.py /usr/bin/vm-appmgr
# Create a self-signed certificate # Create a self-signed certificate
spotter-appmgr create-selfsigned vm-appmgr create-selfsigned
# Configure nginx # Configure nginx
cp ${SOURCE_DIR}/etc/nginx/nginx.conf /etc/nginx/nginx.conf cp ${SOURCE_DIR}/etc/nginx/nginx.conf /etc/nginx/nginx.conf
# Configure services # Configure services
for SERVICE in consolefont crond nginx ntpd sshd spotter-appmgr swap; do for SERVICE in consolefont crond nginx ntpd sshd vm-appmgr swap; do
rc-update add ${SERVICE} boot rc-update add ${SERVICE} boot
service ${SERVICE} start service ${SERVICE} start
done done
@ -67,4 +67,4 @@ service docker start
docker build -t alpine ${SOURCE_DIR} docker build -t alpine ${SOURCE_DIR}
# Set dummy host and generate related files # Set dummy host and generate related files
spotter-appmgr update-host spotter.vm 443 vm-appmgr update-host spotter.vm 443

View File

@ -1,6 +1,6 @@
#!/sbin/openrc-run #!/sbin/openrc-run
command=/srv/spotter/wsgi.py command=/srv/vm/wsgi.py
description="Spotter application manager" description="VM application manager"
pidfile=/var/run/spotter-appmgr.pid pidfile=/var/run/vm-appmgr.pid
start_stop_daemon_args="--background --make-pidfile --stderr /dev/null --stdout /dev/null" start_stop_daemon_args="--background --make-pidfile --stderr /dev/null --stdout /dev/null"

View File

@ -6,7 +6,7 @@
::wait:/sbin/openrc default >/dev/null 2>&1 ::wait:/sbin/openrc default >/dev/null 2>&1
# Set up getty # Set up getty
tty1::respawn:/sbin/getty -n -l /sbin/spotty 38400 tty1 tty1::respawn:/sbin/getty -n -l /sbin/vmtty 38400 tty1
ttyS0::respawn:/sbin/getty -L 115200 ttyS0 xterm ttyS0::respawn:/sbin/getty -L 115200 ttyS0 xterm
# Stuff to do for the 3-finger salute # Stuff to do for the 3-finger salute

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# Rebuild /etc/issue # Rebuild /etc/issue
/usr/bin/spotter-appmgr rebuild-issue /usr/bin/vm-appmgr rebuild-issue
# Remove double-escaping needed for the real /etc/issue # Remove double-escaping needed for the real /etc/issue
/bin/sed 's|\\\\|\\|g' /etc/issue /bin/sed 's|\\\\|\\|g' /etc/issue
# Wait for key press # Wait for key press

View File

@ -11,7 +11,7 @@ from . import validator
VERSION = '0.0.1' VERSION = '0.0.1'
CONF_FILE = '/srv/spotter/config.json' CONF_FILE = '/srv/vm/config.json'
ISSUE_FILE = '/etc/issue' ISSUE_FILE = '/etc/issue'
NGINX_DIR = '/etc/nginx/conf.d' NGINX_DIR = '/etc/nginx/conf.d'
ACME_CRON = '/etc/periodic/daily/acme-sh' ACME_CRON = '/etc/periodic/daily/acme-sh'
@ -32,12 +32,12 @@ NGINX_TEMPLATE = '''server {{
error_page 502 /502.html; error_page 502 /502.html;
location = /502.html {{ location = /502.html {{
root /srv/spotter/templates; root /srv/vm/templates;
}} }}
location = /spotter-ping {{ location = /vm-ping {{
add_header Content-Type text/plain; add_header Content-Type text/plain;
return 200 "spotter-pong"; return 200 "vm-pong";
}} }}
}} }}
''' '''
@ -53,9 +53,9 @@ NGINX_DEFAULT_TEMPLATE = '''server {{
root /etc/acme.sh.d; root /etc/acme.sh.d;
}} }}
location = /spotter-ping {{ location = /vm-ping {{
add_header Content-Type text/plain; add_header Content-Type text/plain;
return 200 "spotter-pong"; return 200 "vm-pong";
}} }}
}} }}
@ -67,17 +67,17 @@ server {{
}} }}
location /static {{ location /static {{
root /srv/spotter; root /srv/vm;
}} }}
error_page 502 /502.html; error_page 502 /502.html;
location = /502.html {{ location = /502.html {{
root /srv/spotter/templates; root /srv/vm/templates;
}} }}
location = /spotter-ping {{ location = /vm-ping {{
add_header Content-Type text/plain; add_header Content-Type text/plain;
return 200 "spotter-pong"; return 200 "vm-pong";
}} }}
}} }}
''' '''

View File

@ -72,7 +72,7 @@ def resolve_ip(domain, type):
def ping_url(url): def ping_url(url):
try: try:
return requests.post('https://tools.dasm.cz/spotter-ping.php', data = {'url': url}, timeout=5).text == 'spotter-pong' return requests.post('https://tools.dasm.cz/vm-ping.php', data = {'url': url}, timeout=5).text == 'vm-pong'
except requests.exceptions.Timeout: except requests.exceptions.Timeout:
raise raise
except: except:

View File

@ -20,7 +20,7 @@ SESSION_KEY = os.urandom(26)
class WSGIApp(object): class WSGIApp(object):
def __init__(self): def __init__(self):
self.jinja_env = Environment(loader=FileSystemLoader('/srv/spotter/templates'), autoescape=True, lstrip_blocks=True, trim_blocks=True) self.jinja_env = Environment(loader=FileSystemLoader('/srv/vm/templates'), autoescape=True, lstrip_blocks=True, trim_blocks=True)
self.jinja_env.globals.update(is_service_autostarted=tools.is_service_autostarted) self.jinja_env.globals.update(is_service_autostarted=tools.is_service_autostarted)
self.jinja_env.globals.update(is_service_started=tools.is_service_started) self.jinja_env.globals.update(is_service_started=tools.is_service_started)
@ -254,7 +254,7 @@ class WSGIApp(object):
return self.render_json({'ok': request.session.lang.app_stopped()}) return self.render_json({'ok': request.session.lang.app_stopped()})
def update_password_action(self, request): def update_password_action(self, request):
# Updates password for both HDD encryption (LUKS-on-LVM) and admin account to spotter-appmgr # Updates password for both HDD encryption (LUKS-on-LVM) and admin account to vm-appmgr
try: try:
if request.form['newpassword'] != request.form['newpassword2']: if request.form['newpassword'] != request.form['newpassword2']:
return self.render_json({'error': request.session.lang.password_mismatch()}) return self.render_json({'error': request.session.lang.password_mismatch()})

View File

@ -4,11 +4,11 @@
import argparse import argparse
import getpass import getpass
import sys import sys
sys.path.append('/srv/spotter') sys.path.append('/srv/vm')
from appmgr import AppMgr from appmgr import AppMgr
parser = argparse.ArgumentParser(description='Spotter VM application manager') parser = argparse.ArgumentParser(description='VM application manager')
subparsers = parser.add_subparsers() subparsers = parser.add_subparsers()
parser_update_login = subparsers.add_parser('update-login', help='Updates application login') parser_update_login = subparsers.add_parser('update-login', help='Updates application login')

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 119 KiB

View File

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 101 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -3,7 +3,7 @@
import sys import sys
sys.path.append('/srv/spotter') sys.path.append('/srv/vm')
from appmgr.wsgiapp import WSGIApp from appmgr.wsgiapp import WSGIApp
application = WSGIApp() application = WSGIApp()

View File

@ -56,7 +56,7 @@ export CKAN_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
export CKAN_ADMIN_HASH=$(docker run --rm ckan python -c "from passlib.hash import pbkdf2_sha512;print pbkdf2_sha512.encrypt('${CKAN_ADMIN_PWD}')") export CKAN_ADMIN_HASH=$(docker run --rm ckan python -c "from passlib.hash import pbkdf2_sha512;print pbkdf2_sha512.encrypt('${CKAN_ADMIN_PWD}')")
export CKAN_ADMIN_EMAIL="admin@example.com" export CKAN_ADMIN_EMAIL="admin@example.com"
envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i postgres psql ckan envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i postgres psql ckan
spotter-appmgr update-login ckan "${CKAN_ADMIN_USER}" "${CKAN_ADMIN_PWD}" vm-appmgr update-login ckan "${CKAN_ADMIN_USER}" "${CKAN_ADMIN_PWD}"
# Install cron job # Install cron job
cp ${SOURCE_DIR}/etc/periodic/hourly/ckan /etc/periodic/hourly/ckan cp ${SOURCE_DIR}/etc/periodic/hourly/ckan /etc/periodic/hourly/ckan

View File

@ -21,11 +21,11 @@ start() {
} }
start_post() { start_post() {
/usr/bin/spotter-appmgr register-proxy ckan /usr/bin/vm-appmgr register-proxy ckan
} }
stop_pre() { stop_pre() {
/usr/bin/spotter-appmgr unregister-proxy ckan /usr/bin/vm-appmgr unregister-proxy ckan
} }
stop() { stop() {

View File

@ -31,7 +31,7 @@ envsubst <${SOURCE_DIR}/srv/crisiscleanup/conf/database.yml >/srv/crisiscleanup/
cp ${SOURCE_DIR}/srv/crisiscleanup/conf/boot.rb /srv/crisiscleanup/conf/boot.rb cp ${SOURCE_DIR}/srv/crisiscleanup/conf/boot.rb /srv/crisiscleanup/conf/boot.rb
cp ${SOURCE_DIR}/srv/crisiscleanup/conf/initializers/devise.rb /srv/crisiscleanup/conf/initializers/devise.rb cp ${SOURCE_DIR}/srv/crisiscleanup/conf/initializers/devise.rb /srv/crisiscleanup/conf/initializers/devise.rb
cp ${SOURCE_DIR}/srv/crisiscleanup/conf/environments/production.rb /srv/crisiscleanup/conf/environments/production.rb cp ${SOURCE_DIR}/srv/crisiscleanup/conf/environments/production.rb /srv/crisiscleanup/conf/environments/production.rb
spotter-appmgr update-login crisiscleanup "${CRISISCLEANUP_ADMIN_EMAIL}" "${CRISISCLEANUP_ADMIN_PWD}" vm-appmgr update-login crisiscleanup "${CRISISCLEANUP_ADMIN_EMAIL}" "${CRISISCLEANUP_ADMIN_PWD}"
# Populate database # Populate database
envsubst <${SOURCE_DIR}/srv/crisiscleanup/db/seeds.rb >/tmp/seeds.rb envsubst <${SOURCE_DIR}/srv/crisiscleanup/db/seeds.rb >/tmp/seeds.rb

View File

@ -17,11 +17,11 @@ start() {
} }
start_post() { start_post() {
/usr/bin/spotter-appmgr register-proxy crisiscleanup /usr/bin/vm-appmgr register-proxy crisiscleanup
} }
stop_pre() { stop_pre() {
/usr/bin/spotter-appmgr unregister-proxy crisiscleanup /usr/bin/vm-appmgr unregister-proxy crisiscleanup
} }
stop() { stop() {

2
cts.sh
View File

@ -39,7 +39,7 @@ export CTS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
export CTS_ADMIN_HASH=$(docker run --rm -h cts -v /srv/cts/conf:/srv/cts/cts/settings cts python -c "from django.contrib.auth.hashers import make_password; print make_password('${CTS_ADMIN_PWD}')") export CTS_ADMIN_HASH=$(docker run --rm -h cts -v /srv/cts/conf:/srv/cts/cts/settings cts python -c "from django.contrib.auth.hashers import make_password; print make_password('${CTS_ADMIN_PWD}')")
export CTS_ADMIN_SECRET=$(head -c 12 /dev/urandom | sha256sum | cut -c1-13) export CTS_ADMIN_SECRET=$(head -c 12 /dev/urandom | sha256sum | cut -c1-13)
envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i postgres psql cts envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i postgres psql cts
spotter-appmgr update-login cts "${CTS_ADMIN_EMAIL}" "${CTS_ADMIN_PWD}" vm-appmgr update-login cts "${CTS_ADMIN_EMAIL}" "${CTS_ADMIN_PWD}"
# Stop services required for build # Stop services required for build
service postgres stop service postgres stop

View File

@ -16,11 +16,11 @@ start() {
} }
start_post() { start_post() {
/usr/bin/spotter-appmgr register-proxy cts /usr/bin/vm-appmgr register-proxy cts
} }
stop_pre() { stop_pre() {
/usr/bin/spotter-appmgr unregister-proxy cts /usr/bin/vm-appmgr unregister-proxy cts
} }
stop() { stop() {

View File

@ -16,4 +16,4 @@ export FRONTLINESMS_ADMIN_USER_HASH=$(echo -n "${FRONTLINESMS_ADMIN_USER}" | bas
export FRONTLINESMS_ADMIN_PWD_HASH=$(echo -n "${FRONTLINESMS_ADMIN_PWD}" | 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 envsubst <${SOURCE_DIR}/srv/frontlinesms/data/app-settings.properties >/srv/frontlinesms/data/app-settings.properties
chown -R 8018:8018 /srv/frontlinesms/data chown -R 8018:8018 /srv/frontlinesms/data
spotter-appmgr update-login frontlinesms "${FRONTLINESMS_ADMIN_USER}" "${FRONTLINESMS_ADMIN_PWD}" vm-appmgr update-login frontlinesms "${FRONTLINESMS_ADMIN_USER}" "${FRONTLINESMS_ADMIN_PWD}"

View File

@ -15,11 +15,11 @@ start() {
} }
start_post() { start_post() {
/usr/bin/spotter-appmgr register-proxy frontlinesms /usr/bin/vm-appmgr register-proxy frontlinesms
} }
stop_pre() { stop_pre() {
/usr/bin/spotter-appmgr unregister-proxy frontlinesms /usr/bin/vm-appmgr unregister-proxy frontlinesms
} }
stop() { stop() {

View File

@ -27,7 +27,7 @@ export GNUHEALTH_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
echo ${GNUHEALTH_ADMIN_PWD} >/tmp/.adminpwd echo ${GNUHEALTH_ADMIN_PWD} >/tmp/.adminpwd
docker run --rm -h gnuhealth --link postgres -v /srv/gnuhealth/conf:/srv/gnuhealth/gnuhealth/tryton/server/config -v /tmp/.adminpwd:/tmp/.adminpwd -e TRYTONPASSFILE=/tmp/.adminpwd gnuhealth /srv/gnuhealth/gnuhealth/tryton/server/trytond-4.2.15/bin/trytond-admin -d gnuhealth --all -v docker run --rm -h gnuhealth --link postgres -v /srv/gnuhealth/conf:/srv/gnuhealth/gnuhealth/tryton/server/config -v /tmp/.adminpwd:/tmp/.adminpwd -e TRYTONPASSFILE=/tmp/.adminpwd gnuhealth /srv/gnuhealth/gnuhealth/tryton/server/trytond-4.2.15/bin/trytond-admin -d gnuhealth --all -v
rm -f /tmp/.adminpwd rm -f /tmp/.adminpwd
spotter-appmgr update-login gnuhealth "${GNUHEALTH_ADMIN_USER}" "${GNUHEALTH_ADMIN_PWD}" vm-appmgr update-login gnuhealth "${GNUHEALTH_ADMIN_USER}" "${GNUHEALTH_ADMIN_PWD}"
# Populate demo database # Populate demo database
wget http://health.gnu.org/downloads/postgres_dumps/gnuhealth-32-demo.sql.gz -O /tmp/gnuhealth_demo.sql.gz wget http://health.gnu.org/downloads/postgres_dumps/gnuhealth-32-demo.sql.gz -O /tmp/gnuhealth_demo.sql.gz

View File

@ -17,11 +17,11 @@ start() {
} }
start_post() { start_post() {
/usr/bin/spotter-appmgr register-proxy gnuhealth /usr/bin/vm-appmgr register-proxy gnuhealth
} }
stop_pre() { stop_pre() {
/usr/bin/spotter-appmgr unregister-proxy gnuhealth /usr/bin/vm-appmgr unregister-proxy gnuhealth
} }
stop() { stop() {

View File

@ -26,7 +26,7 @@ export KANBOARD_ADMIN_USER=admin
export KANBOARD_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) export KANBOARD_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
export KANBOARD_ADMIN_HASH=$(docker run --rm kanboard php -r "echo password_hash('${KANBOARD_ADMIN_PWD}', PASSWORD_BCRYPT);") export KANBOARD_ADMIN_HASH=$(docker run --rm kanboard php -r "echo password_hash('${KANBOARD_ADMIN_PWD}', PASSWORD_BCRYPT);")
envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i postgres psql kanboard envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i postgres psql kanboard
spotter-appmgr update-login kanboard "${KANBOARD_ADMIN_USER}" "${KANBOARD_ADMIN_PWD}" vm-appmgr update-login kanboard "${KANBOARD_ADMIN_USER}" "${KANBOARD_ADMIN_PWD}"
# Install cron job # Install cron job
cp ${SOURCE_DIR}/etc/periodic/daily/kanboard /etc/periodic/daily/kanboard cp ${SOURCE_DIR}/etc/periodic/daily/kanboard /etc/periodic/daily/kanboard

View File

@ -18,11 +18,11 @@ start() {
} }
start_post() { start_post() {
/usr/bin/spotter-appmgr register-proxy kanboard /usr/bin/vm-appmgr register-proxy kanboard
} }
stop_pre() { stop_pre() {
/usr/bin/spotter-appmgr unregister-proxy kanboard /usr/bin/vm-appmgr unregister-proxy kanboard
} }
stop() { stop() {

View File

@ -42,7 +42,7 @@ export MIFOSX_ADMIN_EMAIL=admin@example.com
export MIFOSX_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d "+") export MIFOSX_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d "+")
export MIFOSX_ADMIN_HASH=$(echo -n "${MIFOSX_ADMIN_PWD}{1}" | sha256sum | awk '{print $1}') export MIFOSX_ADMIN_HASH=$(echo -n "${MIFOSX_ADMIN_PWD}{1}" | sha256sum | awk '{print $1}')
envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i mariadb mysql mifostenant-default envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i mariadb mysql mifostenant-default
spotter-appmgr update-login mifosx "${MIFOSX_ADMIN_USER}" "${MIFOSX_ADMIN_PWD}" vm-appmgr update-login mifosx "${MIFOSX_ADMIN_USER}" "${MIFOSX_ADMIN_PWD}"
# Stop services required for build # Stop services required for build
service mariadb stop service mariadb stop

View File

@ -18,11 +18,11 @@ start() {
} }
start_post() { start_post() {
/usr/bin/spotter-appmgr register-proxy mifosx /usr/bin/vm-appmgr register-proxy mifosx
} }
stop_pre() { stop_pre() {
/usr/bin/spotter-appmgr unregister-proxy mifosx /usr/bin/vm-appmgr unregister-proxy mifosx
} }
stop() { stop() {

View File

@ -38,7 +38,7 @@ export MOTECH_ADMIN_EMAIL="admin@example.com"
export MOTECH_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) export MOTECH_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
curl -H "Content-Type: application/json" -X POST -d "{\"adminLogin\":\"${MOTECH_ADMIN_USER}\",\"adminEmail\":\"${MOTECH_ADMIN_EMAIL}\",\"adminPassword\":\"${MOTECH_ADMIN_PWD}\",\"adminConfirmPassword\":\"${MOTECH_ADMIN_PWD}\",\"language\":\"cs\",\"providerName\":\"\",\"providerUrl\":\"\",\"schedulerUrl\":\"\"}" http://${MOTECH_IP}:8080/module/server/startup/ curl -H "Content-Type: application/json" -X POST -d "{\"adminLogin\":\"${MOTECH_ADMIN_USER}\",\"adminEmail\":\"${MOTECH_ADMIN_EMAIL}\",\"adminPassword\":\"${MOTECH_ADMIN_PWD}\",\"adminConfirmPassword\":\"${MOTECH_ADMIN_PWD}\",\"language\":\"cs\",\"providerName\":\"\",\"providerUrl\":\"\",\"schedulerUrl\":\"\"}" http://${MOTECH_IP}:8080/module/server/startup/
service motech stop service motech stop
spotter-appmgr update-login motech "${MOTECH_ADMIN_USER}" "${MOTECH_ADMIN_PWD}" vm-appmgr update-login motech "${MOTECH_ADMIN_USER}" "${MOTECH_ADMIN_PWD}"
# Stop services required for build # Stop services required for build
service activemq stop service activemq stop

View File

@ -18,11 +18,11 @@ start() {
} }
start_post() { start_post() {
/usr/bin/spotter-appmgr register-proxy motech /usr/bin/vm-appmgr register-proxy motech
} }
stop_pre() { stop_pre() {
/usr/bin/spotter-appmgr unregister-proxy motech /usr/bin/vm-appmgr unregister-proxy motech
} }
stop() { stop() {

View File

@ -17,11 +17,11 @@ start() {
} }
start_post() { start_post() {
/usr/bin/spotter-appmgr register-proxy opendatakit-build /usr/bin/vm-appmgr register-proxy opendatakit-build
} }
stop_pre() { stop_pre() {
/usr/bin/spotter-appmgr unregister-proxy opendatakit-build /usr/bin/vm-appmgr unregister-proxy opendatakit-build
} }
stop() { stop() {

View File

@ -39,7 +39,7 @@ export OPENDATAKIT_ADMIN_SALT=$(head -c 4 /dev/urandom | hexdump -e '"%x"') # Mu
export OPENDATAKIT_ADMIN_BASIC_HASH=$(echo -n "${OPENDATAKIT_ADMIN_PWD}{${OPENDATAKIT_ADMIN_SALT}}" | sha1sum | tr -d " -") export OPENDATAKIT_ADMIN_BASIC_HASH=$(echo -n "${OPENDATAKIT_ADMIN_PWD}{${OPENDATAKIT_ADMIN_SALT}}" | sha1sum | tr -d " -")
export OPENDATAKIT_ADMIN_DIGEST_HASH=$(echo -n "${OPENDATAKIT_ADMIN_USER}:${OPENDATAKIT_ADMIN_REALM}:${OPENDATAKIT_ADMIN_PWD}" | md5sum | tr -d " -") export OPENDATAKIT_ADMIN_DIGEST_HASH=$(echo -n "${OPENDATAKIT_ADMIN_USER}:${OPENDATAKIT_ADMIN_REALM}:${OPENDATAKIT_ADMIN_PWD}" | md5sum | tr -d " -")
envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i postgres psql opendatakit envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i postgres psql opendatakit
spotter-appmgr update-login opendatakit "${OPENDATAKIT_ADMIN_USER}" "${OPENDATAKIT_ADMIN_PWD}" vm-appmgr update-login opendatakit "${OPENDATAKIT_ADMIN_USER}" "${OPENDATAKIT_ADMIN_PWD}"
# Stop services required for build # Stop services required for build
service postgres stop service postgres stop

View File

@ -19,11 +19,11 @@ start() {
} }
start_post() { start_post() {
/usr/bin/spotter-appmgr register-proxy opendatakit /usr/bin/vm-appmgr register-proxy opendatakit
} }
stop_pre() { stop_pre() {
/usr/bin/spotter-appmgr unregister-proxy opendatakit /usr/bin/vm-appmgr unregister-proxy opendatakit
} }
stop() { stop() {

View File

@ -15,4 +15,4 @@ mkdir -p /srv/openmapkit/conf /srv/openmapkit/data
chown -R 8007:8007 /srv/openmapkit/data chown -R 8007:8007 /srv/openmapkit/data
docker run --rm -v /srv/openmapkit/data:/mnt/data openmapkit cp -rp /srv/openmapkit/data/. /mnt/data docker run --rm -v /srv/openmapkit/data:/mnt/data openmapkit cp -rp /srv/openmapkit/data/. /mnt/data
envsubst <${SOURCE_DIR}/srv/openmapkit/conf/settings.js >/srv/openmapkit/conf/settings.js envsubst <${SOURCE_DIR}/srv/openmapkit/conf/settings.js >/srv/openmapkit/conf/settings.js
spotter-appmgr update-login openmapkit "${OPENMAPKIT_ADMIN_USER}" "${OPENMAPKIT_ADMIN_PWD}" vm-appmgr update-login openmapkit "${OPENMAPKIT_ADMIN_USER}" "${OPENMAPKIT_ADMIN_PWD}"

View File

@ -16,11 +16,11 @@ start() {
} }
start_post() { start_post() {
/usr/bin/spotter-appmgr register-proxy openmapkit /usr/bin/vm-appmgr register-proxy openmapkit
} }
stop_pre() { stop_pre() {
/usr/bin/spotter-appmgr unregister-proxy openmapkit /usr/bin/vm-appmgr unregister-proxy openmapkit
} }
stop() { stop() {

View File

@ -55,7 +55,7 @@ export PANDORA_ADMIN_EMAIL=admin@example.com
export PANDORA_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) export PANDORA_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
export PANDORA_ADMIN_HASH=$(docker run --rm -h pandora -e DJANGO_SETTINGS_MODULE=pandora.settings -v /srv/pandora/conf:/srv/pandora/conf pandora python3 -c "from django.contrib.auth.hashers import make_password; print(make_password('${PANDORA_ADMIN_PWD}'))") export PANDORA_ADMIN_HASH=$(docker run --rm -h pandora -e DJANGO_SETTINGS_MODULE=pandora.settings -v /srv/pandora/conf:/srv/pandora/conf pandora python3 -c "from django.contrib.auth.hashers import make_password; print(make_password('${PANDORA_ADMIN_PWD}'))")
envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i postgres psql pandora envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i postgres psql pandora
spotter-appmgr update-login pandora "${PANDORA_ADMIN_USER}" "${PANDORA_ADMIN_PWD}" vm-appmgr update-login pandora "${PANDORA_ADMIN_USER}" "${PANDORA_ADMIN_PWD}"
# Stop services required for build # Stop services required for build
service rabbitmq stop service rabbitmq stop

View File

@ -19,11 +19,11 @@ start() {
} }
start_post() { start_post() {
/usr/bin/spotter-appmgr register-proxy pandora /usr/bin/vm-appmgr register-proxy pandora
} }
stop_pre() { stop_pre() {
/usr/bin/spotter-appmgr unregister-proxy pandora /usr/bin/vm-appmgr unregister-proxy pandora
} }
stop() { stop() {

View File

@ -30,7 +30,7 @@ export SAHANADEMO_ADMIN_USER=admin@example.com
export SAHANADEMO_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) export SAHANADEMO_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
envsubst <${SOURCE_DIR}/srv/sahana-demo/conf/000_config.py >/srv/sahana-demo/conf/000_config.py envsubst <${SOURCE_DIR}/srv/sahana-demo/conf/000_config.py >/srv/sahana-demo/conf/000_config.py
envsubst <${SOURCE_DIR}/masterUsers.csv >/tmp/masterUsers.csv envsubst <${SOURCE_DIR}/masterUsers.csv >/tmp/masterUsers.csv
spotter-appmgr update-login sahana-demo "${SAHANADEMO_ADMIN_USER}" "${SAHANADEMO_ADMIN_PWD}" vm-appmgr update-login sahana-demo "${SAHANADEMO_ADMIN_USER}" "${SAHANADEMO_ADMIN_PWD}"
# Populate database # Populate database
docker run --rm -h sahana-demo --link postgres -v /srv/sahana-demo/conf:/srv/web2py/applications/eden/models -v /srv/sahana-demo/data/${TEMPLATE}:/srv/web2py/applications/eden/modules/templates/${TEMPLATE} -v /srv/sahana-demo/data/databases:/srv/web2py/applications/eden/databases -v /tmp/masterUsers.csv:/srv/web2py/applications/eden/modules/templates/default/users/masterUsers.csv sahana su - sahana -c "./web2py.py -S eden -M -R applications/eden/static/scripts/tools/noop.py" docker run --rm -h sahana-demo --link postgres -v /srv/sahana-demo/conf:/srv/web2py/applications/eden/models -v /srv/sahana-demo/data/${TEMPLATE}:/srv/web2py/applications/eden/modules/templates/${TEMPLATE} -v /srv/sahana-demo/data/databases:/srv/web2py/applications/eden/databases -v /tmp/masterUsers.csv:/srv/web2py/applications/eden/modules/templates/default/users/masterUsers.csv sahana su - sahana -c "./web2py.py -S eden -M -R applications/eden/static/scripts/tools/noop.py"

View File

@ -20,11 +20,11 @@ start() {
} }
start_post() { start_post() {
/usr/bin/spotter-appmgr register-proxy sahana-demo /usr/bin/vm-appmgr register-proxy sahana-demo
} }
stop_pre() { stop_pre() {
/usr/bin/spotter-appmgr unregister-proxy sahana-demo /usr/bin/vm-appmgr unregister-proxy sahana-demo
} }
stop() { stop() {

View File

@ -33,7 +33,7 @@ export SAHANA_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
envsubst <${SOURCE_DIR}/srv/sahana/conf/000_config.py >/srv/sahana/conf/000_config.py envsubst <${SOURCE_DIR}/srv/sahana/conf/000_config.py >/srv/sahana/conf/000_config.py
envsubst <${SOURCE_DIR}/srv/sahana/data/Spotter/masterUsers.csv >/srv/sahana/data/Spotter/masterUsers.csv envsubst <${SOURCE_DIR}/srv/sahana/data/Spotter/masterUsers.csv >/srv/sahana/data/Spotter/masterUsers.csv
cp ${SOURCE_DIR}/srv/sahana/conf/00_settings.py /srv/sahana/conf/00_settings.py cp ${SOURCE_DIR}/srv/sahana/conf/00_settings.py /srv/sahana/conf/00_settings.py
spotter-appmgr update-login sahana "${SAHANA_ADMIN_USER}" "${SAHANA_ADMIN_PWD}" vm-appmgr update-login sahana "${SAHANA_ADMIN_USER}" "${SAHANA_ADMIN_PWD}"
# Populate database # Populate database
docker run --rm -h sahana --link postgres -v /srv/sahana/conf:/srv/web2py/applications/eden/models -v /srv/sahana/data/Spotter:/srv/web2py/applications/eden/modules/templates/Spotter -v /srv/sahana/data/databases:/srv/web2py/applications/eden/databases sahana su - sahana -c "./web2py.py -S eden -M -R applications/eden/static/scripts/tools/noop.py" docker run --rm -h sahana --link postgres -v /srv/sahana/conf:/srv/web2py/applications/eden/models -v /srv/sahana/data/Spotter:/srv/web2py/applications/eden/modules/templates/Spotter -v /srv/sahana/data/databases:/srv/web2py/applications/eden/databases sahana su - sahana -c "./web2py.py -S eden -M -R applications/eden/static/scripts/tools/noop.py"

View File

@ -20,11 +20,11 @@ start() {
} }
start_post() { start_post() {
/usr/bin/spotter-appmgr register-proxy sahana /usr/bin/vm-appmgr register-proxy sahana
} }
stop_pre() { stop_pre() {
/usr/bin/spotter-appmgr unregister-proxy sahana /usr/bin/vm-appmgr unregister-proxy sahana
} }
stop() { stop() {

View File

@ -31,7 +31,7 @@ envsubst <${SOURCE_DIR}/srv/sambro/conf/000_config.py >/srv/sambro/conf/000_conf
envsubst <${SOURCE_DIR}/masterUsers.csv >/tmp/masterUsers.csv envsubst <${SOURCE_DIR}/masterUsers.csv >/tmp/masterUsers.csv
cp ${SOURCE_DIR}/srv/sambro/conf/00_settings.py /srv/sambro/conf/00_settings.py cp ${SOURCE_DIR}/srv/sambro/conf/00_settings.py /srv/sambro/conf/00_settings.py
cp ${SOURCE_DIR}/srv/sambro/data/SAMBRO/config.py /srv/sambro/data/SAMBRO/config.py cp ${SOURCE_DIR}/srv/sambro/data/SAMBRO/config.py /srv/sambro/data/SAMBRO/config.py
spotter-appmgr update-login sambro "${SAMBRO_ADMIN_USER}" "${SAMBRO_ADMIN_PWD}" vm-appmgr update-login sambro "${SAMBRO_ADMIN_USER}" "${SAMBRO_ADMIN_PWD}"
# Populate database # Populate database
docker run --rm -h sambro --link postgres -v /srv/sambro/conf:/srv/web2py/applications/eden/models -v /srv/sambro/data/SAMBRO:/srv/web2py/applications/eden/modules/templates/SAMBRO -v /tmp/masterUsers.csv:/srv/web2py/applications/eden/modules/templates/default/users/masterUsers.csv -v /srv/sambro/data/databases:/srv/web2py/applications/eden/databases sahana su - sahana -c "./web2py.py -S eden -M -R applications/eden/static/scripts/tools/noop.py" docker run --rm -h sambro --link postgres -v /srv/sambro/conf:/srv/web2py/applications/eden/models -v /srv/sambro/data/SAMBRO:/srv/web2py/applications/eden/modules/templates/SAMBRO -v /tmp/masterUsers.csv:/srv/web2py/applications/eden/modules/templates/default/users/masterUsers.csv -v /srv/sambro/data/databases:/srv/web2py/applications/eden/databases sahana su - sahana -c "./web2py.py -S eden -M -R applications/eden/static/scripts/tools/noop.py"

View File

@ -20,11 +20,11 @@ start() {
} }
start_post() { start_post() {
/usr/bin/spotter-appmgr register-proxy sambro /usr/bin/vm-appmgr register-proxy sambro
} }
stop_pre() { stop_pre() {
/usr/bin/spotter-appmgr unregister-proxy sambro /usr/bin/vm-appmgr unregister-proxy sambro
} }
stop() { stop() {

View File

@ -32,7 +32,7 @@ export SEEDDMS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
export SEEDDMS_ADMIN_EMAIL=admin@example.com export SEEDDMS_ADMIN_EMAIL=admin@example.com
envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i postgres psql seeddms envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i postgres psql seeddms
chown -R 8010:8010 /srv/seeddms/conf chown -R 8010:8010 /srv/seeddms/conf
spotter-appmgr update-login seeddms "${SEEDDMS_ADMIN_USER}" "${SEEDDMS_ADMIN_PWD}" vm-appmgr update-login seeddms "${SEEDDMS_ADMIN_USER}" "${SEEDDMS_ADMIN_PWD}"
# Install cron job # Install cron job
cp ${SOURCE_DIR}/etc/periodic/hourly/seeddms /etc/periodic/hourly/seeddms cp ${SOURCE_DIR}/etc/periodic/hourly/seeddms /etc/periodic/hourly/seeddms

View File

@ -18,11 +18,11 @@ start() {
} }
start_post() { start_post() {
/usr/bin/spotter-appmgr register-proxy seeddms /usr/bin/vm-appmgr register-proxy seeddms
} }
stop_pre() { stop_pre() {
/usr/bin/spotter-appmgr unregister-proxy seeddms /usr/bin/vm-appmgr unregister-proxy seeddms
} }
stop() { stop() {

View File

@ -44,7 +44,7 @@ sed -i "s|\$2a\$10\$pMcTA1p9fefR8U9NoOPei.H0eq/TbbdSF27M0tn9iDWBrA4JHeCDC|${SIGM
cat /tmp/sigmah-MinimumDataKit.sql | docker exec -i -e PGPASSWORD=${SIGMAH_PWD} postgres psql -U sigmah sigmah cat /tmp/sigmah-MinimumDataKit.sql | docker exec -i -e PGPASSWORD=${SIGMAH_PWD} postgres psql -U sigmah sigmah
cat /tmp/sigmah-newOrganizationLaunchScript.sql | docker exec -i -e PGPASSWORD=${SIGMAH_PWD} postgres psql -U sigmah sigmah cat /tmp/sigmah-newOrganizationLaunchScript.sql | docker exec -i -e PGPASSWORD=${SIGMAH_PWD} postgres psql -U sigmah sigmah
rm -f /tmp/sigmah-MinimumDataKit.sql /tmp/sigmah-newOrganizationLaunchScript.sql rm -f /tmp/sigmah-MinimumDataKit.sql /tmp/sigmah-newOrganizationLaunchScript.sql
spotter-appmgr update-login sigmah "${SIGMAH_ADMIN_EMAIL}" "${SIGMAH_ADMIN_PWD}" vm-appmgr update-login sigmah "${SIGMAH_ADMIN_EMAIL}" "${SIGMAH_ADMIN_PWD}"
# Stop services required for build # Stop services required for build
service postgres stop service postgres stop

View File

@ -19,11 +19,11 @@ start() {
} }
start_post() { start_post() {
/usr/bin/spotter-appmgr register-proxy sigmah /usr/bin/vm-appmgr register-proxy sigmah
} }
stop_pre() { stop_pre() {
/usr/bin/spotter-appmgr unregister-proxy sigmah /usr/bin/vm-appmgr unregister-proxy sigmah
} }
stop() { stop() {

View File

@ -31,7 +31,7 @@ export USHAHIDI_ADMIN_USER=admin@example.com
export USHAHIDI_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) export USHAHIDI_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
export USHAHIDI_ADMIN_HASH=$(docker run --rm ushahidi php -r "echo password_hash('${USHAHIDI_ADMIN_PWD}', PASSWORD_BCRYPT);") export USHAHIDI_ADMIN_HASH=$(docker run --rm ushahidi php -r "echo password_hash('${USHAHIDI_ADMIN_PWD}', PASSWORD_BCRYPT);")
envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i mariadb mysql ushahidi envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i mariadb mysql ushahidi
spotter-appmgr update-login ushahidi "${USHAHIDI_ADMIN_USER}" "${USHAHIDI_ADMIN_PWD}" vm-appmgr update-login ushahidi "${USHAHIDI_ADMIN_USER}" "${USHAHIDI_ADMIN_PWD}"
# Install cron job # Install cron job
cp ${SOURCE_DIR}/etc/periodic/15min/ushahidi /etc/periodic/15min/ushahidi cp ${SOURCE_DIR}/etc/periodic/15min/ushahidi /etc/periodic/15min/ushahidi

View File

@ -19,11 +19,11 @@ start() {
} }
start_post() { start_post() {
/usr/bin/spotter-appmgr register-proxy ushahidi /usr/bin/vm-appmgr register-proxy ushahidi
} }
stop_pre() { stop_pre() {
/usr/bin/spotter-appmgr unregister-proxy ushahidi /usr/bin/vm-appmgr unregister-proxy ushahidi
} }
stop() { stop() {

View File

@ -7,13 +7,13 @@ if (empty($url)) {
if(substr($url, -1) == '/') { if(substr($url, -1) == '/') {
$url = substr($url, 0, -1); $url = substr($url, 0, -1);
} }
$url .= '/spotter-ping'; $url .= '/vm-ping';
$ch = curl_init($url); $ch = curl_init($url);
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_HEADER => FALSE, CURLOPT_SSL_VERIFYHOST => FALSE, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_TIMEOUT => 4]); curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_HEADER => FALSE, CURLOPT_SSL_VERIFYHOST => FALSE, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_TIMEOUT => 4]);
$content = curl_exec($ch); $content = curl_exec($ch);
curl_close($ch); curl_close($ch);
if ($content == 'spotter-pong') { if ($content == 'vm-pong') {
echo 'spotter-pong'; echo 'vm-pong';
} }