Restrict Proxy to Reddit Domains

This commit is contained in:
spikecodes
2021-01-02 20:50:23 -08:00
parent f49bff9853
commit 5ea504e6e8
14 changed files with 156 additions and 61 deletions

View File

@@ -4,8 +4,7 @@
{% block head %}
<title>{% block title %}Libreddit{% endblock %}</title>
<meta http-equiv="Referrer-Policy" content="no-referrer">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; style-src 'self' 'unsafe-inline'; base-uri 'none'; form-action 'self';
{% if cfg!(not(feature = "proxy")) %}img-src https://*; media-src https://*{% endif %}">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; style-src 'self' 'unsafe-inline'; base-uri 'none'; form-action 'self';">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="View on Libreddit, an alternative private front-end to Reddit.">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

View File

@@ -9,7 +9,7 @@
<input id="search" type="text" name="q" placeholder="Search" value="{{ query }}">
{% if sub != "" %}
<div id="inside">
<input type="checkbox" name="restrict_sr" id="restrict_sr" checked="checked" data-com.bitwarden.browser.user-edited="yes">
<input type="checkbox" name="restrict_sr" id="restrict_sr">
<label for="restrict_sr">in r/{{ sub }}</label>
</div>
{% endif %}

18
templates/settings.html Normal file
View File

@@ -0,0 +1,18 @@
{% extends "base.html" %}
{% import "utils.html" as utils %}
{% block title %}Libreddit Settings{% endblock %}
{% block search %}
{% call utils::search("".to_owned(), "", "") %}
{% endblock %}
{% block body %}
<main>
<form action="/settings/save" method="POST">
<label for="pref_nsfw">NSFW</label>
<input type="checkbox" name="pref_nsfw" id="pref_nsfw" {% if pref_nsfw == "on" %}checked{% endif %}>
<input id="sort_submit" type="submit" value="&rarr;">
</form>
</main>
{% endblock %}

View File

@@ -19,7 +19,7 @@
<input id="search" type="text" name="q" placeholder="Search" value="{{ search }}">
{% if root != "/r/" && !root.is_empty() %}
<div id="inside">
<input type="checkbox" name="restrict_sr" id="restrict_sr" checked="checked" data-com.bitwarden.browser.user-edited="yes">
<input type="checkbox" name="restrict_sr" id="restrict_sr">
<label for="restrict_sr">in {{ root }}</label>
</div>
{% endif %}