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
Add "move to a new domain" + fixes #28
Conversation
Fix fake patch...
Possible to review this forgotten PR @YunoHost-Apps/apps-group ? It might not me merge right now because of conflit for handling |
@@ -0,0 +1,130 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the patch modifications are from an older PR, #24, this part can be ignored for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I get it so to be sure, shall I delete these files then ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's only that you took master instead of testing to work on this PR. So, there's so some commit from a previous PR.
I was just saying that we can ignore that part for this PR.
@@ -64,6 +64,20 @@ ynh_setup_source "$final_path" | |||
# NGINX CONFIGURATION | |||
#================================================= | |||
|
|||
# Delete current nginx configuration to be able to check if .well-known is already served. | |||
ynh_remove_nginx_config | |||
ynh_app_setting_delete $app "checksum__etc_nginx_conf.d_$domain.d_$app.conf" || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, could you please check if the config has been modified by the user before deleting it.
https://github.com/YunoHost/yunohost/blob/unstable/data/helpers.d/filesystem#L285
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took the code from here https://github.com/YunoHost-Apps/nextcloud_ynh/blob/master/scripts/upgrade#L109-L116 and do understand what and why it is needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know myself, but it would be good to use the helper ynh_backup_if_checksum_is_different file
, in case the admin changed its config file.
scripts/upgrade
Outdated
# Handle root path, avoid double slash. | ||
# Temporary fix, in waiting for an upgrade of the helper. (#361) | ||
#path_url_slash_less=${path_url%/} | ||
#ynh_replace_string "__PATH__/" "$path_url_slash_less/" "../conf/nginx.conf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you adding that ?
This PR, #361, has been merged on September 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad /o, will correct that later
scripts/install
Outdated
@@ -70,6 +70,20 @@ ynh_setup_source "$final_path" | |||
# NGINX CONFIGURATION | |||
#================================================= | |||
|
|||
# Do not serve .well-known if it's already served on the domain | |||
if https://github.com/YunoHost-Apps/nextcloud_ynh/blob/962cc61ec8ffb045d89dd460cf8b55778d862ffc/scripts/install "https://${domain}/.well-known/caldav" ; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you would write is_url_handled
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well yes... copy pasta
scripts/change_url
Outdated
# Replace path in "return" directives | ||
ynh_replace_string "return \([[:digit:]]\{3\}\) $old_path" "return \1 $new_path" "$nginx_conf_path" | ||
# Calculate and store the nginx config file checksum | ||
ynh_store_file_checksum "$nginx_conf_path" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the new way to handle that part.
https://github.com/YunoHost/example_ynh/blob/master/scripts/change_url#L69-L78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done (did not tried yet)
Sounds like the best thing to do. |
It was my first code PR, I will rework on it with new helpers and my experience when I will have time. Thanks for the review and advices |
In the last commit, I tried to use I do not understand how the helper runs so I created a
|
I'm not sure to understand the problem you have with this helper. I just tried it, it seems to work as expected. |
A simpler version of the helper, without the array and with more comments.
Please try with this new helper. |
scripts/install
Outdated
@@ -70,6 +70,22 @@ ynh_setup_source "$final_path" | |||
# NGINX CONFIGURATION | |||
#================================================= | |||
|
|||
# Exits if another app serves "https://${domain}/.well-known/caldav" and display an error message for user | |||
# Waiting for Yunohost to handles this kind of conflict https://github.com/YunoHost-Apps/baikal_ynh/issues/17 | |||
echo "je suis devant le if" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to remove those debug messages :D
Bump guys, just passing by to say that I'm interested in seeing this PR merged because an user had this issue today about trying to install Baikal while Nextcloud was installed 😅 |
Hello there, I used the new helper provided by @maniackcrudelis and did some tests but could not totally test the PR. On the VM, if nextcloud is already installed, baikal cannot be installed so this part is okay. Issue is that baikal does not work on my VM... There is an nginx error about php in the logs but the config files are identical on my production server and on the VM. So I give up on this. My VM could also be in a poor state as I have removed a lot of applications in order to test baikal / nextcloud. |
Looks good to me |
Ok, I investigated a little this strange helper. (I love when the code is clear and without ambiguities...)
Which means probably that the new helper should return 0 instead of 1. Ok, let's recap:
Currently, So I think that, if we have the sso, the admin or 404 (do we really can expect a 404 !?) we should consider that's fine. If we have something else than that, that would means an app has answered the request. |
Alright ! |
Problem
Solution
change_url
script + adaptcheck_process
/.well-known/carddav
is already served by other application (like Nextcloud in my case) See Check if the caldav/cardav uri are available on the server before installing #17 and Handle .well-known in case of conflict #25Solution not perfect !
This is not perfect as for my use case, baikal does not work anymore after moving the app.
Some possible enhancements
Edit 1
PR Status
Obviously, you should really check these affirmations
Work finished. Package_linter & Package_check, basic tests and upgrade from last version OK.
Upgrade tested on a VM and allowed to realise the conflict with nextcloud (see #25)
Could be reviewed and tested.
Validation
Minor decision
When the PR is mark as ready to merge, you have to wait for 3 days before really merge it.