Questions about how to use the Windows version
gerbenvandijk opened this issue ยท 5 comments
Hi there,
I've been using Grocy for Windows and it's great so far, thanks ๐. I'm having some issues with reaching the Grocy interface over my internal network and setting the language, was hoping you could shed some light on the following:
- I'm able to reach Grocy in a browser on the same machine that Grocy for Windows runs on (via e.g.
http://localhost:$PORT_NUMBER
). And I've allowed all ports on both incoming and outgoing UDP and TCP connections for the Grocy app in the Windows security center. Yet I'm not able to reach them from other machines on my local network, even though I'm serving several other webapps (e.g. Home Assistant and Plex) from the same machine without any issues. Could you give me some pointers in how to get this to work? - When Grocy for Windows starts, it allways overwrites the files in the
settingoverrides
folder. For instance it sets theCULTURE
value to the language of the OS automatically. I've tried to overwrite it manually (my Windows is in Dutch but I want Grocy in Enlish) but each time when I restart Grocy, it overwrites it with the OS language again. Also it seems to randomize the port number inBASE_URL
on start. Could you perhaps give some pointers how to be able to override both in a way that persists through restarts of the app?
Thanks so much, and kind regards!
So this is about grocy-desktop, not a custom setup of grocy on Windows, right?
I've moved this to grocy/grocy-desktop.
First question:
This is not the intention for grocy-desktop (which is meant to use grocy just as normal desktop application and don't care about anything technical), more just a "normal" grocy setup...
It could be possible, but currently is not because the used PHP development server is fixed bound to localhost
and therefore only reachable from the same machine, regardless of firewall rules (ref).
Maybe we could add an option to configure this, feel free to open a separate issue about that.
(But would introduce other problems like that you need admin-permissions to bind anything to a globally accessible port...)
Second question:
Basically the same, not the current intention of grocy-desktop. Of course would be also possible to add options for that somehow.
I think in general this is not something for grocy-desktop, but for a new project, which is basically the same, but without a browser - so an executable which does also the PHP server management stuff and just exposes (a configurable) port to access grocy...
(We already had that topic on reddit: https://www.reddit.com/r/grocy/comments/cvouji/windows_installer/)
Thanks so much for the answer, I thought that this would be the case (the Windows version not being intended to use like this). Apologies, I didn't spot the separate repo :-)
I feel like it would be super useful to expose the server that is currently only on localhost
. And to be to be able to set a fixed port and language. Most self hosted web apps do it like this too, and somehow it was what I expected when I downloaded it (based off the info on the Grocy site).
A more simple executable without an app wrapper and that just exposes a grocy instance would also be great and solve my case. It just feels to me like the Windows app is nearly at this point already, it would only need these two things facilitated and then it would be as accessible as the custom install would be, it would give the less tech savvy users still the easy setup and UI, but also provide the more tech savvy users the possibility to customise it and access it from remote.
I'll see if I can help in any way and explore both cases - I'm a web developer myself but have no knowledge on how to do windows apps etc. I'll check the repo out this weekend ๐
In the meanwhile I'll look into doing a custom install so I can access Grocy from remote too - I was just hoping to avoid this ;-)
This fits not completely for grocy-desktop, as also authentication is disabled, no built-in SSL, and so on...
However, it would be possible to expose the localhost-bound port via a reverse proxy or similar - also Windows has something like that built-in (portproxy) - so assumeing that there is no other php.exe
running on your machine, the following little PowerShell script searches for the port of the currently running PHP server and exposes it on port 8080
, accessible from everywhere:
# Define the exposed port
$exposedPort = 8080
# Search for the used port of grocy-desktop, resp. the one of the php.exe process
$grocyPhpServerPort = (Get-NetTCPConnection | Select LocalPort,@{Name="Process";Expression={(Get-Process -Id $_.OwningProcess).ProcessName}} | Where Process -eq php).LocalPort
# Create the portproxy ($grocyPhpServerPort@localhost -> $exposedPort@AllInterfaces)
netsh interface portproxy add v4tov4 listenport=$exposedPort listenaddress=* connectport=$grocyPhpServerPort connectaddress=127.0.0.1
# Create a firewall rule to allow accessing $exposedPort from anywhere
netsh advfirewall firewall add rule name="grocy-desktop exposed" dir=in action=allow protocol=TCP localport=$exposedPort
# Delete the portproxy and the firewall rule
# netsh interface portproxy delete v4tov4 listenport=$exposedPort listenaddress=*
# netsh advfirewall firewall delete rule name="grocy-desktop exposed" dir=in protocol=TCP localport=$exposedPort
# Show all portproxies
# netsh interface portproxy show all
Thanks so much for putting in the effort! I'll tinker with it :-) In the meanwhile I've also setup Grocy via Docker and I will most likely switch to this. I'm experiencing some I/O errors on the shared volume - I mapped it to a local folder for backup purposes - but I think these are related to windows / docker setup.