Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
68330c39
Commit
68330c39
authored
Jun 09, 2021
by
Albert Salim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable sign up via console
parent
7234f19d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
scripts/review_apps/review-apps.sh
scripts/review_apps/review-apps.sh
+4
-5
No files found.
scripts/review_apps/review-apps.sh
View file @
68330c39
...
...
@@ -127,13 +127,12 @@ function disable_sign_ups() {
fi
# Create the root token
local
ruby_cmd
=
"token = User.find_by_username('root').personal_access_tokens.create(scopes: [:api], name: 'Token to disable sign-ups'); token.set_token('
${
REVIEW_APPS_ROOT_TOKEN
}
'); begin; token.save!; rescue(ActiveRecord::RecordNotUnique); end"
retry
"run_task
\"
${
ruby_cmd
}
\"
"
local
set_token_rb
=
"token = User.find_by_username('root').personal_access_tokens.create(scopes: [:api], name: 'Token to disable sign-ups'); token.set_token('
${
REVIEW_APPS_ROOT_TOKEN
}
'); begin; token.save!; rescue(ActiveRecord::RecordNotUnique); end"
retry
"run_task
\"
${
set_token_rb
}
\"
"
# Disable sign-ups
local
signup_enabled
=
$(
retry
'curl --silent --show-error --request PUT --header "PRIVATE-TOKEN: ${REVIEW_APPS_ROOT_TOKEN}" "${CI_ENVIRONMENT_URL}/api/v4/application/settings?signup_enabled=false" | jq ".signup_enabled"'
)
if
[[
"
${
signup_enabled
}
"
==
"false"
]]
;
then
local
disable_signup_rb
=
"Gitlab::CurrentSettings.current_application_settings.update!(signup_enabled: false)"
if
(
retry
"run_task
\"
${
disable_signup_rb
}
\"
"
)
;
then
echoinfo
"Sign-ups have been disabled successfully."
else
echoerr
"Sign-ups are still enabled!"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment