diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a60c4737..42454785 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -43,9 +43,4 @@ RUN echo "\n\ [default]\n\ region=ca-central-1\n\ output=json\n\ - " >> /home/vscode/.aws/config - -# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image. -# COPY requirements.txt /tmp/pip-tmp/ -# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \ -# && rm -rf /tmp/pip-tmp + " >> /home/vscode/.aws/config \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0497b42d..434ed12c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -40,7 +40,8 @@ ], // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. + //use postcommand to create the maxmind db + 'postCreateCommand': '.devcontainer/maxmind-create.sh', "remoteUser": "vscode", "features": { "ghcr.io/devcontainers/features/aws-cli:1": { diff --git a/.devcontainer/maxmind-create.sh b/.devcontainer/maxmind-create.sh new file mode 100755 index 00000000..034c65b1 --- /dev/null +++ b/.devcontainer/maxmind-create.sh @@ -0,0 +1,6 @@ +mkdir -p /workspace/app/geodb/ +wget -O "/workspace/app/geodb/GeoLite2-City.tar.gz" "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=$MAXMIND_KEY&suffix=tar.gz" +tar -xzvf /workspace/app/geodb/GeoLite2-City.tar.gz -C /workspace/app/geodb/ +cp /workspace/app/geodb/GeoLite2-City_*/GeoLite2-City.mmdb /workspace/app/geodb/GeoLite2-City.mmdb +rm -fr /workspace/app/geodb/GeoLite2-City_* +rm /workspace/app/geodb/GeoLite2-City.tar.gz \ No newline at end of file diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 98e5bdf2..a48ce7c0 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -9424,6 +9424,19 @@ "node": ">=6" } }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/formik": { "version": "2.4.5", "resolved": "https://registry.npmjs.org/formik/-/formik-2.4.5.tgz", @@ -17754,16 +17767,16 @@ } }, "node_modules/typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=14.17" + "node": ">=4.2.0" } }, "node_modules/unbox-primitive": { diff --git a/frontend/src/scenes/geolocate/index.jsx b/frontend/src/scenes/geolocate/index.jsx index ad851656..c81749a7 100644 --- a/frontend/src/scenes/geolocate/index.jsx +++ b/frontend/src/scenes/geolocate/index.jsx @@ -20,7 +20,7 @@ const geoUrl = // call the backend API to fetch the location data using the /geolocate endpoint // if we are in development we need to call the API using the full URL function fetchLocationData(inputValue) { - return fetch(process.env.REACT_APP_API_URL + '/geolocate/' + inputValue); + return fetch(`${window.origin}/geolocate/${inputValue}`); } function Geolocate() {