Merge pull request 'master' (#32) from master into 98

Reviewed-on: #32
This commit is contained in:
Kibi Kelburton
2026-07-27 10:28:47 +00:00
3 changed files with 8 additions and 4 deletions

View File

@@ -88,8 +88,9 @@ export default (router, tpl) => {
return renderError("Passwords do not match.");
}
// reCAPTCHA verification
if (cfg.recaptcha?.enabled && cfg.recaptcha?.secret_key) {
// reCAPTCHA verification (bypassed for .onion requests as Google reCAPTCHA cannot validate .onion domains)
const isOnion = req.headers['host']?.endsWith('.onion');
if (!isOnion && cfg.recaptcha?.enabled && cfg.recaptcha?.secret_key) {
const rcToken = req.post['g-recaptcha-response'];
if (!rcToken) return renderError("Please complete the reCAPTCHA.");
try {

View File

@@ -49,7 +49,7 @@ const gateOptions = {
},
cloudflare_status: {
status: 'ok',
location: 'Frankfurt',
location: cfg.websrv.private_society_gate_location || 'Frankfurt',
name: 'Cloudflare',
status_text: 'Working',
},
@@ -1340,6 +1340,7 @@ 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 || '',
private_society_gate_location: cfg.websrv.private_society_gate_location || 'Frankfurt',
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,
@@ -1496,6 +1497,9 @@ process.on('uncaughtException', err => {
}
if (req) {
if (req.headers['host']?.endsWith('.onion')) {
data.recaptcha_enabled = false;
}
if (req.mode !== undefined) data.mode = req.mode;
data.theme = req.theme || req.cookies?.theme || cfg.websrv.theme || 'f0ck';
if (!data.url) data.url = req.url;