Hi, I've changed the address of my NC server and set up a redirect to the new address. I was unable to change the URL in the app and had to re-add the account instead.
Since changing the URL from the app might be considered a security issue (#3877), I'd like to propose the app changing the URL automatically, when receiving "301 Moved Permanently" response from the server.
Changing the URL manually via settings, but that is not available either.
It seems that the Desktop client has this functionality and has updated the URL on its own after my changes.
This is also an issue for me, i was able to happily update the URL defined in the nextcloud.cfg file in appdata on windows but android i could not find wher ethe cfg file is
Hey i would work on this issue. I would extend the dotmenu within manage account with an option to edit the server credentials.
@AlexNi245 thanks for offering to pick this one up. We do need some feedback from @tobiasKaminsky first though since:
so the only part that is likely up for discussion:
which would require a completely different approach and is also unclear to me if this should be implemented.
- changing the server adress is considered a security issue, see #3877
We indeed should not do this.
In my opinion/experience this is a very rare case and then it is ok to have a new account (for an example on google you also cannot change your id without creating a new account and removing the other).
- app changing the URL automatically, when receiving "301 Moved Permanently" response from the server
I am not entirely sure, but if we get 301, we do follow this.
While it is not ideal to then have two calls, nowadays that should not matter too much.
Why are you so inconsistent in the manual configuration for desktop and mobile clients? Are desktop clients more secure than mobile clients and why? Changing a server address on a desktop client is not an issue via the nextcloud
cfg file, although its alternative in a mobile app is not to be found. Reconfiguring (removing/re-adding) a server on a mobile app would remove the queued auto-upload list, which would require manual sync for every auto-upload folder, and their addition and configuration every time the server address changes. In my case the server address change is temporary, accomplishing this via the desktop client is trivial, I would like it to be similar on mobile.
I just would like to confirm that many users like myself would have loved such a feature (as it still exits in the OC client btw.), given sometimes even big providers like Hetzner need to change their server names — affecting hundreds if not thousands of users. https://wiki.hetzner.de/index.php/Storage_Share/en#Renaming
Hetzner recommends creating a new profile, but then the average would have to download everything again, right?
(Which might be even worse if you have lot of files in different folders that you do not want to sync, meaning that you had to click on every single file you want to be synced to your phone. This could take ages…)
Okay, I have now read #3877 again, and from this statement it seems that this will not be fixed. https://github.com/nextcloud/android/issues/3877#issuecomment-495194482 So the files stay on the smartphone and the app will know which one to sync and which one not?
Unfortunatly the app does not even follow the the moved permanently. Android app tells in in notifications: Hochladen fehlgeschlagen, Moved Permanently. In app: "Server nicht verfügbar".
Recreating the account means for me:
In my case old url will be available as long as I want.,
But: I moved from folder to subdomain and RewriteBase in .htaccess file of nextcloud has to point to either / or /nextcloud. Because of that I can not have both Urls working at the same time.
@fafische Very similar issue here! Because of changes on ISP's side I've recently had to jump between IPv6 and IPv4 addresses and then to a DNS name. And every time it's not only just transfer of lots of data, but also all kinds of metadata updates related to it
I hope this issue can be prioritized
From what I understand, this is a "feature" and will not be fixed (which means others decide for us what is good or right). The only solution I could find so far is to create a new profile, to stop syncing, and then to move all the synced files locally. Worked for me at least…
Please, this is very needed feature. If I move now nextcloud from host subfolder to e.g. cloud.domain.com, then all users needs to resetup they Mobile clients.
Desktop respects Redirects and did not cause any error by test, but for Android it does not fully work.
Client will fetch files List by following redirect, but will not be able to create/change/upload new files, will not be able to fetch activity etc. It's always goes to the old URL and simply stops when redirected.
I'd like to vote for this as well, I have my nextcloud running at home, and was using my ISP provided domain for my house (username.ispname.net), but I have just moved hosue to a location where my previous ISP is no longer available.
I have set up my nextcloud at the new house under a proper domain name, and currently have a raspberypi sitting at my old flat with an SSH forwarding rule to tunnel any traffic to the old URL to my new house. This let's the cloud work (slowly) until I terminate my ISP ocntract and sell the old flat.
We have two accounts on mobile phones which use the nextcloud as an automatic photo backup, and I would like to migrate both phones (since the desktop clients you can edit the config file) without the phones getting confused over the 10s of GBs of photos (one phone also has a 30GB holiday photo folder synced from the nextcloud, I don't want to resync this in either direction!)
I can set a 301 permenantly moved on the pi instead of the ssh tunnel, but from what I read here the Android client doesn't respect this and move anyway. I will have to give up the old domain in a few weeks.
From a security perspective, can't you have the option to "migrate URL" and have the client check the identify of the nextcloud server as a security step? If you're paranoid about someone pointing it to their own cloud, this should address the problem.
You used the example of migrating google accounts, but this is more like if microsoft moves the mail server from mail.hotmail.com to mail.live.com (made up examples), but with the same accounts, you dont' want to have to re-sync your whole mailbox.
You used the example of migrating google accounts, but this is more like if microsoft moves the mail server from mail.hotmail.com to mail.live.com (made up examples), but with the same accounts, you dont' want to have to re-sync your whole mailbox.
Good example, but then all users would have to re-setup all their mail clients, which is the same you would have to do on Android Files.
Solution is to have a redirect.
With some proper check, as you mentioned, this indeed might work and be transparent to user.
Currently I fear that we do not have time to work on such feature, but contributions are welcome :+1:
@tobiasKaminsky : You proposed, that the use case to switch the url where the the nextcloud server is to be reached, was an edge case. So let me add our (family home server raspi nextcloud) scenario as one more data point that this missing feature is really annoying. I started with one raspi at one fixed IP, just reachable in our local network. Some phone was setup with the local IP, some with the pure unix host name ("raspberrypi"), and now I try to do the next step and make the server reachable from the wide wide web using a dynamic DNS entry.
Sorry that I've not thought about all the implications in the first place and just started to use nextcloud because I thought that it was flexible and customizable.
Turns out it isn't, at least this issue (and the bug that links here) is a complete deal breaker for me. And now I have to make some good points to my family members why we don't just move all our stuff to dropbox or google drive.
Have you ever considered what security issue _that_ is.
At the other hand I read the complete discussion and there was just no argument at all, that that clearly explains why modifying the url of an existing account is a security issue.
Just anologies that just don't work in my head, so I'd like to give you another:
Backup is going to some server at dont.givea.where via ssh. And now for one out of a gazillion reasons it is reachable on another URL. And in analogy to this app my rsync would prompt me with an error: sorry, but you have sworn an oath to always use dont.givea.where as home base, so to move somewhere else you have to disguise your old identity, start over fresh at the new url (and don't think about making an incremental backup there it could all fall back on you later).
@AlexNi245 have you considered forking the app? If so, please let me know.
For me this feature certainly isn't a deal breaker. I'm very happy with both, Nextcloud and the Android app. But this feature would make changing the server URL much easier. Especially when you have users, who are not that good at configuring such things.
That being said, I had a very pleasant experience with Thunderbird and its calendar feature. I recently changed my server URL and at the old URL I created a 301 Moved Permanently redirect to the new URL. At first Thunderbird kept using the old URL but it followed the redirect, so everything was still working. After some time I restarted Thunderbird and then it told me that a redirect is happening, showed me both, the old and the new URL, and asked me if I want to update the configuration to use the new URL. All I had to do was click on yes. I think that is a very good example of how it could work.
The UX @zroug mentioned seems to be a nice middle way:
Most helpful comment
Why are you so inconsistent in the manual configuration for desktop and mobile clients? Are desktop clients more secure than mobile clients and why? Changing a server address on a desktop client is not an issue via the
nextcloud cfgfile, although its alternative in a mobile app is not to be found. Reconfiguring (removing/re-adding) a server on a mobile app would remove the queued auto-upload list, which would require manual sync for every auto-upload folder, and their addition and configuration every time the server address changes. In my case the server address change is temporary, accomplishing this via the desktop client is trivial, I would like it to be similar on mobile.