Skip to content

Simple Cmdline User-Creation Tool #702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Nebukadneza opened this issue Jan 24, 2018 · 1 comment
Closed

Simple Cmdline User-Creation Tool #702

Nebukadneza opened this issue Jan 24, 2018 · 1 comment
Labels
enhancement Wants to improvide an existing feature help wanted We want you to help us with this!

Comments

@Nebukadneza
Copy link

Hi,

since #272 (User Administration) is a big of a bigger hunk and will need some time, I propose an intermediate step, which will already help users hosting closed instances: A simple commandline user creation/deletion script.

Currently users hosting a closed instance need to manually hash passwords using scrypt on the node commandline, and enter user-data into their respective database. AFAIK no database-commandline or frontend has scrypt-kdf functionality builtin, so this is quite labour-intensive.

A simple Commandline tool that does something like:

node user_admin.js
    Usage: node user_admin.js <-a||-d> [-p <password>] <user email>
        -a Add User
        -d Delete User
        -p Use password from commandline (rather than prompting)

Would lighten the work of administrators of such a instance tremendously. At the same time, it should be quite simple and quick to implement, so that it can be available quickly.

I could try to understand your database backend and how to argparse in node, and implement/PR a functionality like that. Please let me know what you think about the idea.

Best,
-Dario

@SISheogorath SISheogorath added enhancement Wants to improvide an existing feature help wanted We want you to help us with this! labels Jan 24, 2018
@SISheogorath
Copy link
Contributor

Actually you should be fine with making a require on the User model.

To create such a tool you basically refactor this code by replacing all web request content with CLI and add a function to replace the password:
https://github.com/hackmdio/hackmd/blob/master/lib/web/auth/email/index.js

Feel free to file a PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Wants to improvide an existing feature help wanted We want you to help us with this!
Projects
None yet
Development

No branches or pull requests

2 participants