Skip to content

Commit

Permalink
managed list of ip returned from proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
coulisse committed Dec 29, 2024
1 parent b913e62 commit cb0c611
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 12 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ keywords:
- dxcluster
- spiderweb
license: GPL-3.0
version: v2.5.7.3
date-released: 2024-12-28
version: v2.5.7.4
date-released: 2024-12-29
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![CodeFactor](https://www.codefactor.io/repository/github/coulisse/spiderweb/badge/development)](https://www.codefactor.io/repository/github/coulisse/spiderweb/overview/development)


- **Release:** v2.5.7.3
- **Release:** v2.5.7.4
- **Author:** Corrado Gerbaldo - [IU1BOW](https://www.qrz.com/db/IU1BOW)
- **Mail:** <corrado.gerbaldo@gmail.com>
- **Licensing:** Gpl V3.0 see [LICENSE](LICENSE) file.
Expand Down
2 changes: 1 addition & 1 deletion cfg/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.5.7.3
v2.5.7.4
4 changes: 2 additions & 2 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Change log
Date: 28/12/2024
Release: v2.5.7.3
Date: 29/12/2024
Release: v2.5.7.4
- Fixed Issue [#80](/~https://github.com/coulisse/spiderweb/issues/80)
- Fixed Issue [#79](/~https://github.com/coulisse/spiderweb/issues/79)
- Ficex Security issue [81](/~https://github.com/coulisse/spiderweb/pull/81)
Expand Down
2 changes: 1 addition & 1 deletion static/pwa/manifest.webmanifest
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "IU1BOW Spiderweb v2.5.7.3",
"name": "IU1BOW Spiderweb v2.5.7.4",
"description": "DXCluser for ham radio by IU1BOW",
"short_name": "Spiderweb",
"theme_color": "#f3b221",
Expand Down
2 changes: 1 addition & 1 deletion static/pwa/service-worker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Dichiarazione della costante per il nome della cache
const CACHE_NAME = 'pwa-spiderweb_v2.5.7.3'
const CACHE_NAME = 'pwa-spiderweb_v2.5.7.4'

// Dichiarazione della costante per gli URL da mettere in cache
const URLS_TO_CACHE = [
Expand Down
2 changes: 1 addition & 1 deletion templates/_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
&nbsp;
<a href="/~https://github.com/coulisse/spiderweb/" target="blank" rel="noopener">IU1BOW - Spiderweb</a>
&nbsp;
<span id="version">v2.5.7.3</span>
<span id="version">v2.5.7.4</span>
</div>
</footer>
<script async src="static/js/rel/load-sw.min.js"></script>
Expand Down
16 changes: 13 additions & 3 deletions webapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,24 @@ def get_nonce():
inline_script_nonce = secrets.token_hex()
return inline_script_nonce

#check if it is a unique visitor
# Check if it is a unique visitor
def visitor_count():
user_ip = request.environ.get('HTTP_X_FORWARDED_FOR') or request.environ.get('HTTP_X_REAL_IP') or request.remote_addr
forwarded_for = request.environ.get('HTTP_X_FORWARDED_FOR')
if forwarded_for:
# Separa gli IP e prendi il primo IP dalla lista
user_ip = forwarded_for.split(',')[0].strip()
logger.debug("Proxy found")
logger.debug(f"List of IP returned from proxy: {forwarded_for} ")
else:
user_ip = request.environ.get('HTTP_X_REAL_IP') or request.remote_addr

logger.debug(f"user IP: {user_ip}")

if user_ip not in visits:
visits[user_ip] = 1
else:
visits[user_ip] += 1
visits[user_ip] += 1



# ROUTINGS
Expand Down

0 comments on commit cb0c611

Please sign in to comment.