From cc8eab439402c2364bba1aaf87f35aae1bddd886 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Sun, 29 Sep 2019 16:08:41 +0200 Subject: [PATCH] add robots.txt files for staging and production envs --- .circleci/config.yml | 4 +++- Makefile | 3 ++- README.md | 7 ++----- build/proxy/Dockerfile | 5 +++++ build/proxy/robots.txt.production | 3 +++ build/proxy/robots.txt.staging | 2 ++ 6 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 build/proxy/robots.txt.production create mode 100644 build/proxy/robots.txt.staging diff --git a/.circleci/config.yml b/.circleci/config.yml index 3e962e5..2c2d32a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -178,12 +178,14 @@ jobs: if [ "${CIRCLE_BRANCH}" == "master" ]; then export SITEURL="https://www.offen.dev" export DOCKER_IMAGE_TAG="stable" + export ROBOTS_FILE="robots.txt.production" else export SITEURL="https://staging.offen.dev" export DOCKER_IMAGE_TAG="latest" + export ROBOTS_FILE="robots.txt.staging" fi docker build -t offen/server:$DOCKER_IMAGE_TAG -f build/server/Dockerfile . - docker build --build-arg siteurl=$SITEURL -t offen/proxy:$DOCKER_IMAGE_TAG -f build/proxy/Dockerfile . + docker build --build-arg siteurl=$SITEURL --build-arg robots=$ROBOTS_FILE -t offen/proxy:$DOCKER_IMAGE_TAG -f build/proxy/Dockerfile . - run: name: Save Docker image layer cache command: | diff --git a/Makefile b/Makefile index 4846bcf..e325835 100644 --- a/Makefile +++ b/Makefile @@ -32,10 +32,11 @@ bootstrap: @echo "" DOCKER_IMAGE_TAG ?= latest +ROBOTS_FILE ?= robots.txt.staging build: @docker build -t offen/server:${DOCKER_IMAGE_TAG} -f build/server/Dockerfile . - @docker build --build-arg siteurl=${SITEURL} -t offen/proxy:${DOCKER_IMAGE_TAG} -f build/proxy/Dockerfile . + @docker build --build-arg siteurl=${SITEURL} --build-arg robots=${ROBOTS_FILE} -t offen/proxy:${DOCKER_IMAGE_TAG} -f build/proxy/Dockerfile . secret: @docker-compose run server make secret diff --git a/README.md b/README.md index dcd07c4..3ec5263 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # offen [![CircleCI](https://circleci.com/gh/offen/offen/tree/master.svg?style=svg)](https://circleci.com/gh/offen/offen/tree/master) -[![Pivotal Tracker](https://img.shields.io/static/v1.svg?label=Project+Planning&message=Pivotal+Tracker&color=informational)](https://www.pivotaltracker.com/n/projects/2334535) [![Patreon](https://img.shields.io/static/v1.svg?label=patreon&message=donate&color=e85b46)](https://www.patreon.com/offen) > The offen analytics software @@ -11,9 +10,7 @@ This repository contains all source code needed to build and run __offen__, both Development of __offen__ has just started, so instructions are rare and things will stay highly volatile for quite some while. -Guidelines for running and developing the Software will be added when it makes sense to do so. - -Project planning and issue tracking is done using [Pivotal Tracker](https://www.pivotaltracker.com/n/projects/2334535), but feel free to open a GitHub issue if you have a question or found a bug. +Guidelines for running and developing the Software will be added when it makes sense to do so. If you have questions in the meantime, feel free to open an issue. ### Developing the application @@ -25,7 +22,7 @@ After cloning the repository, you can build the containers and install dependenc $ make setup ``` -Next, create a local encryption key for the `kms` service and seed the database for the `server` application: +Next seed the database for the `server` application: ```sh $ make bootstrap diff --git a/build/proxy/Dockerfile b/build/proxy/Dockerfile index d31d945..ee23061 100644 --- a/build/proxy/Dockerfile +++ b/build/proxy/Dockerfile @@ -58,11 +58,16 @@ RUN pip install --user -r requirements.txt RUN make publish FROM nginx:1.17-alpine +LABEL maintainer="mail@offen.dev" + +ARG robots +ENV ROBOTS_FILE=$robots COPY --from=homepage /code/homepage/output /www/data COPY --from=script /code/script/dist /www/data COPY --from=auditorium /code/auditorium/dist /www/data/auditorium COPY --from=vault /code/vault/dist /www/data/vault +COPY ./build/proxy/$ROBOTS_FILE /www/data/robots.txt COPY ./build/proxy/nginx.conf /etc/nginx/nginx.conf EXPOSE 80 diff --git a/build/proxy/robots.txt.production b/build/proxy/robots.txt.production new file mode 100644 index 0000000..516627c --- /dev/null +++ b/build/proxy/robots.txt.production @@ -0,0 +1,3 @@ +User-agent: * +Disallow: /vault/ +Disallow: /auditorium/ diff --git a/build/proxy/robots.txt.staging b/build/proxy/robots.txt.staging new file mode 100644 index 0000000..1f53798 --- /dev/null +++ b/build/proxy/robots.txt.staging @@ -0,0 +1,2 @@ +User-agent: * +Disallow: /