From edf10c424856ae2651ccd4940a8379eb6bbf2726 Mon Sep 17 00:00:00 2001 From: Alexander Minkin Date: Fri, 22 Sep 2023 23:56:18 +0300 Subject: [PATCH 1/4] Docker: add imagick to dependencies I'm not sure if that's all we need to make it work, but I will solve this issue step by step --- install/automated/docker/base-php-apache.Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/install/automated/docker/base-php-apache.Dockerfile b/install/automated/docker/base-php-apache.Dockerfile index de24d34f..3ead71f0 100644 --- a/install/automated/docker/base-php-apache.Dockerfile +++ b/install/automated/docker/base-php-apache.Dockerfile @@ -18,5 +18,6 @@ RUN apt update; \ yaml \ pdo_mysql \ rdkafka \ + imagick \ && \ rm -rf /var/lib/apt/lists/* \ No newline at end of file From 8483a2d343ad30dad61a908acd98a4605ee4d50a Mon Sep 17 00:00:00 2001 From: Alexander Minkin Date: Sat, 23 Sep 2023 01:10:03 +0300 Subject: [PATCH 2/4] SQL: fix all `support_names`-related migrations This solves some problems in Docker instance --- install/sqls/00002-support-aliases.sql | 8 +++++++- install/sqls/00032-agent-card.sql | 10 ++-------- install/sqls/00037-agent-card-profilefix.sql | 2 -- 3 files changed, 9 insertions(+), 11 deletions(-) delete mode 100644 install/sqls/00037-agent-card-profilefix.sql diff --git a/install/sqls/00002-support-aliases.sql b/install/sqls/00002-support-aliases.sql index b586a1dd..e3d17ca0 100644 --- a/install/sqls/00002-support-aliases.sql +++ b/install/sqls/00002-support-aliases.sql @@ -1 +1,7 @@ -CREATE TABLE `support_names` ( `agent` BIGINT UNSIGNED NOT NULL , `name` VARCHAR(512) NOT NULL , `icon` VARCHAR(1024) NULL DEFAULT NULL , `numerate` BOOLEAN NOT NULL DEFAULT FALSE , PRIMARY KEY (`agent`)) ENGINE = InnoDB; \ No newline at end of file +CREATE TABLE `support_names` ( + `agent` BIGINT UNSIGNED NOT NULL, + `name` VARCHAR(512) NOT NULL, + `icon` VARCHAR(1024) NULL DEFAULT NULL, + `numerate` BOOLEAN NOT NULL DEFAULT FALSE, + PRIMARY KEY (`agent`) +) ENGINE = InnoDB; \ No newline at end of file diff --git a/install/sqls/00032-agent-card.sql b/install/sqls/00032-agent-card.sql index a8354c80..0f82460e 100644 --- a/install/sqls/00032-agent-card.sql +++ b/install/sqls/00032-agent-card.sql @@ -1,14 +1,8 @@ -CREATE TABLE `support_names` ( - `id` bigint(20) UNSIGNED NOT NULL, - `agent` bigint(20) UNSIGNED NOT NULL, - `name` varchar(512) COLLATE utf8mb4_unicode_ci NOT NULL, - `icon` varchar(1024) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `numerate` tinyint(1) NOT NULL DEFAULT 0 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +ALTER TABLE `support_names` ADD `id` bigint(20) UNSIGNED NOT NULL FIRST; ALTER TABLE `support_names` - ADD PRIMARY KEY (`id`); + ADD UNIQUE KEY `id` (`id`); ALTER TABLE `support_names` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; diff --git a/install/sqls/00037-agent-card-profilefix.sql b/install/sqls/00037-agent-card-profilefix.sql deleted file mode 100644 index e7ebc230..00000000 --- a/install/sqls/00037-agent-card-profilefix.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `support_names` - ADD COLUMN `id` bigint(20) NOT NULL AUTO_INCREMENT UNIQUE FIRST; From 75ce995df5200dcda4c57813a709b1d4c4f63c3d Mon Sep 17 00:00:00 2001 From: Alexander Minkin Date: Sat, 23 Sep 2023 01:11:00 +0300 Subject: [PATCH 3/4] Docker: add KAFKA_CFG_NODE_ID to docker-compose --- install/automated/docker/docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/install/automated/docker/docker-compose.yml b/install/automated/docker/docker-compose.yml index cbd697a4..61ee3bac 100644 --- a/install/automated/docker/docker-compose.yml +++ b/install/automated/docker/docker-compose.yml @@ -76,6 +76,7 @@ services: - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092 - KAFKA_BROKER_ID=1 - KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=1@127.0.0.1:9093 + - KAFKA_CFG_NODE_ID=1 phpmyadmin: image: docker.io/phpmyadmin:5 From 5710d131fd49b4b60dbfd72bb9af41d0b818d942 Mon Sep 17 00:00:00 2001 From: Alexander Minkin Date: Sat, 23 Sep 2023 01:18:33 +0300 Subject: [PATCH 4/4] SQL: Reorder migration files The issue was that numbers were duplicating, so I decided to fix them --- install/sqls/{00018-reports.sql => 00019-reports.sql} | 0 .../{00019-block-in-support.sql => 00020-block-in-support.sql} | 0 install/sqls/{00020-image-sizes.sql => 00021-image-sizes.sql} | 0 .../{00021-video-processing.sql => 00022-video-processing.sql} | 0 install/sqls/{00022-group-alerts.sql => 00023-group-alerts.sql} | 0 install/sqls/{00023-email-change.sql => 00024-email-change.sql} | 0 .../{00024-main-page-setting.sql => 00025-main-page-setting.sql} | 0 .../{00025-toncoin-fetching.sql => 00026-toncoin-fetching.sql} | 0 .../{00026-better-birthdays.sql => 00027-better-birthdays.sql} | 0 install/sqls/{00027-rating.sql => 00028-rating.sql} | 0 install/sqls/{00028-deactivation.sql => 00029-deactivation.sql} | 0 .../sqls/{00029-hashtag-search.sql => 00030-hashtag-search.sql} | 0 install/sqls/{00030-apps.sql => 00031-apps.sql} | 0 .../sqls/{00031-ban-page-until.sql => 00032-ban-page-until.sql} | 0 install/sqls/{00032-agent-card.sql => 00033-agent-card.sql} | 0 install/sqls/{00032-banned-urls.sql => 00034-banned-urls.sql} | 0 .../sqls/{00032-better-reports.sql => 00035-better-reports.sql} | 0 .../{00033-shortcode-aliases.sql => 00036-shortcode-aliases.sql} | 0 install/sqls/{00034-polls.sql => 00037-polls.sql} | 0 install/sqls/{00035-backdrops.sql => 00038-backdrops.sql} | 0 install/sqls/{00036-platforms.sql => 00039-platforms.sql} | 0 .../{00038-noSpam-templates.sql => 00040-noSpam-templates.sql} | 0 22 files changed, 0 insertions(+), 0 deletions(-) rename install/sqls/{00018-reports.sql => 00019-reports.sql} (100%) rename install/sqls/{00019-block-in-support.sql => 00020-block-in-support.sql} (100%) rename install/sqls/{00020-image-sizes.sql => 00021-image-sizes.sql} (100%) rename install/sqls/{00021-video-processing.sql => 00022-video-processing.sql} (100%) rename install/sqls/{00022-group-alerts.sql => 00023-group-alerts.sql} (100%) rename install/sqls/{00023-email-change.sql => 00024-email-change.sql} (100%) rename install/sqls/{00024-main-page-setting.sql => 00025-main-page-setting.sql} (100%) rename install/sqls/{00025-toncoin-fetching.sql => 00026-toncoin-fetching.sql} (100%) rename install/sqls/{00026-better-birthdays.sql => 00027-better-birthdays.sql} (100%) rename install/sqls/{00027-rating.sql => 00028-rating.sql} (100%) rename install/sqls/{00028-deactivation.sql => 00029-deactivation.sql} (100%) rename install/sqls/{00029-hashtag-search.sql => 00030-hashtag-search.sql} (100%) rename install/sqls/{00030-apps.sql => 00031-apps.sql} (100%) rename install/sqls/{00031-ban-page-until.sql => 00032-ban-page-until.sql} (100%) rename install/sqls/{00032-agent-card.sql => 00033-agent-card.sql} (100%) rename install/sqls/{00032-banned-urls.sql => 00034-banned-urls.sql} (100%) rename install/sqls/{00032-better-reports.sql => 00035-better-reports.sql} (100%) rename install/sqls/{00033-shortcode-aliases.sql => 00036-shortcode-aliases.sql} (100%) rename install/sqls/{00034-polls.sql => 00037-polls.sql} (100%) rename install/sqls/{00035-backdrops.sql => 00038-backdrops.sql} (100%) rename install/sqls/{00036-platforms.sql => 00039-platforms.sql} (100%) rename install/sqls/{00038-noSpam-templates.sql => 00040-noSpam-templates.sql} (100%) diff --git a/install/sqls/00018-reports.sql b/install/sqls/00019-reports.sql similarity index 100% rename from install/sqls/00018-reports.sql rename to install/sqls/00019-reports.sql diff --git a/install/sqls/00019-block-in-support.sql b/install/sqls/00020-block-in-support.sql similarity index 100% rename from install/sqls/00019-block-in-support.sql rename to install/sqls/00020-block-in-support.sql diff --git a/install/sqls/00020-image-sizes.sql b/install/sqls/00021-image-sizes.sql similarity index 100% rename from install/sqls/00020-image-sizes.sql rename to install/sqls/00021-image-sizes.sql diff --git a/install/sqls/00021-video-processing.sql b/install/sqls/00022-video-processing.sql similarity index 100% rename from install/sqls/00021-video-processing.sql rename to install/sqls/00022-video-processing.sql diff --git a/install/sqls/00022-group-alerts.sql b/install/sqls/00023-group-alerts.sql similarity index 100% rename from install/sqls/00022-group-alerts.sql rename to install/sqls/00023-group-alerts.sql diff --git a/install/sqls/00023-email-change.sql b/install/sqls/00024-email-change.sql similarity index 100% rename from install/sqls/00023-email-change.sql rename to install/sqls/00024-email-change.sql diff --git a/install/sqls/00024-main-page-setting.sql b/install/sqls/00025-main-page-setting.sql similarity index 100% rename from install/sqls/00024-main-page-setting.sql rename to install/sqls/00025-main-page-setting.sql diff --git a/install/sqls/00025-toncoin-fetching.sql b/install/sqls/00026-toncoin-fetching.sql similarity index 100% rename from install/sqls/00025-toncoin-fetching.sql rename to install/sqls/00026-toncoin-fetching.sql diff --git a/install/sqls/00026-better-birthdays.sql b/install/sqls/00027-better-birthdays.sql similarity index 100% rename from install/sqls/00026-better-birthdays.sql rename to install/sqls/00027-better-birthdays.sql diff --git a/install/sqls/00027-rating.sql b/install/sqls/00028-rating.sql similarity index 100% rename from install/sqls/00027-rating.sql rename to install/sqls/00028-rating.sql diff --git a/install/sqls/00028-deactivation.sql b/install/sqls/00029-deactivation.sql similarity index 100% rename from install/sqls/00028-deactivation.sql rename to install/sqls/00029-deactivation.sql diff --git a/install/sqls/00029-hashtag-search.sql b/install/sqls/00030-hashtag-search.sql similarity index 100% rename from install/sqls/00029-hashtag-search.sql rename to install/sqls/00030-hashtag-search.sql diff --git a/install/sqls/00030-apps.sql b/install/sqls/00031-apps.sql similarity index 100% rename from install/sqls/00030-apps.sql rename to install/sqls/00031-apps.sql diff --git a/install/sqls/00031-ban-page-until.sql b/install/sqls/00032-ban-page-until.sql similarity index 100% rename from install/sqls/00031-ban-page-until.sql rename to install/sqls/00032-ban-page-until.sql diff --git a/install/sqls/00032-agent-card.sql b/install/sqls/00033-agent-card.sql similarity index 100% rename from install/sqls/00032-agent-card.sql rename to install/sqls/00033-agent-card.sql diff --git a/install/sqls/00032-banned-urls.sql b/install/sqls/00034-banned-urls.sql similarity index 100% rename from install/sqls/00032-banned-urls.sql rename to install/sqls/00034-banned-urls.sql diff --git a/install/sqls/00032-better-reports.sql b/install/sqls/00035-better-reports.sql similarity index 100% rename from install/sqls/00032-better-reports.sql rename to install/sqls/00035-better-reports.sql diff --git a/install/sqls/00033-shortcode-aliases.sql b/install/sqls/00036-shortcode-aliases.sql similarity index 100% rename from install/sqls/00033-shortcode-aliases.sql rename to install/sqls/00036-shortcode-aliases.sql diff --git a/install/sqls/00034-polls.sql b/install/sqls/00037-polls.sql similarity index 100% rename from install/sqls/00034-polls.sql rename to install/sqls/00037-polls.sql diff --git a/install/sqls/00035-backdrops.sql b/install/sqls/00038-backdrops.sql similarity index 100% rename from install/sqls/00035-backdrops.sql rename to install/sqls/00038-backdrops.sql diff --git a/install/sqls/00036-platforms.sql b/install/sqls/00039-platforms.sql similarity index 100% rename from install/sqls/00036-platforms.sql rename to install/sqls/00039-platforms.sql diff --git a/install/sqls/00038-noSpam-templates.sql b/install/sqls/00040-noSpam-templates.sql similarity index 100% rename from install/sqls/00038-noSpam-templates.sql rename to install/sqls/00040-noSpam-templates.sql