diff --git a/All/Server.xml b/All/Server.xml new file mode 100644 index 0000000..51bc481 Binary files /dev/null and b/All/Server.xml differ diff --git a/All/Sign Using OV Cert.md b/All/Sign Using OV Cert.md index 39e18f1..8c5efb6 100644 --- a/All/Sign Using OV Cert.md +++ b/All/Sign Using OV Cert.md @@ -23,7 +23,18 @@ Download `server.go` by running the following in a command prompt: ``` # Download the server file. powershell -Command Invoke-WebRequest -OutFile server.go https://git.rootprojects.org/josh/code-signing-final/raw/branch/master/All/server.go +``` +### Custom Port +If you want the server to listen on a port other than port 80, you can edit this line in the `server.go` file: +``` +port := flag.String("p", "80", "port to serve on") +``` +Change "80" to whatever port you want to use. + +## Version Info + +``` # Download a pre-made config file for goversioninfo: powershell -Command Invoke-WebRequest -OutFile versioninfo.json https://git.rootprojects.org/josh/code-signing-final/raw/branch/master/All/versioninfo.json @@ -147,12 +158,24 @@ Import command completed: 1 entries successfully imported, 0 entries failed or You can find more information about how this works at the source: https://stackoverflow.com/a/50900084 -## WIP: Service +## Service ``` -SCHTASKS /Create /RU SYSTEM /SC ONSTART /TN "A Go Web Server" /TR "C:\Users\Josh\.local\opt\serviceman\bin\serviceman.A Go Web Server.exe" +# Download the task file. +powershell -Command Invoke-WebRequest -OutFile Server.xml https://git.rootprojects.org/josh/code-signing-final/raw/branch/master/All/Server.xml ``` +To change what file will be launched as administrator on boot, edit this line of the `Server.xml` file and replace the path in quotes. -Service: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/new-service?view=powershell-6 -Credential seems to be what makes it admin or not: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/set-service?view=powershell-6 +``` +"C:\Users\Josh\Downloads\server.exe" +``` + +Run a command prompt as administrator, then run: + +``` +# Create task based off the XML. +SCHTASKS /create /XML "Server.xml" /tn "Task Name" +``` + +You're done! It will launch your program as administrator by default on boot.