0
0

🎉 initial proof of concept

This commit is contained in:
DrMaxNix 2024-05-30 17:46:34 +02:00
commit 67dfd6ae07
7 changed files with 105 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/data

36
README.md Normal file
View File

@ -0,0 +1,36 @@
## Steps to reproduce
#### 1. Clone git repo
```console
git clone https://git.tjdev.de/DrMaxNix/plausible-registerdemo
cd plausible-registerdemo
```
#### 2. Maybe do data cleanup
If you did run the container before you can do a data wipe
```console
./cleanup.sh
```
#### 3. Start docker container
```console
docker compose up --build
```
#### 4. Open browser
1. Open a browser of you choice (tested with firefox)
2. Navigate to `http://127.0.0.1:8000/register`
3. Open browser developer tools
4. Reload page
5. Navigate to network tab under developer tools
6. Find `101 Switching Protocols` Packet
7. Check its contained websocket log to see that ws is working
#### 5. Trigger the error
1. Enter any `Full Name`
2. Enter any `Email`
3. Anter any `Password` and type same into `Password confirmation`
4. Click `Create my account ->`
5. Notice that the UI did not change
6. Click `Create my account ->` again
7. Notice that the UI still didn't change
8. Notice that under the `Email` input there is an error hint

7
cleanup.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
set -euo pipefail
SCRIPT_PATH=$(readlink -f "${BASH_SOURCE[0]}")
SCRIPT_DIR=$(dirname -- "$SCRIPT_PATH")
rm -dr "${SCRIPT_PATH}/data" || true

View File

@ -0,0 +1,16 @@
<clickhouse>
<logger>
<level>warning</level>
<console>true</console>
</logger>
<!-- Stop all the unnecessary logging -->
<query_thread_log remove="remove"/>
<query_log remove="remove"/>
<text_log remove="remove"/>
<trace_log remove="remove"/>
<metric_log remove="remove"/>
<asynchronous_metric_log remove="remove"/>
<session_log remove="remove"/>
<part_log remove="remove"/>
</clickhouse>

View File

@ -0,0 +1,8 @@
<clickhouse>
<profiles>
<default>
<log_queries>0</log_queries>
<log_query_threads>0</log_query_threads>
</default>
</profiles>
</clickhouse>

33
docker-compose.yml Normal file
View File

@ -0,0 +1,33 @@
services:
plausible_db:
image: postgres:16-alpine
restart: always
volumes:
- ./data/postgresql:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
plausible_events_db:
image: clickhouse/clickhouse-server:24.3.3.102-alpine
restart: always
volumes:
- ./data/clickhouse:/var/lib/clickhouse
- ./data/clickhouse-logs:/var/log/clickhouse-server
- ./clickhouse/clickhouse-config.xml:/etc/clickhouse-server/config.d/logging.xml:ro
- ./clickhouse/clickhouse-user-config.xml:/etc/clickhouse-server/users.d/logging.xml:ro
ulimits:
nofile:
soft: 262144
hard: 262144
plausible:
image: ghcr.io/plausible/community-edition:v2.1.0
restart: always
command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run"
depends_on:
- plausible_db
- plausible_events_db
ports:
- 127.0.0.1:8000:8000
env_file:
- plausible-conf.env

4
plausible-conf.env Normal file
View File

@ -0,0 +1,4 @@
BASE_URL=http://127.0.0.1:8000
SECRET_KEY_BASE=+WJa3DNahZahgl0WQIXsZn2PFLJn3s+7/uxA8BBboPrwyB7SjBD1Q36jHB1f/0AW
TOTP_VAULT_KEY=y5/Sxn/X0yzXu84p7yciK3UwdHO2gsdQgAllHld8C/k=
DISABLE_REGISTRATION=false