Skip to content

Commit

Permalink
web - minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
superstes committed Oct 23, 2021
1 parent 1fa674b commit 8325336
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion code/web/base/base/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
DEBUG = True

s = socket(AF_INET, SOCK_DGRAM)
s.connect(("1.1.1.1", 80))
s.connect(('1.1.1.1', 80))
own_ip = s.getsockname()[0]
s.close()

Expand Down
8 changes: 8 additions & 0 deletions code/web/base/ga/config/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,11 @@
WEBUI_SVC_ACTION_COOLDOWN = 15
WEBUI_DEFAULT_DATA_TABLE_ROWS = 50
WEBUI_EMPTY_CHOICE = '---------'

# messages
WEBUI_WARNING_PUBLIC = 'You are accessing this web interface over a public network.<br><strong>This could be a security risk.<br></strong>' \
'This web interface has not been tested for security vulnerabilities.'
WEBUI_WARNING_UNENCRYPTED = '<strong>Your connection is unencrypted!</strong>'
WEBUI_WARNING_PUBLIC_UNENCRYPTED = '<strong>Your connection is unencrypted! And you are accessing this web interface over a public network.<br></strong>' \
'You should consider setting up encryption via LetsEncrypt:<br><a href="https://docs.growautomation.eu">GrowAutomation documentation</a> ' \
'| <a href="https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-20-04">Example tutorial</a>'
1 change: 0 additions & 1 deletion code/web/base/ga/templates/config/list/member.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
{% endif %}
<input type="hidden" name="group" value="{{ data|get_item:'id' }}" />
<input type="hidden" name="return" value="{{ request.get_full_path }}" />
<br>
{% include "../../btn/create.html" %}
{% include "../../btn/add.html" %}
<!-- todo: disable list if target is hidden -->
Expand Down
1 change: 0 additions & 1 deletion code/web/base/ga/templates/system/script/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
{% endfor %}
</select>
</label>
<br>
{% include "../../btn/select.html" %}
</form>
<br><br>
Expand Down
2 changes: 0 additions & 2 deletions code/web/base/ga/templates/system/script/show.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<strong>
Refreshed at {% now "Y-m-d H:i:s T" %} <br>
</strong>
<br>
{% if script_content is None %}
{% include "../../warn/no_results.html" %}
{% else %}
Expand All @@ -19,6 +18,5 @@
Current script: '{{ script_path }}'
</p>
</div>
<br><br>
{% include "../../btn/abort.html" %}
{% endblock %}
1 change: 0 additions & 1 deletion code/web/base/ga/templates/system/service.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
{% if service_name is not None %}
{% include "../miniform/reload_time.html" %}
{% endif %}
<br>
{% include "../btn/select.html" %}
</form>
{% if service_name is not None %}
Expand Down
11 changes: 2 additions & 9 deletions code/web/base/ga/templates/warn/connection_insecure.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@
{% if request.is_secure == False %}
<div class="alert alert-warning">
{% if request|client_is_public %}
<strong>
Your connection is unencrypted! And you are accessing this web interface over a public network.<br>
</strong>
You should consider setting up encryption via LetsEncrypt: <br>
<a href="https://docs.growautomation.eu">GrowAutomation documentation</a> |
<a href="https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-20-04">Example tutorial</a>
{{ '' | warning_public_unencrypted | safe }}
{% else %}
<strong>
Your connection is unencrypted!
</strong>
{{ '' | warning_unencrypted | safe }}
{% endif %}
</div>
{% endif %}
6 changes: 1 addition & 5 deletions code/web/base/ga/templates/warn/connection_public.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{% load util %}
{% if request|client_is_public %}
<div class="alert alert-warning">
You access this web interface over a public network. <br>
<strong>
This could be a security risk. <br>
</strong>
This web interface has not been tested for security vulnerabilities.
{{ '' | warning_public | safe }}
</div>
{% endif %}
1 change: 1 addition & 0 deletions code/web/base/static/css/ga.css
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ form .error-msg {
/* START buttons */

.ga-btn-action {
margin-top: 0.35rem;
padding: 0.35rem 0.4rem !important;
opacity: 75%;
border-radius: .35rem !important;
Expand Down

0 comments on commit 8325336

Please sign in to comment.