asheesh changed the topic of #sandstorm to: Welcome to #sandstorm: home of all things sandstorm.io. Say hi! | Channel glossary: "i,i" means "I have no point, I just want to say". b == thumbs up. | Public logs at https://botbot.me/freenode/sandstorm/ & http://logbot.g0v.tw/channel/sandstorm/today
mnutt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mnutt has joined #sandstorm
<asheesh> Yo TC01
<asheesh> Sounds like your libvirt file share into Vagrant is read-only maybe?
<asheesh> Can you, like, 'touch /vagrant/party.txt' ? from within 'vagrant-spk vm ssh'?
<asheesh> I mean
<asheesh> Can you, like, 'touch /opt/app/party.txt' ? from within 'vagrant-spk vm ssh'?
mnutt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<TC01> asheesh: as root, yes, but not as the vagrant@ user
<asheesh> That sounds like the problem, then, hmm.
<asheesh> Since 'spk dev' runs as the vagrant user
<asheesh> Is there a way to fix the file sharing so that _does_ work?
<asheesh> In a pinch you could "just" chmod 777 the relevant files, but that's not how it's supposed to work. (-:
<TC01> heh. hm... I'm not sure; /opt/app is owned by me (uid 1000) and vagrant is uid 1001. note that there is no user with uid 1000 inside the vm
<TC01> I'm guessing this is a quirk of the Fedora vagrant image, perhaps?
<TC01> maybe touching the files list and chmodding it appropriately is the right thing to do
<TC01> ...except the line that it's failing at is the mkstemp. hm.
<TC01> hm. the first few of those solutions don't actually seem to work, but running chmod -R a+w does. I... guess I'll go with that :/
isd has quit [Quit: Leaving.]
asheesh has quit [Ping timeout: 264 seconds]
mnutt has joined #sandstorm
jemc has joined #sandstorm
amyers has joined #sandstorm
amyers has quit [Ping timeout: 250 seconds]
asheesh has joined #sandstorm
<asheesh> Whoa, I left the channel by accident! Oops or something.
admine_ has quit [Read error: Connection reset by peer]
<TC01> so I'm able to build a spk now :) said spk works when I install it into a vagrant-spk VM (that is, vagrant-spk setupvm -> vagrant-spk up -> install SPK through web interface -> run app), but fails when I upload it to a "real" (production) sandstorm server
<TC01> more specifically, what seems to fail is the redirect from flask to the java app, so I'm wondering if I'm doing that incorrectly?
<TC01> this is all on github now here: https://github.com/TC01/legendsbrowser-sandstorm/; I have the following reverse proxying configuration for apache: https://github.com/TC01/legendsbrowser-sandstorm/blob/master/legendsbrowser-apache.conf#L126
<dwrensha> TC01: is it possible that you've hardcoded http:// into some URLs that would need to be https:// on a prod server?
<dwrensha> (just a wild guess)
<TC01> dwrensha: ooh. that is entirely possible!
<TC01> one of the ways I attempted to redirect was returning (from flask) a redirect("http://...") so, that obviously wouldn't work
<TC01> hm.
isd has joined #sandstorm
<TC01> Having the python code return a redirect("/legends") does not seem to work either (but, again, works fine from vagrant-spk)...
<dwrensha> what does the failure look like? does your browser console show any error?
<TC01> the file uploads, and then it just returns to the upload page; exactly as it was before pressing the button to upload
<TC01> there are two httpd messages in the console: one saying that apr_sockaddr_get_info() failed for sandbox and another complaining I didn't set ServerName in the config so 127.0.0.1 is being used
<dwrensha> this reminds me of a WordPress issue I had where uploads would fail in dev mode only
<dwrensha> the problem had to do UIDs
<dwrensha> right, so in `spk dev` and on Oasis, /var/ is owned by a different UID than the rest of /
<TC01> well, the upload itself succeeds: I'm poking around the grain's files on the server to confirm that
<TC01> is that not the case on production grains?
<dwrensha> another thing that can cause dev to behave differently from prod is if there are some essential files that are stat()ed but not opened, causing spk dev to not detect that they should be included
<TC01> So, I thought that might be the case
<TC01> So I created an entirely different vagrant-spk project using Debian instead of Fedora
<TC01> and uploaded my SPK to that
<TC01> and it also worked :/
<dwrensha> yeah, sounds like it's not a UID thing
<dwrensha> nor a file include thing
<TC01> I'm pretty sure it's something to do with the reverse proxying, or more specifically, redirecting from inside one reverse proxy'd app to another. but I'm not really sure how to debug that further
Isla_de_Muerte has joined #sandstorm
NwS has quit [Ping timeout: 260 seconds]
<asheesh> TC01: You have a reverse proxy involved, yeah? Nginx in the grain or something?
<asheesh> I think I have some magic config for you.
<TC01> asheesh: I do; I'm using apache, but could easily switch to nginx :)
<asheesh> Do you have a grain URL (or sharing link) you can send me?
<asheesh> Interesting; I know of 0 other apps that embed Apache fwiw, but that's fine.
<TC01> sure, one sec
<asheesh> Yay
<TC01> (I default to apache because I always *think* I know how to configure it and I'm less experienced with nginx, and then I always seem to run into some apparently intractable problem like this... perhaps one day, I will learn)
<asheesh> I get this in my JS console:
<asheesh> > Mixed Content: The page at 'https://main.sandstorm.acm.jhu.edu/grain/EzrRFBSeKRC5aKPLj7qpxv/' was loaded over HTTPS, but requested an insecure resource 'http://64052d2cd8a340e8202a27620477b854.sandstorm.acm.jhu.edu/legends'. This request has been blocked; the content must be served over HTTPS.
<TC01> aha
<asheesh> Which Sounds like you're assuming http:// but otherwise things are OK.
<asheesh> s/Which Sounds/Which sounds/
<TC01> I'm not quite sure what's causing that. I do have ProxyPass{,Reverse} /legends http://127.0.0.1:58881/legends in the apache configuration...
<asheesh> Well, here's a different question.
<asheesh> What code, if any, causes a redirect from / to /legends ?
<TC01> specifically this: return redirect(lburl), where lburl = "/legends", redirect is flask.redirect
<TC01> I guess that method must be assuming http.
<TC01> or... something
<asheesh> Oh, interesting.
<asheesh> If your Apache can set X_FORWARDED_PROTO properly then you should be in business.
<asheesh> https://github.com/sandstorm-io/vagrant-spk/blob/master/stacks/lemp/service-config/nginx.conf#L31 "Trust the sandstorm-http-bridge's X-Forwarded-Proto."
<TC01> aha
<asheesh> I'm struggling to figure out how to copy that header into the request in Apache.
<asheesh> http://stackoverflow.com/questions/18935448/https-scheme-lost-in-apache-proxy-scenario-upon-redirect-from-gitlab is all about how to hard-coded it to https, but that's not right in general.
<TC01> right
<asheesh> SetEnvIf X-Forwarded-Proto "^https$" HTTPS=on
<asheesh> RequestHeader set X-Forwarded-Proto 'https' env=HTTPS
<asheesh> If you use those two lines, maybe the right thing will happen?
<TC01> let's find out!
<asheesh> : )
<asheesh> Also looks like you can maybe do
<asheesh> RequestHeader set X-ForwardedProto "%{HTTP_X_FORWARDED_PROTO}"
<isd> So, I'm back to trying to wrap websession in something that looks like the standard go http package's handlers, and having touble rigging up the initial session.
<asheesh> But I'm less sure of that.
<isd> This shows up when I open the grain's page: http://pastie.org/private/mvhryvqpjimlyfauj3536q
<asheesh> "method not implemented"... I guess the question is, which method?
<isd> That interface ID is from APIsession
<asheesh> There's some subclassing stuff for APIsession and websession.
<isd> Yeah, it's the one extra thing in params
<isd> so I'm handing it a websession, and I assume it's actually expecting the whole business
<isd> but, the ApiSession interface doesn't actually specify any extra methods. That thing it's complaining amount is a member of a struct that's defined inside it
<isd> Probably I'm just casting it the wrong way or something.
<asheesh> isd: I'm afraid I am out of my depth for right now on that.
<isd> I have a hunch.
<asheesh> Keep me posted TC01. FWIW you could also look at the Sandstorm-specific HTTP headers and use that to "hint" flask but if you can fix it in Apache then that is the best.
<TC01> asheesh: will do. I think I'm off to bed, but I'll take another look in the morning. thanks for all the help!
<isd> Yeah, this is more of a capnp issue. I have a rough sense of what's happening; I think the go lib is just not reporting the interface ID. There's some awkwardness binding capnp interfaces to Go interfaces, because Go doesn't expect you to declare the interface, it just... has the methods.
<isd> Capnp is actually substantially more annoying to work with than most other-language libs I've touched.
<asheesh> And you're using https://github.com/zombiezen/go-capnproto2 , right?
<asheesh> iirc it's a pure Go library, at least.
<isd> asheesh: yeah I am
<isd> It's still weird trying to map the way Capnp APIs are designed onto other languages
<isd> Is ApiSession supposed to be the top-level thing I expose to the sandstorm API server?
<asheesh> ApiSession is for the "Exporting HTTP APIs" feature <https://docs.sandstorm.io/en/latest/developing/http-apis/> and WebSession is for normal grain view, but those are the two, yeah, as I understand it.
<asheesh> But I should make sure I understand what "UiView" means first, too.
<asheesh> I don't understand personally at the moment how UiView and WebSession and ApiSession interact but that might be useful.
<isd> UiView has a newSession method that returns a UiSession. {Web,Api}Session appear to be subtypes of that.
<isd> Ack, no, I'm mistaken, it's websession.
<isd> not apisession that has that ID.
<isd> that makes more sense.
<isd> Ack, yeah, I see what's going on.
<isd> This is going to be annoying.
<isd> Huzzah!
<isd> progress.
<isd> Yeah, I was doing the casting in a way that loses the type information, so it "forgets" that it's a websession.
jemc has quit [Ping timeout: 244 seconds]
<isd> On the off chance that anyone is curious about what the problem was: https://github.com/zombiezen/go-capnproto2/issues/42
<isd> Now I have to deal with the awful redirect loop that I'm getting :P
<isd> Sandstorm seems to strip off the trailing slash from the URL path; is this correct? If so, why?
<isd> It's probably way too late for anyone to be around...
<isd> fun fact: go's net/http sometimes generates a redirect that adds it if it's missing
<isd> hence redirect loop
<isd> Ah, it's actually adding the leading slash. sandstorm expects relative paths go's ServeMux expects absolute. that's great.
<isd> well, that's enough for tonight I think
isd has quit [Quit: Leaving.]
mnutt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Telesight has joined #sandstorm
synchrone has joined #sandstorm
synchrone has quit [Client Quit]
synchrone has joined #sandstorm
ocdtrekkie has quit [Remote host closed the connection]
dwrensha_ has joined #sandstorm
dwrensha has quit [Ping timeout: 250 seconds]
dwrensha_ is now known as dwrensha
xet7_ has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
mnutt has joined #sandstorm
<Lord> Is there a way to have automatic backup of grains by mail ?
jemc has joined #sandstorm
synchrone has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
synchrone has joined #sandstorm
mrshu has joined #sandstorm
<mrshu> hi!
<mrshu> I have a question that might sound a bit stupid so feel free to ignore me
<mrshu> where do I suggest apps that would be a nice addition to the sandstorm platform?
<synchrone> be sure you're logged in to alpha.sandstorm.io
<synchrone> otherwise you can't submit new apps
<mrshu> hanks synchrone
<mrshu> synchrone: is that link actually still relevant?
<mrshu> synchrone: there does not seem to be much happening there (but it might be just my wrong impression)
<synchrone> this was the "official" link
<mrshu> synchrone: ok, thanks a ton again
<synchrone> although sandstorm devs do not actually port the apps themselves
<synchrone> so it's more for the community to be guided by
mnutt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<TC01> asheesh: got it to work! the SetEnvIf/RequestHeader lines you pasted, combined with setting "app.wsgi_app = ProxyFix(app.wsgi_app)" in flask, made it do the right thing
Lionel_Debroux has quit [Ping timeout: 276 seconds]
<dwrensha> TC01: nice!
synchrone has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
mnutt has joined #sandstorm
Lionel_Debroux has joined #sandstorm
<mnutt> another thing that would be really helpful to know is what sorts of browsers people use who are using sandstorm. for instance, the file upload capability in davros is kind of a mess because it is supporting upload via html5, flash, and silverlight. I'd love to replace it with html5-only code that's much cleaner but am wary of just dropping support without knowing if anyone is using it or not
<zarvox> mnutt: The oldest MS browser that Sandstorm supports is IE11. I'm not sure what the precise numbers are, but I'm pretty sure you can assume a reasonably modern Chrome or Firefox for all but a very long tail of usage.
<mnutt> wow, nice. pretty sure they all have html5 support then
<zarvox> Yeah. http://caniuse.com/#feat=fileapi suggests that you should be able to count on FileReader existing
<zarvox> though IE11 is missing FileReader.readAsBinaryString()
mnutt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mnutt has joined #sandstorm
Telesight has quit [Quit: Leaving.]
xet7_ has joined #sandstorm
xet7 has quit [Quit: Leaving]
mnutt has quit [Read error: Connection reset by peer]
isd has joined #sandstorm
sarahsharp has joined #sandstorm
<sarahsharp> hey asheesh: is there any chance someone could package CiviCRM for sandstorm.io? I would love to try it out for Outreachy.
jemc has quit [Ping timeout: 240 seconds]
jemc has joined #sandstorm
xet7_ has quit [Read error: Connection reset by peer]
afuentes has quit [Quit: Leaving]
xet7_ has joined #sandstorm
frigginglorious has joined #sandstorm
afuentes has joined #sandstorm