2
0
mirror of https://github.com/offen/website.git synced 2024-11-22 09:00:28 +01:00

Merge pull request #142 from offen/robots-files

Add robots.txt files for staging and production envs
This commit is contained in:
Frederik Ring 2019-09-29 16:10:45 +02:00 committed by GitHub
commit 68ed75cd6a
6 changed files with 17 additions and 7 deletions

View File

@ -178,12 +178,14 @@ jobs:
if [ "${CIRCLE_BRANCH}" == "master" ]; then if [ "${CIRCLE_BRANCH}" == "master" ]; then
export SITEURL="https://www.offen.dev" export SITEURL="https://www.offen.dev"
export DOCKER_IMAGE_TAG="stable" export DOCKER_IMAGE_TAG="stable"
export ROBOTS_FILE="robots.txt.production"
else else
export SITEURL="https://staging.offen.dev" export SITEURL="https://staging.offen.dev"
export DOCKER_IMAGE_TAG="latest" export DOCKER_IMAGE_TAG="latest"
export ROBOTS_FILE="robots.txt.staging"
fi fi
docker build -t offen/server:$DOCKER_IMAGE_TAG -f build/server/Dockerfile . 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: - run:
name: Save Docker image layer cache name: Save Docker image layer cache
command: | command: |

View File

@ -32,10 +32,11 @@ bootstrap:
@echo "" @echo ""
DOCKER_IMAGE_TAG ?= latest DOCKER_IMAGE_TAG ?= latest
ROBOTS_FILE ?= robots.txt.staging
build: build:
@docker build -t offen/server:${DOCKER_IMAGE_TAG} -f build/server/Dockerfile . @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: secret:
@docker-compose run server make secret @docker-compose run server make secret

View File

@ -1,6 +1,5 @@
# offen # offen
[![CircleCI](https://circleci.com/gh/offen/offen/tree/master.svg?style=svg)](https://circleci.com/gh/offen/offen/tree/master) [![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) [![Patreon](https://img.shields.io/static/v1.svg?label=patreon&message=donate&color=e85b46)](https://www.patreon.com/offen)
> The offen analytics software > 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. 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. 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.
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.
### Developing the application ### Developing the application
@ -25,7 +22,7 @@ After cloning the repository, you can build the containers and install dependenc
$ make setup $ 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 ```sh
$ make bootstrap $ make bootstrap

View File

@ -58,11 +58,16 @@ RUN pip install --user -r requirements.txt
RUN make publish RUN make publish
FROM nginx:1.17-alpine 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=homepage /code/homepage/output /www/data
COPY --from=script /code/script/dist /www/data COPY --from=script /code/script/dist /www/data
COPY --from=auditorium /code/auditorium/dist /www/data/auditorium COPY --from=auditorium /code/auditorium/dist /www/data/auditorium
COPY --from=vault /code/vault/dist /www/data/vault 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 COPY ./build/proxy/nginx.conf /etc/nginx/nginx.conf
EXPOSE 80 EXPOSE 80

View File

@ -0,0 +1,3 @@
User-agent: *
Disallow: /vault/
Disallow: /auditorium/

View File

@ -0,0 +1,2 @@
User-agent: *
Disallow: /