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

[RFC] safe-mode #44765

Draft
wants to merge 6 commits into
base: 5.3-dev
Choose a base branch
from
Draft

[RFC] safe-mode #44765

wants to merge 6 commits into from

Conversation

alikon
Copy link
Contributor

@alikon alikon commented Jan 21, 2025

RFC Pull Request for Issue #44643 .

Summary of Changes

Testing Instructions

Actual result BEFORE applying this Pull Request

Expected result AFTER applying this Pull Request

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:

  • No documentation changes for manual.joomla.org needed

@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-5.3-dev RFC Request for Comment labels Jan 21, 2025
@dgrammatiko
Copy link
Contributor

dgrammatiko commented Jan 21, 2025

@alikon nice work here. If I may I would like to propose another approach with less db stuff. We could use a reflection here to reset the plugins, in run time, similar to https://github.com/dgrammatiko/jailed-fs/blob/95444d8778e930a0360740e3b511b23bde374a5c/src/plugins/system/restrictedfs/src/Extension/RestrictedFS.php#L68-L78

You need to figure out what is essential and create the correct filter but should be an easier approach, ie not messing around with the real data in the db...

Also, I would use a URL parameter, ie joomla_safe_mode=true that will be checked by the plugin, together with the user permission, ie only users in the administrators group to activate the safe mode.

Comment on lines 337 to 338
<option value="0">COM_CONFIG_FIELD_DEBUG_SAFEMODEOFF</option>
<option value="1">COM_CONFIG_FIELD_DEBUG_SAFEMODEON</option>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the core language strings JOFF and JON

name="safemode"
type="radio"
label="COM_CONFIG_FIELD_DEBUG_SAFEMODE_LABEL"
description="COM_CONFIG_FIELD_DEBUG_SAFEMODE_DESC"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This string does not exist

; Note : All ini files need to be saved as UTF-8

PLG_SYSTEM_SAFEMODE="System - Joomla! SafeMode"
PLG_SYSTEM_SAFEMODE_DEFAULT_AUTHENTICATION_PLUGIN_NOT_ENABLED="The default authentication plugin is not enabled"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PLG_SYSTEM_SAFEMODE_DEFAULT_AUTHENTICATION_PLUGIN_NOT_ENABLED="The default authentication plugin is not enabled"
PLG_SYSTEM_SAFEMODE_DEFAULT_AUTHENTICATION_PLUGIN_NOT_ENABLED="The default authentication plugin is not enabled."


PLG_SYSTEM_SAFEMODE="System - Joomla! SafeMode"
PLG_SYSTEM_SAFEMODE_DEFAULT_AUTHENTICATION_PLUGIN_NOT_ENABLED="The default authentication plugin is not enabled"
PLG_SYSTEM_SAFEMODE_OFF="Safe Mode is swithced off"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PLG_SYSTEM_SAFEMODE_OFF="Safe Mode is swithced off"
PLG_SYSTEM_SAFEMODE_OFF="Safe Mode is switched off."

PLG_SYSTEM_SAFEMODE="System - Joomla! SafeMode"
PLG_SYSTEM_SAFEMODE_DEFAULT_AUTHENTICATION_PLUGIN_NOT_ENABLED="The default authentication plugin is not enabled"
PLG_SYSTEM_SAFEMODE_OFF="Safe Mode is swithced off"
PLG_SYSTEM_SAFEMODE_ON="Safe Mode is swithced on"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PLG_SYSTEM_SAFEMODE_ON="Safe Mode is swithced on"
PLG_SYSTEM_SAFEMODE_ON="Safe Mode is switched on."

PLG_SYSTEM_SAFEMODE_DEFAULT_AUTHENTICATION_PLUGIN_NOT_ENABLED="The default authentication plugin is not enabled"
PLG_SYSTEM_SAFEMODE_OFF="Safe Mode is swithced off"
PLG_SYSTEM_SAFEMODE_ON="Safe Mode is swithced on"
PLG_SYSTEM_SAFEMODE_PUBLISH_NONCORE_WHEN_SAFEMODEON="You have published non-core extensions when Safe Mode is on"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PLG_SYSTEM_SAFEMODE_PUBLISH_NONCORE_WHEN_SAFEMODEON="You have published non-core extensions when Safe Mode is on"
PLG_SYSTEM_SAFEMODE_PUBLISH_NONCORE_WHEN_SAFEMODEON="You have published non-core extensions when Safe Mode is on."

PLG_SYSTEM_SAFEMODE_OFF="Safe Mode is swithced off"
PLG_SYSTEM_SAFEMODE_ON="Safe Mode is swithced on"
PLG_SYSTEM_SAFEMODE_PUBLISH_NONCORE_WHEN_SAFEMODEON="You have published non-core extensions when Safe Mode is on"
PLG_SYSTEM_SAFEMODE_XML_DESCRIPTION="System Plugin that control the safe mode."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PLG_SYSTEM_SAFEMODE_XML_DESCRIPTION="System Plugin that control the safe mode."
PLG_SYSTEM_SAFEMODE_XML_DESCRIPTION="System Plugin that controls the safe mode."

; Note : All ini files need to be saved as UTF-8

PLG_SYSTEM_SAFEMODE="System - Joomla! SafeMode"
PLG_SYSTEM_SAFEMODE_XML_DESCRIPTION="System Plugin that control the safe mode."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PLG_SYSTEM_SAFEMODE_XML_DESCRIPTION="System Plugin that control the safe mode."
PLG_SYSTEM_SAFEMODE_XML_DESCRIPTION="System Plugin that controls the safe mode."

<name>plg_system_safemode</name>
<author>Joomla! Project</author>
<creationDate>2025-01</creationDate>
<copyright>(C) 2021 Open Source Matters, Inc.</copyright>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<copyright>(C) 2021 Open Source Matters, Inc.</copyright>
<copyright>(C) 2025 Open Source Matters, Inc.</copyright>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language Change This is for Translators PR-5.3-dev RFC Request for Comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants