Skip to content

Prevent YOURLS from displaying encryption warning when password is provided via environment variables #3038

@bryanpedini

Description

@bryanpedini

Code of Conduct

Submission validity

  • This is not a personal support request, that should be posted on discussions community.
  • I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.

Summary

Since YOURLS 1.7 as per documentation, the software automatically encrypts passwords.
This is not true (of course) for the user provided by environment variables (e.g. Docker).

Motivation

Just an annoying little error that does not cause any harm but still, it's an error which is actually not true.

Describe the solution

Check if the array contains only one element (the usual case when providing YOURLS_USER via environment variable) and if true check if the YOURLS_USER and YOURLS_PASS variables are set from environment, in case both checks are true do not even bother to call the function that tries to encrypt the password.

Maybe, just a quick, dirty solution (first that came in my mind, feel free to propose / do something else).
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions