Skip to content

Commit 6687311

Browse files
committed
X-Robots-Tag "noindex, nofollow"
1 parent d76a877 commit 6687311

File tree

10 files changed

+34
-10
lines changed

10 files changed

+34
-10
lines changed

Diff for: .ruff.toml

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ lint.ignore = [
2929
'E741',
3030
'F401', # unused imports
3131
'F841',
32-
'PT004',
3332
'SIM102',
3433
'SIM105',
3534
'SIM108',

Diff for: modules/http_host/http_host_lib/nginx.py

+5
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ def create_version_location(
206206
207207
add_header 'Access-Control-Allow-Origin' '*' always;
208208
add_header Cache-Control public;
209+
add_header X-Robots-Tag "noindex, nofollow" always;
209210
210211
add_header x-ofm-debug 'specific JSON {area} {version}';
211212
}}
@@ -224,6 +225,7 @@ def create_version_location(
224225
225226
add_header 'Access-Control-Allow-Origin' '*' always;
226227
add_header Cache-Control public;
228+
add_header X-Robots-Tag "noindex, nofollow" always;
227229
228230
add_header x-ofm-debug 'specific PBF {area} {version}';
229231
}}
@@ -268,6 +270,7 @@ def create_latest_locations(*, local: str, domain: str) -> str:
268270
269271
add_header 'Access-Control-Allow-Origin' '*' always;
270272
add_header Cache-Control public;
273+
add_header X-Robots-Tag "noindex, nofollow" always;
271274
272275
add_header x-ofm-debug 'latest JSON {area}';
273276
}}
@@ -289,6 +292,7 @@ def create_latest_locations(*, local: str, domain: str) -> str:
289292
290293
add_header 'Access-Control-Allow-Origin' '*' always;
291294
add_header Cache-Control public;
295+
add_header X-Robots-Tag "noindex, nofollow" always;
292296
293297
add_header x-ofm-debug 'wildcard JSON {area}';
294298
}}
@@ -309,6 +313,7 @@ def create_latest_locations(*, local: str, domain: str) -> str:
309313
310314
add_header 'Access-Control-Allow-Origin' '*' always;
311315
add_header Cache-Control public;
316+
add_header X-Robots-Tag "noindex, nofollow" always;
312317
313318
add_header x-ofm-debug 'wildcard PBF {area}';
314319
}}

Diff for: modules/http_host/http_host_lib/nginx_confs/le.conf

+5
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@ server {
2222
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
2323
ssl_prefer_server_ciphers off;
2424

25+
2526
# access log doesn't contain IP address
2627
access_log off;
2728
#access_log /data/ofm/http_host/logs_nginx/le-access.jsonl access_json buffer=128k;
2829

2930
error_log /data/ofm/http_host/logs_nginx/le-error.log;
3031

32+
add_header X-Robots-Tag "noindex, nofollow" always;
33+
34+
3135
location ^~ /.well-known/acme-challenge/ {
3236
# trailing slash
3337
root /data/nginx/acme-challenges;
@@ -52,6 +56,7 @@ server {
5256

5357
add_header 'Access-Control-Allow-Origin' '*' always;
5458
add_header Cache-Control public;
59+
add_header X-Robots-Tag "noindex, nofollow" always;
5560
}
5661

5762
# catch-all block to deny all other requests

Diff for: modules/http_host/http_host_lib/nginx_confs/location_static.conf

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Serve robots.txt that blocks all crawlers
2+
#location = /robots.txt {
3+
# add_header Content-Type text/plain;
4+
#return 200 "User-agent: *\nDisallow: /\n";
5+
#}
6+
17
location /fonts/ {
28
# trailing slash
39

@@ -8,6 +14,8 @@ location /fonts/ {
814

915
add_header 'Access-Control-Allow-Origin' '*' always;
1016
add_header Cache-Control public;
17+
add_header X-Robots-Tag "noindex, nofollow" always;
18+
1119
}
1220

1321
location /natural_earth/ {
@@ -20,6 +28,8 @@ location /natural_earth/ {
2028

2129
add_header 'Access-Control-Allow-Origin' '*' always;
2230
add_header Cache-Control public;
31+
add_header X-Robots-Tag "noindex, nofollow" always;
32+
2333
}
2434

2535
location /sprites/ {
@@ -32,6 +42,8 @@ location /sprites/ {
3242

3343
add_header 'Access-Control-Allow-Origin' '*' always;
3444
add_header Cache-Control public;
45+
add_header X-Robots-Tag "noindex, nofollow" always;
46+
3547
}
3648

3749

@@ -47,6 +59,7 @@ location @empty_tile {
4759

4860
add_header 'Access-Control-Allow-Origin' '*' always;
4961
add_header Cache-Control public;
62+
add_header X-Robots-Tag "noindex, nofollow" always;
5063

5164
add_header x-ofm-debug 'empty tile';
5265
}

Diff for: modules/http_host/http_host_lib/nginx_confs/roundrobin.conf

+5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ server {
2828

2929
error_log /data/ofm/http_host/logs_nginx/roundrobin-error.log;
3030

31+
add_header X-Robots-Tag "noindex, nofollow" always;
32+
33+
3134
__LOCATION_BLOCKS__
3235

3336
location /styles/ {
@@ -46,6 +49,8 @@ server {
4649

4750
add_header 'Access-Control-Allow-Origin' '*' always;
4851
add_header Cache-Control public;
52+
add_header X-Robots-Tag "noindex, nofollow" always;
53+
4954
}
5055

5156
# catch-all block to deny all other requests

Diff for: modules/tile_gen/scripts/shrink_btrfs.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def cli(btrfs_img: Path):
6969
mnt_dir.rmdir()
7070

7171
subprocess.run(['truncate', '-s', str(total_size), btrfs_img])
72-
print(f'Truncated {btrfs_img} to {total_size//1_000_000} MB size')
72+
print(f'Truncated {btrfs_img} to {total_size // 1_000_000} MB size')
7373
print('shrink_btrfs.py DONE')
7474

7575

@@ -86,7 +86,7 @@ def get_usage(mnt: Path, key: str):
8686

8787
def do_shrink(mnt: Path, delta_size: float):
8888
delta_size = int(delta_size)
89-
print(f'Trying to shrink by {delta_size//1_000_000} MB')
89+
print(f'Trying to shrink by {delta_size // 1_000_000} MB')
9090
p = subprocess.run(['btrfs', 'filesystem', 'resize', str(-delta_size), mnt])
9191
return p.returncode == 0
9292

Diff for: modules/tile_gen/tile_gen_lib/btrfs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def make_btrfs(run_folder: Path):
8888
['btrfs', 'filesystem', 'show', mount],
8989
['btrfs', 'filesystem', 'usage', mount],
9090
]:
91-
f.write(f"\n\n{' '.join(cmd)}\n")
91+
f.write(f'\n\n{" ".join(cmd)}\n')
9292
result = subprocess.run(['sudo'] + cmd, check=True, capture_output=True, text=True)
9393
f.write(result.stdout)
9494

Diff for: website/astro.config.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @ts-check
22
import { defineConfig } from 'astro/config'
33

4-
import sitemap from '@astrojs/sitemap';
4+
import sitemap from '@astrojs/sitemap'
55

66
// https://astro.build/config
77

Diff for: website/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
"lightningcss": "^1.29.1"
1616
},
1717
"pnpm": {
18-
"onlyBuiltDependencies": [
19-
"esbuild",
20-
"sharp"
21-
]
18+
"onlyBuiltDependencies": ["esbuild", "sharp"]
2219
}
2320
}

Diff for: website/src/layouts/Layout.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
const { frontmatter } = Astro.props || {}
33
const { title } = frontmatter || Astro.props
4-
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
4+
const canonicalURL = new URL(Astro.url.pathname, Astro.site)
55
66
import '../styles/_style.css'
77
---

0 commit comments

Comments
 (0)