From c55934e3ddf60b68963c62319c832453cb76a00e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Sun, 30 Jul 2017 14:20:12 +0200 Subject: [PATCH] Fixed install issues Added docker-compose --- docker-compose.yml | 36 ++++++++++++++++++++++++++++ includes/FIRST_INSTALL | 0 includes/common.php | 2 +- install/index.php | 12 +++++++--- install/install.sql | 2 +- styles/templates/install/ins_acc.tpl | 6 ++--- 6 files changed, 50 insertions(+), 8 deletions(-) create mode 100644 docker-compose.yml delete mode 100644 includes/FIRST_INSTALL diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..13377586e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,36 @@ +version: '2' +services: + web: + image: webdevops/php-apache-dev:ubuntu-16.04 + depends_on: + - db + volumes: + - .:/app + environment: + DB_HOST: database + DB_USER: 2moons + DB_PASSWORD: 2moons + DB_NAME: 2moons + ADMIN_NAME: admin + ADMIN_PASSWORD: admin + ADMIN_MAIL: mail@example.com + ports: + - 8080:80 + networks: + - 2moons + db: + image: mariadb + environment: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: 2moons + MYSQL_USER: 2moons + MYSQL_PASSWORD: 2moons + ports: + - 3306:3306 + networks: + 2moons: + aliases: + - database + +networks: + 2moons: \ No newline at end of file diff --git a/includes/FIRST_INSTALL b/includes/FIRST_INSTALL deleted file mode 100644 index e69de29bb..000000000 diff --git a/includes/common.php b/includes/common.php index 8424816c1..d04eba226 100644 --- a/includes/common.php +++ b/includes/common.php @@ -73,7 +73,7 @@ return; } -if(!file_exists('includes/config.php')) { +if(!file_exists('includes/config.php') || filesize('includes/config.php') === 0) { HTTP::redirectTo('install/index.php'); } diff --git a/install/index.php b/install/index.php index 724408250..f5dee93ff 100644 --- a/install/index.php +++ b/install/index.php @@ -388,7 +388,7 @@ $template->assign(array( 'host' => getenv('DB_HOST'), 'user' => getenv('DB_USER'), - 'password' => getenv('DB_USER'), + 'password' => getenv('DB_PASSWORD'), 'dbname' => getenv('DB_NAME'), )); $template->show('ins_form.tpl'); @@ -503,12 +503,13 @@ $db->query(str_replace(array( '%PREFIX%', '%VERSION%', - '%REVISION%' + '%REVISION%', + '%DB_VERSION%' ), array( DB_PREFIX, $installVersion, $installRevision, - $installSQL + DB_VERSION_REQUIRED ), $installSQL)); $config = Config::get(Universe::current()); @@ -543,6 +544,11 @@ } break; case 7: + $template->assign(array( + 'name' => getenv('ADMIN_NAME'), + 'password' => getenv('ADMIN_PASSWORD'), + 'mail' => getenv('ADMIN_MAIL'), + )); $template->show('ins_acc.tpl'); break; case 8: diff --git a/install/install.sql b/install/install.sql index a880c99fa..79825c22e 100644 --- a/install/install.sql +++ b/install/install.sql @@ -939,7 +939,7 @@ INSERT INTO `%PREFIX%cronjobs` (`cronjobID`, `name`, `isActive`, `min`, `hours`, (NULL, 'tracking', 1, FLOOR(RAND() * 60), FLOOR(RAND() * 24), '*', '*', '0', 'TrackingCronjob', 0, NULL); INSERT INTO `%PREFIX%system` (`dbVersion`) VALUES -(2); +(%DB_VERSION%); INSERT INTO `%PREFIX%ticket_category` (`categoryID`, `name`) VALUES (1, 'Support'); diff --git a/styles/templates/install/ins_acc.tpl b/styles/templates/install/ins_acc.tpl index 33c9515b2..9c9e29d21 100644 --- a/styles/templates/install/ins_acc.tpl +++ b/styles/templates/install/ins_acc.tpl @@ -8,15 +8,15 @@ - + - + - +

{$LNG.step4_admin_name}

{$LNG.step4_admin_name_desc}

{$LNG.step4_admin_pass}

{$LNG.step4_admin_pass_desc}

{$LNG.step4_admin_mail}