Revert "adding hardcoded meta for onion" #26

Merged
kibi merged 1 commits from master into 98 2026-07-26 21:07:57 +00:00
2 changed files with 0 additions and 12 deletions
Showing only changes of commit 5e35fd48d4 - Show all commits

View File

@@ -331,15 +331,6 @@ function buildGatePage(req) {
'<title>502: Bad Gateway</title>',
`<title>${reqHost} | 502: Bad gateway</title>`
);
// Inject Onion-Location meta tag into <head> for Tor Browser compatibility
if (cfg.websrv?.enable_tor_hs !== false && cfg.main?.onion && req && req.headers && !req.headers['host']?.endsWith('.onion')) {
const p = req.url?.pathname || '/';
const s = req.url?.search || '';
const onionHost = cfg.main.onion.replace(/\/+$/, '');
const onionUrl = `${onionHost}${p}${s}`;
html = html.replace('<head>', `<head>\n<meta http-equiv="onion-location" content="${onionUrl}">`);
}
html = html.replace('</body>', gateLoginInjection + '\n</body>');
return html;
}
@@ -1334,8 +1325,6 @@ process.on('uncaughtException', err => {
show_mime_picker: cfg.websrv.show_mime_picker !== false,
private_society: cfg.websrv.private_society || false,
private_society_gate: cfg.websrv.private_society_gate || '',
onion: cfg.main.onion || '',
enable_tor_hs: cfg.websrv.enable_tor_hs !== false,
show_content_warning: cfg.websrv.show_content_warning !== false,
web_url_upload: !!cfg.websrv.web_url_upload,
enable_youtube_upload: cfg.websrv.enable_youtube_upload !== false,

View File

@@ -2,7 +2,6 @@
<html lang="{{ lang || 'en' }}" theme="@if(typeof theme !== 'undefined'){{ theme }}@endif" res="@if(typeof fullscreen !== 'undefined'){{ fullscreen == 1 ? 'fullscreen' : '' }}@endif">
<head>
@if(enable_tor_hs && onion)<meta http-equiv="onion-location" content="{{ onion }}" />@endif
@if(typeof page_meta !== 'undefined' && page_meta.title)<title>{{ domain }} - {{ page_meta.title }}</title>@elseif(typeof item !== 'undefined')<title>{{ domain }} - {{ item.id }}</title>@else<title>{{ domain }}</title>@endif
<link rel="manifest" href="/manifest.json">
<meta name="theme-color" content="#0096ff">