Patch: now hledger-web compiles; also fixes some hardcoded static urls

21 views
Skip to first unread message

Xinruo Sun

unread,
Jan 6, 2013, 4:50:43 AM1/6/13
to hle...@googlegroups.com
Hi,

This is a patch mainly to fix a bug where hledger-web would use wrong relative static url when base-url is specified. I encounter this because I have a reverse proxy to serve hledger-web, which required me to use base-url.

For example, I start the server like this:

hledger-web --base-url=http://localhost/ledger/

And I use apache to setup a reverse proxy of http://localhost/ledger/ -> http://localhost:5000/

Now if you browse to http://localhost/ledger/register , and view source, it includes jquery at http://localhost/static/jquery.js instead of http://localhost/ledger/static/jquery.js . The same to combo_select.gif

The thing with base-url is that, it only changes the output of links on the page. The embeded server is still serving everything from root. So this problem only occurs when a reverse proxy is involved.

In this patch, first hledger-web is enabled in Makefile. Then a little fixes to make it compile. Finally these wrong static urls are fixed.

Sorry that this is a git formated patch. I had a hard time working with darcs when trying to look through the history. Stick to my favourite git for hacking now.


Best,
Xinruo


0001-now-hledger-web-compiles-also-fixes-some-hardcoded-s.patch

Simon Michael

unread,
Jan 11, 2013, 9:59:06 AM1/11/13
to hle...@googlegroups.com
Hi Xinruo,
 
nice patch! Thank you and sorry for the slow reply. I have applied most of your changes.
 
I felt it was best to exclude hledger-web by default from "make install" in a hledger source tree, because it tends to be harder to cabal install than the others. We could have that rule print a message letting builders know about editing PACKAGES. Or, perhaps it would be best to get rid of make install and document the cabal commands directly (cabal install ./hledger-lib ./hledger [./hledger-web] [--dry] [--only-dependencies] ). What do you think ?
 
Best - Simon

Xinruo Sun

unread,
Jan 12, 2013, 4:44:41 AM1/12/13
to hle...@googlegroups.com
Hi Simon,

I'm no expert here. But I feel like commenting out hledger-web in Makefile seems like hledger-web is no longer supported. 

It makes sense to document commands directly. Or maybe add a make installweb just for the hledger-web.

Best,
Xinruo

-- You received this message because you are subscribed to the Google Groups hledger group. To post to this group, send email to hle...@googlegroups.com. To unsubscribe from this group, send email to hledger+u...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/hledger?hl=en

Reply all
Reply to author
Forward
0 new messages