9001 / 9001/copyparty

Uploading an URL shortcut

未关闭
#521 0 条评论 0 个 reaction 已指派 1 人 已被 @9001 认领 在 GitHub 查看
enhancement
主要语言
Python
星标
46.7k
派生
1.9k
平均合并
9 天 2 小时
30 天内合并 PR
4

描述

Hi !
First of all, thanks for this amazing piece of software.

**Some context** (feel free to skip)
A few days ago, I wanted to host my own cloud, and installed OCIS (OwnCloud Infinite Scale), but since copyparty seems better for my use case, I'm going to replace it.
With OCIS, there's a feature that allows one to upload an URL instead of a file. This is handy since I host and want to share ressources about computer science, including youtube videos. They handle this by using a .url file. I believe that they manually handle the redirection on the web client. However, it doesn't work well when browsing through WebDav : those files aren't supported by default on Linux, neither they are on Android / iOS.
A way to do so that's widely supported on every operating system is simply by using a `.html` that redirects to the desired URL. The most common way is through a `` tag, but _no need for JavaScript_; the refresh meta http-equiv attribute does that by default, and it even works through WebDav since HTML files are handled by the browser.

**Describe the idea**
Allowing an user to share an URL shortcut (follows the link when clicked). It would take the following form:
inputs: `<name>` and `<some-url>`
output: write the following in `<name>.html` (if the file doesn't exist yet obviously):
```html
<meta http-equiv="refresh" content="0; url=<some-url>">
```
Since HTML files are currently directly rendered upon click, the redirection is immediate, so copyparty wouldn't have to manually handle anything.

**Describe any alternatives you've considered**
An issue would be to be able to distinguish between an HTML file that was uploaded as HTML, and some HTML file that was created specifically for sharing a single link.
My first idea would be to specify this by using `<name>.url.html`, or something similar that would make it more obvious that the HTML file actually only holds an URL.
This would maybe allow the UI to make it more obvious as well (by changing the file color, or adding an icon ?), but I feel like this may not match with copyparty's current philosophy.

**Additional context**
I thought it would be a cool feature, but I'll understand if this seems too specific of a use case haha.
This is also to make people aware that the `<meta http-equiv="refresh">` attribute really works well for this use case and with the way copyparty handles HTML files.

edit: typo

贡献指南

打开贡献指南

调研方向

查看 copyparty 中的文件上传处理,以了解应在哪里拦截 URL 输入并生成带有 meta refresh 标签的 HTML 文件。检查当前如何渲染 HTML 文件,并确保新的 .url.html 文件能够与普通 HTML 上传文件区分开来。上传一个 URL 快捷方式,并验证它在浏览器中以及通过 WebDAV 都能正确重定向,以测试此功能。

由索引模型根据 Issue 内容生成。

评估

技术栈
html, python
领域
backend, frontend, web-dev
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。