Skip to content
New issue

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

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

Already on GitHub? # to your account

multi-site support #299

Open
gour opened this issue Mar 2, 2021 · 7 comments
Open

multi-site support #299

gour opened this issue Mar 2, 2021 · 7 comments

Comments

@gour
Copy link

gour commented Mar 2, 2021

Hello,

I'm looking for a commenting engine to serve my Hugo-generated static websites. I like that HashOver is written in PHP since I anyway have to use PHP on the server for Matomo analytics, but wonder if single instance of HashOver can serve comments in multiple site?

@zimocode
Copy link

zimocode commented Mar 2, 2021

YES.

  1. deploy HashOver on comments.example.com
  2. edit backend/classes/sensitivesettings.php, change :
    public $allowedDomains = array (
            // '*.example.com',
            // '*.example.org',
            // '*.example.net'
    );
    TO:
    public $allowedDomains = array (
            'www.site0.com',
            'www.site1.com'
    );
  3. now , it works on www.site0.com and www.site1.com.

@gour
Copy link
Author

gour commented Mar 8, 2021

YES.

1. deploy HashOver on comments.example.com

When I tried to do that, I get CORS problem:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://hashover.tld.com/backend/comments-ajax.php. (Reason: CORS header ‘Access-Control-Allow-Origin’ does not match ‘http://demo.tld.com’).

iow. I tried to deploy HashOver at https://hashover.tld.com to serve comments for the https://demo.tld.com site?

I also wonder about the possibility to manage all comments from the single place in regard to #284?

@jacobwb
Copy link
Owner

jacobwb commented Mar 9, 2021

@gour What do you have in the $allowedDomains setting? You should only have the domain name. If you are running HashOver on hashover.tld.com the setting should contain the domain demo.tld.com. Alternatively, you can use a wildcard, like *.tld.com, this way it will work from any subdomain. Also, you may have to use the same scheme on both websites. Your error says "http://demo.tld.com" not "https://demo.tld.com", if you are using HTTPS on demo.tld.com you may also have to use HTTPS on hashover.tld.com. Check to make sure you are doing so.

As for managing all comments from a single page, the situation is the same as my response in that issue, it isn't implemented. The current plan is to add a page that uses the Latest Comments API to display the 10 most recent comments from all pages, from there a structural change to how comments are stored may be required in order to display more comments. The moderation needs to be improved altogether, but for now I don't have the time to give proper consideration to a better implementation.

@gour
Copy link
Author

gour commented Mar 9, 2021

@gour What do you have in the $allowedDomains setting?

I've wildcard *.tld.com and using HTTPS everywhere?

As for managing all comments from a single page, the situation is the same as my response in that issue, it isn't implemented.

OK.

@jacobwb
Copy link
Owner

jacobwb commented Mar 9, 2021

@gour Is $supportsMultisites also set to true ?

@gour
Copy link
Author

gour commented Mar 10, 2021

@gour Is $supportsMultisites also set to true ?

I've changed it to true, but still get:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://hashover.tld.com/backend/comments-ajax.php. (Reason: CORS header ‘Access-Control-Allow-Origin’ does not match ‘http://demo.tld.com’).

and I'm puzzled why it does complain about http://demo.tld.com since it is supposed to serve via HTTPS only?

Edit: Let me add that the setup where I run Hashover is kind of semi-share hosting where Apache is running behing Ngix acting as reverse proxy, if that does matter for some reason.

@jacobwb
Copy link
Owner

jacobwb commented Mar 28, 2021

@gour

Edit: Let me add that the setup where I run Hashover is kind of semi-share hosting where Apache is running behing Ngix acting as reverse proxy, if that does matter for some reason.

This may matter, yes. I actually already have code to handle this, or at least it should, but I haven't seen anyone need it. So, I will commit that code now, please test it. I think this is just a matter of HTTPS not being detected properly because of the proxy.

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

No branches or pull requests

3 participants