summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/ide/components/repo_commit_section.vue2
-rw-r--r--app/assets/stylesheets/framework/buttons.scss4
-rw-r--r--app/assets/stylesheets/framework/variables.scss11
-rw-r--r--app/assets/stylesheets/pages/boards.scss2
-rw-r--r--app/assets/stylesheets/pages/commits.scss2
-rw-r--r--app/assets/stylesheets/pages/issuable.scss2
-rw-r--r--app/assets/stylesheets/pages/tree.scss4
-rw-r--r--app/controllers/projects/pages_controller.rb2
-rw-r--r--app/controllers/projects/pages_domains_controller.rb8
-rw-r--r--app/models/pages_domain.rb8
-rw-r--r--app/services/pages_domains/retry_acme_order_service.rb21
-rw-r--r--app/views/layouts/nav/_dashboard.html.haml2
-rw-r--r--app/views/projects/pages/_list.html.haml5
-rw-r--r--app/views/projects/pages_domains/_certificate.html.haml2
-rw-r--r--app/views/projects/pages_domains/_lets_encrypt_callout.html.haml23
15 files changed, 71 insertions, 27 deletions
diff --git a/app/assets/javascripts/ide/components/repo_commit_section.vue b/app/assets/javascripts/ide/components/repo_commit_section.vue
index b8dca2709c8..2e7e55a61c5 100644
--- a/app/assets/javascripts/ide/components/repo_commit_section.vue
+++ b/app/assets/javascripts/ide/components/repo_commit_section.vue
@@ -45,7 +45,7 @@ export default {
if (this.lastOpenedFile && this.lastOpenedFile.type !== 'tree') {
this.openPendingTab({
file: this.lastOpenedFile,
- keyPrefix: this.lastOpenedFile.changed ? stageKeys.unstaged : stageKeys.staged,
+ keyPrefix: this.lastOpenedFile.staged ? stageKeys.staged : stageKeys.unstaged,
})
.then(changeViewer => {
if (changeViewer) {
diff --git a/app/assets/stylesheets/framework/buttons.scss b/app/assets/stylesheets/framework/buttons.scss
index 6257ee3ae8e..ecf2097dc87 100644
--- a/app/assets/stylesheets/framework/buttons.scss
+++ b/app/assets/stylesheets/framework/buttons.scss
@@ -120,7 +120,7 @@
}
@mixin btn-white {
- @include btn-color($white, $border-color, $white-normal, $border-white-normal, $white-dark, $border-gray-dark, $gl-text-color);
+ @include btn-color($white, $border-color, $white-normal, $border-white-normal, $white-dark, $border-white-normal, $gl-text-color);
}
@mixin btn-with-margin {
@@ -365,7 +365,7 @@
.active {
box-shadow: $gl-btn-active-background;
- border: 1px solid $border-gray-dark !important;
+ border: 1px solid $border-white-normal !important;
background-color: $btn-active-gray-light !important;
}
}
diff --git a/app/assets/stylesheets/framework/variables.scss b/app/assets/stylesheets/framework/variables.scss
index fed2b5c905d..c23623005b0 100644
--- a/app/assets/stylesheets/framework/variables.scss
+++ b/app/assets/stylesheets/framework/variables.scss
@@ -329,7 +329,6 @@ $border-white-normal: darken($white-normal, $darken-border-factor);
$border-gray-light: darken($gray-light, $darken-border-factor);
$border-gray-normal: darken($gray-normal, $darken-border-factor);
$border-gray-normal-dashed: darken($gray-normal, $darken-border-dashed-factor);
-$border-gray-dark: darken($white-normal, $darken-border-factor);
/*
* UI elements
@@ -350,13 +349,13 @@ $gl-font-size-small: 12px;
$gl-font-size-large: 16px;
$gl-font-weight-normal: 400;
$gl-font-weight-bold: 600;
-$gl-text-color: #2e2e2e;
-$gl-text-color-secondary: #707070;
-$gl-text-color-tertiary: #919191;
+$gl-text-color: $gray-900;
+$gl-text-color-secondary: $gray-700;
+$gl-text-color-tertiary: $gray-600;
$gl-text-color-quaternary: #d6d6d6;
-$gl-text-color-inverted: rgba(255, 255, 255, 1);
+$gl-text-color-inverted: $white;
$gl-text-color-secondary-inverted: rgba(255, 255, 255, 0.85);
-$gl-text-color-disabled: #919191;
+$gl-text-color-disabled: $gray-600;
$gl-grayish-blue: #7f8fa4;
$gl-gray-dark: #313236;
$gl-gray-light: #5c5c5c;
diff --git a/app/assets/stylesheets/pages/boards.scss b/app/assets/stylesheets/pages/boards.scss
index 78d4383ce28..11291dad28b 100644
--- a/app/assets/stylesheets/pages/boards.scss
+++ b/app/assets/stylesheets/pages/boards.scss
@@ -475,7 +475,7 @@
}
.board-card {
- border: 1px solid $border-gray-dark;
+ border: 1px solid $border-white-normal;
box-shadow: 0 1px 2px rgba($issue-boards-card-shadow, 0.3);
cursor: pointer;
}
diff --git a/app/assets/stylesheets/pages/commits.scss b/app/assets/stylesheets/pages/commits.scss
index 1a07600769c..230f390aa90 100644
--- a/app/assets/stylesheets/pages/commits.scss
+++ b/app/assets/stylesheets/pages/commits.scss
@@ -131,7 +131,7 @@
color: $gl-text-color-secondary;
padding: 1px $gl-padding-4;
cursor: pointer;
- border: 1px solid $border-gray-dark;
+ border: 1px solid $border-white-normal;
border-radius: $border-radius-default;
margin-left: 5px;
font-size: 12px;
diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss
index c48f4b0622e..85fdcb753b4 100644
--- a/app/assets/stylesheets/pages/issuable.scss
+++ b/app/assets/stylesheets/pages/issuable.scss
@@ -426,7 +426,7 @@
height: $sidebar-toggle-height;
margin-left: 0;
padding-left: 0;
- border-bottom: 1px solid $border-gray-dark;
+ border-bottom: 1px solid $border-white-normal;
}
a.gutter-toggle {
diff --git a/app/assets/stylesheets/pages/tree.scss b/app/assets/stylesheets/pages/tree.scss
index 142078588df..22b5859e297 100644
--- a/app/assets/stylesheets/pages/tree.scss
+++ b/app/assets/stylesheets/pages/tree.scss
@@ -130,8 +130,8 @@
&.selected {
td {
background: $white-normal;
- border-top: 1px solid $border-gray-dark;
- border-bottom: 1px solid $border-gray-dark;
+ border-top: 1px solid $border-white-normal;
+ border-bottom: 1px solid $border-white-normal;
}
}
}
diff --git a/app/controllers/projects/pages_controller.rb b/app/controllers/projects/pages_controller.rb
index 18a171700e9..2a8bc823931 100644
--- a/app/controllers/projects/pages_controller.rb
+++ b/app/controllers/projects/pages_controller.rb
@@ -10,7 +10,7 @@ class Projects::PagesController < Projects::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
def show
- @domains = @project.pages_domains.order(:domain)
+ @domains = @project.pages_domains.order(:domain).present(current_user: current_user)
end
# rubocop: enable CodeReuse/ActiveRecord
diff --git a/app/controllers/projects/pages_domains_controller.rb b/app/controllers/projects/pages_domains_controller.rb
index 5a81a064048..cdf6f5ce828 100644
--- a/app/controllers/projects/pages_domains_controller.rb
+++ b/app/controllers/projects/pages_domains_controller.rb
@@ -26,6 +26,12 @@ class Projects::PagesDomainsController < Projects::ApplicationController
redirect_to project_pages_domain_path(@project, @domain)
end
+ def retry_auto_ssl
+ PagesDomains::RetryAcmeOrderService.new(@domain.pages_domain).execute
+
+ redirect_to project_pages_domain_path(@project, @domain)
+ end
+
def edit
redirect_to project_pages_domain_path(@project, @domain)
end
@@ -82,6 +88,6 @@ class Projects::PagesDomainsController < Projects::ApplicationController
end
def domain
- @domain ||= @project.pages_domains.find_by_domain!(params[:id].to_s)
+ @domain ||= @project.pages_domains.find_by_domain!(params[:id].to_s).present(current_user: current_user)
end
end
diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb
index 37d45c5934d..486da2c6b45 100644
--- a/app/models/pages_domain.rb
+++ b/app/models/pages_domain.rb
@@ -1,6 +1,8 @@
# frozen_string_literal: true
class PagesDomain < ApplicationRecord
+ include Presentable
+
VERIFICATION_KEY = 'gitlab-pages-verification-code'
VERIFICATION_THRESHOLD = 3.days.freeze
SSL_RENEWAL_THRESHOLD = 30.days.freeze
@@ -13,6 +15,8 @@ class PagesDomain < ApplicationRecord
has_many :acme_orders, class_name: "PagesDomainAcmeOrder"
has_many :serverless_domain_clusters, class_name: 'Serverless::DomainCluster', inverse_of: :pages_domain
+ before_validation :clear_auto_ssl_failure, unless: :auto_ssl_enabled
+
validates :domain, hostname: { allow_numeric_hostname: true }
validates :domain, uniqueness: { case_sensitive: false }
validates :certificate, :key, presence: true, if: :usage_serverless?
@@ -208,6 +212,10 @@ class PagesDomain < ApplicationRecord
Pages::VirtualDomain.new([project], domain: self)
end
+ def clear_auto_ssl_failure
+ self.auto_ssl_failed = false
+ end
+
private
def pages_deployed?
diff --git a/app/services/pages_domains/retry_acme_order_service.rb b/app/services/pages_domains/retry_acme_order_service.rb
new file mode 100644
index 00000000000..ef3d8ce0b67
--- /dev/null
+++ b/app/services/pages_domains/retry_acme_order_service.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+module PagesDomains
+ class RetryAcmeOrderService
+ attr_reader :pages_domain
+
+ def initialize(pages_domain)
+ @pages_domain = pages_domain
+ end
+
+ def execute
+ updated = pages_domain.with_lock do
+ next unless pages_domain.auto_ssl_enabled && pages_domain.auto_ssl_failed
+
+ pages_domain.update!(auto_ssl_failed: false)
+ end
+
+ PagesDomainSslRenewalWorker.perform_async(pages_domain.id) if updated
+ end
+ end
+end
diff --git a/app/views/layouts/nav/_dashboard.html.haml b/app/views/layouts/nav/_dashboard.html.haml
index 6fc06030d7a..0b23a06f5a9 100644
--- a/app/views/layouts/nav/_dashboard.html.haml
+++ b/app/views/layouts/nav/_dashboard.html.haml
@@ -26,7 +26,7 @@
%ul
- if dashboard_nav_link?(:groups)
%li.d-md-none
- = link_to dashboard_groups_path do
+ = link_to dashboard_groups_path, class: 'dashboard-shortcuts-groups' do
= _('Groups')
- if dashboard_nav_link?(:activity)
= nav_link(path: 'dashboard#activity') do
diff --git a/app/views/projects/pages/_list.html.haml b/app/views/projects/pages/_list.html.haml
index a9e2cbac890..c116efe521a 100644
--- a/app/views/projects/pages/_list.html.haml
+++ b/app/views/projects/pages/_list.html.haml
@@ -1,12 +1,11 @@
- verification_enabled = Gitlab::CurrentSettings.pages_domain_verification_enabled?
-- if can?(current_user, :update_pages, @project) && @domains.load.any?
+- if can?(current_user, :update_pages, @project) && @domains.any?
.card
.card-header
Domains (#{@domains.size})
%ul.list-group.list-group-flush.pages-domain-list{ class: ("has-verification-status" if verification_enabled) }
- @domains.each do |domain|
- - domain = Gitlab::View::Presenter::Factory.new(domain, current_user: current_user).fabricate!
%li.pages-domain-list-item.list-group-item.d-flex.justify-content-between
- if verification_enabled
- tooltip, status = domain.unverified? ? [s_('GitLabPages|Unverified'), 'failed'] : [s_('GitLabPages|Verified'), 'success']
@@ -35,6 +34,6 @@
%li.list-group-item.bs-callout-warning
- details_link_start = "<a href='#{project_pages_domain_path(@project, domain)}'>".html_safe
- details_link_end = '</a>'.html_safe
- = s_("GitLabPages|Something went wrong while obtaining Let's Encrypt certificate for %{domain}. To retry visit your %{link_start}domain details%{link_end}.").html_safe % { domain: domain.domain,
+ = s_("GitLabPages|Something went wrong while obtaining the Let's Encrypt certificate for %{domain}. To retry visit your %{link_start}domain details%{link_end}.").html_safe % { domain: domain.domain,
link_start: details_link_start,
link_end: details_link_end }
diff --git a/app/views/projects/pages_domains/_certificate.html.haml b/app/views/projects/pages_domains/_certificate.html.haml
index 92d30e0b056..e95841f2867 100644
--- a/app/views/projects/pages_domains/_certificate.html.haml
+++ b/app/views/projects/pages_domains/_certificate.html.haml
@@ -36,7 +36,7 @@
= _('Certificate')
.d-flex.justify-content-between.align-items-center.p-3
%span
- = @domain.subject || _('missing')
+ = @domain.pages_domain.subject || _('missing')
= link_to _('Remove'),
clean_certificate_project_pages_domain_path(@project, @domain),
data: { confirm: _('Are you sure?') },
diff --git a/app/views/projects/pages_domains/_lets_encrypt_callout.html.haml b/app/views/projects/pages_domains/_lets_encrypt_callout.html.haml
index d6406a78fca..f2de42b218c 100644
--- a/app/views/projects/pages_domains/_lets_encrypt_callout.html.haml
+++ b/app/views/projects/pages_domains/_lets_encrypt_callout.html.haml
@@ -1,10 +1,21 @@
- if @domain.enabled?
- - if @domain.auto_ssl_enabled && !@domain.certificate
- .form-group.border-section.js-shown-if-auto-ssl{ class: ("d-none" unless auto_ssl_available_and_enabled) }
- .row
- .col-sm-10.offset-sm-2
- .bs-callout.bs-callout-info.mt-0
- = _("GitLab is obtaining a Let's Encrypt SSL certificate for this domain. This process can take some time. Please try again later.")
+ - if @domain.auto_ssl_enabled
+ - if @domain.show_auto_ssl_failed_warning?
+ .form-group.border-section.js-shown-if-auto-ssl{ class: ("d-none" unless auto_ssl_available_and_enabled) }
+ .row
+ .col-sm-10.offset-sm-2
+ .bs-callout.bs-callout-warning.mt-0
+ .row.align-items-center.mx-2
+ = icon('warning', class: 'mr-2')
+ = _("Something went wrong while obtaining the Let's Encrypt certificate.")
+ .row.mx-0.mt-3
+ = link_to s_('GitLabPagesDomains|Retry'), retry_auto_ssl_project_pages_domain_path(@project, @domain), class: "btn btn-sm btn-grouped btn-warning", method: :post
+ - elsif !@domain.certificate_gitlab_provided?
+ .form-group.border-section.js-shown-if-auto-ssl{ class: ("d-none" unless auto_ssl_available_and_enabled) }
+ .row
+ .col-sm-10.offset-sm-2
+ .bs-callout.bs-callout-info.mt-0
+ = _("GitLab is obtaining a Let's Encrypt SSL certificate for this domain. This process can take some time. Please try again later.")
- else
.form-group.border-section.js-shown-if-auto-ssl{ class: ("d-none" unless auto_ssl_available_and_enabled) }
.row