diff --git a/.gitignore b/.gitignore index 72be633..22b2fe2 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,7 @@ development.env .coverage .firebaserc .firebase + +# Certificates for localhost testing +localhost.pem +localhost-key.pem diff --git a/Dockerfile.test b/Dockerfile.test index e43b796..13673db 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -32,4 +32,4 @@ COPY --from=builder /install /usr/local COPY . . -ENTRYPOINT [ "flask", "run", "--host=0.0.0.0" ] +ENTRYPOINT [ "flask", "run", "--cert=localhost.pem", "--key=localhost-key.pem", "--host=0.0.0.0" ] diff --git a/requirements/test.in b/requirements/test.in index df21d6b..f3a4ed2 100644 --- a/requirements/test.in +++ b/requirements/test.in @@ -5,4 +5,4 @@ green pylint autopep8 selenium -coveralls \ No newline at end of file +coveralls diff --git a/requirements/test.txt b/requirements/test.txt index c914972..235345e 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -5,45 +5,44 @@ # pip-compile --output-file=test.txt test.in # astroid==2.3.3 # via pylint -autopep8==1.4.4 -blinker==1.4 -certifi==2019.11.28 +autopep8==1.4.4 # via -r test.in +blinker==1.4 # via -r base.txt, sentry-sdk +certifi==2019.11.28 # via -r base.txt, requests, sentry-sdk chardet==3.0.4 # via requests -click==7.0 +click==7.0 # via -r base.txt, flask, pip-tools colorama==0.4.3 # via green coverage==5.0.1 # via coveralls, green -coveralls==1.10.0 +coveralls==1.10.0 # via -r test.in docopt==0.6.2 # via coveralls -envparse==0.2.0 -flask-cdn==1.5.3 -flask-testing==0.7.1 -flask==1.1.1 -gitdb2==2.0.6 -gitpython==3.0.5 -green==3.0.0 -gunicorn==20.0.4 +envparse==0.2.0 # via -r base.txt +flask-cdn==1.5.3 # via -r base.txt +flask-testing==0.7.1 # via -r test.in +flask==1.1.1 # via -r base.txt, flask-cdn, flask-testing, sentry-sdk +gitdb2==2.0.6 # via -r base.txt, gitpython +gitpython==3.0.5 # via -r base.txt +green==3.0.0 # via -r test.in +gunicorn==20.0.4 # via -r base.txt idna==2.8 # via requests isort==4.3.21 # via pylint -itsdangerous==1.1.0 -jinja2==2.10.3 +itsdangerous==1.1.0 # via -r base.txt, flask +jinja2==2.10.3 # via -r base.txt, flask lazy-object-proxy==1.4.3 # via astroid lxml==4.4.2 # via green -markupsafe==1.1.1 +markupsafe==1.1.1 # via -r base.txt, jinja2 mccabe==0.6.1 # via pylint -pip-tools==4.3.0 +pip-tools==4.3.0 # via -r base.txt pycodestyle==2.5.0 # via autopep8 -pylint==2.4.4 -pysolar==0.8 -pytz==2019.3 +pylint==2.4.4 # via -r test.in +pysolar==0.8 # via -r base.txt +pytz==2019.3 # via -r base.txt requests==2.22.0 # via coveralls -selenium==3.141.0 -sentry-sdk[flask]==0.13.5 -six==1.13.0 -smmap2==2.0.5 -typed-ast==1.4.0 # via astroid +selenium==3.141.0 # via -r test.in +sentry-sdk[flask]==0.13.5 # via -r base.txt +six==1.13.0 # via -r base.txt, astroid, pip-tools +smmap2==2.0.5 # via -r base.txt, gitdb2 unidecode==1.1.1 # via green -urllib3==1.25.7 -werkzeug==0.16.0 +urllib3==1.25.7 # via -r base.txt, requests, selenium, sentry-sdk +werkzeug==0.16.0 # via -r base.txt, flask wrapt==1.11.2 # via astroid # The following packages are considered to be unsafe in a requirements file: diff --git a/static/js/bundle.js b/static/js/bundle.js index c1a04b8..a2027ab 100644 --- a/static/js/bundle.js +++ b/static/js/bundle.js @@ -1,2 +1,2 @@ -!function(t){var e={};function o(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)o.d(n,i,function(e){return t[e]}.bind(null,i));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=0)}([function(t,e,o){"use strict";o.r(e);var n=function(){return(n=Object.assign||function(t){for(var e,o=1,n=arguments.length;op.getVisible()?r.getVisible()?void 0:(r.setPosition(t.latLng),r.setVisible(!0),n.setOptions({strokeOpacity:.6}),$("#azimuth").show(),c(p,r),$("#step2").removeClass("active",500),$("#step3").addClass("active",500)):(p.setPosition(t.latLng),p.setVisible(!0),$("#step1").removeClass("active",500),$("#step2").addClass("active",500))),$([p,r]).each((t,e)=>google.maps.event.addListener(e,"position_changed",()=>(n.setPath([p.getPosition(),r.getPosition()]),document.az=u(p.getPosition(),r.getPosition()),$("#azimuth").text(document.az.round(2)+"º"),$("#results").html("")))),$([p,r]).each((t,e)=>google.maps.event.addListener(e,"dragend",()=>c(p,r))),$("#reset").click((function(){return p.setOptions({position:s,visible:!1}),r.setOptions({position:s,visible:!1}),n.setOptions({strokeOpacity:0}),$("#step1").addClass("active",500),$("#step2").removeClass("active",500),$("#step3").removeClass("active",500),$("#azimuth").hide(),$("#results").html(""),window.location.hash=""})),e=d(),f.call(Object.keys(e),"pov")>=0&&f.call(Object.keys(e),"poi")>=0?(h=g(e.pov),l=g(e.poi),p.setPosition(h),r.setPosition(l),p.setVisible(!0),r.setVisible(!0),n.setOptions({strokeOpacity:.6}),(t=new google.maps.LatLngBounds).extend(h),t.extend(l),i.fitBounds(t),$("#step1").removeClass("active",500),$("#step3").addClass("active",500),$("#azimuth").show(),c(p,r)):navigator.geolocation?navigator.geolocation.getCurrentPosition(t=>(o=new google.maps.LatLng(t.coords.latitude,t.coords.longitude),i.panTo(o))):void 0})),u=function(t,e){var o,n,i,s,a;return i=t.lat().toRad(),n=e.lat().toRad(),o=(e.lng()-t.lng()).toRad(),a=Math.sin(o)*Math.cos(n),s=Math.cos(i)*Math.sin(n)-Math.sin(i)*Math.cos(n)*Math.cos(o),Math.atan2(a,s).toBrng()},h=function(t,e){var o,n;return n=t.getPosition().toUrlValue(),o=e.getPosition().toUrlValue(),window.location.hash=`pov=${n}&poi=${o}`},d=function(){var t;return t={},window.location.hash.replace(/[#&]+([^=&]+)=([^&]*)/gi,(e,o,n)=>t[o]=n),t},g=function(t){var e;return e=t.split(","),new google.maps.LatLng(e[0],e[1])},c=function(t,e){var o;return document.spinner=new s({lines:13,length:7,width:4,radius:10,rotate:0,color:"#333",speed:1,trail:60,shadow:!1,hwaccel:!0,className:"spinner",zIndex:2e9,top:"50%",left:"50%"}).spin($("#results")[0]),_gaq.push(["_trackEvent","Interaction","Request"]),o=t.getPosition().lat().round(1),$.ajax({type:"POST",url:"/findMatch",data:{lat:o,az:document.az},dataType:"json",success:t=>{var e,o,n,i,s;if(null!=t.matches){for(o=$("