You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.md
+35-31Lines changed: 35 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ PassWeaver API is a collaborative, enterprise-scale secrets manager REST API. It
6
6
7
7
It's **collaborative**, meaning that users are organized in groups and protected items are organized in folders: different permissions can be defined for each folder for each user group.
8
8
9
-
PassWeaver API is a standard REST API server: you can easily integrate it with your systems and let it act as a centralized password vault. Instead, for a ready to use, simple yet complete Web GUI to run along the API, have a look at the companion app PassWeaver GUI: https://github.com/steunix/passweaver-gui
9
+
PassWeaver API is a standard REST API server: you can easily integrate it with your systems and let it act as a centralized password vault. Instead, for a ready to use, simple yet complete Web GUI to run along the API, have a look at the companion app [PassWeaver GUI](https://github.com/steunix/passweaver-gui).
10
10
11
11
PassWeaver API is a NodeJS application, released under MIT license, and it uses these (great) opensource libraries, among several others:
12
12
@@ -361,24 +361,32 @@ If any data is returned by the endpoint, it will be always encapsulated in the "
361
361
362
362
# Install and run
363
363
364
-
## Prerequisites
364
+
## 1. Pre-requisites
365
365
366
-
In order to be able to install PassWeaver API, you need:
366
+
In order to be able to install PassWeaver API:
367
+
1. you need to install NodeJS and npm
368
+
2. you need to have connectivity to a running PostgreSQL instance
369
+
3. you'd better have connectivity to a running Redis instance
367
370
368
-
- NodeJS and npm
369
-
- A running PostgreSQL instance
371
+
## 2. Install
370
372
371
-
A running Redis instance is warmly advised.
373
+
Download the source at [this link](https://github.com/steunix/passweaver-api/releases/latest), and install all dependencies with npm:
372
374
373
-
## Install
375
+
`npm install`
374
376
375
-
Download the source from [this link](https://github.com/steunix/passweaver-api/releases/tag/v2.1.2), and install all dependencies with npm:
377
+
## 3. Setup environment variables
376
378
377
-
`npm install`
379
+
Passweaver API uses this environment variable:
378
380
379
-
## Configure
381
+
-`PASSWEAVERAPI_PRISMA_URL`: the database connection string in the form `postgresql://user:password@serverip:port/database`
380
382
381
-
Copy `config-skel.json` to `config.json` and adjust the options:
383
+
See [Prisma Documentation](https://www.prisma.io/docs/orm/overview/databases/postgresql#connection-details) for further details.
384
+
385
+
If you're installing a production environment, don't forget to set variable `NODE_ENV` to `production`, since some of Passweaver API dependencies use that variable to optimize operations.
386
+
387
+
## 4. Configure
388
+
389
+
Copy `config-skel.json` to `config.json` and adjust the options (all options are mandatory, unless a default is specified):
382
390
383
391
-**obsolete**`master_key_file`: The file (with complete path) containing the (base64 encoded) master key; it is only necessary if you have a database with items created with version 1.x API
384
392
-`jwt_duration`: JWT duration. For example, "2h" or "1d". When JWT expires, a new login is required.
@@ -408,37 +416,33 @@ Copy `config-skel.json` to `config.json` and adjust the options:
408
416
-`enabled`: true or false; if false, internal cache is uses
409
417
-`url`: Redis url
410
418
-`onetimetokens`:
411
-
-`max_hours`: Max one-time secrets duration
412
-
-`readonly`: true or false; if true, no write operation is allowed both for admins and regolar users
413
-
-`enable_metrics`: true or false, enables Prometheusformatted metrics
419
+
-`max_hours`: Max one-time secrets duration, expressed in hours
420
+
-`readonly`: true or false; if true, no write operation is allowed both for admins and non-admins (logging is still operational)
421
+
-`enable_metrics`: true or false, enables Prometheus-formatted metrics
414
422
-`generated_password_length`: length of random generated password, default is 20
415
423
416
-
## Environment variables
417
-
418
-
Passweaver API uses this environment variable:
419
-
420
-
-`PASSWEAVERAPI_PRISMA_URL`: the database connection string in the form `postgresql://user:password@serverip:port/database`
421
-
422
-
See [Prisma Documentation](https://www.prisma.io/docs/orm/overview/databases/postgresql#connection-details) for further details.
423
-
424
-
If you're installing a production environment, don't forget to set variable `NODE_ENV` to `production`, since some of Passweaver API dependencies use that variable to optimize operations.
425
-
426
-
## Database
424
+
## 5. Prepare the database
427
425
428
426
PassWeaver API uses PostgreSQL as RDBMS and Prisma ORM to access it.
429
427
430
-
Create an empty database on your existent PostgreSQL instance, and set the environment variable `PASSWEAVERAPI_PRISMA_URL` accordingly.
428
+
Create an empty database on your existent PostgreSQL instance, and set the environment variable `PASSWEAVERAPI_PRISMA_URL`(see above) accordingly.
431
429
432
-
Then, from PassWeaver-API directory, run the following commands:
430
+
Then, in PassWeaver-API install directory, run the following commands:
433
431
434
432
-`npx prisma db push`: creates the database objects
435
433
-`npx prisma db seed`: add initial default data
436
434
-`npx prisma generate`: generates Prisma code
437
435
438
-
## Default user
436
+
## 6. Run PassWeaver API
437
+
438
+
Run `node passweaver-api.mjs`.
439
+
440
+
If no error is reported, the API is up and running.
441
+
442
+
## 7. First login
439
443
440
-
A default user `admin`will be created with password `0`: of course you should change it as soon as possible.
444
+
A default user `admin`has been created, with password `0`: of course you should change it as soon as possible.
441
445
442
-
## Run
446
+
## 8. Need a GUI to handle your passwords?
443
447
444
-
run `node passweaver-api.mjs`.
448
+
If you need a GUI, have a look at [PassWeaver GUI](https://steunix.github.io/passweaver-gui/), a WEB based frontend for PassWeaver API.
0 commit comments