[scripts] Add scrips for setting up a new authoritative keyserver
Summary:
issues: ENG-6613 and ENG-6612
These scripts
- check if usingIdentityCredentials flag is set to true in user_credentials.json
- if so check if metadata table is correctly filled in
- if either of these is not fulfilled asks the dev if they want to set up a new authoritative keyserver
- if they agree, the db is moved to a backup and the dev is prompted for admin credentials (username and password)
I found using bash for operations on the db, and using js for writing files to be the most readable. I also had the js code already written as part of my February goal. But if this is too messy I can also write everything in bash. Please let me know what you think
In .sh files we don't seem to cut the lines to be under 80 characters
Test Plan:
ran $PRJ_ROOT/scripts/set-up-authoritative-keyserver.sh from dev-shell.nix
ran nix and checked that if the dev aborts the process they can still use their old setup
ran from nix, and checked that if the dev agrees to proceed and gives correct credentials, the db is moved and user_credentials.json is filled in. It is also possible to run the keyserver and the db is correctly set up
ran from nix, and checked that if the dev agrees to proceed but gives incorrect credentials, then the keyserver fails. Then, the next time nix is run, the script correctly recognises that something is wrong, and asks again if the dev wants to set up the keyserver
(some logs explaining that nix has to be run again will be added in ENG-6618)
Reviewers: tomek, michal, ashoat
Reviewed By: tomek, ashoat
Differential Revision: https://phab.comm.dev/D11246