diff --git a/.circleci/config.yml b/.circleci/config.yml index 8bb2678..bc4960e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,6 @@ deploy_preconditions: &deploy_preconditions - script - auditorium - packages - - shared filters: branches: only: /^master$/ @@ -68,20 +67,6 @@ jobs: cp ~/offen/bootstrap.yml . make test-ci - shared: - docker: - - image: circleci/golang:1.12 - working_directory: ~/offen/shared - steps: - - checkout: - path: ~/offen - - run: - name: Install dependencies - command: go get ./... - - run: - name: Run tests - command: make test - vault: docker: - image: circleci/node:10-browsers diff --git a/Makefile b/Makefile index aa9a1ab..5a317c7 100644 --- a/Makefile +++ b/Makefile @@ -25,4 +25,8 @@ bootstrap: @echo "Bootstrapping Accounts service ..." @docker-compose run accounts make bootstrap -.PHONY: setup bootstrap +build: + @docker build -t offen-server:latest -f build/server/Dockerfile . + @docker build -t offen-proxy:latest -f build/proxy/Dockerfile . + +.PHONY: setup bootstrap build diff --git a/build/docker-compose.yml b/build/docker-compose.yml index b45db47..0eef43d 100644 --- a/build/docker-compose.yml +++ b/build/docker-compose.yml @@ -2,15 +2,23 @@ version: '3' services: proxy: - build: - context: './..' - dockerfile: build/proxy/Dockerfile + image: offen-proxy:latest ports: - 3000:80 depends_on: - server server: - build: - context: './..' - dockerfile: build/server/Dockerfile + image: offen-server:latest + environment: + POSTGRES_CONNECTION_STRING: postgres://postgres:develop@server_database:5432/postgres?sslmode=disable + COOKIE_EXCHANGE_SECRET: Wsttdo4Z3mXV5sTc + EVENT_RETENTION_PERIOD: 4464h + ACCOUNT_USER_EMAIL_SALT: UwBkP24HCUYqy0Eq + depends_on: + - server_database + + server_database: + image: postgres:11.2 + environment: + POSTGRES_PASSWORD: develop diff --git a/build/proxy/Dockerfile b/build/proxy/Dockerfile index 40dd5b2..6d4d0da 100644 --- a/build/proxy/Dockerfile +++ b/build/proxy/Dockerfile @@ -50,8 +50,8 @@ RUN make publish FROM nginx:1.17-alpine 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=script /code/script/dist /www/data/script COPY --from=vault /code/vault/dist /www/data/vault COPY ./build/proxy/nginx.conf /etc/nginx/nginx.conf diff --git a/build/proxy/nginx.conf b/build/proxy/nginx.conf index ae70f49..0e658c5 100644 --- a/build/proxy/nginx.conf +++ b/build/proxy/nginx.conf @@ -1,8 +1,12 @@ events {} http { - include /etc/nginx/mime.types; + gzip on; + gzip_comp_level 2; + gzip_min_length 1000; + gzip_proxied expired no-cache no-store private auth; + include mime.types; upstream server { server server:3000; } @@ -16,6 +20,12 @@ http { proxy_pass http://server; proxy_redirect off; rewrite ^/api(.*)$ $1 break; + proxy_hide_header Content-Type; + add_header Content-Type "application/json"; + } + + location /auditorium/ { + try_files $uri $uri/ /auditorium/index.html; } } } diff --git a/docker-compose.yml b/docker-compose.yml index ed4d640..fc95272 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,6 @@ services: - ./styles:/code/styles ports: - 8080:80 - - 8081:81 depends_on: - homepage - server @@ -26,7 +25,6 @@ services: - ./bootstrap.yml:/offen/server/bootstrap.yml - serverdeps:/go/pkg/mod environment: - CORS_ORIGIN: http://localhost:9977 POSTGRES_CONNECTION_STRING: postgres://postgres:develop@server_database:5432/postgres?sslmode=disable PORT: 8080 DEVELOPMENT: '1' @@ -61,8 +59,6 @@ services: - .:/offen - scriptdeps:/offen/script/node_modules command: npm start -- --port 9966 - environment: - - VAULT_HOST=/vault/ auditorium: build: @@ -73,8 +69,6 @@ services: - .:/offen - auditoriumdeps:/offen/auditorium/node_modules command: npm start -- --port 9955 - environment: - - VAULT_HOST=/vault/ homepage: build: diff --git a/homepage/content/pages/auditorium.md b/homepage/content/pages/auditorium.md deleted file mode 100644 index 463761a..0000000 --- a/homepage/content/pages/auditorium.md +++ /dev/null @@ -1,5 +0,0 @@ -Title: Auditorium | offen -description: offen is a free and open source analytics software for websites and web applications that allows respectful handling of data. -save_as: auditorium/index.html -href: /auditorium/ -template: auditorium diff --git a/homepage/publishconf.py b/homepage/publishconf.py index e442015..b28fdae 100644 --- a/homepage/publishconf.py +++ b/homepage/publishconf.py @@ -11,8 +11,8 @@ sys.path.append(os.curdir) from pelicanconf import * # If your site is available via HTTPS, make sure SITEURL begins with https:// -SITEURL = 'https://www.offen.dev' -RELATIVE_URLS = False +SITEURL = os.environ.get('PELICAN_SITEURL', 'https://www.offen.dev') +# RELATIVE_URLS = True FEED_ALL_ATOM = 'feeds/all.atom.xml' CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml' diff --git a/homepage/theme/templates/auditorium.html b/homepage/theme/templates/auditorium.html deleted file mode 100644 index 997789b..0000000 --- a/homepage/theme/templates/auditorium.html +++ /dev/null @@ -1,10 +0,0 @@ -{% extends "base.html" %} - -{% block content %} -
-{% endblock %} - -{% block scripts %} - {{ super () }} - -{% endblock %} diff --git a/homepage/theme/templates/base.html b/homepage/theme/templates/base.html index 26b3792..160e6bd 100644 --- a/homepage/theme/templates/base.html +++ b/homepage/theme/templates/base.html @@ -20,7 +20,7 @@ {% assets filters="cssmin", output="css/style.min.css", "css/normalize.css", "css/fonts.css", "css/style.css" %} - + {% endassets %} {% if OFFEN_ACCOUNT_ID %} @@ -138,7 +138,7 @@ {% block scripts %} {% assets filters="rjsmin", output="scripts/packed.js", "scripts/jquery-3.4.1.min.js", "scripts/menu.js", "scripts/fade.js" %} - + {% endassets %} {% endblock %}