From 724d901ab8cd06a80e1430d8754ab2661ee9099b Mon Sep 17 00:00:00 2001 From: Mauricio Villegas Date: Thu, 8 Oct 2020 19:39:59 +0200 Subject: [PATCH] - Changed docker file to use more recent software, base ubuntu 20.04. - uid and gid of www-data can now be set via environment variables: WWWDATA_UID, WWWDATA_GID --- Dockerfile | 4 ++-- README.md | 2 +- package.json | 2 +- web-app/common.inc.php | 4 ++-- web-app/start-server.sh | 14 ++++++++------ 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4e99887..8a3c625 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM library/ubuntu:16.04 +FROM ubuntu:20.04 -MAINTAINER Mauricio Villegas +LABEL maintainer="Mauricio Villegas " ### Install pre-requisites ### RUN apt-get update --fix-missing \ diff --git a/README.md b/README.md index 8f61e03..b25e2e6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ nw-page-editor - Simple app for visual editing of Page XML files. -Version: 2020.10.02 +Version: 2020.10.08 # Description diff --git a/package.json b/package.json index 477e6ec..fbc6e75 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nw-page-editor", - "version": "2020.10.02", + "version": "2020.10.08", "description": "Simple app for visual editing of Page XML files", "main": "./html/index.html#1", "author": "Mauricio Villegas ", diff --git a/web-app/common.inc.php b/web-app/common.inc.php index 7c0f9b6..32f0b50 100644 --- a/web-app/common.inc.php +++ b/web-app/common.inc.php @@ -2,13 +2,13 @@ /** * Common code to be executed by other php scripts. * - * @version $Version: 2020.10.02$ + * @version $Version: 2020.10.08$ * @author Mauricio Villegas * @copyright Copyright(c) 2017-present, Mauricio Villegas * @license MIT License */ -$version = str_replace('Version: ','',"Version: 2020.10.02"); +$version = str_replace('Version: ','',"Version: 2020.10.08"); $v = '?v='.$version; /// User authentication /// diff --git a/web-app/start-server.sh b/web-app/start-server.sh index 5a07df1..7150bf8 100755 --- a/web-app/start-server.sh +++ b/web-app/start-server.sh @@ -1,19 +1,21 @@ #!/bin/bash ## -## @version $Version: 2017.09.24$ +## @version $Version: 2020.10.08$ ## @author Mauricio Villegas ## @copyright Copyright(c) 2016-present, Mauricio Villegas ## @license MIT License ## -### Change user and group IDs of www-data to that of /var/www/nw-page-editor/data directory ### -usermod -u $(stat -c %u /var/www/nw-page-editor/data) www-data; -groupmod -g $(stat -c %g /var/www/nw-page-editor/data) www-data; +## Change user and group IDs of www-data to that of /var/www/nw-page-editor/data directory ## +[ "$WWWDATA_UID" = "" ] && WWWDATA_UID=$(stat -c %u /var/www/nw-page-editor/data); +[ "$WWWDATA_GID" = "" ] && WWWDATA_GID=$(stat -c %g /var/www/nw-page-editor/data); +usermod -u $WWWDATA_UID www-data; +groupmod -g $WWWDATA_GID www-data; chown :www-data /var/www/nw-page-editor/app; chmod g+w /var/www/nw-page-editor/app; -### Start the git commit daemon ### +## Start the git commit daemon ## if [ -d "/var/www/nw-page-editor/data/.git" ]; then cd /var/www/nw-page-editor/data; export HOME="/var/www"; @@ -34,5 +36,5 @@ if [ -d "/var/www/nw-page-editor/data/.git" ]; then fi fi -### Start apache server ### +## Start apache server ## apachectl -D FOREGROUND;