Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Greenlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arbeitsgruppe Hardwarenahe IT-Systeme
Greenlight
Commits
0b64acae
Commit
0b64acae
authored
5 years ago
by
farhatahmad
Committed by
Jesus Federico
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed issues with maintenance mode (#683)
parent
d1e50f2e
Branches
Branches containing commit
Tags
release-2.2.3
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/controllers/application_controller.rb
+1
-1
1 addition, 1 deletion
app/controllers/application_controller.rb
app/helpers/application_helper.rb
+1
-0
1 addition, 0 deletions
app/helpers/application_helper.rb
bin/start
+5
-2
5 additions, 2 deletions
bin/start
with
7 additions
and
3 deletions
app/controllers/application_controller.rb
+
1
−
1
View file @
0b64acae
...
@@ -197,6 +197,6 @@ class ApplicationController < ActionController::Base
...
@@ -197,6 +197,6 @@ class ApplicationController < ActionController::Base
# Manually Handle errors when application is in readonly mode
# Manually Handle errors when application is in readonly mode
def
handle_readonly_error
def
handle_readonly_error
flash
.
clear
flash
.
clear
redirect_to
request
.
referrer
,
flash:
{
alert:
I18n
.
t
(
"errors.maintenance.readonly"
)
}
redirect_to
request
.
referrer
||
root_path
,
flash:
{
alert:
I18n
.
t
(
"errors.maintenance.readonly"
)
}
end
end
end
end
This diff is collapsed.
Click to expand it.
app/helpers/application_helper.rb
+
1
−
0
View file @
0b64acae
...
@@ -87,6 +87,7 @@ module ApplicationHelper
...
@@ -87,6 +87,7 @@ module ApplicationHelper
def
allow_greenlight_accounts?
def
allow_greenlight_accounts?
return
Rails
.
configuration
.
allow_user_signup
unless
Rails
.
configuration
.
loadbalanced_configuration
return
Rails
.
configuration
.
allow_user_signup
unless
Rails
.
configuration
.
loadbalanced_configuration
return
false
unless
@user_domain
&&
!
@user_domain
.
empty?
&&
Rails
.
configuration
.
allow_user_signup
return
false
unless
@user_domain
&&
!
@user_domain
.
empty?
&&
Rails
.
configuration
.
allow_user_signup
return
false
if
@user_domain
==
"greenlight"
# Proceed with retrieving the provider info
# Proceed with retrieving the provider info
begin
begin
provider_info
=
retrieve_provider_info
(
@user_domain
,
'api2'
,
'getUserGreenlightCredentials'
)
provider_info
=
retrieve_provider_info
(
@user_domain
,
'api2'
,
'getUserGreenlightCredentials'
)
...
...
This diff is collapsed.
Click to expand it.
bin/start
+
5
−
2
View file @
0b64acae
...
@@ -9,9 +9,12 @@ if [ "$RAILS_ENV" = "production" ] && [ "$DB_ADAPTER" = "postgresql" ]; then
...
@@ -9,9 +9,12 @@ if [ "$RAILS_ENV" = "production" ] && [ "$DB_ADAPTER" = "postgresql" ]; then
fi
fi
bundle
exec
rake db:create
bundle
exec
rake db:create
if
[
"
$MAINTENANCE_MODE
"
!=
"readonly"
]
&&
[
"
$MAINTENANCE_MODE
"
!=
"full"
]
;
then
if
!
bundle
exec
rake db:migrate
;
then
if
!
bundle
exec
rake db:migrate
;
then
export
DB_MIGRATE_FAILED
=
1
export
DB_MIGRATE_FAILED
=
1
fi
fi
fi
bundle
exec
rake assets:precompile
bundle
exec
rake assets:precompile
...
...
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