-
-
Notifications
You must be signed in to change notification settings - Fork 437
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
New feature: enhance security with custom admin URL. #4264
Open
kiatng
wants to merge
9
commits into
OpenMage:main
Choose a base branch
from
kiatng:custom_admin_url
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+42
−4
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
Component: Core
Relates to Mage_Core
Component: Adminhtml
Relates to Mage_Adminhtml
labels
Oct 10, 2024
I did a quick test ... It seems it needs some documentation. Changes to .htaccess etc ... I tried with apache (DDEV), added addtional host names, but got redirected to frontend page. |
Can you please combine the if statements as suggested? |
Quality Gate passedIssues Measures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Component: Adminhtml
Relates to Mage_Adminhtml
Component: Core
Relates to Mage_Core
errors
Relates to error pages
new feature
security
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description (*)
Ref #1209 (comment), where I was trying to make use of the nginx config for admin without the use of caddy. For this, I needed the ability to have a custom admin URL, which is configurable here:
However, Custom Admin URL is not implemented. This PR is my attempt to complete the implementation.
When Custom Admin URL is used, frontend access to admin is forbidden in the function
match()
in app/code/core/Mage/Core/Controller/Varien/Router/Admin.php. This is independent of server config, which provides an alternate way:magento-lts/dev/openmage/nginx-frontend.conf
Lines 150 to 154 in 5a95706
Related Pull Requests
PR #1209
Manual testing scenarios (*)
admin.example.com/adminFrontName
whereadminFrontName
is set in /etc/local.xmlwww.example.com/adminFrontName
should return 404 page not found.Questions or comments
I am not sure if this is the best way to implement the custom admin URL. Collab welcome.
Possible issue for API in 3rd-party code because of
magento-lts/api.php
Line 38 in 5496d8a
As can be seen above, API is admin store, and if there is a
Mage::getUrl()
in the response params, the URL will not be accessible. There is noMage::getUrl()
in the core, but may be present in 3rd-party code/modules.