Skip to content

Commit ac4a3c7

Browse files
author
Ahmed Elghareeb
committed
docs: update documentation with new backend CLI tool
1 parent d903832 commit ac4a3c7

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

README.docker.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ to delete the volumes (this will reset your instance).
5353

5454
1. run the script `DELA_REPLICAS=... init_dela.sh` to initialize the DELA network with `DELA_REPLICAS set to the same value as in .env`
5555
2. run `docker exec -it d-voting-backend-1 /bin/bash` to connect to the backend
56-
3. execute `node -e 'require("./dbUtils").addAdmin("./dvoting-users", <sciper>)'` with your Sciper to add yourself as admin
56+
3. execute `npx cli addAdmin --sciper 123455` with your SCIPER to add yourself as admin

deb-package/README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@ and be sure to *export* variables in `config.env` (i.e do `export xx=yy`).
2525
However it is recommended to use a service manager such as systemd to run the
2626
app.
2727

28-
4) Use dbUtils.js
29-
30-
You can manually update the rights with `dbUtils.js`:
28+
4) Use the CLI to set yourself up as an admin
3129

3230
```sh
33-
NODE_PATH=./node_modules node -e 'require("./dbUtils").listEls("../data/dvoting-users")'
31+
npx cli addAdmin --sciper 1234
3432
```
3533

3634
# Run the web frontend

web/backend/readme.md

+23
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,26 @@ func GenerateKey() {
2525
# Run the program
2626

2727
Once all the previous steps done, the project can be run using `npm start`
28+
29+
# CLI
30+
31+
To control the administration right of different users, the CLI tool can be used.
32+
For example,
33+
```sh
34+
$ npx cli addAdmin --sciper MY_SCIPER_NUMBER
35+
```
36+
37+
You can also consult the following command for more information
38+
```sh
39+
$ npx cli help
40+
Usage: cli [options] [command]
41+
42+
Options:
43+
-h, --help display help for command
44+
45+
Commands:
46+
addAdmin [options] Given a SCIPER number, the owner would gain full admin permissions
47+
listUserPermissions [options] Lists the permissions -if any- of the owner of a given SCIPER
48+
removeAdmin [options] Given a SCIPER number, the owner would lose all admin privileges -if any-
49+
help [command] display help for command
50+
```

0 commit comments

Comments
 (0)