entrypoint appends to the config file, resulting in errors after
- Dominant language
- Makefile
- Stars
- 63
- Forks
- 36
- PR merge metrics
- No merged PRs in 30d
Description
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:
```
###
### Create configuration
###
cat > /var/www/html/config/config.inc.php <
EOF
```
Cheers!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in docker/entrypoint.sh around line 113 and inspect how /var/www/html/config/config.inc.php is written. Recreate the issue by restarting the container with PHP error logging enabled, then verify that the configuration is recreated rather than accumulated and that warnings do not increase across restarts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, php, shell
- Domain
- backend, devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100