Using Apache rewrite?

3 views
Skip to first unread message

Dan Krol

unread,
Aug 2, 2015, 2:30:49 AM8/2/15
to ubos...@googlegroups.com
Hello,

I have a question that I can separate from my other questions regarding Ubos packaging.

I recall a presentation wherein Johannes said that he could not package a certain application until its maintainer put in one small fix, which was to make the root URL configurable. That way, UBOS could put the particular application into whatever path the user wanted it.

I was poking around and read about Apache's mod_rewrite. Any reason we can't just use that? Seems like it could save us a lot of waiting around for maintainers to fulfil requests.

Thanks a lot,

Dan

Dan Krol

unread,
Aug 2, 2015, 2:30:50 AM8/2/15
to ubos...@googlegroups.com
I read it wrong when I was reading about mod_rewrite. I was surprised and somehow thought Apache was intelligently rewriting URLs in the html source.

So I guess instead I mean mod_substitute. But then, it's up to the packager to correctly select the URLs, which of course is precarious. I may try it anyway, could be easier than dealing with upstream.

Johannes Ernst

unread,
Aug 2, 2015, 2:49:08 AM8/2/15
to ubos...@googlegroups.com
On Aug 1, 2015, at 20:27, Dan Krol <orbl...@gmail.com> wrote:

Hello,

I have a question that I can separate from my other questions regarding Ubos packaging.

I recall a presentation wherein Johannes said that he could not package a certain application until its maintainer put in one small fix, which was to make the root URL configurable. That way, UBOS could put the particular application into whatever path the user wanted it.

Actually you can now set the context to “fixed” in the ubos-manifest.json, and UBOS will respect that: http://ubos.net/docs/developers/manifest/roles.html, look for “fixedcontext”.


I was poking around and read about Apache's mod_rewrite. Any reason we can't just use that? Seems like it could save us a lot of waiting around for maintainers to fulfil requests.

That works for HTTP-level URLs, but not for HTML files (or worse, other files) containing URLs (like href and img tags). You can do search-and-replace on the fly, and in fact I have done that, but unless you know the app really well, chances are that sooner or later you change something you shouldn’t have.




Thanks a lot,

Dan

--
You received this message because you are subscribed to the Google Groups "UBOS Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ubos-dev+u...@googlegroups.com.
To post to this group, send email to ubos...@googlegroups.com.
Visit this group at http://groups.google.com/group/ubos-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/ubos-dev/CAAWRcS-sYm%3DjoMFrOgDX_XA_hNbZPBgVpho6n%3DVByKoS2J-1_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Johannes Ernst

unread,
Aug 2, 2015, 2:50:10 AM8/2/15
to ubos...@googlegroups.com
On Aug 1, 2015, at 21:28, Dan Krol <orbl...@gmail.com> wrote:

I read it wrong when I was reading about mod_rewrite. I was surprised and somehow thought Apache was intelligently rewriting URLs in the html source.

This would be really hard to do in the context of Javascript. How do you re-write a URL that is dynamically constructed on the client?

So I guess instead I mean mod_substitute. But then, it's up to the packager to correctly select the URLs, which of course is precarious. I may try it anyway, could be easier than dealing with upstream.

On Sat, Aug 1, 2015 at 8:27 PM, Dan Krol <orbl...@gmail.com> wrote:
Hello,

I have a question that I can separate from my other questions regarding Ubos packaging.

I recall a presentation wherein Johannes said that he could not package a certain application until its maintainer put in one small fix, which was to make the root URL configurable. That way, UBOS could put the particular application into whatever path the user wanted it.

I was poking around and read about Apache's mod_rewrite. Any reason we can't just use that? Seems like it could save us a lot of waiting around for maintainers to fulfil requests.

Thanks a lot,

Dan


-- 
You received this message because you are subscribed to the Google Groups "UBOS Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ubos-dev+u...@googlegroups.com.
To post to this group, send email to ubos...@googlegroups.com.
Visit this group at http://groups.google.com/group/ubos-dev.

Dan Krol

unread,
Aug 2, 2015, 11:49:39 AM8/2/15
to ubos...@googlegroups.com
So with "fixedcontext", if you had two apps at the same URL, you'd need two different domains, correct? I suppose you could use subdomains. Is this something you intend to be common within UBOS, or is it sort of a copout that is to be avoided? I guess subdomains are decent anyway, maybe even preferable to some people.

Johannes Ernst

unread,
Aug 2, 2015, 3:01:30 PM8/2/15
to ubos...@googlegroups.com
On Aug 2, 2015, at 8:49, Dan Krol <orbl...@gmail.com> wrote:

So with "fixedcontext", if you had two apps at the same URL, you'd need two different domains, correct?

Yes. There may also be the case that only a single instance of an app may be installed on the same device (mailman being the notorious example) but we’d like to stay away from this, so UBOS doesn’t support that case directly today. So no mailman on UBOS.

I suppose you could use subdomains. Is this something you intend to be common within UBOS, or is it sort of a copout that is to be avoided? I guess subdomains are decent anyway, maybe even preferable to some people.

I’ve found that people who think in stovepipe apps often prefer to use subdomains, and people who think of “website” (which may run several apps) prefer to use a single domain. google.com is a great example.

There’s also the issue of DNS setup, which is a lot easier if there is only a single domain to set up.

But then, UBOS doesn’t care and lets you do either.

Cheers,



Johannes.

Reply all
Reply to author
Forward
0 new messages