Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VOTE-972: Add robotstxt module. Delete default robots.txt file and pr… #758

Merged
merged 3 commits into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
/drush/Commands/contrib/
/web/profiles/contrib/
/web/libraries/
/web/robots.txt

# Ignore configuration files that may contain sensitive information.
/web/sites/*/settings*.php
Expand Down
9 changes: 9 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"drupal/redirect": "^1.8",
"drupal/remove_http_headers": "^2.0",
"drupal/rest_views": "^3.0",
"drupal/robotstxt": "^1.5",
"drupal/s3fs": "^3.1",
"drupal/samlauth": "^3.8",
"drupal/simple_sitemap": "^4.1",
Expand Down Expand Up @@ -145,5 +146,13 @@
" composer remove drupal/core-project-message"
]
}
},
"scripts": {
"post-install-cmd": [
"test -e web/robots.txt && rm web/robots.txt || echo The default robots.txt file has been deleted."
],
"post-update-cmd": [
"test -e web/robots.txt && rm web/robots.txt || echo The default robots.txt file has been deleted."
]
}
}
59 changes: 58 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions config/production/robotstxt.settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
_core:
default_config_hash: ceCx5XZ_ay1Mxcv-sB95U_fBKoVkpvo8RaQiwutSZLI
content: "#\r\n# robots.txt\r\n#\r\n# This file is to prevent the crawling and indexing of certain parts\r\n# of your site by web crawlers and spiders run by sites like Yahoo!\r\n# and Google. By telling these \"robots\" where not to go on your site,\r\n# you save bandwidth and server resources.\r\n#\r\n# This file will be ignored unless it is at the root of your host:\r\n# Used: http://example.com/robots.txt\r\n# Ignored: http://example.com/site/robots.txt\r\n#\r\n# For more information about the robots.txt standard, see:\r\n# http://www.robotstxt.org/robotstxt.html\r\n\r\nUser-agent: *\r\nCrawl-delay: 10\r\n\r\n# Sitemaps\r\nSitemap: https://vote.gov/sitemap.xml\r\n\r\n# CSS, JS, Images\r\nAllow: /*.css$\r\nAllow: /*.js$\r\nAllow: /core/*.css$\r\nAllow: /core/*.css?\r\nAllow: /core/*.js$\r\nAllow: /modules/*.css$\r\nAllow: /modules/*.css?\r\nAllow: /modules/*.js$\r\nAllow: /modules/*.js?\r\nAllow: /modules/*.gif\r\nAllow: /modules/*.jpg\r\nAllow: /modules/*.jpeg\r\nAllow: /modules/*.png\r\nAllow: /themes/*.css$\r\nAllow: /themes/*.css?\r\nAllow: /themes/*.js$\r\nAllow: /themes/*.js?\r\nAllow: /themes/*.gif\r\nAllow: /themes/*.jpg\r\nAllow: /themes/*.jpeg\r\nAllow: /themes/*.png\r\n# Directories\r\nDisallow: /core/\r\nDisallow: /modules/\r\nDisallow: /themes/\r\n"
1 change: 1 addition & 0 deletions config/sync/config_split.config_split.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ theme: { }
complete_list:
- log_stdout.settings
- new_relic_rpm.settings
- robotstxt.settings
- s3fs.settings
- samlauth.authentication
- usagov_login.settings
Expand Down
1 change: 1 addition & 0 deletions config/sync/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ module:
remove_http_headers: 0
rest: 0
rest_views: 0
robotstxt: 0
serialization: 0
simple_sitemap: 0
system: 0
Expand Down
1 change: 1 addition & 0 deletions config/sync/robotstxt.settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
content: "#\r\n# robots.txt\r\n#\r\n# This file is to prevent the crawling and indexing of certain parts\r\n# of your site by web crawlers and spiders run by sites like Yahoo!\r\n# and Google. By telling these \"robots\" where not to go on your site,\r\n# you save bandwidth and server resources.\r\n#\r\n# This file will be ignored unless it is at the root of your host:\r\n# Used: http://example.com/robots.txt\r\n# Ignored: http://example.com/site/robots.txt\r\n#\r\n# For more information about the robots.txt standard, see:\r\n# http://www.robotstxt.org/robotstxt.html\r\n\r\nUser-agent: *\r\nDisallow: /\r\n"
2 changes: 2 additions & 0 deletions config/sync/user.role.site_builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ dependencies:
- redirect
- remove_http_headers
- rest
- robotstxt
- simple_sitemap
- system
- taxonomy
Expand Down Expand Up @@ -110,6 +111,7 @@ permissions:
- 'administer redirect settings'
- 'administer redirects'
- 'administer rest resources'
- 'administer robots.txt'
- 'administer site configuration'
- 'administer sitemap settings'
- 'administer software updates'
Expand Down
17 changes: 0 additions & 17 deletions web/robots.txt

This file was deleted.