-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(console): mailpit and profile w.i.p
- Loading branch information
Showing
6 changed files
with
108 additions
and
42 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 |
---|---|---|
|
@@ -6,16 +6,26 @@ Everything you need to build a Svelte project, powered by [`create-svelte`](http | |
|
||
### First Step | ||
|
||
download latest `traefik.me` certs for _svelte_ dev server. | ||
1. download latest `traefik.me` certs for _svelte_ dev server. | ||
|
||
> NOTE: they will expire every 60 days | ||
> NOTE: they will expire every 60 days | ||
```shell | ||
curl traefik.me/fullchain.pem -o infra/base/traefik/certs/traefik.me.crt | ||
curl traefik.me/privkey.pem -o infra/base/traefik/certs/traefik.me.key | ||
# make sure docker has read access to those files: | ||
chmod ugo+r infra/base/traefik/.htpasswd | ||
``` | ||
```shell | ||
curl traefik.me/fullchain.pem -o infra/base/traefik/certs/traefik.me.crt | ||
curl traefik.me/privkey.pem -o infra/base/traefik/certs/traefik.me.key | ||
# make sure docker has read access to those files: | ||
chmod ugo+r infra/base/traefik/.htpasswd | ||
``` | ||
|
||
2. Generate TLS `certs` to enable **TLS** transport for **Mailpit** and **Hasura-auth** | ||
|
||
```shell | ||
cd infra/base/mailpit | ||
./create-certs.sh mailpit | ||
chmod -R ugo+r certs | ||
# go back to project root | ||
cd ../../.. | ||
``` | ||
|
||
### Backend | ||
|
||
|
@@ -105,32 +115,6 @@ crane export ghcr.io/xmlking/spectacular/console:v0.1.3 - | tar -tvf - | grep -v | |
| Dashboard | <https://dashboard.traefik.me> | | ||
| Tailcall | <https://gateway.traefik.me> | | ||
|
||
#### (Or) Start backend services with nhost cli | ||
|
||
```shell | ||
# start all | ||
nhost up | ||
# check logs for example: auth service | ||
nhost logs auth -f | ||
# shutdown all | ||
nhost down | ||
# (optional) shutdown and reset volume | ||
nhost down --volumes | ||
# (optional) nhost first time when started, will load seeds but you can force with `--apply-seeds` | ||
nhost up --apply-seeds | ||
``` | ||
|
||
| Service | URL | | ||
| --------- | ------------------------------------------------- | | ||
| Postgres | postgres://postgres:postgres@localhost:5432/local | | ||
| Hasura | <https://local.hasura.nhost.run> | | ||
| GraphQL | <https://local.graphql.nhost.run> | | ||
| Auth | <https://local.auth.nhost.run> | | ||
| Storage | <https://local.storage.nhost.run> | | ||
| Functions | <https://local.functions.nhost.run/v1/echo> | | ||
| Dashboard | <https://local.dashboard.nhost.run> | | ||
| Mailhog | <https://local.mailhog.nhost.run> | | ||
|
||
#### Apply seeds | ||
|
||
Optionally apply all seed files | ||
|
@@ -151,7 +135,7 @@ turbo dev | |
turbo dev --log-order=stream | ||
# or run with `prod` profile and | ||
# overload envelopment variables from `.env.prod` | ||
NODE_ENV=prod turbo dev | ||
turbo dev:prod --log-order=stream | ||
``` | ||
|
||
Default demo user's **username:** `[email protected]` **password:** `sumodemo123` | ||
|
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,72 @@ | ||
<script lang="ts"> | ||
import { Debug } from '@spectacular/skeleton/components'; | ||
import { Settings } from 'lucide-svelte'; | ||
import Cookies from 'js-cookie' | ||
import { nhost, user } from '$lib/stores/user'; | ||
import { goto } from '$app/navigation'; | ||
import { NHOST_SESSION_KEY } from '$lib/constants.js'; | ||
import type { AuthErrorPayload } from '@nhost/nhost-js'; | ||
export let data | ||
let email: string | ||
let error: AuthErrorPayload | null | ||
const handleSubmit = async () => { | ||
const { session, error: signInError } = await nhost.auth.signUp({ email, securityKey: true }) | ||
if (session) { | ||
Cookies.set(NHOST_SESSION_KEY, btoa(JSON.stringify(session)), { path: '/' }) | ||
goto('/protected/todos') | ||
} else { | ||
error = signInError | ||
} | ||
} | ||
</script> | ||
|
||
<svelte:head> | ||
<title>Datablocks | Profile</title> | ||
<meta name="description" content="Account Profile" /> | ||
</svelte:head> | ||
|
||
<div class="page-container"> | ||
<div class="page-section"> | ||
<h2 class="h2">Profile</h2> | ||
<Debug data={$user} /> | ||
</div> | ||
<div class="page-section"> | ||
<h3 class="h3">WebAuthn</h3> | ||
<div class="card p-4"> | ||
<title>Security keys</title> | ||
<table > | ||
<colgroup> | ||
<col /> | ||
<col width="20%" /> | ||
</colgroup> | ||
<!-- <tbody> | ||
{list.map(({ id, nickname }) => ( | ||
<tr key={id}> | ||
<td>{nickname || id}</td> | ||
<td> | ||
<button type="button" class="btn variant-filled" on:click={() => handleRemoveKey(id)} color="red"> | ||
<Settings /> | ||
</button> | ||
</td> | ||
</tr> | ||
))} | ||
</tbody> --> | ||
</table> | ||
<form class="space-y-4" on:submit|preventDefault={handleSubmit}> | ||
<input | ||
bind:value={email} | ||
placeholder='email' | ||
class="block w-full p-3 border rounded-md border-slate-300 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" | ||
/> | ||
<button type="submit" class="btn variant-filled">Add a new device</button> | ||
|
||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# mailpit | ||
|
||
SMTP Relay for Development time. | ||
**SMTP Relay** for *Development* time. | ||
|
||
## Mailpit TLS Certs | ||
|
||
|