Giter Club home page Giter Club logo

Comments (6)

ps-feng avatar ps-feng commented on June 29, 2024 4

For the sake of completion, here's the login-password-less.php file that allows password-less access. For DBs without password, enter admin as the password.

<?php
require_once('plugins/login-password-less.php');

/** Set allowed password
	* @param string result of password_hash
	*/
return new AdminerLoginPasswordLess(
	$password_hash = password_hash("admin", PASSWORD_DEFAULT)
);

from docker-adminer.

TimWolla avatar TimWolla commented on June 29, 2024 3

Am I missing something ?

Yes. The ADMINER_PLUGINS environment variable is needed for the “autoloader” that set's up the file in plugins-enabled automatically. If you create the file yourself you must not add the plugin to the environment, because it would be overridden.

from docker-adminer.

TimWolla avatar TimWolla commented on June 29, 2024 1

PASSWORD_DEFAULT is global php variable, or docker environment variable, or placeholder for us to change?

That is a PHP constant to indicate the password hashing algorithm to use. Adminer expects a hashed password and that call will create a valid hash ad-hoc. As of right now PASSWORD_DEFAULT will result in a BCrypt hash:

php > var_dump(password_hash("admin", PASSWORD_DEFAULT));
php shell code:1:
string(60) "$2y$10$BsmC9NHuyjlOWyt9Q5FVA.WL/6lvZCZAdNF0wr9vLAA.s5SaU7xQq"

You must not replace that constant.

from docker-adminer.

Shurbeski avatar Shurbeski commented on June 29, 2024

is it USER adminer in your dockerfile necessary?
Because i did the same thing and it didnt work.
I used this scritp:

require_once('plugins/login-password-less.php');

/** Set allowed password
	* @param string result of password_hash
	*/
return new AdminerLoginPasswordLess(
	$password_hash = password_hash("admin", PASSWORD_DEFAULT)
);

I just didn't add USER in my dockerfile as you

from docker-adminer.

TimWolla avatar TimWolla commented on June 29, 2024

is it USER adminer in your dockerfile necessary?

The USER within the Dockerfile is used to run the container as a restricted system user. It has nothing to do with the database user or a login username. So yes, the USER adminer is necessary.

from docker-adminer.

nerkn avatar nerkn commented on June 29, 2024

PASSWORD_DEFAULT is global php variable, or docker environment variable, or placeholder for us to change?

from docker-adminer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.