× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Mercurial (hg) SCM on ReadyNAS?

anonynas
Aspirant

Mercurial (hg) SCM on ReadyNAS?

Hi All,

I was wondering if anyone has successfully installed Mercurial on their ReadyNAS. I'm struggling because I can't seem to get a complete Python install.

I downloaded and installed Python 2.7. I also downloaded Mercurial 1.7.5, but when I try to install it, it complains that I don't have bz2. I installed libbz2 using apt, and I'm not sure what else I need to do to get this working. Has anyone else had success in installing Mercurial?

If anyone has tips, I'd appreciate it.

Thanks!
Message 1 of 26
WhoCares_
Mentor

Re: Mercurial (hg) SCM on ReadyNAS?

I'll take a look at it once I'm fully awake 😉

-Stefan
Message 2 of 26
anonynas
Aspirant

Re: Mercurial (hg) SCM on ReadyNAS?

Thanks Stephan!

I kept on at this today, but couldn't figure out what's wrong. If you (or anyone else) has ideas, that would be a great help!

Thanks.
Message 3 of 26
anonynas
Aspirant

Re: Mercurial (hg) SCM on ReadyNAS?

Hi,

If anyone is interested, I managed to get this working, sort of, but it was ugly.

I installed Python 2.5.2 according to the instructions in this thread http://www.readynas.com/forum/viewtopic.php?f=35&t=35447. I then downloaded Mercurial v. 1.7.5. Since this version of Python inexplicably did not find my local install of bz2, I commented out the lines in the Mercurial setup.py that refer to importing bz2 (lines 39-43 in this version of Mercurial). I then did
make install
, and it worked.

To clone a repository on another machine over ssh I had to
chmod o+w /dev/tty
to allow outbound ssh. I tried pull, up and serve, and they all seem to be working.

I've not used Mercurial enough to know what is going to happen because Python can't find bz2, but if I find out, I'll try to remember to report it here.

If anyone comes up with a better way of doing this, I'd been keen to find out.
Message 4 of 26
WhoCares_
Mentor

Re: Mercurial (hg) SCM on ReadyNAS?

You could try
apt-get install bz2
if you've got the APT add-on installed. Other than that all I can say is that I'm working on it but want to use Python 2.6 instead of 2.5. Unfortunately this still gives me some headaches, otherwise the Mercurial add-on would be available already.

-Stefan
Message 5 of 26
anonynas
Aspirant

Re: Mercurial (hg) SCM on ReadyNAS?

WhoCares? wrote:
You could try
apt-get install bz2
if you've got the APT add-on installed. Other than that all I can say is that I'm working on it but want to use Python 2.6 instead of 2.5. Unfortunately this still gives me some headaches, otherwise the Mercurial add-on would be available already.

-Stefan


Hi Stefan,

Yeah, I did apt-get install bz2, which is why I'm so confused. I also downloaded the package descriptions for the sparc release of Sarge and installed everything that seemed relevant when I grepped for bz2, but to no avail. I don't know if it is a path issue or something?

I didn't try Python 2.6, but I did try 2.7, and it came up with far more complaints than 2.5 did. I'm really confused why this is so hard; it should be trivial.

Cheers!
Message 6 of 26
WhoCares_
Mentor

Re: Mercurial (hg) SCM on ReadyNAS?

Sorry, my fault. I meant
apt-get install libbz2
and possibly even
apt-get install libbz2-dev

As to the problems installing 2.6/2.7: Both rely heavily on libraries that just aren't availabe on the ReadyNAS.

-Stefan
Message 7 of 26
anonynas
Aspirant

Re: Mercurial (hg) SCM on ReadyNAS?

Thanks. I hadn't installed the development version. Stupid of me to have missed that. I'll try a recompile, and see if that works. Other than Mercurial, I'm not much of a Python user, so 2.5 is okay for me.

Thanks!
Message 8 of 26
ddumont
Aspirant

Re: Mercurial (hg) SCM on ReadyNAS?

Any news on this being turned into an addon? I'm very interested in it.
Message 9 of 26
ddumont
Aspirant

Re: Mercurial (hg) SCM on ReadyNAS?

Actually python 2.7 was really easy to install without having to edit anything, and mercurial installed without too much effort either.

hopefully it's easy to set up as a place to push to easily.
Message 10 of 26
InTheShires
Tutor

Re: Mercurial (hg) SCM on ReadyNAS?

This looks quite interesting, might have a look at it myself.

Before I investigate further, any first hand experience of people using it now? And on which Readynas?
Message 11 of 26
ddumont
Aspirant

Re: Mercurial (hg) SCM on ReadyNAS?

Duo running latest firmware.

Trying to get RhodeCode installed. I have for the most part, it seems really nice. Trying to get force SSL to work. I'd love for someone to make that into a module like websvn
Message 12 of 26
ddumont
Aspirant

Re: Mercurial (hg) SCM on ReadyNAS?

Trying to configure RhodeCode.
Got it installed and set up but I need the help of a readynas guru.

I'm stuck here:
http://packages.python.org/RhodeCode/se ... st-example

I think I've found the frontview http conf file, which imports conf files stored in an addons folder. So I know I can add one for rhodecode there.
I'm not sure what to put in it though, does frontview have the proxy support?

Can you recommend how my config file should look?
Also, I've installed rhodecode in a python virtual environment. Do you have any suggestions on how I can auto launch this web service on startup?

If anyone has interests in getting mercurial and rhodecode set up as plugins for the readynas, I'd be more than happy to share how I've managed to get this far.
Message 13 of 26
WhoCares_
Mentor

Re: Mercurial (hg) SCM on ReadyNAS?

Adding virtual hosts to the Apache config isn't trivial because it's not enabled in the default config on the ReadyNAS (which I believe is a real bug). So you may try with the subdirectory example for that's easier to implement.

-Stefan
Message 14 of 26
ddumont
Aspirant

Re: Mercurial (hg) SCM on ReadyNAS?

Can you help me out about what I might need in my config? or what it might look like?
Exactly like the example? Does the frontview thing have ProxyPass?

Are you at all interested in creating addons for these things? 🙂
Message 15 of 26
WhoCares_
Mentor

Re: Mercurial (hg) SCM on ReadyNAS?

LOL. As you may have noticed there may be one or two add-ons that I created around 😉 Still, even if you get it to work, that won't help much in building an add-on. If you want to build an add-on, I'd suggest you have a look at the Add-on SDK. This will allow you to build add-ons more easily and also provide a rough framework for the Apache configs needed.

-Stefan
Message 16 of 26
ddumont
Aspirant

Re: Mercurial (hg) SCM on ReadyNAS?

Yes I had noticed. 🙂 I was hoping you might be intereted in adding these as addons to your collection 🙂

I have so many projects on my plate right now, I don't really have the resources to invest in learning all about readynas addon creation. I was hoping a readynas guru like yourself would be willing to bundle this all up in a nice package, or at the very least, help me get set up so I can get back to my projects.
Message 17 of 26
WhoCares_
Mentor

Re: Mercurial (hg) SCM on ReadyNAS?

ddumont wrote:
Yes I had noticed. 🙂 I was hoping you might be intereted in adding these as addons to your collection 🙂

If it depends on Python 2.7 I can't, at least not at the moment.

ddumont wrote:
I have so many projects on my plate right now,

Same problem here, unfortunately.

ddumont wrote:
I was hoping a readynas guru like yourself would be willing to bundle this all up in a nice package, or at the very least, help me get set up so I can get back to my projects.

I do what I can but there are limits. If you want to, you can bundle up what you have in a zip file and send it my way, so I can have a look at it. That'd be much easier for me than to try to navigate you through the process using forum posts 😉

-Stefan
Message 18 of 26
ddumont
Aspirant

Re: Mercurial (hg) SCM on ReadyNAS?

I'm not attempting to make this an addon, so I'm not sure what you want me to zip up.

I can certainly zip my installed rhodecode server in the python virtual env if you want to see that.
One thing I'm running into with the apache server is it seems to be barfing on the ProxyPass directive/module
Message 19 of 26
WhoCares_
Mentor

Re: Mercurial (hg) SCM on ReadyNAS?

Yeah, that's a problem with Apache on the ReadyNAS: It doesn't contain all the modules that normally come with Apache. So for some applications you're out of luck - until I've got time to finish yet another add-on that's already in the making;)

-Stefan
Message 20 of 26
ddumont
Aspirant

Re: Mercurial (hg) SCM on ReadyNAS?

If you could maybe help me with a more simple (hopefully) problem with apache conf files:

http://mercurial.selenic.com/wiki/Publi ... positories
Sections 6 and 7... Following this I have /etc/frontview/apache/DDUMONT_HGWEB.conf:

ScriptAlias /hg /c/home/ddumont/.hg/hgweb.cgi
<Location /hg>
AuthType Basic
AuthName "Hg repositories"
Require user ddumont
</Location>

This doesn't seem to work 😞

[Thu Apr 07 21:22:44 2011] [crit] [client 10.0.0.4] (13)Permission denied: /c/home/ddumont/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

Not sure why it's checking the .htaccess file. None of the other configs that Require a user seem to have to do that. How can I get apache to do regular system auth here?
Message 21 of 26
ddumont
Aspirant

Re: Mercurial (hg) SCM on ReadyNAS?

Ahhhh... I don't think admin could read my home dir. I moved the .hg dir to /c/ and it's working! wooooo!
Message 22 of 26
ddumont
Aspirant

Re: Mercurial (hg) SCM on ReadyNAS?

Just adding a note here. I gave up on RhodeCode... the hgweb cgi worked much easier for me.
I don't think that this requires python 2.7... Honestly, I had forgotten I installed your 2.5 module. (oh well too late)

Mercurial install went smooth, so did python 2.7. I now have mercurial hosting for repos running over https on my readynas! (and auto-update on push)
fantastic! I'm 100% sure that you can figure all this out in less time than it took me... but if you have any questions about what I did, let me know, I'd be happy to help you add to your addon collection when you get the time to look at it.
Message 23 of 26
Dewdman42
Virtuoso

Re: Mercurial (hg) SCM on ReadyNAS?

Can you please provide some instructions for what you did to get mercurial working on your readyNas?
Message 24 of 26
ddumont
Aspirant

Re: Mercurial (hg) SCM on ReadyNAS?

Migrated to a new nas (pro4) and the install was a bit different this time around.

Notes to future people looking to do this:
apt-get install make <and gcc and stuff>
download python 2.7.x source packs, and latest mercurial.

build python, run the tests... then install it.
build mercurial, run the tests... then install it.

I satisfied some libraries that python warned me it might be a good idea to have.

once that's all set up you can pretty much follow the instructions for hgweb i linked above... one note, to pw protect the dir on the pro you need this apache conf:
ScriptAlias /hg /c/mercurial/hgweb.cgi
<Location /hg>
Include /etc/frontview/apache/Auth.conf
AuthName "Mercurial Repositories"
require user ddumont
</Location>

I put my mercurial stuff in a share (to make backing up easier). The include lets frontview do your user auth.
This conf file should be a link in or placed in /etc/frontview/apache/addons

storage:/c/mercurial# ls -la /etc/frontview/apache/addons/
total 8
drwxr-xr-x 2 admin admin 4096 2012-11-12 13:48 .
drwxr-xr-x 3 admin admin 4096 2012-11-12 13:48 ..
lrwxrwxrwx 1 admin admin 31 2012-11-12 09:39 DDUMONT_HGWEB.conf -> /c/mercurial/.apache.hgweb.conf
Message 25 of 26
Top Contributors
Discussion stats
  • 25 replies
  • 5915 views
  • 0 kudos
  • 5 in conversation
Announcements