Browse Source

Add somewhat hacky way of adding a user

master
eta 2 years ago
parent
commit
86847ad3dd
  1. 12
      ircd-config.lisp
  2. 10
      ircd.lisp

12
ircd-config.lisp

@ -55,4 +55,14 @@
:short #\D
:meta-var "USERNAME"
:arg-parser #'identity
:long "db-database"))
:long "db-database")
(:name :new-username
:description "If this argument is supplied, creates a new user with this username."
:meta-var "USERNAME"
:arg-parser #'identity
:long "new-username")
(:name :new-password
:description "If this argument is supplied with --new-username, sets the password of the new user."
:meta-var "PASSWORD"
:arg-parser #'identity
:long "new-password"))

10
ircd.lisp

@ -506,6 +506,16 @@ When they arrive, it delivers them to connected clients."
(format t "Running NEA IRCd with server name '~A'.~%" *server-name*)
(format t "Connecting to database using: ~A~%" *default-database-args*)
(initialize-database)
(let ((new-username (getf opts :new-username))
(new-password (getf opts :new-password)))
(when new-username
(unless new-password
(format *error-output* "fatal: supply a new password with --new-password!~%")
(opts:exit 2))
(format t "Creating new user...")
(register-user new-username new-password "nowhere@example.invalid")
(format t "done.~%")
(opts:exit 3)))
(start-ircd)))
(defun main ()

Loading…
Cancel
Save