mstilkerich/rcmcarddav

Плагин carddav_migrations через mysql

sys-team-59 opened this issue · 13 comments

roundcube версия 1.6.
carddav версия 4.4.6
Чистая установка.
Инициализируем таблицы в базу данных mysql (пример команда на postgreq)
cat dbmigrations/INIT-currentschema/postgres.sql | sed -r -e 's/TABLE_PREFIX//g' | psql -U roundcube -h 127.0.0.1 -W roundcubemail

Какую команду нужно ввести на mysql ?

Пробовал вводить команду cat dbmigrations/INIT-currentschema/mysql.sql выдаёт ошибку :

  • table to store the configured address books
    CREATE TABLE IF NOT EXISTS TABLE_PREFIXcarddav_addressbooks (
    id INT UNSIGNED NOT NULL AUTO_INCREMENT,
    name TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
    username VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
    password TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
    url VARCHAR(4095) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
    active TINYINT UNSIGNED NOT NULL DEFAULT 1,
    user_id INT(10) UNSIGNED NOT NULL,
    last_updated BIGINT NOT NULL DEFAULT 0, -- time stamp (seconds since epoch) of the last update of the local database
    refresh_time INT NOT NULL DEFAULT 3600, -- time span (seconds) after that the local database will be refreshed, default 1h
    sync_token TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, -- sync-token the server sent us for the last sync

      presetname VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin, -- presetname
      use_categories INT NOT NULL DEFAULT '0',
    
      PRIMARY KEY(id),
      KEY `user_id` (`user_id`) USING BTREE,
      FOREIGN KEY (user_id) REFERENCES TABLE_PREFIXusers(user_id) ON DELETE CASCADE ON UPDATE CASCADE
    

) ROW_FORMAT=DYNAMIC ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;

Помогите как решить данный вопрос

Hello,

please write your comments in English.

You do not have to initialize the tables yourself, rcmcarddav will do it automatically when you log into roundcube. Please see the INSTALL instructions.

Also I would suggest to use the latest v5 release.

I will be grateful to you if you can help. Carddav v 5 cannot be installed; we settled on version 4.4.6, php version 7.3. Maria db base. How can I manually install the carddav plugin and add it to PHP ini?

Инструкция для postgress. База установлена Maria DB
Установка плагина Addressbook с поддержкой Carddav
Переходим по следующему пути:

cd /var/www/roundcube/plugins
Скачиваем плагин:

wget wget https://github.com/mstilkerich/rcmcarddav/releases/download/v4.4.6/carddav-v4.4.6.tar.gz
Распаковываем:

tar -xzvf carddav-v4.4.6.tar.gz
Переходим в каталог с плагином:

cd carddav
Выполняем необходимые команды с Composer:

curl -sS https://getcomposer.org/installer | php
php composer.phar update && php composer.phar install
Копируем конфигурационный файл:

cp config.inc.php.dist config.inc.php
Инициализируем таблицы в базу данных Postgres

Переходим в каталог

/var/www/roundcube/plugins/carddav
Запускаем процедуру инициализации:

cat dbmigrations/INIT-currentschema/postgres.sql | sed -r -e 's/TABLE_PREFIX//g' | psql -U roundcube -h 127.0.0.1 -W roundcubemail

The steps you describe are not following the installation instructions.

When you install via tarball, there is no need to run composer. Also, as I said before, you do not have to initialize the database tables manually, and doing so will make rcmcarddav fail.

So you need to:

  1. Drop the carddav* tables from postgres that you created manually
  2. Add the carddav plugin to the plugins list in roundcube/config/config.inc.php
  3. Log into roundcube, and rcmcarddav should initialize the database tables on first login

Добрый день! Благодарю за помощь очень признателен вам. как вы и написали добавил в список roundcube/config/config.inc.php. Плагин Carddav. Что то ещё нужно до настроить как Администратору адресную книгу чтобы сотрудники могли добавлять свои адресные книги удалять ? Нажал о программе установленные дополнения carddav появился возле источник требует загрузить (Что именно нужно загрузить) ? Буду вам признателен за помощь.

Cardav
@mstilkerich

There is nothing you need to configure if your users add their addressbook themselves. Roundcube users can do this in the roundcube settings, where you will find a "carddav" entry.

If there is a central addressbook service that is shared by all of your employees, and the passwords are the same as for the IMAP server (or, you use Kerberos or OAUTH2 with a common identity server), you can as administrator configure pre-configure the addressbooks so the users will automatically have them available. This is described in detail in ADMIN-SETTINGS.md

Добрый день! Столкнулся с ещё одной проблемой при добавления Адресной книги. Прописывал название адресной книги, имя пользователя и пароль URL. При сохранении настроек выдаёт ошибку could not determine the addressbook home.
Правильно я понимаю что основные настройки нужно прописывать в /var/www/roundcube/plugins/carddav/config.inc.php или в carddav.php Неоднократно прочитал инструкцию вот этот момент только не понятен
Добавления Адресной книги Carddav
photo_2024-02-19_08-49-18

Буду вам признателен что ещё я не так делаю по настройке @mstilkerich

Please enable debug logging in plugins/carddav/config.inc.php for both log settings, try to create add an addressbook and then provide the logfiles carddav.log and carddav_http.log.

Without any information on your carddav setup I cannot help.

Добрый день! Прикладываю вам log carrdav_http_log . Я так понимаю мне нужно открыть 443 порт ?
carrddav_http_log
@mstilkerich

Hello,

yes, if your carddav service runs on port 443 it needs to be open for the server running roundcube.

Also I think the next problem you will run into is that your SSL certificate must match the hostname of the carddav service. For web.local I don't expect you to have a certificate from a public CA.

Тогда как перенаправить на 80 порт чтобы carddav работал ? по умолчанию 443 порт закрыли. В конфигурационном файле carddav php не указано на каком порту и где изменить можно ? @mstilkerich

You can specify the port as part of the URL as usual if it is not the default port. Default for http is port 80, for https 443. If your server runs on port 80, I guess https is not correct so correctly specify the URL starting with http:// and port 80 will be used. For HTTP you must explicitly state http://, if you omit the protocol from the URL https is assumed as default.

Спасибо вам огромное за помощь буду разбираться. Очень помогли разобраться с Carddav как и что надо настраивать. Очень благодарен за помощь! @mstilkerich