Skip to content

Commit cda8efe

Browse files
authored
Update docs (#331)
Fixes #330
1 parent 2521dad commit cda8efe

File tree

1 file changed

+35
-31
lines changed

1 file changed

+35
-31
lines changed

docs/index.md

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ PassWeaver API is a collaborative, enterprise-scale secrets manager REST API. It
66

77
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.
88

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).
1010

1111
PassWeaver API is a NodeJS application, released under MIT license, and it uses these (great) opensource libraries, among several others:
1212

@@ -361,24 +361,32 @@ If any data is returned by the endpoint, it will be always encapsulated in the "
361361

362362
# Install and run
363363

364-
## Prerequisites
364+
## 1. Pre-requisites
365365

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
367370

368-
- NodeJS and npm
369-
- A running PostgreSQL instance
371+
## 2. Install
370372

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:
372374

373-
## Install
375+
`npm install`
374376

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
376378

377-
`npm install`
379+
Passweaver API uses this environment variable:
378380

379-
## Configure
381+
- `PASSWEAVERAPI_PRISMA_URL`: the database connection string in the form `postgresql://user:password@serverip:port/database`
380382

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):
382390

383391
- **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
384392
- `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:
408416
- `enabled`: true or false; if false, internal cache is uses
409417
- `url`: Redis url
410418
- `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 Prometheus formatted 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
414422
- `generated_password_length`: length of random generated password, default is 20
415423

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
427425

428426
PassWeaver API uses PostgreSQL as RDBMS and Prisma ORM to access it.
429427

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.
431429

432-
Then, from PassWeaver-API directory, run the following commands:
430+
Then, in PassWeaver-API install directory, run the following commands:
433431

434432
- `npx prisma db push`: creates the database objects
435433
- `npx prisma db seed`: add initial default data
436434
- `npx prisma generate`: generates Prisma code
437435

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
439443

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.
441445

442-
## Run
446+
## 8. Need a GUI to handle your passwords?
443447

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

Comments
 (0)