mirror of
https://git.waldn.net/git/knotteye/satyr.git
synced 2025-05-07 13:29:25 +00:00
User accounts are now only for streamers, update CLI, API, and config to reflect that. Fixed a bug with registration in api.ts Made http port configurable Added beginnings of socket.io chat server Possibly more, I took a break in the middle of this commit.
27 lines
786 B
TypeScript
27 lines
786 B
TypeScript
import * as db from "./database"
|
|
import * as flags from "flags";
|
|
import * as config from "config"
|
|
|
|
db.init(config.database, config.bcrypt);
|
|
|
|
flags.defineString('adduser', '', 'User to add');
|
|
flags.defineString('rmuser', '', 'User to remove');
|
|
flags.defineString('password', '', 'password to hash');
|
|
|
|
flags.parse();
|
|
|
|
if(flags.get('adduser') !== ''){
|
|
db.addUser(flags.get('adduser'), flags.get('password')).then((result) => {
|
|
if(result) console.log("User added successfully.");
|
|
else console.log("Could not add user. Is the password field empty?");
|
|
process.exit();
|
|
});
|
|
}
|
|
|
|
if(flags.get('rmuser') !== ''){
|
|
db.rmUser(flags.get('rmuser')).then((result) => {
|
|
if(result) console.log("User removed successfully.");
|
|
else console.log("Could not remove user.");
|
|
process.exit();
|
|
});
|
|
} |