mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2025-12-19 05:47:46 +00:00
update README (#129)
This commit is contained in:
@@ -15,15 +15,17 @@ JAMBONES_MYSQL_CONNECTION_LIMIT # defaults to 10
|
|||||||
JAMBONES_REDIS_HOST
|
JAMBONES_REDIS_HOST
|
||||||
JAMBONES_REDIS_PORT
|
JAMBONES_REDIS_PORT
|
||||||
JAMBONES_LOGLEVEL # defaults to info
|
JAMBONES_LOGLEVEL # defaults to info
|
||||||
JAMBONES_API_VERSION # defaults to v1
|
JAMBONES_API_VERSION # defaults to v1
|
||||||
|
JAMBONES_TIME_SERIES_HOST
|
||||||
|
JWT_SECRET
|
||||||
HTTP_PORT # defaults to 3000
|
HTTP_PORT # defaults to 3000
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Database dependency
|
#### Database dependency
|
||||||
A mysql database is used to store long-lived objects such as Accounts, Applications, etc. To create the database schema, use or review the scripts in the 'db' folder, particularly:
|
A mysql database is used to store long-lived objects such as Accounts, Applications, etc. To create the database schema, use or review the scripts in the 'db' folder, particularly:
|
||||||
- [create_db.sql](db/create_db.sql), which creates the database and associated user (you may want to edit the username and password),
|
|
||||||
- [jambones-sql.sql](db/jambones-sql.sql), which creates the schema,
|
- [jambones-sql.sql](db/jambones-sql.sql), which creates the schema,
|
||||||
- [create-admin-token.sql](db/create-admin-token.sql), which creates an admin-level auth token that can be used for testing/exercising the API.
|
- [seed-production-database-open-source.sql](db/seed-production-database-open-source.sql), which seeds the database with initial dataset(accounts, permissions, api keys, applications etc).
|
||||||
|
- [create-admin-user.sql](db/create-admin-user.sql), which creates admin user with password set to "admin". The password will be forced to change after the first login.
|
||||||
|
|
||||||
> Note: due to the dependency on the npmjs [mysql](https://www.npmjs.com/package/mysql) package, the mysql database must be configured to use sql [native authentication](https://medium.com/@crmcmullen/how-to-run-mysql-8-0-with-native-password-authentication-502de5bac661).
|
> Note: due to the dependency on the npmjs [mysql](https://www.npmjs.com/package/mysql) package, the mysql database must be configured to use sql [native authentication](https://medium.com/@crmcmullen/how-to-run-mysql-8-0-with-native-password-authentication-502de5bac661).
|
||||||
|
|
||||||
|
|||||||
10
db/create-admin-user.sql
Normal file
10
db/create-admin-user.sql
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
/* hashed password is "admin" */
|
||||||
|
insert into users (user_sid, name, email, hashed_password, force_change, provider, email_validated)
|
||||||
|
values ('12c80508-edf9-4b22-8d09-55abd02648eb', 'admin', 'joe@foo.bar', '$argon2i$v=19$m=65536,t=3,p=4$c2FsdHNhbHRzYWx0c2FsdA$x5OO6gXFXS25oqUU2JvbYqrSgRxBujNUJBq6xv9EgjM', 1, 'local', 1);
|
||||||
|
|
||||||
|
insert into user_permissions (user_permissions_sid, user_sid, permission_sid)
|
||||||
|
values ('8919e0dc-4d69-4de5-be56-a121598d9093', '12c80508-edf9-4b22-8d09-55abd02648eb', 'ffbc342a-546a-11ed-bdc3-0242ac120002');
|
||||||
|
insert into user_permissions (user_permissions_sid, user_sid, permission_sid)
|
||||||
|
values ('d6fdf064-0a65-4b17-8b10-5500e956a159', '12c80508-edf9-4b22-8d09-55abd02648eb', 'ffbc3a10-546a-11ed-bdc3-0242ac120002');
|
||||||
|
insert into user_permissions (user_permissions_sid, user_sid, permission_sid)
|
||||||
|
values ('f68185dd-0486-4767-a77d-a0b84c1b236e' ,'12c80508-edf9-4b22-8d09-55abd02648eb', 'ffbc3c5e-546a-11ed-bdc3-0242ac120002');
|
||||||
Reference in New Issue
Block a user