cloudpanel-io / cloudpanel-ce

1.21k stars 99 forks source link

`.well-known` Directory gets deleted automatically #439

Closed vreoo closed 5 months ago

vreoo commented 6 months ago

CloudPanel version(s) affected

2.4.0

Description

On our single WordPress Website, we created .well-known Directory inside our htdocs/<site_name>/.well-known and the only files we need inside it is the assetlinks.json for Android's Deeplinks, and apple-app-site-association for iOS Deeplinks.

After some time we begin to notice that the deeplinks don't work anymore, and when we check we discover that the whole .well-known directory is deleted from the server under the same path I provided previously (htdocs/<site_name>/.well-known).

We are not sure what is the reason behind this, but after a little research, we knew that a corn job related to the certificate renewal is causing this to happen whenever it runs. We don't have much experience in this regard so we didn't mess around with any configurations or files since we might cause more issues than solving the one we have already.

While we were investigating we noticed a configuration line in our Vhost (knowing we didn't mess up or change anything inside it) regarding the .well-known directory which says:

location ~ /.well-known {
   auth_basic off;
   allow all;
}

It's worth mentioning that there is a .well-known directory under the default path ~/ that doesn't get deleted or removed but it's not visible to Google Play or iOS when they try to verify the files associated with this directory. Since they require for the verification that these files are accessible (readable) via: https://<site_name>/.well-known/assetlinks.json and the same for the iOS conf file I mentioned at the beginning. So the directory under the default path is not much of a use for us so we don't use instead we create it under the htdocs of our website which is the one that gets deleted.

How to reproduce

1- Create .well-known directory under htodcs/<site_name>/.well-known 2- A cronjob runs after x amount of time (possibly every month or so, not sure tbh) 3- check for the .well-known dir, It's missing! 4- Re-create the folder again ...

Possible Solution

No idea! :(

Additional Context

No response

vreoo commented 6 months ago

No update on this?!!

Let me know if there is anything to clear out if its not already, if that's why there is no response on it - yet -.

vreoo commented 5 months ago

@cloudpanel-io @achouvardas Still no response regarding this issue!!

cloudpanel-io commented 5 months ago

Yes, CloudPanel creates and deletes the directory after issuing certificates.

As a workaround, you can apply a rewrite in the site vhost for .well-known/assetlinks.json to another directory.