Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
9a8bbc9a
Commit
9a8bbc9a
authored
6 years ago
by
Bruno Windels
Committed by
Richard van der Hoff
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
add --no-admin flag to registration script (#3836)
parent
3deaad2f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.d/3836.bugfix
+1
-0
1 addition, 0 deletions
changelog.d/3836.bugfix
scripts/register_new_matrix_user
+14
-4
14 additions, 4 deletions
scripts/register_new_matrix_user
with
15 additions
and
4 deletions
changelog.d/3836.bugfix
0 → 100644
+
1
−
0
View file @
9a8bbc9a
support registering regular users non-interactively with register_new_matrix_user script
\ No newline at end of file
This diff is collapsed.
Click to expand it.
scripts/register_new_matrix_user
+
14
−
4
View file @
9a8bbc9a
...
@@ -133,7 +133,7 @@ def register_new_user(user, password, server_location, shared_secret, admin):
...
@@ -133,7 +133,7 @@ def register_new_user(user, password, server_location, shared_secret, admin):
print
"
Passwords do not match
"
print
"
Passwords do not match
"
sys
.
exit
(
1
)
sys
.
exit
(
1
)
if
not
admin
:
if
admin
is
None
:
admin
=
raw_input
(
"
Make admin [no]:
"
)
admin
=
raw_input
(
"
Make admin [no]:
"
)
if
admin
in
(
"
y
"
,
"
yes
"
,
"
true
"
):
if
admin
in
(
"
y
"
,
"
yes
"
,
"
true
"
):
admin
=
True
admin
=
True
...
@@ -160,10 +160,16 @@ if __name__ == "__main__":
...
@@ -160,10 +160,16 @@ if __name__ == "__main__":
default
=
None
,
default
=
None
,
help
=
"
New password for user. Will prompt if omitted.
"
,
help
=
"
New password for user. Will prompt if omitted.
"
,
)
)
parser
.
add_argument
(
admin_group
=
parser
.
add_mutually_exclusive_group
()
admin_group
.
add_argument
(
"
-a
"
,
"
--admin
"
,
"
-a
"
,
"
--admin
"
,
action
=
"
store_true
"
,
action
=
"
store_true
"
,
help
=
"
Register new user as an admin. Will prompt if omitted.
"
,
help
=
"
Register new user as an admin. Will prompt if --no-admin is not set either.
"
,
)
admin_group
.
add_argument
(
"
--no-admin
"
,
action
=
"
store_true
"
,
help
=
"
Register new user as a regular user. Will prompt if --admin is not set either.
"
,
)
)
group
=
parser
.
add_mutually_exclusive_group
(
required
=
True
)
group
=
parser
.
add_mutually_exclusive_group
(
required
=
True
)
...
@@ -197,4 +203,8 @@ if __name__ == "__main__":
...
@@ -197,4 +203,8 @@ if __name__ == "__main__":
else
:
else
:
secret
=
args
.
shared_secret
secret
=
args
.
shared_secret
register_new_user
(
args
.
user
,
args
.
password
,
args
.
server_url
,
secret
,
args
.
admin
)
admin
=
None
if
args
.
admin
or
args
.
no_admin
:
admin
=
args
.
admin
register_new_user
(
args
.
user
,
args
.
password
,
args
.
server_url
,
secret
,
admin
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment