genielabs / HomeGenie

HomeGenie, the programmable automation intelligence
https://homegenie.it
GNU General Public License v3.0
392 stars 155 forks source link

HomeGenie.exe hardcodes HTTP port at 80 #37

Closed pfalcon closed 9 years ago

pfalcon commented 9 years ago

I'm giving a test to HomeGenie (from binary download). I'm using my workstation which of course runs Apache on port 80. Moreover, running on ports below <1024 requires root privileges, and no way I run random binaries from internet as root.

So, I'm trying to see how I can use other port, and seems I can't:

$ mono ./HomeGenie.exe --help
2014-10-17T13:39:32.5393410+03:00   HomeAutomation.HomeGenie    SystemInfo  Http port bind failed.  HTTP.PORT   91
HomeGenie is now exiting...

...QUIT!

So, can you please add "--help", "--port", etc. options to HomePage to make its usage comfortable? Also, it's best practice to use non-privileged port by default (like 8080) to avoid problems with requiring root privileges.

Thanks.

ado464 commented 9 years ago

Well you can actually change this in the GUI or if you go into the HomeGenie folder and open the file systemsettings.ini and change the port number there?

cheers. Ado

pfalcon commented 9 years ago

Sorry if I didn't mentioned that, I used provided binary download file "homegenie_1_00_beta_r415.tgz". I'm using Linux.

So, in the provided tarball, there's single executable file, "HomeGenie.exe". Running it tries to start web server, which fails as described above. There's no GUI, or at least unclear how to start it, because standard "--help" or "-h" switches don't work. If you actually meant "WebUI", then it's chicken and egg problem - I cannot change port setting in WebUI, because I cannot start WebUI, and I cannot start WebUI because I cannot change port setting.

you go into the HomeGenie folder and open the file systemsettings.ini and change the port number there

There's no such file in the tarball above. (I surely checked for any config file around, and found nothing.)

ado464 commented 9 years ago

My bad it was named systemconfig.xml in the main HomeGenie folder, it must be there or the system won't start at all. Yes the HomeGenie.exe does launch a web server, but since port 80 is occupied as you say then you should edit the file mentioned above to whatever port you want.

Change this line: skarmavbild 2014-10-29 kl 13 31 58

To whatever port you wish and restart HomeGenie.

cheers. Ado

pfalcon commented 9 years ago

@ado464: Ah, I can see systemconfig.xml there, didn't pay attention to it, as there're bunch of XMLs there. Didn't yet have chance to give it a try - working on bunch of projects in parallel (or rather, in round-robin).

But, the real problem reported here is that HomeGenie uses port 80 by default, which is problem, because it's: 1) privileged port, requires running as root; 2) something else already runs there.

@genielabs: Are you interested in bug reports for your software, or are you going to close them without saying a word? Thanks for clarification (I posted couple of test bugs exactly to test how well project is maintained and if it's worth to spend any more time on it.)

ado464 commented 9 years ago

@pfalcon: Hello again, yes HomeGenie is set to port 80 by default but by making the simple change in the systemconfig.xml you are changing it's default port making it the new default. If you change 80 to 81 then HomeGenie will always boot up on port 81. Yes the problem is if there is already something there then you can't go into the WebUI and change the port, i suggest always using the xml file to just be on the safe side.

Cheers :)

genemars commented 9 years ago

@pfalcon I thought the solution proposed by @ado464 was acceptable because of no answer since then. I can mark this as enhancement although HomeGenie cannot run without root privileges because there are other things that require this on linux systems by default (such as access to gpios and serial port). Also, this project is a very little one with very few contributors so either help to gain more contributors or don't expect too much from it =)

pfalcon commented 9 years ago

Thanks for the replies folks, and sorry, got sidetracked again.

So, I'd like to detail how I arrived at this bugreport:

  1. There're dozens of open-source home automation projects (my list has ~30 now). Way too much. And no clear leader. (It's not just me having this concern - see http://forum.mysensors.org/topic/175/open-source-home-automation-raspberry and http://www.reddit.com/r/homeautomation/comments/1uee1f/open_source_control_software_roundup/ for example).
  2. So, which one to use, and maybe even contribute? Some choose randomly and bang their head on, I just go thru the list reviewing each, hoping to find "the thing".
  3. In HomeGenie, the Android client what caught my attention. I installed it and immediately hit into https://github.com/genielabs/HomeGenie-Android/issues/3
  4. Ok, so I need to install server too to just try an Android client, I tried, and got into this issue.
  5. I communicated both issues back to you, in the hope that it may provide outsider's perspective on how to make your software better.

5) may seem small, but keep in mind that most people won't do even that, if they see something not working, they strike it out and move to something else. Good rule of thumb is that for each reported problem, there're N more people face it (N > 10).

And I'd love to contribute more than such bug reports, but first I need to be sure that it's the best app and will conquer the world ;-). (And "best" includes things such as "easy to try", "listening to feedback", etc.)

genemars commented 9 years ago

Hi pfalcon,

thanks for contributing with your suggestions. Consider that any issue reported, even if not apparently taken into consideration in a short time, can be a good contribution for future development of this software, whenever it will be the "right time" for it.

Still have to say that HomeGenie project aim is not conquer anything at all =) Please read this: http://www.homegenie.it/forum/index.php?topic=7.0 So if you're looking for the "best app", keep looking, I'm sure you will find something else out here.

Cheers =)