Make Ushahidi SPOC-compatible, cont'd
This commit is contained in:
parent
6cb0440d4a
commit
268dc6447c
@ -15,7 +15,8 @@
|
||||
],
|
||||
"mounts": {
|
||||
"ushahidi/ushahidi_conf/env": "srv/ushahidi/platform/.env:file",
|
||||
"ushahidi/ushahidi_data": "srv/ushahidi/platform/application/media/uploads"
|
||||
"ushahidi/ushahidi_conf/config.json": "srv/ushahidi/config.json:file",
|
||||
"ushahidi/ushahidi_data": "srv/ushahidi/platform/storage"
|
||||
}
|
||||
},
|
||||
"ushahidi-redis": {
|
||||
|
@ -3,7 +3,7 @@ FROM alpine3.11-php7.3_7.3.15-200313
|
||||
|
||||
RUN EOF
|
||||
# Install runtime dependencies
|
||||
apk --no-cache add php7-curl php7-imap php7-mysqli php7-pdo_mysql
|
||||
apk --no-cache add php7-curl php7-imap php7-mysqli php7-pecl-memcached php7-pecl-redis php7-pdo_mysql
|
||||
|
||||
# Download Ushahidi
|
||||
wget https://github.com/ushahidi/platform-client/releases/download/v4.4.1/ushahidi-platform-client-bundle-v4.4.1.tar.gz -O - | tar xzf - -C /srv
|
||||
@ -14,7 +14,8 @@ RUN EOF
|
||||
# Create OS user
|
||||
addgroup -S -g 8080 ushahidi
|
||||
adduser -S -u 8080 -h /srv/ushahidi -s /bin/false -g ushahidi -G ushahidi ushahidi
|
||||
chown -R ushahidi:ushahidi /srv/ushahidi/platform/application/logs /srv/ushahidi/platform/application/cache /srv/ushahidi/platform/application/media/uploads
|
||||
mkdir /srv/ushahidi/platform/storage
|
||||
chown -R ushahidi:ushahidi /srv/ushahidi/platform/storage
|
||||
EOF
|
||||
|
||||
COPY image.d
|
||||
|
@ -23,10 +23,10 @@ http {
|
||||
server_name localhost;
|
||||
|
||||
root /srv/ushahidi;
|
||||
index index.php;
|
||||
index index.html index.php;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
try_files $uri $uri/ /index.html /index.php;
|
||||
}
|
||||
|
||||
location /platform {
|
||||
|
@ -4,6 +4,8 @@ set -ev
|
||||
# Volumes
|
||||
MARIADB_CONF="${VOLUMES_DIR}/ushahidi/mariadb_conf"
|
||||
MARIADB_DATA="${VOLUMES_DIR}/ushahidi/mariadb_data"
|
||||
REDIS_CONF="${VOLUMES_DIR}/ushahidi/redis_conf"
|
||||
REDIS_DATA="${VOLUMES_DIR}/ushahidi/redis_data"
|
||||
USHAHIDI_CONF="${VOLUMES_DIR}/ushahidi/ushahidi_conf"
|
||||
USHAHIDI_DATA="${VOLUMES_DIR}/ushahidi/ushahidi_data"
|
||||
|
||||
@ -11,7 +13,7 @@ USHAHIDI_DATA="${VOLUMES_DIR}/ushahidi/ushahidi_data"
|
||||
install -o 100000 -g 100000 -m 755 -d ${MARIADB_CONF}
|
||||
install -o 103306 -g 103306 -m 750 -d ${MARIADB_DATA}
|
||||
install -o 100000 -g 100000 -m 644 mariadb_conf/my.cnf ${MARIADB_CONF}/my.cnf
|
||||
spoc-container exec mifosx-mariadb -- mysql_install_db --user=mysql --datadir=/var/lib/mysql --auth-root-authentication-method=socket --skip-test-db
|
||||
spoc-container exec ushahidi-mariadb -- mysql_install_db --user=mysql --datadir=/var/lib/mysql --auth-root-authentication-method=socket --skip-test-db
|
||||
|
||||
# Create database
|
||||
export USHAHIDI_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=')
|
||||
@ -25,11 +27,13 @@ install -o 100000 -g 106379 -m 640 redis_conf/redis.conf ${REDIS_CONF}/redis.con
|
||||
spoc-container start ushahidi-redis
|
||||
|
||||
# Configure Ushahidi
|
||||
USHAHIDI_APPKEY=$(spoc-container exec ushahidi -- sh -c 'cd /srv/ushahidi/platform; php artisan key:generate')
|
||||
install -o 108080 -g 100000 -m 750 -d ${USHAHIDI_CONF}
|
||||
export USHAHIDI_APPKEY=$(head -c 32 /dev/urandom | base64 | tr -d '+/=' | cut -c0-32) # Must be exactly 32 characters
|
||||
install -o 100000 -g 108080 -m 750 -d ${USHAHIDI_CONF}
|
||||
install -o 108080 -g 108080 -m 755 -d ${USHAHIDI_DATA}
|
||||
envsubst <ushahidi_conf/env | install -o 108080 -g 100000 -m 640 /dev/stdin ${USHAHIDI_CONF}/env
|
||||
install -o 108080 -g 108080 -m 640 ushahidi_conf/config.json ${USHAHIDI_CONF}/config.json
|
||||
install -o 108080 -g 108080 -m 755 -d ${USHAHIDI_DATA}/passport
|
||||
envsubst <ushahidi_conf/env | install -o 100000 -g 108080 -m 640 /dev/stdin ${USHAHIDI_CONF}/env
|
||||
install -o 100000 -g 108080 -m 644 ushahidi_conf/config.json ${USHAHIDI_CONF}/config.json
|
||||
spoc-container exec ushahidi -- sh -c 'cd /srv/ushahidi/platform; php artisan passport:keys'
|
||||
|
||||
# Populate database
|
||||
spoc-container exec ushahidi -- sh -c 'cd /srv/ushahidi/platform; php artisan migrate'
|
||||
|
6
lxc-apps/ushahidi/install/ushahidi_conf/config.json
Normal file
6
lxc-apps/ushahidi/install/ushahidi_conf/config.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"backend_url": "https://ush.spotter.vm/platform",
|
||||
"client_id": "ushahidiui",
|
||||
"client_secret": "35e7f0bca957836d05ca0492211b0ac707671261",
|
||||
"google_analytics_id": ""
|
||||
}
|
@ -4,11 +4,12 @@ APP_KEY=${USHAHIDI_APPKEY}
|
||||
APP_TIMEZONE=Europe/Prague
|
||||
APP_LANGUAGES=cs,en
|
||||
|
||||
DB_TYPE=mysql
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=ushahidi-mariadb
|
||||
DB_NAME=ushahidi
|
||||
DB_USER=ushahidi
|
||||
DB_PASS=${USHAHIDI_PWD}
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=ushahidi
|
||||
DB_USERNAME=ushahidi
|
||||
DB_PASSWORD=${USHAHIDI_PWD}
|
||||
|
||||
CACHE_DRIVER=redis
|
||||
QUEUE_DRIVER=redis
|
||||
|
Loading…
Reference in New Issue
Block a user