You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks for all the hard work on this container setup. We've done it in the past, but never as comprehensive as this project.
There is a small issue with how the PHP config is written. Namely, it appends on each container start, rather than overwriting it, and it's visible only when the PHP error logging is enabled. This becomes an issue if the container is restarted: the main page doesn't redirect to login.php, and all pages show a fair number of warnings (that number increments with each container restart).
One way to solve it would be to write out the entire file via entrypoint, without having a static config + dynamic append. For example, a combined version:
###
### Create configuration
###
cat > /var/www/html/config/config.inc.php <<EOF
<?php
# If you are having problems connecting to the MySQL database and all of the variables below are correct
# try changing the 'db_server' variable from localhost to 127.0.0.1. Fixes a problem due to sockets.
# Thanks to @digininja for the fix.
# Database management system to use
\$DBMS = 'MySQL';
# Database variables
# WARNING: The database specified under db_database WILL BE ENTIRELY DELETED during setup.
# Please use a database dedicated to DVWA.
#
# If you are using MariaDB then you cannot use root, you must use create a dedicated DVWA user.
# See README.md for more information on this.
\$_DVWA = array();
\$_DVWA[ 'db_port'] = '3306';
\$_DVWA[ 'db_server' ] = '${MYSQL_HOSTNAME}';
\$_DVWA[ 'db_database' ] = '${MYSQL_DATABASE}';
\$_DVWA[ 'db_user' ] = '${MYSQL_USERNAME}';
\$_DVWA[ 'db_password' ] = '${MYSQL_PASSWORD}';
\$_DVWA[ 'recaptcha_public_key' ] = '${DEF_RECAPTCHA_PUB_KEY}';
\$_DVWA[ 'recaptcha_private_key' ] = '${DEF_RECAPTCHA_PRIV_KEY}';
\$_DVWA[ 'default_security_level' ] = '${DEF_SECURITY_LEVEL}';
\$_DVWA[ 'default_phpids_level' ] = '${DEF_PHPIDS_ENABLED}';
\$_DVWA[ 'default_phpids_verbose' ] = '${DEF_PHPIDS_VERBOSE}';
define ("MYSQL", "mysql");
define ("SQLITE", "sqlite");
# TODO: make this configurable via docker env vars
\$_DVWA["SQLI_DB"] = MYSQL;
#\$_DVWA["SQLI_DB"] = SQLITE;
#\$_DVWA["SQLITE_DB"] = "sqli.db";
?>
EOF
Cheers!
The text was updated successfully, but these errors were encountered:
Hello,
First of all, thanks for all the hard work on this container setup. We've done it in the past, but never as comprehensive as this project.
There is a small issue with how the PHP config is written. Namely, it appends on each container start, rather than overwriting it, and it's visible only when the PHP error logging is enabled. This becomes an issue if the container is restarted: the main page doesn't redirect to login.php, and all pages show a fair number of warnings (that number increments with each container restart).
https://github.com/cytopia/docker-dvwa/blob/master/docker/entrypoint.sh#L113
main page:
login page:
One way to solve it would be to write out the entire file via entrypoint, without having a static config + dynamic append. For example, a combined version:
Cheers!
The text was updated successfully, but these errors were encountered: