Skip to content

Commit c1f155d

Browse files
committed
Improve regex for warning heavy users, add secondary warning tile
kozlekedesiklub.hu tried to append a random number after the file name but regex rules. XD Send them a black warning message before we escalate further.
1 parent 15a2f06 commit c1f155d

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

ansible/group_vars/tileservers.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,16 @@ apache:
183183
RewriteRule "." "/tile-util/crowded.webp" [PT]
184184
185185
# Warn pages that they are running into being blocked.
186-
RewriteCond "%{HTTP_REFERER}" "(holavonat\.is|kozlekedesiklub\.hu|vonatinfo-production\.up\.railway\.app)"
186+
RewriteCond "%{HTTP_REFERER}" "(holavonat\.is|vonatinfo-production\.up\.railway\.app)"
187187
# Exclude requests not for tiles. Otherwise /index.html and its assets are forbidden as well.
188-
RewriteRule "[38]/[0-9]+9\.png$" "/tile-util/vr0.png" [PT]
188+
RewriteRule "[38]/[0-9]+9\.png" "/tile-util/vr0.png" [PT]
189+
# Special message for the operator of kozlekedesiklub.hu who "struggle" :-) to set up a cache.
190+
RewriteCond "%{HTTP_REFERER}" "kozlekedesiklub\.hu"
191+
# Exclude requests not for tiles. Otherwise /index.html and its assets are forbidden as well.
192+
RewriteRule "/7/70/44\.png" "/tile-util/please-contact.png" [PT]
193+
RewriteRule "/8/141/89\.png" "/tile-util/please-contact.png" [PT]
194+
RewriteRule "[50]/[0-9]+[27]\.png" "/tile-util/please-contact.png" [PT]
195+
RewriteRule "[38]/[0-9]+[18]\.png" "/tile-util/vr0.png" [PT]
189196
190197
# Warn https://168railway.com/ that they are running into being blocked.
191198
# Their frontend on the login page loads lots of tiles without user
5.69 KB
Loading

ansible/roles/tileserver_step2/tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@
251251
- vr0.png
252252
- vr0-automatic-tile-loading.png
253253
- attribution-tile.png
254+
- please-contact.png
254255

255256
- name: Enable Apache module tile
256257
apache2_module:

0 commit comments

Comments
 (0)