[PR #965] implement static_url to direct link to ressources if reachable via different URL #1103

Open
opened 2026-03-02 16:03:13 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/prasathmani/tinyfilemanager/pull/965
Author: @gebi
Created: 2/16/2023
Status: 🔄 Open

Base: masterHead: t/feature_static_url


📝 Commits (1)

  • a8aae96 implement static_url to direct link to ressources if reachable via different url

📊 Changes

1 file changed (+12 additions, -2 deletions)

View changed files

📝 tinyfilemanager.php (+12 -2)

📄 Description

Hi,

thx for your nice "tiny" filemanager :)!

i had the usecase, that all files worked on by FM in the backend (like https://backend-www.example.org/staticwww/index.php) are actually reachable for the main site (like https://www.example.org) without auth.

I've thus implemented a config option static_url that is used (only for direct linking) to ressources and is supported to point to a completely different server.

Main purpose being, that direct links are now useable without FM and can be used by the users directly!

In case static_url is not set it should be a no-op and uses FM_ROOT_URL down the line, just like without this patch.

example config:

$use_auth = false;
$root_path = "/mnt/data";
$root_url = "/staticwww";
$static_url = "https://www.example.org";
$http_host = "backend-www.example.org"

yields the following urls: https://www.example.org/foo/test.png

with static_url commented out it yields: https://backend-www.example.org/foo/test.png


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/prasathmani/tinyfilemanager/pull/965 **Author:** [@gebi](https://github.com/gebi) **Created:** 2/16/2023 **Status:** 🔄 Open **Base:** `master` ← **Head:** `t/feature_static_url` --- ### 📝 Commits (1) - [`a8aae96`](https://github.com/prasathmani/tinyfilemanager/commit/a8aae96f5c2dd05043e8b164c8e3f5ada0b70894) implement static_url to direct link to ressources if reachable via different url ### 📊 Changes **1 file changed** (+12 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `tinyfilemanager.php` (+12 -2) </details> ### 📄 Description Hi, thx for your nice "tiny" filemanager :)! i had the usecase, that all files worked on by FM in the backend (like `https://backend-www.example.org/staticwww/index.php`) are actually reachable for the main site (like `https://www.example.org`) without auth. I've thus implemented a config option `static_url` that is used (only for direct linking) to ressources and is supported to point to a completely different server. Main purpose being, that direct links are now useable without FM and can be used by the users directly! In case static_url is not set it should be a no-op and uses FM_ROOT_URL down the line, just like without this patch. example config: ``` $use_auth = false; $root_path = "/mnt/data"; $root_url = "/staticwww"; $static_url = "https://www.example.org"; $http_host = "backend-www.example.org" ``` yields the following urls: `https://www.example.org/foo/test.png` with `static_url` commented out it yields: `https://backend-www.example.org/foo/test.png` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tinyfilemanager#1103
No description provided.