diff --git a/composer.json b/composer.json index 5f574aa6..e9ceac19 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,8 @@ "inc/queue.php", "inc/polyfill.php", "inc/error.php", - "inc/functions.php" + "inc/functions.php", + "inc/functions/net.php" ] }, "license": "Tinyboard + vichan", diff --git a/inc/config.php b/inc/config.php index a37a2d51..d8ae7584 100644 --- a/inc/config.php +++ b/inc/config.php @@ -180,6 +180,10 @@ // Whether or not you can access the mod cookie in JavaScript. Most users should not need to change this. $config['cookies']['httponly'] = true; + // Do not allow logins via unencrypted HTTP. Should only be changed in testing environments or if you connect to a + // load-balancer without encryption. + $config['cookies']['secure_login_only'] = true; + // Used to salt secure tripcodes ("##trip") and poster IDs (if enabled). $config['secure_trip_salt'] = ')(*&^%$#@!98765432190zyxwvutsrqponmlkjihgfedcba'; @@ -1216,6 +1220,7 @@ // Moderator errors $config['error']['toomanyunban'] = _('You are only allowed to unban %s users at a time. You tried to unban %u users.'); $config['error']['invalid'] = _('Invalid username and/or password.'); + $config['error']['insecure'] = _('Login on insecure connections is disabled.'); $config['error']['notamod'] = _('You are not a mod…'); $config['error']['invalidafter'] = _('Invalid username and/or password. Your user may have been deleted or changed.'); $config['error']['malformed'] = _('Invalid/malformed cookies.'); diff --git a/inc/functions/net.php b/inc/functions/net.php new file mode 100644 index 00000000..ab08c3cb --- /dev/null +++ b/inc/functions/net.php @@ -0,0 +1,10 @@ +