Skip to content

Commit

Permalink
FOSSBilling#1583 initial workflow update using debug reference in con…
Browse files Browse the repository at this point in the history
…fig for install dir bypass
  • Loading branch information
Ron-Zarbyte committed Sep 11, 2023
1 parent 01fa1d3 commit ed30808
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ npm-debug.log

### friendsofphp/php-cs-fixer ###
src/.php-cs-fixer.cache
.php-cs-fixer.cache
.php-cs-fixer.cache

# Developer Workflow
src/themes/*/config/settings_data.json
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM php:8.1-apache

RUN a2enmod rewrite headers

RUN docker-php-ext-install pdo pdo_mysql

ADD . /var/www/html
23 changes: 23 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: "3.8"

services:
web:
build:
dockerfile: Dockerfile
context: ./
image: php:8.1-apache
ports:
- 80:80
volumes:
- ./src:/var/www/html
mysql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: fossroot
MYSQL_DATABASE: fossdb
MYSQL_USER: fossdb
MYSQL_PASSWORD: fossdb
volumes:
- mysql:/var/lib/mysql
volumes:
mysql:
4 changes: 3 additions & 1 deletion src/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ function checkInstaller()

// Check if /install directory still exists after installation has been completed.
if ($filesystem->exists(PATH_CONFIG) && $filesystem->exists('install/index.php')) {
throw new Exception('For security reasons, you have to delete the install directory before you can use FOSSBilling.', 2);
// Throw exception only if debug mode is NOT enabled.
$config = require PATH_CONFIG;
if (! $config['debug']) throw new Exception('For security reasons, you have to delete the install directory before you can use FOSSBilling.', 2);
}
}

Expand Down

0 comments on commit ed30808

Please sign in to comment.