From e662e3b45224f4026fc3cc1c8b30843b82c5869e Mon Sep 17 00:00:00 2001 From: iamdoubz <> Date: Wed, 21 May 2025 13:01:21 -0500 Subject: [PATCH] Add python and go sections --- README.md | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b9f8ff..56dcad7 100644 --- a/README.md +++ b/README.md @@ -4,18 +4,44 @@ A simple program that integrates with Windows Services to retrieve the hostname ## Prerequisites +### Python + - At least python3.10 or higher (may work on lower versions but untested) - python and pip are in your environmental variables (python --version) - `pip install pywin32` +### Go + +- At least go 1.18 or higher +- go is in your environmental variables (go version) +- `go install github.com/kardianos/service` + ## Installation +### Python + 1. Download `hostname-service.py` file 2. Open terminal as admin 3. `python hostname_service.py run` +### Go + +1. Clone the repository `git clone https://git.dou.bet/iamdoubz/hostname-service` +2. Enter the directory `cd hostname-service` +3. Open terminal +4. `go run hostname_service.go run` + +## Building + +### Go + +1. `go build -o hostname_service.exe hostname_service.go` +2. Test it `./hostname_service.exe` + ## Program Run Options +### Python + Use `python hostname_service.py` and one of the following option names. | Option Name | Description | @@ -28,7 +54,20 @@ Use `python hostname_service.py` and one of the following option names. | remove | Removes the Windows Service entry | | debug | Runs the Windows service in debug mode | +### Go + +Use `./hostname_service.exe` and one of the following option names. + +| Option Name | Description | +| :---: | ---: | +| | Start the server in standalone mode | +| install | Create a Windows Service entry | +| start | Start the Windows service | +| stop | Stop the Windows service | +| restart | Stop then Start the Windows service | +| uninstall | Removes the Windows Service entry | + ## How to use 1. Make a post request to http://127.0.0.1:8999 with a body payload of `{"ip":"8.8.8.8"}` -2. Should return `{"hostname": "dns.google"}` \ No newline at end of file +2. Should return `{"hostname": "dns.google"}`