Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"api url" didn't changed when moving domain #626

Closed
Martin-bl opened this issue Nov 13, 2023 · 2 comments · Fixed by #633
Closed

"api url" didn't changed when moving domain #626

Martin-bl opened this issue Nov 13, 2023 · 2 comments · Fixed by #633

Comments

@Martin-bl
Copy link

Martin-bl commented Nov 13, 2023

After changing url the api url wasn't changed

  • I am working on a server with a misconfiguration on nextcloud.api permission. What I know is that : "the nextcloud url was changed, but after deleting the old domain nextcloud stopped working"
  • I see that in /etc/ssowat/conf.json the url is wrong in nextcloud.api
grep --color .well-kn /etc/ssowat/conf.json
           "re:cloud.old-url.fr\\/.well-known\\/.*",

  • I think that the change_url is not complete but maybe not : I didn't tried again to reproduce it.
  • Note : I solved the problem for myself, so I'll report it here if it helps improve the package or helps others

Context

  • Hardware: *VPS bought online *
  • YunoHost version: 11.2.5 (but I don't know what the version was when the url was changed)
  • I have access to my server: Through SSH
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: no

Steps to reproduce

  • Change nextcloud url (I don't know more about what was done exactly)

Expected behavior

The api url should also have changed but it remains on the last url

Logs

I have no history of this action. I started working on the server after the action had been performed. I've just seen that it wasn't done correctly

To resolve

Actions to resolve the problem :

source /usr/share/yunohost/helpers
cat /etc/yunohost/apps/nextcloud/settings.yml
new_domain=new_domain.tld
url="re:$new_domain\/.well-known\/.*"
app=nextcloud

ynh_permission_url --permission "api" --clear_urls
ynh_permission_url --permission "api" --url="$url" --auth_header="false"

Suggestion

Add this part to change_url

#=================================================
# CHANGE API URL SSOWAT
#=================================================
ynh_permission_url --permission "api" --clear_urls
ynh_permission_url --permission "api" --url="$url" --auth_header="false"

The following didn't work for me :
ynh_permission_url --permission "api" --add_url="$new_domain" --remove_url="$old_domain" --auth_header="false"

@ericgaspar
Copy link
Member

ericgaspar commented Jan 11, 2024

This should be fixed with #622. Please confirm

@alexAubin
Copy link
Member

No feedback, assuming this is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants