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

"Hosted on same domain name" note not completely true #36

Closed
ralscha opened this issue Apr 8, 2013 · 5 comments
Closed

"Hosted on same domain name" note not completely true #36

ralscha opened this issue Apr 8, 2013 · 5 comments

Comments

@ralscha
Copy link

ralscha commented Apr 8, 2013

The readme states that ttrss-mobile " should be hosted on the same domain name." Without additional configuration this true, but with a simple .htaccess file it is possible to install ttrss-mobile in any domain you want.

My ttrss is installed on http://rss.mydomain.com. I wanted ttrss-mobile install on http://mrss.mydomain.com. After setting everything up the browsers throws a cross-origin resource sharing exception and that is expected.

If ttrss is running with an Apache web server this is easy to solve. I only had to copy this .htaccess file into the ttrss/api folder and everything works.

Header set Access-Control-Allow-Methods "POST, OPTIONS"
Header set Access-Control-Allow-Origin "http://mrss.mydomain.com"
Header set Access-Control-Allow-Headers "Content-Type"

My conf.js looks like this:

window.apiPath="http://rss.mydomain.com/";
window.webappPath="http://mrss.mydomain.com/";

Not sure if I set the window.webappPath variable correctly. But it looks like everything works.

@mboinet
Copy link
Owner

mboinet commented Apr 14, 2013

You set it right.

You're totally right about the cross-origin thing. I didn't want to test this and I think that there were only a few people interested in this. You're proving me wrong ;-)

I'll update the README and point to your post & a litte doc on MDN I find good: https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS

@mboinet
Copy link
Owner

mboinet commented Apr 22, 2013

Doc updated

@mboinet mboinet closed this as completed Apr 22, 2013
@ordually
Copy link

Great writeup. Just a little tip on the .htaccess use of Header. If you don't have the Apache Headers module enabled, you'll see an error in the log:

Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration

Enable the module with:

sudo a2enmod headers

@tanty
Copy link

tanty commented Jan 5, 2015

Is this still supported?

At least, the variables:

window.apiPath="http://rss.mydomain.com/";
window.webappPath="http://mrss.mydomain.com/";

Don't exist any more in the latest release.

I assumed that just setting:

apiPath: "http://rss.mydomain.com/"

Would be enough, in collaboration with the .htaccess changes, but it doesn't seem to work in my installation.

@tanty
Copy link

tanty commented Jan 5, 2015

False alarm. It actually seems to work just setting:

apiPath: "http://rss.mydomain.com/"

And the .htaccess changes aboves.

Sorry for the noise, and thanks for your awesome work :)

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

No branches or pull requests

4 participants