Skip to content

Commit

Permalink
Merge pull request #12 from MetroStar/theming
Browse files Browse the repository at this point in the history
Make Registration Theme Configurable
  • Loading branch information
kenafoster authored May 16, 2024
2 parents 187422b + 95330f4 commit 4ee142d
Show file tree
Hide file tree
Showing 28 changed files with 444 additions and 218 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/publish-docker-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Publish Docker Image

on:
push:
branches: ['main']
branches: ["main"]
paths:
- docker/**
- self-registration/**
pull_request:
paths:
- docker/**
- self-registration/**

env:
REGISTRY: ghcr.io
Expand All @@ -26,7 +26,7 @@ jobs:
- name: Set the timestamp for version
run: echo "VERSION=$(date +'%Y%m%d-%H%M')" >> ${GITHUB_ENV}
- name: Build image
run: docker build docker --file docker/Dockerfile --tag $IMAGE_LC --label "runnumber=${GITHUB_RUN_ID}"
run: docker build self-registration --file self-registration/Dockerfile --tag $IMAGE_LC --label "runnumber=${GITHUB_RUN_ID}"
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login $REGISTRY -u $ --password-stdin
- name: Push image
Expand All @@ -40,4 +40,4 @@ jobs:
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_LC $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![PyPI - Version](https://img.shields.io/pypi/v/nebari-plugin-self-registration.svg)](https://pypi.org/project/nebari-plugin-self-registration)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/nebari-plugin-self-registration.svg)](https://pypi.org/project/nebari-plugin-self-registration)

-----
---

**Table of Contents**

Expand All @@ -16,7 +16,27 @@
pip install nebari-plugin-self-registration
```

## Running locally with Docker

_Note_: running locally requires a `config.yaml` file to be present within the `self-registration` directory. Please create a copy of the `sample.config.yaml`, rename, and update as needed before proceeding:

1. Navigate to the `self-registration` directory
2. To build the docker image, run the following:

```
docker build . --file Dockerfile.local -t self-registration
```

3. To run the app, run the following:

```
docker run -p 8000:8000 --name self-registration self-registration
```

4. Navigate to http://0.0.0.0:8000/registration

## User Registration via this extension

Steps for self registration:

- Navigate to your Nebari domain.
Expand All @@ -34,7 +54,7 @@ Steps for self registration:

- After clicking "Submit" follow the instructions to login with your temporary password. By clicking the "Login" button, it will take you to a Welcome page where you can sign in with Keycloak.

- After you have entered a new password, you will receive a verification email.
- After you have entered a new password, you will receive a verification email.

<p align="center">
<img src="images/account-confirm.png" />
Expand Down
Binary file removed docker/app/static/logo.png
Binary file not shown.
56 changes: 0 additions & 56 deletions docker/app/templates/index.html

This file was deleted.

69 changes: 0 additions & 69 deletions docker/app/templates/success.html

This file was deleted.

File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions self-registration/Dockerfile.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM python:3.12

WORKDIR /app

COPY ./requirements.txt /tmp/requirements.txt
COPY ./config.yaml .

# need to pre-install cython < 3 to avoid pyyaml >= 5.4.1 incompatibility https://github.com/yaml/pyyaml/issues/601
RUN echo "cython<3" > /tmp/constraint.txt

RUN PIP_CONSTRAINT=/tmp/constraint.txt pip install --no-cache-dir --upgrade -r /tmp/requirements.txt

COPY ./app /app

# Run web app as non-root
RUN useradd -m www
USER www

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
File renamed without changes.
Loading

0 comments on commit 4ee142d

Please sign in to comment.