Update picture, update documentation

This commit is contained in:
Nico Schottelius 2019-02-05 15:10:21 +01:00
parent daa48c907f
commit 243e10d809
3 changed files with 9 additions and 5 deletions

View file

@ -53,15 +53,16 @@
{% 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 %}, you need to enable {% else %}this part of the Internet{% endif %},
IPv6 on your computer. you need to enable 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 for your IPv6 only service.</a> to use this service</a> for your IPv6 only service.
</p> </p>
</div> </div>
<footer class="center"> <footer class="center">

View file

@ -2,6 +2,7 @@ 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.
@ -16,7 +17,9 @@ 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:
back_to_url = "http://{}".format(self.request.META['HTTP_HOST']) # Exclude ourselves
if not re.match("^(no-ipv4-here.ungleich.ch|localhost)", 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: 98 KiB

After

Width:  |  Height:  |  Size: 45 KiB