Roundcube Installation issues

Je suppose
image

Mais pour l’installer, avec la commande composer ou juste en téléchargeant le dépôt github ??

Et aussi comment le choisir pour tous les utilisateurs ??

Là il n’y a que elastic pour le moment

yunohost app shell roundcube
roundcube@yuno:~/skins$ ls
elastic

Il faut le récupérer sur le lien donné au-dessus.

Ok, je ne sais pas vraiment comment ça a pu se faire… Tout cela est sur nouvelle instance ou tous les utilisateurs n’ont pas encore tous été ajoutés à Roundcube… Il n’y en a que 2 de test…

En tous les cas, j’ai téléchargé avec l’user le dossier avec un wget, je l’ai activé sur un utilisateur depuis ses préférences (il faut tout même choisir son thème dans ses paramètres)… Un autre utilisateur à l’ancien thème.
J’ai ensuite mis à jour roundcube…
Je ne peux pas vraiment me rendre compte car les comptes sont déjà dans le LDAP donc pas besoin de connexion,ils y arrivent directement.
Mais ce qui me rassure c’est les permissions qui cette fois semblent justes

ls -l /var/www/roundcube/
total 3268
drwxrwx---  2 roundcube www-data    4096 May 19 10:20 bin
-rw-rw----  1 roundcube www-data  213791 May 19 10:20 CHANGELOG.md
-rw-r-----  1 roundcube www-data    1250 Jun  7 18:22 composer.json
-rw-rw----  1 roundcube www-data    1086 May 19 10:20 composer.json-dist
-rw-r-----  1 roundcube www-data  139340 Jun  7 18:22 composer.lock
-rwxr-xr-x  1 root      root     2834111 Jun  7 18:21 composer.phar
drwxrwx---  2 roundcube www-data    4096 Jun  7 18:22 config
-rw-rw----  1 roundcube www-data   11201 May 19 10:20 index.php
-rw-rw----  1 roundcube www-data   12661 May 19 10:20 INSTALL
drwxrwx---  3 roundcube www-data    4096 May 19 10:20 installer
-rw-rw----  1 roundcube www-data    3973 May 19 10:20 jsdeps.json
-rw-rw----  1 roundcube www-data   35147 May 19 10:20 LICENSE
drwxrwx---  2 roundcube www-data    4096 Jun  7 18:22 logs
-rw-rw----  1 roundcube www-data    4526 May 19 10:20 Makefile
drwxrwx--- 40 roundcube www-data    4096 May 19 10:20 plugins
drwxrwx---  8 roundcube www-data    4096 May 19 10:20 program
drwxrwx---  3 roundcube www-data    4096 May 19 10:20 public_html
-rw-rw----  1 roundcube www-data    3853 May 19 10:20 README.md
-rw-rw----  1 roundcube www-data     967 May 19 10:20 SECURITY.md
drwxrwx---  4 roundcube www-data    4096 May 19 10:20 skins
drwxrwx---  7 roundcube www-data    4096 May 19 10:20 SQL
drwxrwx---  3 roundcube www-data    4096 May 19 10:20 temp
drwxrwx---  7 roundcube www-data    4096 May 19 10:20 tests
-rw-rw----  1 roundcube www-data    4657 May 19 10:20 UPGRADING
drwxr-x--- 25 roundcube www-data    4096 Jun  7 18:22 vendor

Ensuite, pour l’user avec ce nouveau thème, très beau, au début, il y avait une erreur ! je devais supprimer les données et cookies du site avant je pense et ça c’est rétabli, pour l’autre user aussi le thème par défaut fonctionne.
Pour les nouveaux utilisateurs on verra si ils n’ont pas une page horrible de login !!
On attends de migrer leur mails avant…

J’ai essayé avec un nouvel utilisateur… ça fonctionne même sans ce thème (avec celui par défaut)

Je pense de plus en plus à cette histoire de permissions, il ne devrait y avoir que que composer.phar avec des permissions root:

very cool, thanx for that! working here now.

quick fix

cd /var/www/roundcube
chown roundcube:www-data -R .
su -s /bin/bash - roundcube

composer install, first line - rest optional

COMPOSER_HOME=./.composer php8.1 composer.phar install
COMPOSER_HOME=./.composer php8.1 composer.phar update
COMPOSER_HOME=./.composer php8.1 composer.phar update php8.1 composer.phar update --no-dev

theme install

COMPOSER_HOME=./.composer php8.1 composer.phar require seb1k/elastic2022:dev-main
chmod 750 config/config.inc.php
nano config/config.inc.php
$config[‘skin’] = ‘elastic2022’;

2 Likes

Hello @tmp501

Thank you for this fix, but I have some problems with it.

it seems that you have root access to do this. But I don’t have a root password, until now I’ve always worked with sudo.

Are you working as root?
How do I find my root password?

I’m asking obvious questions but I’m still a beginner in system administration.

should be your user name if you did the install.
yunohost web interface → users → groups & permissions
look at the users listed in the admin section

Hello, you don’t really need root password, when you are connected with your user, he is in the group admins and have sudo permissions, to be connexted with root just do

$ sudo -i

I am not sure is a good idea change all permissions like this, what will happens with upgrade ? I think composer.phar must keep with owners root:root, but thanks for the edition of the config.inc.php. The user root can edit this file without changing the permissions !
Also you can now use

yunohost app shell roundcube

in place of

su -s /bin/bash - roundcube
1 Like

Perhaps you should better try a hook

Something like

#!/bin/bash
if [ "$YNH_APP_ID" == "roundcube" ] ; then
        source /usr/share/yunohost/helpers
        ynh_write_var_in_file --file=/var/www/roundcube/config/config.inc.php --key=$config['skin'] --value='elastic2022'
fi

The file you are editing have a checksum on the settings, and next upgrade will alert you

Changing the theme fixed the issue.
I don’t know why the ownership of some files is wrong and about composer.phar, what should the ownership be.
When trying to change the theme from preferences of the app to elastic it breaks. So I had to reinstall and redo the changes.
What’s wrong with the elastic theme?
Is it possible to add the choice of the theme in the install script?

Well I just have done like this

# yunohost app shell roundcube
~$ cd skins
~/skins$ wget https://github.com/seb1k/Elastic2022/archive/refs/heads/main.zip
~/skins$ unzip main.zip
~/skins$ rm main.zip

The folder unziped is named Elastic2022-main, I can rename it

~/skins$ mv Elastic2022-main elastic2022
~/skins$ exit

Now I am tryng a hook to chnage the default theme in /etc/yunohost/hooks.d/80-rouncube_customhook

touch etc/yunohost/hooks.d/80-rouncube_customhook
nano etc/yunohost/hooks.d/80-rouncube_customhook

and I put this

#!/bin/bash
source /usr/share/yunohost/helpers
app=$YNH_APP_INSTANCE_NAME

if [ "$YNH_APP_ID" == "roundcube" ] ; then
        source /usr/share/yunohost/helpers
        ynh_write_var_in_file --file=/var/www/roundcube/config/config.inc.php --key=$config['skin'] --value='elastic2022'
fi
1 Like

It doesn’t work !

Warning: /usr/share/yunohost/helpers: line 9: XTRACE_ENABLE: readonly variable
Error: Could not run script: /etc/yunohost/hooks.d/post_app_upgrade/80-roundcube_customhook

Error: Could not run script: /etc/yunohost/hooks.d/post_app_upgrade/80-roundcube_customhook

Because the file is on read only in th install script there is a chmod 400

The installation issues were pointed out the day that the ynh ver 1.6.7~ynh1 was released (thank you, rodinux)
For me personally, I could not properly:
Install 1.6.7.
Upgrade to 1.6.7
uninstall 1.6.7 (how does this even break?)
uninstalling caused php 8.1 to stay incorrectly configured / broken, requiring an apt get update + apt get upgrade, or apt --fix-broken install

Changing the theme? I ain’t doin’ all that. Nextcloud has an web email interface that isn’t broken, albeit slower? Works for me!
It looks like ericgaspar (my beloved) is presently working on something roundcube. Is it a fix? He doesn’t fill out his pull requests, so I don’t know, but it looks promising.

My solution was just to use yunohost’s automatic backup feature when upgrading and revert back to 1.6.6~ynh2 (which requires uninstalling, waiting for it to fail, ssh-ing and doing apt --fix-broken install before restoring roundcube), and wait for a proper fix. 1.6.7 is just an xss and command injection vulnerability fix :man_shrugging:.

Thank you @tmp501 and @rodinux !

I’ve restored the correct rights to composer.json with command:

chown roundcube:www-data /var/www/roundcube/composer.json

Then I followed @tmp501’s advices
Roundcube is fixed

1 Like

just want to point out that my method of installing the skin will error in settings/filter

looks like new skins need some kind of folder structure under templates…go figure. still playing around. still no easy task to get identy_switch running.

automatic_addressbook which is installed by default seems outdated - 8 years. seems to be broken.
default install by ynh → sblaisot/automatic_addressbook
this one seems to be the new default → projectmyst/automatic_addressbook

i dont see my nextcloud contacts showing up. not a problem. but all those plugin seem to create a mess… might prefer a unmodified vanilla install more and go from there.

edit: current temp theme fix


COMPOSER_HOME=./.composer php8.1 composer.phar require seb1k/elastic2022:dev-main
chmod 750 config/config.inc.php
nano config/config.inc.php
	$config['skin'] = 'elastic2022';
cp plugins/managesieve/skins/elastic plugins/managesieve/skins/elastic2022 -r
1 Like

Can you propose a PR for the fixes? Or add an option in the install for choosing the theme?

1 Like