From c4f413929a4c3b20ae60373ff3dc93864649d8cc Mon Sep 17 00:00:00 2001 From: BrianEllwood Date: Mon, 2 Dec 2024 15:06:53 +0000 Subject: [PATCH] fix more linting issues --- .github/PULL_REQUEST_TEMPLATE.md | 4 ++-- README.md | 26 +++++++++++---------- docker-compose.yaml | 2 +- nginx-proxy/Dockerfile | 5 ++-- nginx-proxy/custom_404.html | 40 +++++++++++++++----------------- 5 files changed, 39 insertions(+), 38 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index f124067..4707e4f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,7 +2,7 @@ Title the PR to complete the sentence: "Merging this PR will ..." ## What -Describe what you have changed and *why* +Describe what you have changed and _why_ ## How to review @@ -11,4 +11,4 @@ Describe what you have changed and *why* 3. Profit! Provide [http://example.com](links) to relevant tickets, articles or other -resources. \ No newline at end of file +resources. diff --git a/README.md b/README.md index 620b549..a9f2c28 100644 --- a/README.md +++ b/README.md @@ -9,20 +9,21 @@ Jupyterlab is deployed by the Control Panel. When deployed the pod looks like th The authentication is done using an OIDC call to Auth0, the call is written in lua. N.B. There may in future be a better solution, however at time of implementation, lua was the nginx community recommended solution for this authentication flow. + ## Usage locally All interactions are performed via the `Makefile`. -| Makefile command | Description | -| ---------------- | ----------- | -| clean | stop & destroy containers | -| pull | pull the latest image (unused) | -| push | push the image to a docker repository (gha-only) | -| build | build the proxy image | -| up | start the proxy and jupyter in daemon mode | -| logs | see the logs | -| integration | just run the tests (for gha) | -| test | run the test process including start and cleanup | +| Makefile command | Description | +| ---------------- | ------------------------------------------------ | +| clean | stop & destroy containers | +| pull | pull the latest image (unused) | +| push | push the image to a docker repository (gha-only) | +| build | build the proxy image | +| up | start the proxy and jupyter in daemon mode | +| logs | see the logs | +| integration | just run the tests (for gha) | +| test | run the test process including start and cleanup | ### Running the Application Locally @@ -33,7 +34,7 @@ directory. Run `make build` then `make up` to start the proxy and Jupyter. Once up, you'll find it at http://__-jupyter-lab.127-0-0-1.nip.io:8001/. -On the callback from Auth0, you'll need to remove the s from the https in the callback url, +On the callback from Auth0, you'll need to remove the s from the https in the callback url, because this doesn't have http support. (https is handled by kubernetes ingress in production.) @@ -46,7 +47,7 @@ To restart and rebuild, `make clean build up`. ## Environment Variables | Environment Variable | Description | -| -------------------- | -----------------------------------------------------| +| -------------------- | ---------------------------------------------------- | | APP_HOST | The hostname of the proxied app (e.g. rstudio) | | APP_PORT | Port on which the proxied app is listening (eg 8787) | | USERNAME | GitHub username of the person whose instance this is | @@ -73,6 +74,7 @@ The nginx-proxy-jupyter container is deployed via helm chart without using the M It will need the above environment variables to be set; the startup script will complain if they are not. Currently it's used in the following charts + - jupyter-lab - jupyter-lab-all-spark - jupyter-lab-datascience-notebook diff --git a/docker-compose.yaml b/docker-compose.yaml index 870d756..c0a699f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -4,7 +4,7 @@ services: jupyter-lab: image: jupyter/pyspark-notebook - ports: [8888:8888,8050:8050] + ports: [8888:8888, 8050:8050] volumes: [./home:/home/test_user] nginx-proxy: diff --git a/nginx-proxy/Dockerfile b/nginx-proxy/Dockerfile index ee71497..90c0ab7 100644 --- a/nginx-proxy/Dockerfile +++ b/nginx-proxy/Dockerfile @@ -1,10 +1,11 @@ +#checkov:skip=CKV_DOCKER_3: Migrate as is + FROM openresty/openresty:alpine-fat RUN mkdir /var/log/nginx RUN apk add --no-cache openssl-dev git gcc RUN luarocks install lua-resty-openidc COPY nginx.conf.template /config/nginx.conf.template -COPY scripts/start_proxy.sh /usr/bin/start_proxy.sh -RUN chmod +x /usr/bin/start_proxy.sh +COPY --chmod=0755 scripts/start_proxy.sh /usr/bin/start_proxy.sh COPY custom_404.html /var/www/html HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD ["/usr/local/bin/healthcheck.sh"] diff --git a/nginx-proxy/custom_404.html b/nginx-proxy/custom_404.html index 35c8019..3a1636b 100644 --- a/nginx-proxy/custom_404.html +++ b/nginx-proxy/custom_404.html @@ -1,27 +1,25 @@ - + - - - - 404 Error - + + 404 Error - + - +

Error 404: Not found

- The requested URL was not found on this server. Please check the URL and try again. - - - - \ No newline at end of file + The requested URL was not found on this server. Please check the URL and + try again. + +