feat: use dynamic DATABASE_URL for Prisma db

This commit is contained in:
Nour 2024-01-26 15:13:26 +00:00
parent d1fd2d466a
commit 33fb9703f7
No known key found for this signature in database
GPG Key ID: 9744560DE7DA09AE
3 changed files with 11 additions and 9 deletions

View File

@ -4,8 +4,8 @@
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
# Enable to use different location for dev db file
# DATABASE_URL="file:./dev.db"
# Change to use different location for dev db file
DATABASE_URL="file:$HOME/.nsecbunker-config/nsecbunker.db"
# Add your admin Nostr npub
# ADMIN_NPUBS=npub1q2s369...

View File

@ -7,13 +7,15 @@ To quickly install `nsecbunkerd` via Docker just run:
### Configurations
Prepare your config directory
- Prepare your config directory
```shell
mkdir $HOME/.nsecbunker-config
```
```shell
mkdir $HOME/.nsecbunker-config
```
Clone `.env.example` and add your nostr public key to `ADMIN_NPUBS` to the `.env` file.
- Clone `.env.example` and add your nostr public key to `ADMIN_NPUBS` to the `.env` file.
- Change `DATABASE_URL` if necessary.
```shell
cp .env.example .env

View File

@ -1,11 +1,11 @@
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "linux-musl-arm64-openssl-3.0.x"]
binaryTargets = ["native", "linux-musl-openssl-3.0.x", "linux-musl-arm64-openssl-3.0.x"]
}
datasource db {
provider = "sqlite"
url = "file:../config/nsecbunker.db"
url = env("DATABASE_URL")
}
model Request {