-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[6.0][Dotenv] Configure Joomla with environment variables #45070
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
Conversation
476e3bd to
f1ab985
Compare
aec3851 to
7dfa960
Compare
|
I have tested this item ✅ successfully on 0f39e4e ( I don't understand however the logic of wanting to keep the installation folder after installation though, it seems like an unnecessary potential security risk ) This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45070. |
|
I have tested this item ✅ successfully on 0f39e4e This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45070. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45070. |
e666432 to
7edbd5a
Compare
|
This was reviewed by Maintainers on 16th April. Is the RMDQ label still relevant @Hackwar or are we good to proceed? |
|
I made an alternative PR, with cli and web installation support, and better variable names #45523 |
|
Closed in favor of #45523 |
Pull Request for Issue #36898.
This is a reopened version of PR #44894. I can't reopen the #44894 for technical reasons, sorry 😱
Summary of Changes
This PR adds an ability to configure Joomla using environment variables. To do this, the config provider has been changed to load all environment variables whose names start with
JOOMLA_(e.g.JOOMLA_DEBUG,JOOMLA_PASSWORD) and merge them into theconfigservice.Also, environment variables can be loaded from
.envfiles, thankfully to symfony/dotenv.Testing Instructions
Create
.envfile in the site's root directorySet environment variables (inside the
.envfile):Reload site's home page and ensure that site is offline and the
Joomla!message is shownRun the following command and ensure that the output is
true:Run the following command and ensure that the output is
Joomla!:Actual result BEFORE applying this Pull Request
All should work.
Expected result AFTER applying this Pull Request
All should work.
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org: [6.0] Article about .env files Manual#432
No documentation changes for manual.joomla.org needed
Why?
The 12-factor app methodology recommends to store config in the environment.
Also, it makes Joomla more cloud-friendly and simplifies running it inside containers.
For example, using environment variables it's very easy to configure separate database for testing: