From 3f3480dbcb88f34f21b0f254a317ddf2633a2673 Mon Sep 17 00:00:00 2001 From: lauren_tb Date: Tue, 17 Sep 2024 14:18:28 +0100 Subject: [PATCH 1/3] added default authenication plugin to docker compose --- db/schema.rb | 24 ++++++++++++------------ docker-compose.yml | 1 + 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index ff940d8d..edacdf8c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # It's strongly recommended that you check this file into your version control system. ActiveRecord::Schema[7.0].define(version: 2022_11_22_153858) do - create_table "audits", charset: "utf8", force: :cascade do |t| + create_table "audits", charset: "utf8mb3", force: :cascade do |t| t.integer "auditable_id" t.string "auditable_type" t.integer "associated_id" @@ -33,7 +33,7 @@ t.index ["user_id", "user_type"], name: "user_index" end - create_table "certificates", charset: "utf8", force: :cascade do |t| + create_table "certificates", charset: "utf8mb3", force: :cascade do |t| t.string "name", null: false t.text "description", null: false t.date "expiry_date" @@ -48,7 +48,7 @@ t.text "contents" end - create_table "clients", charset: "utf8", force: :cascade do |t| + create_table "clients", charset: "utf8mb3", force: :cascade do |t| t.string "shared_secret", null: false t.string "ip_range", null: false t.bigint "site_id", null: false @@ -58,14 +58,14 @@ t.index ["site_id"], name: "index_clients_on_site_id" end - create_table "csv_import_results", charset: "utf8", force: :cascade do |t| + create_table "csv_import_results", charset: "utf8mb3", force: :cascade do |t| t.text "import_errors" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.datetime "completed_at" end - create_table "delayed_jobs", charset: "utf8", force: :cascade do |t| + create_table "delayed_jobs", charset: "utf8mb3", force: :cascade do |t| t.integer "priority", default: 0, null: false t.integer "attempts", default: 0, null: false t.text "handler", size: :long, null: false @@ -80,7 +80,7 @@ t.index ["priority", "run_at"], name: "delayed_jobs_priority" end - create_table "mac_authentication_bypasses", charset: "utf8", force: :cascade do |t| + create_table "mac_authentication_bypasses", charset: "utf8mb3", force: :cascade do |t| t.string "address", null: false t.string "name" t.text "description" @@ -91,7 +91,7 @@ t.index ["site_id"], name: "index_mac_authentication_bypasses_on_site_id" end - create_table "policies", charset: "utf8", force: :cascade do |t| + create_table "policies", charset: "utf8mb3", force: :cascade do |t| t.string "name", null: false t.text "description", null: false t.timestamp "created_at", default: -> { "CURRENT_TIMESTAMP" }, null: false @@ -102,7 +102,7 @@ t.string "action", default: "accept" end - create_table "responses", charset: "utf8", force: :cascade do |t| + create_table "responses", charset: "utf8mb3", force: :cascade do |t| t.string "response_attribute", null: false t.text "value", null: false t.timestamp "created_at", default: -> { "CURRENT_TIMESTAMP" }, null: false @@ -113,7 +113,7 @@ t.index ["policy_id"], name: "index_responses_on_policy_id" end - create_table "rules", charset: "utf8", force: :cascade do |t| + create_table "rules", charset: "utf8mb3", force: :cascade do |t| t.string "operator", null: false t.text "value", null: false t.bigint "policy_id", null: false @@ -123,7 +123,7 @@ t.index ["policy_id"], name: "index_rules_on_policy_id" end - create_table "site_policies", charset: "utf8", force: :cascade do |t| + create_table "site_policies", charset: "utf8mb3", force: :cascade do |t| t.bigint "site_id" t.bigint "policy_id" t.integer "priority" @@ -131,7 +131,7 @@ t.timestamp "updated_at", default: -> { "CURRENT_TIMESTAMP" }, null: false end - create_table "sites", charset: "utf8", force: :cascade do |t| + create_table "sites", charset: "utf8mb3", force: :cascade do |t| t.string "name", null: false t.timestamp "created_at", default: -> { "CURRENT_TIMESTAMP" }, null: false t.timestamp "updated_at", default: -> { "CURRENT_TIMESTAMP" }, null: false @@ -140,7 +140,7 @@ t.index ["name"], name: "index_sites_on_name" end - create_table "users", charset: "utf8", force: :cascade do |t| + create_table "users", charset: "utf8mb3", force: :cascade do |t| t.string "provider" t.string "uid" t.boolean "editor", default: false diff --git a/docker-compose.yml b/docker-compose.yml index c0b14b9a..18949ac4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,6 +13,7 @@ services: - datavolume:/var/lib/mysql networks: - adminnet + command: "--default-authentication-plugin=caching_sha2_password" app: build: From 9c3d690e6e994294841b686126003852f3f28b63 Mon Sep 17 00:00:00 2001 From: lauren_tb Date: Tue, 17 Sep 2024 14:22:16 +0100 Subject: [PATCH 2/3] amended charset back --- db/schema.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index edacdf8c..cdbd5cbd 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # It's strongly recommended that you check this file into your version control system. ActiveRecord::Schema[7.0].define(version: 2022_11_22_153858) do - create_table "audits", charset: "utf8mb3", force: :cascade do |t| + create_table "audits", charset: "utf8", force: :cascade do |t| t.integer "auditable_id" t.string "auditable_type" t.integer "associated_id" @@ -33,7 +33,7 @@ t.index ["user_id", "user_type"], name: "user_index" end - create_table "certificates", charset: "utf8mb3", force: :cascade do |t| + create_table "certificates", charset: "utf8", force: :cascade do |t| t.string "name", null: false t.text "description", null: false t.date "expiry_date" @@ -48,7 +48,7 @@ t.text "contents" end - create_table "clients", charset: "utf8mb3", force: :cascade do |t| + create_table "clients", charset: "utf8", force: :cascade do |t| t.string "shared_secret", null: false t.string "ip_range", null: false t.bigint "site_id", null: false @@ -65,7 +65,7 @@ t.datetime "completed_at" end - create_table "delayed_jobs", charset: "utf8mb3", force: :cascade do |t| + create_table "delayed_jobs", charset: "utf8", force: :cascade do |t| t.integer "priority", default: 0, null: false t.integer "attempts", default: 0, null: false t.text "handler", size: :long, null: false @@ -80,7 +80,7 @@ t.index ["priority", "run_at"], name: "delayed_jobs_priority" end - create_table "mac_authentication_bypasses", charset: "utf8mb3", force: :cascade do |t| + create_table "mac_authentication_bypasses", charset: "utf8", force: :cascade do |t| t.string "address", null: false t.string "name" t.text "description" @@ -91,7 +91,7 @@ t.index ["site_id"], name: "index_mac_authentication_bypasses_on_site_id" end - create_table "policies", charset: "utf8mb3", force: :cascade do |t| + create_table "policies", charset: "utf8", force: :cascade do |t| t.string "name", null: false t.text "description", null: false t.timestamp "created_at", default: -> { "CURRENT_TIMESTAMP" }, null: false @@ -102,7 +102,7 @@ t.string "action", default: "accept" end - create_table "responses", charset: "utf8mb3", force: :cascade do |t| + create_table "responses", charset: "utf8", force: :cascade do |t| t.string "response_attribute", null: false t.text "value", null: false t.timestamp "created_at", default: -> { "CURRENT_TIMESTAMP" }, null: false @@ -113,7 +113,7 @@ t.index ["policy_id"], name: "index_responses_on_policy_id" end - create_table "rules", charset: "utf8mb3", force: :cascade do |t| + create_table "rules", charset: "utf8", force: :cascade do |t| t.string "operator", null: false t.text "value", null: false t.bigint "policy_id", null: false @@ -123,7 +123,7 @@ t.index ["policy_id"], name: "index_rules_on_policy_id" end - create_table "site_policies", charset: "utf8mb3", force: :cascade do |t| + create_table "site_policies", charset: "utf8", force: :cascade do |t| t.bigint "site_id" t.bigint "policy_id" t.integer "priority" @@ -131,7 +131,7 @@ t.timestamp "updated_at", default: -> { "CURRENT_TIMESTAMP" }, null: false end - create_table "sites", charset: "utf8mb3", force: :cascade do |t| + create_table "sites", charset: "utf8", force: :cascade do |t| t.string "name", null: false t.timestamp "created_at", default: -> { "CURRENT_TIMESTAMP" }, null: false t.timestamp "updated_at", default: -> { "CURRENT_TIMESTAMP" }, null: false @@ -140,7 +140,7 @@ t.index ["name"], name: "index_sites_on_name" end - create_table "users", charset: "utf8mb3", force: :cascade do |t| + create_table "users", charset: "utf8", force: :cascade do |t| t.string "provider" t.string "uid" t.boolean "editor", default: false From 474e0df95f0d79f5ef0e39170fa611c29bb69ac8 Mon Sep 17 00:00:00 2001 From: lauren_tb Date: Tue, 17 Sep 2024 14:22:42 +0100 Subject: [PATCH 3/3] amended charset back --- db/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/schema.rb b/db/schema.rb index cdbd5cbd..ff940d8d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -58,7 +58,7 @@ t.index ["site_id"], name: "index_clients_on_site_id" end - create_table "csv_import_results", charset: "utf8mb3", force: :cascade do |t| + create_table "csv_import_results", charset: "utf8", force: :cascade do |t| t.text "import_errors" t.datetime "created_at", null: false t.datetime "updated_at", null: false