Proxy API requests, load data from API (#15)

* Remove nginx.conf from Dockerfile

* Move nginx.conf, add proxy settings

* Add docker-compose.yaml

* Update .gitignore

* Load data from API

* Remove spider result JSON

* Fix some page details

* Remove logging

* Several details page fixes and improvements

* Load screenshots data from API

* Load screenshots via proxy

* Remove site favicons

* Update nginx configs

* Delete CNAME

* Update serviceWorkerAddon.js

* Update docker-compose files

* Update production docker-compose file

* Update Dockerfile

* Update Makefile

* Several functional improvements and fixes
main
Marian Steinbach 4 years ago committed by GitHub
parent ae34e0f23a
commit 5fb10d0690
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .gitignore
  2. 13
      Dockerfile
  3. 7
      Dockerfile_node_dev
  4. 15
      Makefile
  5. 58
      config/nginx.conf
  6. 91
      config/nginx/nginx_dev.conf
  7. 124
      config/nginx/nginx_prod.conf
  8. 114
      config/nginx/nginx_staging.conf
  9. 2
      config/webpack.config.dev.js
  10. 24
      docker-compose-prod.yaml
  11. 34
      docker-compose-staging.yaml
  12. 32
      docker-compose.yaml
  13. 1
      package.json
  14. 1
      public/CNAME
  15. 11
      public/index.html
  16. 42
      public/serviceWorkerAddon.js
  17. BIN
      public/siteicons/0073bd6a9bfa8259f684bb664bd28c9a.png
  18. BIN
      public/siteicons/042f0bf5868511974bfd22dcf2278fd8.ico
  19. BIN
      public/siteicons/0967129c188cec05434bcef22632e797.ico
  20. BIN
      public/siteicons/09d52e5603efb19a8c1cb52af6a1c9da.png
  21. BIN
      public/siteicons/0ab85f7ffac1aa671cfb2f15116fbc23.ico
  22. BIN
      public/siteicons/0ca3f844672deef54d6fc98ecb502ed5.png
  23. BIN
      public/siteicons/0dc13b50e03ca27f58f87b00671a1e68.ico
  24. BIN
      public/siteicons/0deb279b67c6b805d11e27fc8df48f3a.ico
  25. BIN
      public/siteicons/0ecdac24b862d6cb40828fa64c969386.ico
  26. BIN
      public/siteicons/10bccf7c5fd52a0f20456ea4ccf2c403.png
  27. BIN
      public/siteicons/1194d7d32448e1f90741a97b42af91fa.ico
  28. BIN
      public/siteicons/11ef6c0950e86d4aafd15be832deddd9.ico
  29. BIN
      public/siteicons/16eba5d237ec52611d79f5b6714aa6a9.jpg
  30. BIN
      public/siteicons/16f5808feb148ca9d088b5535f00777a.png
  31. BIN
      public/siteicons/17984ad0a5a726b238a85ae124101276.ico
  32. BIN
      public/siteicons/186bbbf767927571de3a8e3648cfded4.png
  33. BIN
      public/siteicons/18f1edbd361b70444fd7c7559c1754a0.ico
  34. BIN
      public/siteicons/1a345584649d5ec47d61b6f0b73a869d.ico
  35. BIN
      public/siteicons/1b890842ba700bd1869198e993f498ac.ico
  36. BIN
      public/siteicons/1b9ca126dff5ed42e5ad7e572c0cd2c3.ico
  37. BIN
      public/siteicons/1ce0c63f8bd1e5d3376ec0ae95a41c08.ico
  38. BIN
      public/siteicons/1d0f9c3c4782850ce383a671bf00f470.png
  39. BIN
      public/siteicons/1f615d5bf91b5eb2187c8d85fb801c9a.ico
  40. BIN
      public/siteicons/21ab4a872462964b3d3581eb7915ce26.png
  41. BIN
      public/siteicons/22cc2005b4cc3d72564fde512b7ac88d.gif
  42. BIN
      public/siteicons/249c9b5ef6be0f26977387928c9a4b69.ico
  43. BIN
      public/siteicons/2acd93ebf6225a014f4820d5c57bcea1.png
  44. BIN
      public/siteicons/2b4be9b11156199e96acb71392cc14ce.png
  45. BIN
      public/siteicons/2c77da304308884f973dc578f33f22f3.ico
  46. BIN
      public/siteicons/2e6ca33657d64802e2814814fe81a7b4.png
  47. BIN
      public/siteicons/304c2af408fe19b004c3bccf847b455a.png
  48. BIN
      public/siteicons/31c08a20b3ce617969ee503adfa1a06a.ico
  49. BIN
      public/siteicons/32e88c483a630ca0df4a00d8ff1ece04.png
  50. BIN
      public/siteicons/360d1d2987fcd886dbfb83f4cf2ae833.ico
  51. BIN
      public/siteicons/3c4dea2f646571881e8d882c2b07531a.ico
  52. BIN
      public/siteicons/3fbab8afc54f5aa6c679b15655661196.ico
  53. BIN
      public/siteicons/3ff9ad98caf4ee59d8789b1c431cd50c.ico
  54. BIN
      public/siteicons/41b57c0a0c1c40cd2f3962e3caf87d57.png
  55. BIN
      public/siteicons/426267ae845576e8fed33013ff4849f0.ico
  56. BIN
      public/siteicons/43fb33c57227e9d867b3089d993628e3.png
  57. BIN
      public/siteicons/45764934608573e1d807d338d4ce405d.png
  58. BIN
      public/siteicons/469c7d11d58fff007d0d911a2a1e952d.ico
  59. BIN
      public/siteicons/47cfbba59aa7e10c678bc8ef3e429b58.ico
  60. BIN
      public/siteicons/4822081b2998400cc4422b25ff099c37.ico
  61. BIN
      public/siteicons/48ab9a01b86429c31dc2fcd85e925c91.png
  62. BIN
      public/siteicons/4a8754784888a49ad98e0a7afce8a906.ico
  63. BIN
      public/siteicons/4f4203fe1c43523919b3905a8b3e63a9.ico
  64. BIN
      public/siteicons/5080db01b907f1ade5e1f0952799adaf.jpg
  65. BIN
      public/siteicons/52582e72bd938205498521c6b509c49d.ico
  66. BIN
      public/siteicons/53bc42ded65062b7dc578a20b5ff2cce.jpg
  67. BIN
      public/siteicons/557d087af1a964c9015332d64617b6d4.png
  68. BIN
      public/siteicons/56ee1b7375fa13b039f8f5319675309c.png
  69. BIN
      public/siteicons/5734263810e8879e443ee84db61bf729.ico
  70. BIN
      public/siteicons/5982e4314c393fb79586947a0c1fd937.png
  71. BIN
      public/siteicons/5a680a0d49276bbc6a5b2f2600f0079b.png
  72. BIN
      public/siteicons/5a73b539cd667f41fab9916dffe52882.ico
  73. BIN
      public/siteicons/5b8565f8cba452e6903b09c8e60530ec.png
  74. BIN
      public/siteicons/63b982eddd64d44233baa25066db6bc1.ico
  75. BIN
      public/siteicons/694f7df47d355683105b4d59bbaa4b37.ico
  76. BIN
      public/siteicons/6d11f61fcfc825f4f5446a844d910cd7.png
  77. BIN
      public/siteicons/7043aa439c45317d0495a544e6db92e7.ico
  78. BIN
      public/siteicons/705424b605eccdb32f161363457e6374.ico
  79. BIN
      public/siteicons/713705bb8b087e0d7b9778e595317600.ico
  80. BIN
      public/siteicons/71552f9c7124091304e29d797a89192d.png
  81. BIN
      public/siteicons/716be6f93d646088f652036da8701778.ico
  82. BIN
      public/siteicons/732bd7f50ca99981afb8252c153a7fb7.png
  83. BIN
      public/siteicons/75da0b668686a57ff9622eeb5f54a2b5.ico
  84. BIN
      public/siteicons/763a07a20f4c0be782bfc18673b39f04.ico
  85. BIN
      public/siteicons/766725601f313ff3b55127f747e868d9.png
  86. BIN
      public/siteicons/76a49e20f30f1ff94b7c199dd362709e.jpg
  87. BIN
      public/siteicons/77089d19250cbb84ebc67c9906c49af3.ico
  88. BIN
      public/siteicons/773ffeda045b702523518f1fc217ae54.ico
  89. BIN
      public/siteicons/78f719ae961451e9ad3347283e98daee.png
  90. BIN
      public/siteicons/79ded96df21306ec7044622d38902355.ico
  91. BIN
      public/siteicons/7b112a77ea87f04a01274c624274a369.ico
  92. BIN
      public/siteicons/7cc55df75343353acc6a8be8cbdbe386.png
  93. BIN
      public/siteicons/7d70923f50d6a591b474519c1ff1fb41.ico
  94. BIN
      public/siteicons/7e6c4a5e862318819087f280178d22f8.ico
  95. BIN
      public/siteicons/82143ace59ceead2f64930232180ffad.ico
  96. BIN
      public/siteicons/82336140469da0ceb26e6285ef521078.ico
  97. BIN
      public/siteicons/835e96c57c3a75a1f4e667800ab71b1a.ico
  98. BIN
      public/siteicons/83d74cceb607c6b19336d72f877ef474.jpg
  99. BIN
      public/siteicons/8894791e84f5cafebd47311d14a3703c.ico
  100. BIN
      public/siteicons/89dda5b572f9ad9a89b0163c8e29c846.png
  101. Some files were not shown because too many files have changed in this diff Show More

1
.gitignore vendored

@ -22,3 +22,4 @@ yarn-error.log*
# secret key we never want to share
/secrets
/test-certs

@ -4,14 +4,19 @@ WORKDIR /
ADD yarn.lock /
ADD package.json /
ADD src /src
ADD scripts /scripts
ADD public /public
ADD config /config
RUN yarn install
ADD config /config
ADD public /public
ADD src /src
RUN yarn build
FROM nginx:1.14-alpine
# move this file, as /etc/nginx/ will be masked by a volume
RUN cp /etc/nginx/mime.types /mime.types
COPY --from=builder /build /usr/share/nginx/html
COPY config/nginx.conf /etc/nginx/nginx.conf

@ -0,0 +1,7 @@
# Dockerfile for the webapp dev server
FROM node:10-slim
WORKDIR /workdir
RUN yarn install

@ -1,10 +1,6 @@
IMAGE := quay.io/netzbegruenung/green-spider:latest
# Run a development server and load it in your default browser.
# Will reload as soon as some source has changed.
dev:
yarn start
# Build the web application to be served by a static web server
build:
@ -15,8 +11,17 @@ dist: build
rm -rf docs
cp -r build docs
# Run a development server on http://localhost:8000
dev:
docker-compose -f docker-compose.yaml up --build
# Run a staging server at http://localhost:8080
serve-staging:
docker-compose -f docker-compose-staging.yaml up --build
# Run the production setup at https://localhost
serve-prod:
cd docs && python3 -m http.server
docker-compose -f docker-compose-prod.yaml up --build
clean:
rm -rf build

@ -1,58 +0,0 @@
user nginx;
worker_processes 1;
error_log stderr warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
server {
listen *:8000;
rewrite ^/$ https://green-spider.netzbegruenung.de/ redirect;
}
server {
listen *:443;
ssl on;
ssl_certificate /etc/letsencrypt/live/green-spider.netzbegruenung.de/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/green-spider.netzbegruenung.de/privkey.pem;
root /usr/share/nginx/html;
# siteicons, css, js never change
location /siteicons/ {
expires 100d;
}
location /static/ {
expires 100d;
}
location / {
try_files $uri $uri/ /index.html;
}
}
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /dev/stdout main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}

@ -0,0 +1,91 @@
user nginx;
worker_processes 1;
error_log stderr warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
proxy_cache_path /var/cache/nginx/cache-api keys_zone=api:1m;
proxy_cache_path /var/cache/nginx/cache-screenshots keys_zone=screenshots:1m;
upstream gs {
server storage.googleapis.com:443;
keepalive 128;
}
server {
listen *:8000;
location /api/ {
proxy_pass http://api:5000;
proxy_cache api;
proxy_cache_background_update on;
proxy_cache_lock on;
proxy_cache_lock_timeout 15s;
proxy_cache_use_stale updating;
proxy_cache_valid 200 6h;
proxy_cache_valid any 60m;
proxy_set_header X-Real-IP $remote_addr;
}
location /screenshots/ {
resolver 8.8.8.8 ipv6=off;
rewrite /screenshots/(.*) /$1 break;
proxy_pass https://gs/green-spider-screenshots.sendung.de/$1;
proxy_http_version 1.1;
proxy_set_header Host storage.googleapis.com;
proxy_set_header Connection "";
proxy_intercept_errors on;
proxy_cache screenshots;
proxy_cache_background_update on;
proxy_cache_lock on;
proxy_cache_lock_timeout 5s;
proxy_cache_use_stale updating;
proxy_cache_valid 200 24h;
proxy_cache_valid any 3h;
proxy_hide_header alt-svc;
proxy_hide_header X-GUploader-UploadID;
proxy_hide_header alternate-protocol;
proxy_hide_header x-goog-hash;
proxy_hide_header x-goog-generation;
proxy_hide_header x-goog-metageneration;
proxy_hide_header x-goog-stored-content-encoding;
proxy_hide_header x-goog-stored-content-length;
proxy_hide_header x-goog-storage-class;
proxy_hide_header x-xss-protection;
proxy_hide_header accept-ranges;
proxy_hide_header Set-Cookie;
proxy_ignore_headers Set-Cookie;
}
location / {
proxy_pass http://webapp:3000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" $request_time';
access_log /dev/stdout main;
sendfile on;
keepalive_timeout 65;
}

@ -0,0 +1,124 @@
user nginx;
worker_processes 1;
error_log stderr warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
proxy_cache_path /var/cache/nginx/cache-api keys_zone=api:1m;
proxy_cache_path /var/cache/nginx/cache-screenshots keys_zone=screenshots:1m;
upstream gs {
server storage.googleapis.com:443;
keepalive 128;
}
# This server redirects all requests to the HTTPS server
server {
listen *:80;
rewrite ^/$ https://green-spider.netzbegruenung.de/ redirect;
}
server {
listen *:443;
ssl on;
ssl_certificate /etc/letsencrypt/live/green-spider.netzbegruenung.de/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/green-spider.netzbegruenung.de/privkey.pem;
root /usr/share/nginx/html;
# css, js never change
location /static/ {
expires 100d;
}
# The last-updated resource will be cached for 5 minutes max.
location /api/v1/spider-results/last-updated/ {
proxy_pass http://api:5000/api/v1/spider-results/last-updated/;
proxy_cache api;
proxy_cache_background_update on;
proxy_cache_lock on;
proxy_cache_lock_timeout 3s;
proxy_cache_use_stale updating;
proxy_cache_valid 200 5m;
proxy_cache_valid any 30m;
proxy_set_header X-Real-IP $remote_addr;
}
# All other API calls are cached for 6 hours
location /api/ {
proxy_pass http://api:5000;
proxy_cache api;
proxy_cache_background_update on;
proxy_cache_lock on;
proxy_cache_lock_timeout 15s;
proxy_cache_use_stale updating;
proxy_cache_valid 200 6h;
proxy_cache_valid any 60m;
proxy_set_header X-Real-IP $remote_addr;
}
location /screenshots/ {
resolver 8.8.8.8 ipv6=off;
rewrite /screenshots/(.*) /$1 break;
proxy_pass https://gs/green-spider-screenshots.sendung.de/$1;
proxy_http_version 1.1;
proxy_set_header Host storage.googleapis.com;
proxy_set_header Connection "";
proxy_intercept_errors on;
proxy_cache screenshots;
proxy_cache_background_update on;
proxy_cache_lock on;
proxy_cache_lock_timeout 5s;
proxy_cache_use_stale updating;
proxy_cache_valid 200 24h;
proxy_cache_valid any 3h;
proxy_hide_header alt-svc;
proxy_hide_header X-GUploader-UploadID;
proxy_hide_header alternate-protocol;
proxy_hide_header x-goog-hash;
proxy_hide_header x-goog-generation;
proxy_hide_header x-goog-metageneration;
proxy_hide_header x-goog-stored-content-encoding;
proxy_hide_header x-goog-stored-content-length;
proxy_hide_header x-goog-storage-class;
proxy_hide_header x-xss-protection;
proxy_hide_header accept-ranges;
proxy_hide_header Set-Cookie;
proxy_ignore_headers Set-Cookie;
}
location / {
try_files $uri $uri/ /index.html;
}
}
include /mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" $request_time';
access_log /dev/stdout main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip on;
gzip_types application/json application/javascript application/x-javascript text/css;
include /etc/nginx/conf.d/*.conf;
}

@ -0,0 +1,114 @@
user nginx;
worker_processes 1;
error_log stderr info;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
proxy_cache_path /var/cache/nginx/cache-api keys_zone=api:1m;
proxy_cache_path /var/cache/nginx/cache-screenshots keys_zone=screenshots:1m;
upstream gs {
server storage.googleapis.com:443;
keepalive 128;
}
server {
listen *:8080;
root /usr/share/nginx/html;
# css, js never change
location /static/ {
expires 100d;
}
# The last-updated resource will be cached for 5 minutes max.
location /api/v1/spider-results/last-updated/ {
proxy_pass http://api:5000/api/v1/spider-results/last-updated/;
proxy_cache api;
proxy_cache_background_update on;
proxy_cache_lock on;
proxy_cache_lock_timeout 3s;
proxy_cache_use_stale updating;
proxy_cache_valid 200 5m;
proxy_cache_valid any 30m;
proxy_set_header X-Real-IP $remote_addr;
}
# All other API calls are cached for 6 hours
location /api/ {
proxy_pass http://api:5000;
proxy_cache api;
proxy_cache_background_update on;
proxy_cache_lock on;
proxy_cache_lock_timeout 15s;
proxy_cache_use_stale updating;
proxy_cache_valid 200 6h;
proxy_cache_valid any 60m;
proxy_set_header X-Real-IP $remote_addr;
}
location /screenshots/ {
resolver 8.8.8.8 ipv6=off;
rewrite /screenshots/(.*) /$1 break;
proxy_pass https://gs/green-spider-screenshots.sendung.de/$1;
proxy_http_version 1.1;
proxy_set_header Host storage.googleapis.com;
proxy_set_header Connection "";
proxy_intercept_errors on;
proxy_cache screenshots;
proxy_cache_background_update on;
proxy_cache_lock on;
proxy_cache_lock_timeout 5s;
proxy_cache_use_stale updating;
proxy_cache_valid 200 24h;
proxy_cache_valid any 3h;
proxy_hide_header alt-svc;
proxy_hide_header X-GUploader-UploadID;
proxy_hide_header alternate-protocol;
proxy_hide_header x-goog-hash;
proxy_hide_header x-goog-generation;
proxy_hide_header x-goog-metageneration;
proxy_hide_header x-goog-stored-content-encoding;
proxy_hide_header x-goog-stored-content-length;
proxy_hide_header x-goog-storage-class;
proxy_hide_header x-xss-protection;
proxy_hide_header accept-ranges;
proxy_hide_header Set-Cookie;
proxy_ignore_headers Set-Cookie;
}
location / {
try_files $uri $uri/ /index.html;
}
}
include /mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" $request_time';
access_log /dev/stdout main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip on;
gzip_types application/json application/javascript application/x-javascript text/css;
include /etc/nginx/conf.d/*.conf;
}

@ -1,5 +1,3 @@
'use strict';
const autoprefixer = require('autoprefixer');
const path = require('path');
const webpack = require('webpack');

@ -0,0 +1,24 @@
version: "3"
services:
# The HTTPS server and proxy on port 443
webapp:
image: quay.io/netzbegruenung/green-spider-webapp:latest
restart: always
ports:
- "443:443"
volumes:
- $PWD:/workdir
- $PWD/config/nginx/nginx_prod.conf:/etc/nginx/nginx.conf
- $PWD/test-certs:/etc/letsencrypt/live/green-spider.netzbegruenung.de
- $PWD/proxy-cache-prod:/var/cache/nginx
api:
image: quay.io/netzbegruenung/green-spider-api:latest
restart: always
ports:
- 5000:5000
environment:
GCLOUD_DATASTORE_CREDENTIALS_PATH: /secrets/datastore-reader.json
volumes:
- $PWD/secrets:/secrets

@ -0,0 +1,34 @@
version: "3"
services:
# The static file server and proxy on port 80
webapp:
image: quay.io/netzbegruenung/green-spider-webapp:latest
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
volumes:
- ".:/workdir"
- ${PWD}/config/nginx/nginx_staging.conf:/etc/nginx/nginx.conf
- ${PWD}/proxy-cache-staging:/var/cache/nginx
depends_on:
- api
networks:
- staging
api:
image: quay.io/netzbegruenung/green-spider-api:latest
ports:
- 5000:5000
environment:
GCLOUD_DATASTORE_CREDENTIALS_PATH: /secrets/datastore-reader.json
volumes:
- "./secrets:/secrets"
networks:
- staging
networks:
staging:
driver: bridge

@ -0,0 +1,32 @@
version: "3"
services:
# proxy passing through webapp and api
proxy:
image: nginx:1.14-alpine
ports:
- "8000:8000"
volumes:
- ${PWD}/config/nginx/nginx_dev.conf:/etc/nginx/nginx.conf
- ${PWD}/proxy-cache:/var/cache/nginx
# The webapp dev server on port 3000
webapp:
image: green-spider-webapp:dev
build:
context: .
dockerfile: Dockerfile_node_dev
command: yarn start
ports:
- "3000:3000"
volumes:
- ".:/workdir"
api:
image: quay.io/netzbegruenung/green-spider-api:latest
ports:
- 5000:5000
environment:
GCLOUD_DATASTORE_CREDENTIALS_PATH: /secrets/datastore-reader.json
volumes:
- "./secrets:/secrets"

@ -4,6 +4,7 @@
"private": true,
"dependencies": {
"autoprefixer": "7.1.6",
"axios": "^0.18.0",
"babel-core": "6.26.0",
"babel-eslint": "7.2.3",
"babel-jest": "20.0.3",

@ -1 +0,0 @@
green-spider.netzbegruenung.de

@ -18,16 +18,7 @@
JavaScript muss aktiviert sein, um diese Anwendung nutzen zu können.
</noscript>
<div class="d-flex flex-column flex-md-row align-items-center p-3 px-md-4 mb-3 header border-bottom box-shadow">
<h5 class="my-0 mr-md-auto"><a href="/">Green Spider</a></h5>
<nav class="my-2 my-md-0 mr-md-3">
<span id="status" class="p-2">Lade Daten...</span>
<a class="p-2 text-light" href="https://github.com/netzbegruenung/green-spider/"><i class="ion-logo-github"></i> GitHub</a>
<a class="p-2 text-light" href="https://blog.netzbegruenung.de/projekte/green-spider/"><i class="ion-md-information-circle"></i> Über</a>
</nav>
</div>
<div id="root" class="container"></div>
<div id="root"></div>
</body>
</html>

@ -3,16 +3,29 @@
*/
/**
* This handler intercepts all GET requests and either responds with a
* cached version of the resource or fetches the original one and then
* adds it to the cache.
*
* This is called "on network response" in
* https://jakearchibald.com/2014/offline-cookbook/#on-network-response
*
* We whitelist the URLs to cache in this manner.
*/
self.addEventListener('fetch', function(event) {
var shouldRespond = false;
if (event.request.method === 'GET') {
// icon
if (event.request.url.indexOf('/siteicons/') !== -1) {
shouldRespond = true;
// API
if (event.request.url.indexOf('/api/v1/') !== -1) {
// exclude our freshness check from cache
if (event.request.url.indexOf('/api/v1/spider-results/last-updated/') === -1) {
shouldRespond = true;
}
}
// webfonts
else if (event.request.url.indexOf('https://netzbegruenung.github.io') !== -1) {
else if (event.request.url.indexOf('https://netzbegruenung.github.io/webfonts/') !== -1) {
shouldRespond = true;
}
@ -37,4 +50,23 @@ self.addEventListener('fetch', function(event) {
);
}
}
});
});
/**
* Pre-fetch some static resources on service worker installation.
*/
self.addEventListener('install', function(event) {
event.waitUntil(
caches.open(cacheName).then(function(cache) {
console.log('Pre-fetching some resources on SW install');
return cache.addAll([
'https://netzbegruenung.github.io/webfonts/fonts/Arvo_Gruen_2015_10.woff',
'https://unpkg.com/ionicons@4.4.3/dist/fonts/ionicons.woff2',
'https://netzbegruenung.github.io/webfonts/fonts/arvo_regular.woff',
'https://netzbegruenung.github.io/webfonts/style.css',
'https://unpkg.com/ionicons@4.4.3/dist/css/ionicons.min.css'
]);
})
);
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 846 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 918 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 610 B

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save