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

Add robots.txt and X-Robots-Tag header #17946

Merged
merged 1 commit into from
Sep 1, 2021
Merged

Conversation

thejens
Copy link
Contributor

@thejens thejens commented Aug 31, 2021

Added a robots.txt file and X-Robots-Tag header to limit some of the damage caused when accidentally exposing airflow to the public internet.

@boring-cyborg boring-cyborg bot added area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues labels Aug 31, 2021
@thejens
Copy link
Contributor Author

thejens commented Aug 31, 2021

... could use some help with where and how to add tests to this as I didn't find that setup intuitive

@potiuk
Copy link
Member

potiuk commented Aug 31, 2021

Cool. Thanks for that ! The easiest way to add tests is to add separate package for /robots endpoint + check in the home test view if the header is returned : https://github.com/apache/airflow/blob/main/tests/www/views/test_views_home.py

The setup is rather easy. For those tests you can setup local virtualenv (https://github.com/apache/airflow/blob/main/LOCAL_VIRTUALENV.rst) - classic python virtualenv and run pytest tests there (make sure to init the db before or run the test once with --with-db-init custom flag.

You can also setup BREEZE with (https://github.com/apache/airflow/blob/main/BREEZE.rst) - thi s more compleete environment whicch is docker -compose based and is the exact replica of what happens in hthe CI. This is as simple as running ./breeze and the script should guide you and eventually you should be dropped tinto basjh interpreter inside breeze container with everyything read y to run pytest with the test to run (your sources will be mounted in container so you can edit them locally and run in container immediately) . Also recommend to install pre-commit (pre-commit install) in your repo, so that all static checks will be run at commit time.

@thejens
Copy link
Contributor Author

thejens commented Sep 1, 2021

@potiuk added tests.

@github-actions github-actions bot added the okay to merge It's ok to merge this PR as it does not require more tests label Sep 1, 2021
@github-actions
Copy link

github-actions bot commented Sep 1, 2021

The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.

@thejens thejens mentioned this pull request Sep 1, 2021
2 tasks
@uranusjr uranusjr merged commit fac06a1 into apache:main Sep 1, 2021
@thejens thejens deleted the robots branch September 1, 2021 13:27
@kaxil kaxil added this to the Airflow 2.2 milestone Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues okay to merge It's ok to merge this PR as it does not require more tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants