No Description

Oz N Tiram 4515f363bc Merge branch 'master' of gogs.tiram.it:oznt/catster 5 years ago
catster 51bd13b7df Initial commit 5 years ago
.gitignore 2c6399cf9d Initial commit 5 years ago
LICENSE 2c6399cf9d Initial commit 5 years ago
Makefile 51bd13b7df Initial commit 5 years ago
Pipfile 51bd13b7df Initial commit 5 years ago
README 51bd13b7df Initial commit 5 years ago
README.md 2c6399cf9d Initial commit 5 years ago
manage.py 51bd13b7df Initial commit 5 years ago

README

Catster
-------

A simple django application to that shows cute cats purring only on ipv6.
Users trying to view purring cats via ipv4 will be shown a message that the
website only serves cats to ipv6 client.


To view the application first install the dependencies:

```
make install-deps
```

To run application:

```
make server
```

To run the tests:

```
make tests
```

## Notes:

While this is solved with django mechanism. The "ipv4 only" page can simply be
served with nginx listening on 0.0.0.0 and serving a static page, while another
server directive can listen on ipv6 and transfer the traffic to the uwsgi server.

```
server {
listen [::]:80 ipv6only=on;
server_name catster.info;
location / {
root /var/www/localhost/;
index index.html index.htm;
}
}

server {
listen 0.0.0.0:80;
server_name catster.info;
location / {
root /var/www/localhost/nocats;
index index.html index.htm;
}
}
```

Another approach using nginx is also demonstrated in the ungleich blog ...
https://ungleich.ch/en-us/cms/blog/2019/01/27/how-to-distinguish-ipv6-and-ipv4-traffic-with-nginx/