Skip to content

Commit bbaaf00

Browse files
fix: move Google-Ads.txt to templates (#2868)
* fix: move Google-Ads.txt to templates * feat: implement Google Ads verification endpoint and move Google-Ads.txt to static files --------- Co-authored-by: Benjamin Oni <onibenjo@gmail.com>
1 parent 5615213 commit bbaaf00

4 files changed

Lines changed: 15 additions & 1 deletion

File tree

Google-Ads.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

static/files/Google-Ads.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
GooGhywoiu9839t543j0s7543uw1. Please Modify Admin access for user "mohamed.elmasry@canonical.com" in Google Ads account 404-765-5407 - Date 08/18/2026.

webapp/app.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
build_knowledge_index,
6060
build_knowledge_category_index,
6161
get_knowledge_sections,
62+
google_ads_verification,
6263
)
6364
from webapp.application import application_bp
6465
from webapp.canonical_cla.views import (
@@ -229,6 +230,7 @@ def home_sitemap():
229230

230231

231232
app.add_url_rule("/asset/<file_name>", view_func=json_asset_query)
233+
app.add_url_rule("/Google-Ads.txt", view_func=google_ads_verification)
232234

233235

234236
# OpenStack resources blog section

webapp/views.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,3 +558,15 @@ def knowledge_category_index():
558558
)
559559

560560
return knowledge_category_index
561+
562+
563+
def google_ads_verification():
564+
"""
565+
Serve the Google Ads account-access verification token from the domain
566+
root. Google fetches /Google-Ads.txt directly and does not reliably
567+
follow redirects, so this is served in place rather than through a
568+
redirects.yaml entry like robots.txt uses.
569+
"""
570+
return flask.send_from_directory(
571+
flask.current_app.static_folder, "files/Google-Ads.txt"
572+
)

0 commit comments

Comments
 (0)