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

Add configurable path display modes for better privacy and clarity #1034

Merged
merged 1 commit into from
Apr 26, 2023

Conversation

DannyDaemonic
Copy link
Contributor

This pull request introduces configurable path display modes. The new options improve privacy and clarity for users by allowing the administrator to choose between displaying the full file path, a path relative to the root path, or the host path.

The primary motivation for this change is to hide certain system internals from users who don't need to see them, both for security reasons and to avoid any confusion. Another use is to prevent any confusion when using the Docker image, as the path can be misleading.

Three new display modes have been added:

  1. Full Path (default): This mode displays the full path to the file, preserving the original behavior.
  2. Relative Root Path: This mode shows the path relative to the root path, which can be useful for providing context without revealing the full system path.
  3. Host Path: This mode displays the path on the host, which can be helpful when even the relative path is not meaningful or is potentially confusing (such as when using Docker).

The feature includes a setting in the configuration section, a helper function to handle the path display logic, and updates to the appropriate sections of the code to utilize the new functionality.

Please review the changes and let me know if you have any suggestions or feedback.

If accepted. The config sample should also be updated to contain the option:

// Path display mode when viewing file information
// 'full' => show full path
// 'relative' => show path relative to root_path
// 'host' => show path on the host
$path_display_mode = 'full';

@prasathmani prasathmani merged commit 8486c7a into prasathmani:master Apr 26, 2023
@prasathmani
Copy link
Owner

@DannyDaemonic thanks for the PR. updated sample config.

@DannyDaemonic DannyDaemonic deleted the path-options branch April 29, 2023 14:17
ner00 pushed a commit to ner00/tinyfilemanager that referenced this pull request May 6, 2023
ner00 pushed a commit to ner00/tinyfilemanager that referenced this pull request May 6, 2023
ner00 pushed a commit to ner00/tinyfilemanager that referenced this pull request May 7, 2023
ner00 pushed a commit to ner00/tinyfilemanager that referenced this pull request May 7, 2023
ner00 pushed a commit to ner00/tinyfilemanager that referenced this pull request May 7, 2023
ner00 pushed a commit to ner00/tinyfilemanager that referenced this pull request May 7, 2023
prasathmani added a commit that referenced this pull request May 7, 2023
* publish additional docker tags (#975)

* Update Romanian translations (#981)

* Update tinyfilemanager.php

* Prevent logout issue after page was cached (#1004)

Logout may not work otherwise, browser reloads cached page from disk instead of sending GET request ?logout=1 to server.

* tell git to always commit .php in unix-newlines (#1017)

so hopefully we don't get a repeat of #994 (comment)

* Check if posix_getpwuid/posix_getgrgid calls were successful (#1023)

* use stream_copy_to_stream (#1014)

* use stream_copy_to_stream

it's simpler, and should be faster.
For example, stream_copy_to_stream can use sendfile ( https://man7.org/linux/man-pages/man2/sendfile.2.html ) on operating systems supporting it, which is faster and use less RAM than fread()+fwrite() (because it avoids copying data to/from userland, doing the copy entirely in-kernel~)

* fix loop early return, and workaround bug

* use feof

ref #1016 (comment)

* added bengali translation (#1018)

* Fix upload of existing files (#1026)

* Fix typo. (#1028)

* login (Redirecting to Main domain of website instead of tfm.php) fix (#1031)

When logged in it takes to the website's main URL. For example, if I have tfm in www.example.com/tfm/index.php (index.php is tfm) then after logging in it redirects to www.example.com and then have to press back on the browser then it takes to www.example.com/tfm/index.php

* Add configurable path display modes for better privacy and clarity (#1034)

* Resize preview image and implement zoom in/out (#1036)

* Resize preview image and implement zoom in/out

* Remove redundant class name

---------

Co-authored-by: ssams <6338356+ssams@users.noreply.github.com>
Co-authored-by: Sergiu Bivol <sergiu@cip.md>
Co-authored-by: Prasath Mani <prasathmani@users.noreply.github.com>
Co-authored-by: divinity76 <divinity76@gmail.com>
Co-authored-by: Micha Ober <github@ober-mail.de>
Co-authored-by: Joy Biswas <74253956+joybiswas007@users.noreply.github.com>
Co-authored-by: Micha Ober <git@ober-mail.de>
Co-authored-by: Caleb Mazalevskis <maikuolan@gmail.com>
Co-authored-by: xololunatic <97784387+xololunatic@users.noreply.github.com>
Co-authored-by: DannyDaemonic <DannyDaemonic@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants