From dfcf4cf5f1e87a29f0d9fcc5ff2bba47258893bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C5=82gorzata=20Ksionek?= Date: Thu, 18 Jul 2019 10:27:02 +0200 Subject: Add captcha if there are multiple failed login attempts Add method to store session ids by ip Add new specs for storing session ids Add cleaning up records after login Add retrieving anonymous sessions Add login recaptcha setting Add new setting to sessions controller Add conditions for showing captcha Add sessions controller specs Add admin settings specs for login protection Add new settings to api Add stub to devise spec Add new translation key Add cr remarks Rename class call Add cr remarks Change if-clause for consistency Add cr remarks Add code review remarks Refactor AnonymousSession class Add changelog entry Move AnonymousSession class to lib Move store unauthenticated sessions to sessions controller Move link to recaptcha info Regenerate text file Improve copy on the spam page Change action filter for storing anonymous sessions Fix rubocop offences Add code review remarks --- db/schema.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 6f5fc6c65eb..8acc81c26ab 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -228,6 +228,7 @@ ActiveRecord::Schema.define(version: 2019_07_29_090456) do t.boolean "lock_memberships_to_ldap", default: false, null: false t.boolean "time_tracking_limit_to_hours", default: false, null: false t.string "grafana_url", default: "/-/grafana", null: false + t.boolean "login_recaptcha_protection_enabled", default: false, null: false t.string "outbound_local_requests_whitelist", limit: 255, default: [], null: false, array: true t.integer "raw_blob_request_limit", default: 300, null: false t.index ["custom_project_templates_group_id"], name: "index_application_settings_on_custom_project_templates_group_id" -- cgit v1.2.1 From 45c5144e36e73c80e34282dda7b7c1c32a1fc0ea Mon Sep 17 00:00:00 2001 From: Fabio Pitino Date: Mon, 19 Aug 2019 16:29:53 +0200 Subject: Add active_jobs_limit to plans table This is a port from EE changes where we introduce a new limit for Plan model. https://dev.gitlab.org/gitlab/gitlab-ee/merge_requests/1182 --- db/schema.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index ce5fd38129a..7bdc8c5d849 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_08_15_093949) do +ActiveRecord::Schema.define(version: 2019_08_16_151221) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" @@ -2500,6 +2500,7 @@ ActiveRecord::Schema.define(version: 2019_08_15_093949) do t.string "title" t.integer "active_pipelines_limit" t.integer "pipeline_size_limit" + t.integer "active_jobs_limit", default: 0 t.index ["name"], name: "index_plans_on_name" end -- cgit v1.2.1 From 8bcc47ac02e69eb4564238b454ca8286a4126765 Mon Sep 17 00:00:00 2001 From: George Koltsov Date: Wed, 21 Aug 2019 10:13:45 +0000 Subject: Add SortingPreference concern Sorting preference functionality has been extracted from `IssuableCollections` to a new `SortingPreference` concern in order to reuse this functionality in projects (and groups in the future). --- db/schema.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index ce5fd38129a..3f7917654cf 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -3411,6 +3411,7 @@ ActiveRecord::Schema.define(version: 2019_08_15_093949) do t.string "epics_sort" t.integer "roadmap_epics_state" t.string "roadmaps_sort" + t.string "projects_sort", limit: 64 t.index ["user_id"], name: "index_user_preferences_on_user_id", unique: true end -- cgit v1.2.1 From 68ae21d6115172252d8efec2305faa9a965b18b3 Mon Sep 17 00:00:00 2001 From: Sean Carroll Date: Fri, 23 Aug 2019 19:46:02 +0000 Subject: Remove redundant index --- db/schema.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 3f7917654cf..944d23e5365 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -3015,7 +3015,6 @@ ActiveRecord::Schema.define(version: 2019_08_15_093949) do t.datetime_with_timezone "released_at", null: false t.index ["author_id"], name: "index_releases_on_author_id" t.index ["project_id", "tag"], name: "index_releases_on_project_id_and_tag" - t.index ["project_id"], name: "index_releases_on_project_id" end create_table "remote_mirrors", id: :serial, force: :cascade do |t| -- cgit v1.2.1 From ad05e488636ebe05b4985dbf3c7d912fd8d56f49 Mon Sep 17 00:00:00 2001 From: Brett Walker Date: Wed, 20 Feb 2019 17:51:55 -0600 Subject: Add support for using a Camo proxy server User images and videos will get proxied through the Camo server in order to keep malicious sites from collecting the IP address of users. --- db/schema.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 944d23e5365..7e5e96707dc 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -278,6 +278,11 @@ ActiveRecord::Schema.define(version: 2019_08_15_093949) do t.boolean "allow_local_requests_from_system_hooks", default: true, null: false t.bigint "instance_administration_project_id" t.string "snowplow_collector_hostname" + t.boolean "asset_proxy_enabled", default: false, null: false + t.string "asset_proxy_url" + t.text "asset_proxy_whitelist" + t.text "encrypted_asset_proxy_secret_key" + t.string "encrypted_asset_proxy_secret_key_iv" t.index ["custom_project_templates_group_id"], name: "index_application_settings_on_custom_project_templates_group_id" t.index ["file_template_project_id"], name: "index_application_settings_on_file_template_project_id" t.index ["instance_administration_project_id"], name: "index_applicationsettings_on_instance_administration_project_id" -- cgit v1.2.1 From a06410d995e1200c7734b2d50e68506320d13dd0 Mon Sep 17 00:00:00 2001 From: Aishwarya Subramanian Date: Mon, 26 Aug 2019 18:20:18 +0000 Subject: Using before_save method instead of setter Removed unused method for name setter method --- db/schema.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 944d23e5365..36bf2371994 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_08_15_093949) do +ActiveRecord::Schema.define(version: 2019_08_20_163320) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" @@ -3511,6 +3511,8 @@ ActiveRecord::Schema.define(version: 2019_08_15_093949) do t.text "note" t.integer "roadmap_layout", limit: 2 t.integer "bot_type", limit: 2 + t.string "first_name", limit: 255 + t.string "last_name", limit: 255 t.index ["accepted_term_id"], name: "index_users_on_accepted_term_id" t.index ["admin"], name: "index_users_on_admin" t.index ["bot_type"], name: "index_users_on_bot_type" -- cgit v1.2.1 From 3394c6532e4ef4582d806aed8c5285bf462fea3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Etienne=20Baqu=C3=A9?= Date: Thu, 11 Jul 2019 16:41:04 -0400 Subject: Added migration to encrypt token in DeployToken records Added migrations to make token column accepting null values and to add encrypted token column. --- db/schema.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 36bf2371994..f36ee372382 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1121,8 +1121,9 @@ ActiveRecord::Schema.define(version: 2019_08_20_163320) do t.datetime_with_timezone "expires_at", null: false t.datetime_with_timezone "created_at", null: false t.string "name", null: false - t.string "token", null: false + t.string "token" t.string "username" + t.string "token_encrypted" t.index ["token", "expires_at", "id"], name: "index_deploy_tokens_on_token_and_expires_at_and_id", where: "(revoked IS FALSE)" t.index ["token"], name: "index_deploy_tokens_on_token", unique: true end -- cgit v1.2.1 From 64e24d6492f39a4ab7f2202897755afd1704f147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Etienne=20Baqu=C3=A9?= Date: Fri, 19 Jul 2019 14:00:56 -0400 Subject: Added new index to deploy_tokens table --- db/schema.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index f36ee372382..1393737b8b9 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1126,6 +1126,7 @@ ActiveRecord::Schema.define(version: 2019_08_20_163320) do t.string "token_encrypted" t.index ["token", "expires_at", "id"], name: "index_deploy_tokens_on_token_and_expires_at_and_id", where: "(revoked IS FALSE)" t.index ["token"], name: "index_deploy_tokens_on_token", unique: true + t.index ["token_encrypted"], name: "index_deploy_tokens_on_token_encrypted", unique: true end create_table "deployments", id: :serial, force: :cascade do |t| -- cgit v1.2.1 From 2dd6f423b77c82436e3e0b3978d9bda513207b4b Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 26 Aug 2019 19:44:28 -0700 Subject: Add limit: 255 to token_ecnrypted column --- db/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 1393737b8b9..f30dad3d030 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1123,7 +1123,7 @@ ActiveRecord::Schema.define(version: 2019_08_20_163320) do t.string "name", null: false t.string "token" t.string "username" - t.string "token_encrypted" + t.string "token_encrypted", limit: 255 t.index ["token", "expires_at", "id"], name: "index_deploy_tokens_on_token_and_expires_at_and_id", where: "(revoked IS FALSE)" t.index ["token"], name: "index_deploy_tokens_on_token", unique: true t.index ["token_encrypted"], name: "index_deploy_tokens_on_token_encrypted", unique: true -- cgit v1.2.1 From 55d28efa1f1fb0d2ce074ac3ebecf6d4e67aaa90 Mon Sep 17 00:00:00 2001 From: Adam Hegyi Date: Wed, 28 Aug 2019 13:38:50 +0000 Subject: Adding NOT NULL constraint to private_profile This change sets NOT NULL constraint to users.private profile. closes https://gitlab.com/gitlab-org/gitlab-ce/issues/57538 --- db/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index f30dad3d030..6c6c2796b9a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -3499,7 +3499,7 @@ ActiveRecord::Schema.define(version: 2019_08_20_163320) do t.integer "theme_id", limit: 2 t.integer "accepted_term_id" t.string "feed_token" - t.boolean "private_profile", default: false + t.boolean "private_profile", default: false, null: false t.boolean "include_private_contributions" t.string "commit_email" t.boolean "auditor", default: false, null: false -- cgit v1.2.1 From e4fbd94cf5eba0b103bd97627d822f2014dfe474 Mon Sep 17 00:00:00 2001 From: Victor Zagorodny Date: Wed, 28 Aug 2019 14:26:42 +0000 Subject: Update CE files for GSD projects filter A new param with_security_reports was added to GET /groups/:id/projects API and the code to support this logic in GroupProjectsFinder and Project model. Also, a DB index was added to ci_job_artifacts table to speed up the search of security reports artifacts for projects --- db/schema.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 6c6c2796b9a..88a7ff77ab4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_08_20_163320) do +ActiveRecord::Schema.define(version: 2019_08_28_083843) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" @@ -658,6 +658,7 @@ ActiveRecord::Schema.define(version: 2019_08_20_163320) do t.index ["file_store"], name: "index_ci_job_artifacts_on_file_store" t.index ["job_id", "file_type"], name: "index_ci_job_artifacts_on_job_id_and_file_type", unique: true t.index ["project_id"], name: "index_ci_job_artifacts_on_project_id" + t.index ["project_id"], name: "index_ci_job_artifacts_on_project_id_for_security_reports", where: "(file_type = ANY (ARRAY[5, 6, 7, 8]))" end create_table "ci_job_variables", force: :cascade do |t| -- cgit v1.2.1 From 8f6a433c416f8fb052468f4ecf1141afd5e5ef6b Mon Sep 17 00:00:00 2001 From: Felipe Artur Date: Wed, 28 Aug 2019 20:18:40 +0000 Subject: Save board lists collapsed setting Persists if a board list is collapsed for each user. --- db/schema.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 88a7ff77ab4..454ea939a6f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1922,6 +1922,17 @@ ActiveRecord::Schema.define(version: 2019_08_28_083843) do t.datetime "updated_at" end + create_table "list_user_preferences", force: :cascade do |t| + t.bigint "user_id", null: false + t.bigint "list_id", null: false + t.datetime_with_timezone "created_at", null: false + t.datetime_with_timezone "updated_at", null: false + t.boolean "collapsed" + t.index ["list_id"], name: "index_list_user_preferences_on_list_id" + t.index ["user_id", "list_id"], name: "index_list_user_preferences_on_user_id_and_list_id", unique: true + t.index ["user_id"], name: "index_list_user_preferences_on_user_id" + end + create_table "lists", id: :serial, force: :cascade do |t| t.integer "board_id", null: false t.integer "label_id" @@ -3880,6 +3891,8 @@ ActiveRecord::Schema.define(version: 2019_08_28_083843) do add_foreign_key "labels", "projects", name: "fk_7de4989a69", on_delete: :cascade add_foreign_key "lfs_file_locks", "projects", on_delete: :cascade add_foreign_key "lfs_file_locks", "users", on_delete: :cascade + add_foreign_key "list_user_preferences", "lists", on_delete: :cascade + add_foreign_key "list_user_preferences", "users", on_delete: :cascade add_foreign_key "lists", "boards", name: "fk_0d3f677137", on_delete: :cascade add_foreign_key "lists", "labels", name: "fk_7a5553d60f", on_delete: :cascade add_foreign_key "lists", "milestones", on_delete: :cascade -- cgit v1.2.1 From 1dec74808cca3d78c904f645659384b525c72337 Mon Sep 17 00:00:00 2001 From: Thong Kuah Date: Tue, 20 Aug 2019 01:17:28 +1200 Subject: Add index to improve query performance For Environment.deployed_to_cluster --- db/schema.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 454ea939a6f..14029486dfe 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1146,6 +1146,7 @@ ActiveRecord::Schema.define(version: 2019_08_28_083843) do t.integer "status", limit: 2, null: false t.datetime_with_timezone "finished_at" t.integer "cluster_id" + t.index ["cluster_id", "status"], name: "index_deployments_on_cluster_id_and_status" t.index ["cluster_id"], name: "index_deployments_on_cluster_id" t.index ["created_at"], name: "index_deployments_on_created_at" t.index ["deployable_type", "deployable_id"], name: "index_deployments_on_deployable_type_and_deployable_id" -- cgit v1.2.1 From 3ed555f3c980ef7c21efd17cabc06a8037643787 Mon Sep 17 00:00:00 2001 From: Thong Kuah Date: Mon, 26 Aug 2019 21:11:41 +1200 Subject: Remove redundant index Now we have cluster_id, state index, we don't the cluster_id index as well. --- db/schema.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 14029486dfe..54774b0a65b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1147,7 +1147,6 @@ ActiveRecord::Schema.define(version: 2019_08_28_083843) do t.datetime_with_timezone "finished_at" t.integer "cluster_id" t.index ["cluster_id", "status"], name: "index_deployments_on_cluster_id_and_status" - t.index ["cluster_id"], name: "index_deployments_on_cluster_id" t.index ["created_at"], name: "index_deployments_on_created_at" t.index ["deployable_type", "deployable_id"], name: "index_deployments_on_deployable_type_and_deployable_id" t.index ["environment_id", "id"], name: "index_deployments_on_environment_id_and_id" -- cgit v1.2.1 From 69bfe12a7a5e3cecf15c1cd632f4434aa0fbe8eb Mon Sep 17 00:00:00 2001 From: Tiger Date: Fri, 23 Aug 2019 16:05:55 +1000 Subject: Default clusters namespace_per_environment to true --- db/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 13572022235..f1dbe5c322c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -935,7 +935,7 @@ ActiveRecord::Schema.define(version: 2019_08_28_083843) do t.integer "cluster_type", limit: 2, default: 3, null: false t.string "domain" t.boolean "managed", default: true, null: false - t.boolean "namespace_per_environment", default: false, null: false + t.boolean "namespace_per_environment", default: true, null: false t.index ["enabled"], name: "index_clusters_on_enabled" t.index ["user_id"], name: "index_clusters_on_user_id" end -- cgit v1.2.1 From 0f59d73ef2f65aba791b6738a5e705fe1a8da789 Mon Sep 17 00:00:00 2001 From: Felipe Artur Date: Fri, 30 Aug 2019 11:28:20 +0000 Subject: Rename epic column state to state_id Rename epic column state to state_id to be consistent with issues and merge requests --- db/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index f1dbe5c322c..5999a859e77 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1286,11 +1286,11 @@ ActiveRecord::Schema.define(version: 2019_08_28_083843) do t.date "due_date_fixed" t.boolean "start_date_is_fixed" t.boolean "due_date_is_fixed" - t.integer "state", limit: 2, default: 1, null: false t.integer "closed_by_id" t.datetime "closed_at" t.integer "parent_id" t.integer "relative_position" + t.integer "state_id", limit: 2, default: 1, null: false t.index ["assignee_id"], name: "index_epics_on_assignee_id" t.index ["author_id"], name: "index_epics_on_author_id" t.index ["closed_by_id"], name: "index_epics_on_closed_by_id" -- cgit v1.2.1