Improved help message for URL upload

* Hide notice about max size if it's equal to max size of regular uploads.

* Show notice about DuckDuckGo's proxy if it's turned on.

* Also updated description in config.sample.js to further emphasize about the limitation of using DuckDuckGo's proxy.
This commit is contained in:
Bobby Wibowo 2018-09-30 05:38:13 +07:00
parent a36062d33c
commit d4b6933891
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
3 changed files with 14 additions and 3 deletions

View File

@ -120,7 +120,8 @@ module.exports = {
/*
Use DuckDuckGo's proxy when fetching any URL uploads.
This may be considered a hack and not supported by DuckDuckGo, so USE AT YOUR OWN RISK.
This have only been tested with pictures, GIFs, WEBMs and MP4s.
This should work with any type of URLs, but they have to be direct links,
since DuckDuckGo's proxy will not follow redirects.
*/
urlDuckDuckGoProxy: false,

View File

@ -68,8 +68,10 @@ for (const page of config.pages) {
}))
} else if (page === 'home') {
safe.get('/', (req, res, next) => res.render('home', {
maxSize: config.uploads.maxSize,
urlMaxSize: config.uploads.urlMaxSize,
gitHash: safe.get('git-hash')
gitHash: safe.get('git-hash'),
urlDuckDuckGoProxy: config.uploads.urlDuckDuckGoProxy
}))
} else if (page === 'faq') {
const fileLength = config.uploads.fileLength

View File

@ -71,7 +71,15 @@
<div class="control">
<textarea id="urls" class="textarea" rows="2"></textarea>
</div>
<p class="help">Maximum file size for URL upload is {{ urlMaxSize }}.</p>
<p class="help">
{% if urlMaxSize !== maxSize -%}
Maximum file size for URL upload is <span style="font-weight: bold">{{ urlMaxSize }}</span>.
{%- endif %}
{%- if urlMaxSize and urlMaxSize !== maxSize and urlDuckDuckGoProxy %}<br>{% endif -%}
{%- if urlDuckDuckGoProxy %}
Since we're using DuckDuckGo's proxy, the URLs have to be direct links.
{% endif -%}
</p>
</div>
<div class="field">
<div class="control is-expanded">