Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to disable basic authentication when using docker #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ $config = array(

Remove the ```auth``` section in the config file to disable the protection.

If you are using docker, setting a blank username and/or password will also disable the protection.

```
-e "PHPREDMIN_AUTH_USERNAME="
```

_Note:_ You should use the [password_hash](http://php.net/manual/en/function.password-hash.php) function with your desired password and store the result in the ```password``` key, instead of storing the plaintext password as in the code above.

## Features
Expand Down
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3'
services:
phpredmin:
# image: sasanrose/phpredmin
build: .
environment:
- PHPREDMIN_DATABASE_REDIS_0_HOST=redis
- PHPREDMIN_AUTH_USERNAME=root
ports:
- "8089:80"
depends_on:
- redis
redis:
image: redis
2 changes: 1 addition & 1 deletion public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function __autoload($class)

$auth = App::instance()->config['auth'];

if(isset($auth['username']) && isset($auth['password']))
if(isset($auth['username']) && isset($auth['password']) && !empty($auth['username']) && !empty($auth['password']))
{
// mod_php
if (isset($_SERVER['PHP_AUTH_USER'])) {
Expand Down