chriseldredge / Klondike

Ember front-end that builds on NuGet.Lucene for private package hosting
Apache License 2.0
299 stars 73 forks source link

Self Hosted Run As A service installer #150

Closed ashtonian closed 8 years ago

ashtonian commented 8 years ago

I think it would really round out the experience of Klondike if there was an installer that would install the self hosted option as service? similar to Octopus Deploy and TC.

what do you think?

matthewhartstonge commented 8 years ago

Would a docker container work for you in this case instead of an installer? Or are you wanting this specifically for windows?

ashtonian commented 8 years ago

I wish we were using docker, as it is the future but my case is specifically windows right now and we don't currently have docker in our stack. Our docker adoption will likely come with the upgrade to .net core whenever they stabilize all of that - as it seems that everything will be easily docker-able.

I'm unfamiliar with how the self hosting works but we usually use topshelf for console apps we'd like to host as a service and it provides a very easy --install command line argument and is smart enough to run like a console app when debugging locally and essentially removes all pain points of dealing with windows services. Its also very quick to get going. Its not a full blown installer or manager but its something. I would think you would want to add arguments to specify different config options like port number and stuff.

Actually the more I think about it the more I wonder how is the self hosting setup currently? I gave up a bit quickly on it honestly. It blew up and I assumed it was just a console app that you would run to start the website and I need an always on solution so I just went with the IIS route. But is that the current behavior or does it actually install something somewhere? I'll try it again and see why it blew up tomorrow.

chriseldredge commented 8 years ago

The self hosted executable will determine if it should run as a Windows Service or interactively on the command line. This works fine on Windows but not on Mono because Environment.UserInteractive is always false. If the program blew up, it's probably not because you tried to run it from a console instead of as a service. The --interactive argument allows you to explicitly specify how it should run.

To address the original question: TeamCity and Octopus Deploy are commercial products. Klondike is not. Installers are notoriously difficult and tend to require more investment of time than they are worth for a small project like this. Furthermore, Klondike is cross platform and runs on Windows, OS X and Linux. Installers are platform dependent.

Another option would be to create a Chocolatey package, but that ecosystem is tied to Windows as well.

To summarize: in my opinion this is more trouble than its worth for a small project like Klondike.

chriseldredge commented 8 years ago

In case you missed it, there is already a one-liner recipe for creating a service in the Klondike.SelfHost README

ashtonian commented 8 years ago

Thanks very much @chriseldredge - missed that readme and that would explain why it blew up, and it also meets all my needs.