-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MySQL prisma schema and doc update
- Loading branch information
1 parent
be94fcd
commit dadf71d
Showing
12 changed files
with
986 additions
and
92 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,4 +6,5 @@ deployments | |
postman | ||
.DS_Store | ||
.env | ||
.git | ||
.git | ||
notes.txt |
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,2 +1,2 @@ | ||
DATABASE_URL="postgresql://hivemq:hivemq@192.168.69.230:5432/hivemq?schema=public" | ||
DATABASE_URL="mysql://hivemq:hivemq@127.0.0.1:3306/hivemq" | ||
TOKEN_KEY="@lsirfgjoirnkk!!" |
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 |
---|---|---|
|
@@ -396,3 +396,5 @@ FodyWeavers.xsd | |
|
||
# JetBrains Rider | ||
*.sln.iml | ||
|
||
notes.txt |
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 |
---|---|---|
|
@@ -78,21 +78,27 @@ Sync dev to DB (need to have a valid connection string in the DATABASE_URL envir | |
``` | ||
npx prisma migrate dev | ||
``` | ||
|
||
Based on the database needed, the good prisma schema as to be used (renamed): | ||
- schema.prisma.mysql | ||
- schema.prisma.postgres | ||
|
||
## Database compatibility | ||
Thanks to Prisma, we can connect to several types of database engine with the same code. Here is the status of tests and validations carried out on the various engines compatible with the security extension. | ||
[Full list of supported version](https://docs.hivemq.com/ese/4.20/enterprise-security-extension/ese#sql-db-versions) | ||
|
||
| DB | Tested | Validated | Connection string format | | ||
|---------------|:------:|:---------:|:--------------------------------------------------------------------------------------------------------------------:| | ||
| PostgreSQL | YES | YES | postgresql://username:password@server:port/database_name?schema=public | | ||
| MariaDB | NO | NO | mysql://USER:PASSWORD@HOST:PORT/DATABASE | | ||
| MySQL | NO | NO | mysql://USER:PASSWORD@HOST:PORT/DATABASE | | ||
| MariaDB | YES | YES | mysql://USER:PASSWORD@HOST:PORT/DATABASE | | ||
| MySQL | YES | YES | mysql://USER:PASSWORD@HOST:PORT/DATABASE | | ||
| SQL Server | NO | NO | sqlserver://HOST:PORT;database=DATABASE;user=USER;password=PASSWORD;encrypt=true | | ||
| Azure SQL | NO | NO | sqlserver://HOST:PORT;database=DATABASE;user=USER;password=PASSWORD;encrypt=true | | ||
| Amazon Aurora | NO | NO | mysql://USER:PASSWORD@HOST:PORT/DATABASE | | ||
|
||
[More details on configuring Prisma connection string](https://www.prisma.io/docs/concepts/database-connectors) | ||
|
||
|
||
## Database preparation | ||
The schema of the Enterprise Security Extension remain untouched. The authentication on the API and the UI is done with the accounts that are in the resp_api_users table. | ||
To be able to access the user needs to have the eseapi_admin role assigned which has himself the eseapiadmin permission. | ||
|
@@ -134,13 +140,18 @@ where rest_api_users.username = 'eseapiadmin' | |
|
||
## Build Docker Image | ||
``` | ||
docker build -t ese-companion --platform linux/amd64 . | ||
docker build -t ese-companion-dbflavor --platform linux/amd64 . | ||
``` | ||
(Platform is specified when other CPU than AMD64 are used like ARM) | ||
|
||
## Run Docker image | ||
|
||
At the moment two DB flavors are available (later on SQL Server is in the roadmap) : | ||
- [PostgreSQL version](https://hub.docker.com/repository/docker/anthonyolazabal/ese-companion-postgresql/general) | ||
- [MySQL version](https://hub.docker.com/repository/docker/anthonyolazabal/ese-companion-mysql/general) | ||
|
||
``` | ||
docker run --env=TOKEN_KEY=@JwTT0k3nK3y!!!@JwTT0k3nK3y!!! --env=DATABASE_URL=postgresql://hivemq:[email protected]:5432/hivemq-ese-dev?schema=public -p 3301:3001 -d ese-companion:latest | ||
docker run --env=TOKEN_KEY=@JwTT0k3nK3y!!!@JwTT0k3nK3y!!! --env=DATABASE_URL=postgresql://hivemq:[email protected]:5432/hivemq-ese-dev?schema=public -p 3301:3001 -d ese-companion-dbflavor:latest | ||
``` | ||
|
||
Two important environment variables are needed : | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.