toenuff / flancy

A micro web framework for Windows PowerShell
MIT License
189 stars 21 forks source link

PowerShell has to be run with elevated permissions #13

Closed beatcracker closed 8 years ago

beatcracker commented 9 years ago

PowerShell has to be run with elevated permissions, otherwise this error message is thrown when creating New-Flancy:

The Nancy self host was unable to start, as no namespace reservation existed for the provided url(s).

Please either enable UrlReservations.CreateAutomatically on the HostConfiguration provided to the NancyHost, or create the reservations manually with the (elevated) command(s):

netsh http add urlacl url=http://+:9999/ user=Everyone

This probably should be stated somewhere in readme and\or examples.

toenuff commented 8 years ago

I've updated this already in my private repo - Going forward it will prompt for elevated privs. Basically, it sets urlreservations.createautomatically in Nancy. If you are not elevated, it attempts to elevate on its own. I'll push this to devel soon.

Actually, the whole thing is poor. You shouldn't need admin privs to open a port in a high enough range, but I can't find a way around it.

toenuff commented 8 years ago

oooo- figured it out - you can run nancy as a user - config.urlreservations.user = username. I'll make this the default and add some sort of parameter to make it a system-level "everyone" change.

beatcracker commented 8 years ago

Works like a charm, thank you!