Skip to content
GitLab
Explore
Sign in
Commits on Source (4)
Move logo
· 7979f85d
Marco Marinello
authored
Sep 19, 2019
7979f85d
Generate all virtualhosts
· 5e433d28
Marco Marinello
authored
Sep 19, 2019
5e433d28
Add copyright notice
· b5526a33
Marco Marinello
authored
Sep 19, 2019
b5526a33
Fix text to the left
· 2e0ddc92
Marco Marinello
authored
Sep 19, 2019
2e0ddc92
Hide whitespace changes
Inline
Side-by-side
access_landing/management/commands/vhosts.py
View file @
2e0ddc92
...
...
@@ -51,12 +51,26 @@ class Command(BaseCommand):
\t
ProxyPass /
{
school
.
internal_host
}
\t
ProxyPassReverse /
{
school
.
internal_host
}
\t
ProxyPreserveHost on
</VirtualHost>
"""
def
gen_disabled_vhost
(
self
,
school
):
return
f
"""
<VirtualHost *:443>
\t
ServerName
{
school
.
external_host
}
\t
ServerAdmin webmaster@
{
school
.
external_host
}
\t
DocumentRoot /var/www/fra_disabled
\t
Include /etc/apache2/ssl.conf
</VirtualHost>
"""
def
handle
(
self
,
*
args
,
**
kwargs
):
for
school
in
models
.
Institute
.
objects
.
filter
(
active
=
True
):
for
school
in
models
.
Institute
.
objects
.
filter
():
if
self
.
is_valid_fqdn_or_ip
(
school
.
external_host
)
and
\
self
.
is_valid_fqdn_or_ip
(
school
.
internal_host
):
self
.
is_valid_fqdn_or_ip
(
school
.
internal_host
)
and
\
school
.
active
:
print
(
self
.
gen_vhost
(
school
))
else
:
print
(
self
.
gen_disabled_vhost
(
school
))
access_landing/templates/base.html
View file @
2e0ddc92
...
...
@@ -34,6 +34,10 @@
{% endfor %}
{% block content %}
{% endblock content %}
<br><br>
<div
class=
"alert alert-secondary text-center"
>
Copyright (
©
) 2019 Marco Marinello
</div>
</div>
</div>
</body>
...
...
access_landing/templates/index.html
View file @
2e0ddc92
...
...
@@ -3,16 +3,16 @@
{% block content %}
<div
class=
"row"
>
<div
class=
"col-lg-7"
></div>
<div
class=
"col-lg-3 text-right"
>
<div
class=
"col-lg-2"
>
<img
src=
"{% static 'img/logo-FUSS.png' %}"
style=
"max-width: 100%;"
>
</div>
<div
class=
"col-lg-3"
>
<h1
style=
"font-weight: bold; font-size: 55px;"
>
Remote
<br>
Access
</h1>
</div>
<div
class=
"col-lg-2"
>
<img
src=
"{% static 'img/logo-FUSS.png' %}"
style=
"max-width: 100%;"
>
</div>
</div>
<br><br><br>
...
...