Skip to content

Commit

Permalink
Some improvements before official inauguration
Browse files Browse the repository at this point in the history
  • Loading branch information
user@tuer.maschinendeck.org committed Dec 14, 2016
1 parent 693a66a commit a6ce00d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pi/mdosweb/login/templates/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<title>Maschinendeck MDOS</title>
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" type="image/png" href="{% static "images/maschinendeck.png" %}">

<!-- Mobile Specific Metas
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
Expand All @@ -27,7 +28,6 @@

<!-- Favicon
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="icon" type="image/png" href="{% static "images/favicon.png" %}">

<script src="{% static "js/jquery.js" %}"></script>

Expand Down
3 changes: 2 additions & 1 deletion pi/mdosweb/login/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ class OpenForm(forms.Form):
class LoginView(View):
template_name = "login.html"
form_class = OpenForm
success_url = '/login' #reverse('login')
success_url = '/' #reverse('login')


@method_decorator(login_required)
def get(self, request, *args, **kwargs):
form = self.form_class()
createLogEntry(request, 'index')
Expand Down
1 change: 1 addition & 0 deletions pi/mdosweb/mdosweb.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ processes = 2
chdir = /home/pi/mdos/pi/mdosweb/
socket = /home/pi/mdos/pi/mdosweb/mdosweb.sock
chmod-socket = 666
logto = /home/pi/mdos/pi/mdosweb/mdosweb.log
34 changes: 32 additions & 2 deletions pi/mdosweb/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,21 +1,46 @@
# limit requests based on proxy protocol remote address
limit_req_zone $proxy_protocol_addr zone=one:10m rate=5r/s;


# the upstream component nginx needs to connect to
upstream django {
server unix:///home/pi/mdos/pi/mdosweb/mdosweb.sock; # for a file socket
#server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}

server {
listen 80;
listen 80 proxy_protocol;
server_name tuer.maschinendeck.org;
return 301 https://tuer.maschinendeck.org/;
set_real_ip_from 10.172.3.23; # only allow proxy protocol requests from this ip.
real_ip_header proxy_protocol;
limit_req zone=one burst=15;
server_tokens off;
}



server {
listen 81;
server_name tuer.maschinendeck.org;
location /setroomstate {
uwsgi_pass django;
include /home/pi/mdos/pi/mdosweb/uwsgi_params; # the uwsgi_params file you installed
}
allow 127.0.0.1;
deny all;
}

# configuration of the server
server {
# the port your site will be served on
listen 443;
listen 443 proxy_protocol;
set_real_ip_from 10.172.3.23;
real_ip_header proxy_protocol;
# the domain name it will serve for
server_name tuer.maschinendeck.org; # substitute your machine's IP address or FQDN
limit_req zone=one burst=15;
server_tokens off;
charset utf-8;

ssl on;
Expand All @@ -40,4 +65,9 @@ server {
uwsgi_pass django;
include /home/pi/mdos/pi/mdosweb/uwsgi_params; # the uwsgi_params file you installed
}

location /setroomstate {
deny all;
}

}

0 comments on commit a6ce00d

Please sign in to comment.