URL Change for Nextcloud (or any other application)

,

My YunoHost configuration

Hardware: X64 VM on My Proxmox server
Internet access: ethernet at home
YunoHost version:
yunohost:
repo: stable
version: 3.4.2.4
yunohost-admin:
repo: stable
version: 3.4.2
moulinette:
repo: stable
version: 3.4.2
ssowat:
repo: stable
version: 3.4.2
Have you personalized your yunohost with some specifics configurations or do you use only the yunohost cli/webadmin tool ? basic

Description of my problem

In 2017, I installed my yunohost server with 2 domains:

  • domain1.tld
  • domain2.tld
    Recently, I added 2 sub-domains:
  • sdom.domain1.tld
  • sdom.domain2.tld
    Nextcloud installed on domain1.tld and is accessible with url: https://domain1.tld/nextcloud
    I would like to change this URL, and transfer it to a subdomain: https://sdom.domain1.tld/nextcloud
    I found some explanations about how to do that. I tried with applications I could easily uninstall and reinstall.
    With phpmyadmin:
    I moved the file phpmyadmin.conf from /etc/nginx/conf.d/domain1.tld to /etc/nginx/conf.d/sdom.domain1.tld
    Then, I edited the file /etc/yunohost/apps/phpmyadmin/settings.yml, and replaced the string domain1.tld with sdom.domain1.tld, and then restarted the server.
    It did not work.
    It seems I missed a step…
    Who has an idea about what this step could be…

I need to do this, because my HaProxy does not handle properly the redirection with names beginning directly by the domain name…

You are changing the wrong app. You need to change nextcloud.conf from /etc/nginx/conf.d/domain1.tld to /etc/nginx/conf.d/sdom.domain1.tld

And then edit the domain name in the /var/www/nextcloud/config_install.json from domain1.tld to sdom.domain1.tld

Hello @kanhu
Thank you for your reply.

I’m not changing the wrong app at all.

As long as I won’t be able to properly migrate an app to a différent domain, I won’t touch Nextcloud.
I want to be sure that I’m able to change an app’s URL before migrating Nextcloud.

As explained, all the applications I tried to migrate, were not working properly once migrated.
It seems there is one more step to achieve before having a functionnal migrated application.
I’d like to identify this additional step.

Can you help ?

You have to change the domain in /var/www/nextcloud/config_install.json

@kanhu

I won’t touch Nextcloud before being able to migrate an application from a domain to a subdomain…

For each app you want to move, first check if the “Change URL” feature in available in the panel admin for each app.
If so, use that feature.

If not, Nextcloud doesn’t have it yet, you should first make a backup of each app. Then the part you missed is probably to regenerate the configuration of the SSO. Changing the config in /etc/yunohost/apps/APP/settings.yml is not enough, to make those modification effective, you have to use that command:

sudo yunohost app ssowatconf

Hello @Maniack_Crudelis

Thank you for your reply.
My yunohost is behind a haproxy which handles let’s encrypt certificates.
On Yunohost, there are only self signed certificates.

However, I’ve tried mo move some applications from a domain to a subdomain. However, the first visible issue, can be seen just by moving you mouse over the application on the dashboard. It then display, the previous URL, which is wrong of course.

Where are the dashboard’s URL cached ?
I think that if I can figure out this item, I should not be too far from my goal.

And did you run the command sudo yunohost app ssowatconf ? After changing the value in /etc/yunohost/apps/APP/settings.yml ?

1 Like

No I didn’t, but I’m going to try that, and will let you know if it fixes the issue.

@Maniack_Crudelis
It works !!!
I’m going to migrate more applications but for Shellinabox, I was able to move it from a domain to another !
Great !
Thank you very much…

1 Like

Be careful, it’s not going to be that easy for any apps.
Have a look first to the admin panel and use the “Change URL” feature if available.

Indeed, I will be careful.

Thank you again…