From b29a6efba5034fcec77814c2f7fbe17f4549edcf Mon Sep 17 00:00:00 2001 From: Josh Mudge Date: Fri, 15 Nov 2019 14:52:10 -0700 Subject: [PATCH] Add Service docs. --- All/Server.xml | Bin 0 -> 3230 bytes All/Sign Using OV Cert.md | 31 +++++++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 All/Server.xml diff --git a/All/Server.xml b/All/Server.xml new file mode 100644 index 0000000000000000000000000000000000000000..51bc481393498721257967cfc1833856b5bcd5be GIT binary patch literal 3230 zcmbuCUsDq?6vgkeGk%8-?@*8`e`bX#v}zTFfg&$`sceA`?Uv~lt6yIIorGmKTM7kd zr<*0YIrrR?o15_WPh`9H%Z4_viv6^njV-mljV!VEwq$FzVym6K&G?H2!6 zcpZb^u%?~Z7cdX)2>kDSH*Fuq+hBFpLOZ@& zb75q5*=+SKu8vlHjCPkiK8woA?cseye4$-vJPep9E;b5X)58=$9d zT?Zgf;Vl1S-Yxd~A^!IGTTy6@`n(m#g`1&ulTI(g2zkiwhzyfg?MtuOV*Z~uH}qRa zUmy7=7kA8VP^7A`+I5OM+;NM|2)*R0p1C@nJdl%RRTrBR`tdtKstw2(X{kJ!u&&CQ z>jk{N1R><0eXML&J)NKZeg|YLC&t-4RWwz(FvlLVEc*Ajs?#aneI^&t%eaqO7IBs5 z8NbsseBE^p#dwM;6A=$6<=&d$fsQSL%qtQ;at_nn5PGqvLfMFIBzyPGEK@T zk6DJ8^Q(t6)A|g_UhTs=_2I_lRm$r6dr8^v|DuK5{K<0)k3RXR>KEhR-^F5Ay?vdM z+PXC*ScKK$We6dQGjiq{iMd_jX(YOuw(xKMi~iz literal 0 HcmV?d00001 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.