-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from cholasimmons/major-update
Major update + Dockerfile fix
- Loading branch information
Showing
35 changed files
with
801 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Build and Push Elysia Auth Demo Docker Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- build | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: simmonsstudiozm/elysia-auth:slim | ||
platforms: linux/arm64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ TZ=Africa/Harare # For Lusaka too | |
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings | ||
|
||
# Postgres | ||
|
||
DATABASE_USER=postgres | ||
DATABASE_PASSWORD=postgres | ||
DATABASE_PORT=5432 | ||
|
@@ -23,13 +22,20 @@ DATABASE_URL="postgresql://${DATABASE_USER}:${DATABASE_PASSWORD}@${HOST}:${DATAB | |
|
||
# Resend | ||
# API used for sending emails, usually only for Dev mode | ||
|
||
RESEND_API_KEY=re_1234 | ||
|
||
# OAuth2 API | ||
GOOGLE_CLIENT_ID="" | ||
GOOGLE_API_KEY="" | ||
|
||
# PGAdmin | ||
[email protected] | ||
PGADMIN_DEFAULT_PASSWORD="root" | ||
PGADMIN_DEFAULT_PASSWORD="root" | ||
|
||
|
||
# OAuth 2.0 API | ||
|
||
GOOGLE_CLIENT_ID= | ||
GOOGLE_CLIENT_SECRET= | ||
GOOGLE_API_KEY= | ||
|
||
# Github | ||
GH_BASIC_CLIENT_ID= | ||
GH_BASIC_SECRET_ID= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"email": "[email protected]", | ||
"github": "https://github.com/cholasimmons" | ||
}, | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"trustedDependencies": [ | ||
"@prisma/client", | ||
"@prisma/engines", | ||
|
@@ -18,30 +18,30 @@ | |
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build": "bun build --compile --minify --sourcemap --target=bun-linux-x64 src/index.ts --outfile app", | ||
"compile": "NODE_ENV=production bun build src/index.ts --compile --minify --outfile ./build/bundle", | ||
"dev": "bun run --watch src/index.ts", | ||
"prisma:generate": "bunx prisma generate", | ||
"prisma:seed": "bunx prisma db seed", | ||
"prisma:deploy": "bunx prisma migrate deploy", | ||
"start": "NODE_ENV=production bun run src/index.ts" | ||
}, | ||
"dependencies": { | ||
"@bogeychan/elysia-logger": "^0.0.21", | ||
"@elysiajs/cookie": "^0.7.0", | ||
"@bogeychan/elysia-logger": "^0.1.1", | ||
"@elysiajs/cookie": "^0.8.0", | ||
"@elysiajs/cors": "^1.1.0", | ||
"@elysiajs/cron": "^1.1.0", | ||
"@elysiajs/html": "^0.7.3", | ||
"@elysiajs/html": "^1.1.0", | ||
"@elysiajs/jwt": "^1.1.0", | ||
"@elysiajs/lucia-auth": "^0.0.0-exp-20230623.312", | ||
"@elysiajs/lucia-auth": "^1.1.0-exp.1", | ||
"@elysiajs/static": "^1.1.0", | ||
"@elysiajs/swagger": "1.0.5", | ||
"@lucia-auth/adapter-prisma": "^4.0.1", | ||
"@prisma/client": "5.15.1", | ||
"arctic": "^1.9.2", | ||
"chalk": "^5.3.0", | ||
"elysia": "1.1.2", | ||
"elysia": "^1.1.4", | ||
"elysia-helmet": "^2.0.0", | ||
"elysia-htmx": "1.0.9", | ||
"elysia-http-error": "^1.3.0", | ||
"elysia-htmx": "^1.0.9", | ||
"elysia-http-status-code": "^1.0.9", | ||
"elysia-ip": "^1.0.7", | ||
"elysia-oauth2": "^1.3.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
body { | ||
margin: 0; | ||
padding: 2rem 0 0 0; | ||
font-family: 'Montserrat', Helvetica, sans-serif; | ||
text-align: center; | ||
height: 100%; | ||
border-top: 4px orange solid; | ||
cursor: default; | ||
} | ||
span { | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; right: 0; | ||
color: darkgray; | ||
padding: 1rem; | ||
margin: 0 auto; | ||
text-align: center; | ||
} | ||
h2 { | ||
color: purple | ||
} | ||
button[type='submit']{ | ||
background-color: purple; | ||
border: none; | ||
transition-duration: 300ms; | ||
transition-property: all; | ||
font-weight: 700; | ||
} | ||
.link { | ||
background-color: purple; | ||
color: white; | ||
padding: 1rem 2rem; | ||
border-radius: 12px; | ||
transition-duration: 500ms; | ||
transition-property: all; | ||
font-weight: bold; | ||
} | ||
.link:hover { | ||
background-color: lightgray; | ||
color: purple; | ||
} | ||
a { | ||
color: darkgray; | ||
text-decoration: none; | ||
font-weight: 600; | ||
} | ||
a:hover { | ||
color: purple; | ||
} | ||
img { | ||
user-drag: none; | ||
} |
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,23 +3,42 @@ | |
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Login Form</title> | ||
<link rel="preconnect" href="https://fonts.googleapis.com"> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400&display=swap" rel="stylesheet"> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> | ||
<!-- Link to the favicon --> | ||
<link rel="icon" href="/v1/public/icons/favicon.ico" type="image/x-icon"> | ||
<link rel="stylesheet" type="text/css" href="/v1/public/css/style.css"> | ||
</head> | ||
|
||
<body> | ||
<div class="container mt-5"> | ||
<div class="row justify-content-center"> | ||
<h3 class="text-center">Login</h3> | ||
<div class="col-md-6"> | ||
<h3 class="text-center">Welcome Back</h3> | ||
<div class="col-md-8"> | ||
<form hx-post="/v1/auth/login" hx-target="#login-response" hx-swap="outerHTML" class="card p-4"> | ||
<div class="mb-3"> | ||
<label for="username" class="form-label">Username:</label> | ||
<input type="text" id="username" name="username" required class="form-control"> | ||
<input type="text" id="email" name="email" required autocomplete="email" class="form-control" placeholder="Email Address"> | ||
</div> | ||
|
||
<div class="mb-3"> | ||
<label for="password" class="form-label">Password:</label> | ||
<input type="password" id="password" name="password" required class="form-control"> | ||
<input type="password" id="password" name="password" required autocomplete="current-password" class="form-control" placeholder="Password"> | ||
</div> | ||
|
||
<hr> | ||
|
||
<div class="d-flex justify-content-center mb-3"> | ||
<div class="d-flex justify-content-center col-md-6 text-center gap-4"> | ||
<a href="/v1/auth/login/github"><img src="/v1/public/icons/github.webp" target="github" alt="Sign in with GitHub" width="48" title="Login with Github"></a> | ||
<a href="/v1/auth/login/google" aria-disabled="true" disabled><img src="/v1/public/icons/google.webp" target="google" alt="Sign in with Google" width="48" title="Login with Google"></a> | ||
</div> | ||
</div> | ||
|
||
<hr> | ||
|
||
<div class="d-flex justify-content-center mb-3 text-center"> | ||
<a href="/v1/auth/register" class="text-decoration-none font-weight-bold">Create a New Account</a> | ||
</div> | ||
|
||
<button type="submit" class="btn btn-dark">Log In</button> | ||
|
Oops, something went wrong.