Compare commits

..

No commits in common. "32ac399c7fc2cc64f2701b92ed50741987ec8a3c" and "daa48c907f13158e9d2314ce97857f77cfb341fb" have entirely different histories.

3 changed files with 5 additions and 9 deletions

View File

@ -53,16 +53,15 @@
{% if domain != "" %} {% if domain != "" %}
The site you tried to access is not reachable by IPv4. The site you tried to access is not reachable by IPv4.
To access <a href="{{ back_to_url }}" target="_blank">{{ domain }}</a> To access <a href="{{ back_to_url }}" target="_blank">{{ domain }}</a>
{% else %}this part of the Internet{% endif %}, {% else %}this part of the Internet{% endif %}, you need to enable
you need to enable IPv6 on your computer. IPv6 on your computer.
<br>
Find Find
out out
<a href="https://ungleich.ch/en-us/cms/blog/2019/02/05/how-to-get-ipv6/"> <a href="https://ungleich.ch/en-us/cms/blog/2019/02/05/how-to-get-ipv6/">
how to enable IPv6</a> how to enable IPv6</a>
or or
<a href="https://redmine.ungleich.ch/projects/open-infrastructure/wiki/How_to_disable_IPv4_on_your_website">how <a href="https://redmine.ungleich.ch/projects/open-infrastructure/wiki/How_to_disable_IPv4_on_your_website">How
to use this service</a> for your IPv6 only service. to use this service for your IPv6 only service.</a>
</p> </p>
</div> </div>
<footer class="center"> <footer class="center">

View File

@ -2,7 +2,6 @@ from urllib.parse import urlsplit
from django.views.generic import TemplateView from django.views.generic import TemplateView
import re
# Create your views here. # Create your views here.
@ -17,9 +16,7 @@ class IndexView(TemplateView):
if "back_to" in self.request.GET: if "back_to" in self.request.GET:
back_to_url = self.request.GET["back_to"] back_to_url = self.request.GET["back_to"]
elif 'HTTP_HOST' in self.request.META: elif 'HTTP_HOST' in self.request.META:
# Exclude ourselves back_to_url = "http://{}".format(self.request.META['HTTP_HOST'])
if not re.match("^no-ipv4-here.ungleich.ch", self.request.META['HTTP_HOST']):
back_to_url = "http://{}".format(self.request.META['HTTP_HOST'])
context['back_to_url'] = back_to_url context['back_to_url'] = back_to_url
if back_to_url != "": if back_to_url != "":
context['domain'] = (urlsplit(back_to_url)).netloc context['domain'] = (urlsplit(back_to_url)).netloc

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 98 KiB