diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6044ede --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +--- + +install: + - 'sudo apt-get update -qq' + - 'sudo apt-get install -qq oracle-java8-installer' + - 'sudo update-java-alternatives -s java-8-oracle' + - 'sudo pip install html5validator' + +script: + - "make check" diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..d26c507 --- /dev/null +++ b/.yamllint @@ -0,0 +1,8 @@ +--- + +extends: default + +rules: + line-length: + max: 1000 + level: warning diff --git a/Makefile b/Makefile index c9a695d..d67d6ca 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,13 @@ list: @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | sed 's/^/ /' ## }}} +.PHONY: check +check: check-html + +.PHONY: check-html +check-html: + html5validator --root . --blacklist js opening_hours.js --ignore-re 'Start tag seen without seeing a doctype first' + ## Make this project ready to be served by a webserver. .PHONY: ready-for-hosting ready-for-hosting: dependencies-get @@ -18,11 +25,12 @@ opening_hours+deps.min.js: $(MAKE) --directory opening_hours.js/ opening_hours+deps.min.js taginfo.json: ./opening_hours.js/gen_taginfo_json.js ./opening_hours.js/related_tags.txt taginfo_template.json - $< --key-file ./opening_hours.js/related_tags.txt --template-file taginfo_template.json > "$@" + opening_hours_map --key-file ./opening_hours.js/related_tags.txt --template-file taginfo_template.json > "$@" .PHONY: dependencies-get dependencies-get: js/OpenLayers-$(OpenLayersVersion)/OpenLayers.js - git submodule update --init --recursive + git submodule update --init + cd opening_hours.js/ && git verify-commit HEAD && git submodule update --init --recursive js/OpenLayers-$(OpenLayersVersion)/OpenLayers.js: -wget --no-clobber -O js/OpenLayers-$(OpenLayersVersion).tar.gz https://github.com/openlayers/openlayers/releases/download/release-$(OpenLayersVersion)/OpenLayers-$(OpenLayersVersion).tar.gz @@ -35,6 +43,10 @@ deploy-on-all-servers: deploy-on-openingh.openstreetmap.de deploy-on-ypid.de deploy-on-openingh.openstreetmap.de: opening_hours+deps.min.js rsync --archive * gauss.osm.de:~/www -v +## Custom deployment method which allows me to fully isolate the development and build environment from the server. .PHONY: deploy-on-openingh.openstreetmap.de deploy-on-ypid.de: opening_hours+deps.min.js - rsync --archive * osm@www.pubsrv.ypid.de:/srv/www/osm/sites/openingh.ypid.de/public -v + rm -rf "/tmp/opening_hours_map" + mkdir --parents "/tmp/opening_hours_map" + /bin/tar --exclude-vcs --exclude='./js/*.tar.gz' --exclude='./js/OpenLayers-$(OpenLayersVersion)/doc' --exclude='./opening_hours.js/node_modules/bower' --exclude='./opening_hours.js/submodules/panieravide.github.io/id-indoor' --exclude='./opening_hours.js/submodules/panieravide.github.io/pic4carto' --no-acls -czf - . | /bin/tar -xz --directory "/tmp/opening_hours_map" -f - + qvm-copy-to-vm s-cm "/tmp/opening_hours_map" diff --git a/docs/deployment.rst b/docs/deployment.rst index 83d52a1..4855de1 100644 --- a/docs/deployment.rst +++ b/docs/deployment.rst @@ -23,7 +23,7 @@ The following Webserver configuration is currently deployed: name: [ 'openingh.ypid.de', 'openingh.openstreetmap.de' ] owner: 'osm' csp: True - csp_policy: "default-src 'none'; script-src 'self' 'unsafe-inline'; connect-src https://overpass-api.de https://nominatim.openstreetmap.org https://localhost:8111; img-src 'self' data: https://*.tile.openstreetmap.org https://*.tile.opencyclemap.org; style-src 'self' 'unsafe-inline'" + csp_policy: "default-src 'none'; script-src 'self' 'unsafe-inline' https://code.jquery.com; connect-src https://overpass-api.de https://nominatim.openstreetmap.org https://localhost:8111; img-src 'self' data: https://*.tile.openstreetmap.org https://*.tile.opencyclemap.org; style-src 'self' 'unsafe-inline'" location_list: - pattern: '/stats' options: 'return 307 http://openingh.openstreetmap.de$request_uri;' diff --git a/index.html b/index.html index af0302a..feb3f33 100644 --- a/index.html +++ b/index.html @@ -1,25 +1,31 @@
- +