WardCunningham / Smallest-Federated-Wiki

This wiki innovates by: 1. federated sharing, 2. drag refactoring and 3. data visualization.
http://wardcunningham.github.com/
GNU General Public License v2.0
1.21k stars 178 forks source link

Persona login error via pagekite reverse tunnel #426

Closed jasonkgreen closed 10 years ago

jasonkgreen commented 10 years ago

I have a node.js instance of SFW running in a debian VM which is also running pagekite to reverse tunnel to the wider world.

I can access the instance as localhost:3000 on the VM and successfully log in via Persona, but I get a "Login failure: unable to log you in" error popup when I try to do the same thing via the pagekite reverse tunnel. Pagekite support says that pagekite is just tunneling and I should get the same thing I would on localhost, but I'm not getting that.

ozten commented 10 years ago

Is the protocol, hostname or port number different when you are using Pagekite?

The Persona config values must match what is in your address bar, otherwise an "audience mismatch" will happen.

jasonkgreen commented 10 years ago

Aha, The port 3000 of the original instance is shifted to port 80 (I think) when it goes through pagekite. It may cause a hostname change as well. Is there a way to get SFW to run over port 80?

paul90 commented 10 years ago

The server port is set using --port or -p

The Persona audience is set using --url, which you will need to set as this defaults to http://localhost

jasonkgreen commented 10 years ago

I had to use pm2 to start it b/c of some node flakiness. Would you end up with something like

pm2 start something.js -p 80 --url http://site.i.want.example.com

?

paul90 commented 10 years ago

Not sure, as I don't use pm2, but I think you will want something like

pm2 start path_to_fedwiki/index.js -- -p 80 --url http://site.i.want.example.com

pm2 parameters will need to come before the --

almereyda commented 10 years ago

What about wiki farms (--farm) here?

I'm running one locally serving ~6 local wikis which are occasionally synced (either by file system/db sync, in this setup supposedly even by forking between the LAN and WAN instances run by a farm, or sooner or later mediated via browser) to public facing wikis.

jasonkgreen commented 10 years ago

Paul -- It didn't throw an error when I passed the parameters, but I still couldn't get Persona login to work. Not sure why

Jon -- It's only login and editing that won't work remotely. I can fork from it without problem. My Persona difficulties mean that I have to be logged in from the VM localhost to make changes. This is a smaller problem in the grand scheme of things,

I'm now getting an error about alternate addresses, which is more than I was getting. The --port flag doesn't seem to affect the port SFW is running on.

paul90 commented 10 years ago

Just tried pm2, as far as I can see you need to remove the app from the process list before starting it with different parameters, using pm2 delete, but it appears to work as expected.

jasonkgreen commented 10 years ago

Got it. Actually it's pm2 stop [id of wiki process] pm2 delete [id of wiki process] pm2 start ./index.js -- -p 3000 --url http://mysubdomain.pagekite.me

You need to tell persona what port SFW is running on, rather than the port it's forwarded to via pagekite.

Thanks for all the help.

WardCunningham commented 10 years ago

@jasonkgreen summarizes what works with pagekite here: http://blog.jasongreen.net/2014/08/personal-wikis-a-how-to-including-better-icons/