Skip to content

Resolve "Hosted website on Gitlab Pages asking for authorization via OAuth login."

What does this MR do?

#32961 (closed)

We've enabled access control for pages on .com 2.5 months after the migration fixing settings were run. gitlab-foss!30354 (merged)

All private projects created within this timeframe have access control enabled but users do not know that.

This MR adds migration which will find such projects and reset settings to the anticipated state.

The migration is suitable only for gitlab.com, since it uses json config file, and we will are planning to get rid of them in favor of API calls. So this migration should be removed once it will finish its work.

Estimated time for gitlab.com

18 hours

10_800_000.0 / 20_000 * 2 / 60
=> 18.0

Cleaning issue: #34018 (closed)

To estimate the impact of the current problem:

start_date = Time.new(2019, 7, 7) # when migration was merged https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/30354/diffs
end_date = Time.new(2019, 9, 17) # when access control was enabled on .com
created_at_column = Project.arel_table[:created_at]
first_project_id = Project.where(created_at_column.gt(start_date)).order(:created_at).first.id
last_project_id = Project.where(created_at_column.lteq(end_date)).order(:created_at).last.id
Project.where(id: (first_project_id..last_project_id)).find_each{|p| puts p.id if p.private? && p.pages_deployed?}

This printed 8673 projects

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Performance and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Closes #32961 (closed)

Edited by Vladimir Shushlin

Merge request reports