User Tools

Site Tools


setting-up-rct-service

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
setting-up-rct-service [2019/06/13 19:57]
gsamfira removed
— (current)
Line 1: Line 1:
-<markdown> 
-# Installing rct-service 
  
-This guide will walk you through installing ```rct-service``` from source on a fresh installation of Windows Server 2016 and above. 
- 
-## Download the binary 
- 
-```powershell 
-[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 
- 
-$cli = New-Object "System.Net.WebClient" 
-$cli.DownloadFile("https://cloudbase.it/downloads/app/hyper-v/rct-service.zip", "$env:USERPROFILE\rct-service.zip") 
-``` 
- 
-Extract files: 
- 
-```powershell 
-Expand-Archive $env:USERPROFILE\rct-service.zip -DestinationPath $env:USERPROFILE\rct 
-``` 
- 
-The RCT service requires some x509 certificates. All traffic is over HTTPS. You may use whichever method you want to generate them. 
- 
-For your convenience, the gen-certs.exe application can generate a proper CA and server/client certificates in one go. The pre-compiled binary can be downloaded [from here](http://wiki.cloudbase.it/_media/gen-certs.zip) 
- 
-```powershell 
-$cli.DownloadFile("http://wiki.cloudbase.it/_media/gen-certs.zip", "$env:USERPROFILE\gen-certs.zip") 
-Expand-Archive "$env:USERPROFILE\gen-certs.zip" -DestinationPath "$env:USERPROFILE\rct" 
-``` 
- 
-## Generate certificates 
- 
-```powershell 
-& "$env:USERPROFILE\rct\gen-certs.exe" -certificate-hosts "127.0.0.1,localhost" -output-dir "$env:USERPROFILE\rct" 
-``` 
- 
-You should now have a bunch of certificates in ```$env:USERPROFILE\rct``` 
- 
-## Create Rocket.toml 
- 
-Rocket looks for it's config in the current working directory. If none is found, it will go one level up and look there. It will keep doing this until it reaches the filesystem root. 
- 
-We will be writing the config in the root of the filesystem. Because I am lazy, and I have no idea what the CWD is for a windows service. 
- 
-Expand the full path to the certificates: 
- 
-```powershell 
-ls $env:USERPROFILE\rct 
-``` 
- 
-In my case it's ```C:\Users\Administrator\rct```. 
- 
-```powershell 
-$config = @" 
-[global] 
-# Use something else 
-auth_key = "swordfish" 
-address = "0.0.0.0" 
-port = 6677 
- 
-[global.tls] 
-certs = "C:/Users/Administrator/rct/srv-pub.pem" 
-key = "C:/Users/Administrator/rct/srv-key.pem" 
-"@ 
- 
-Set-Content C:\Rocket.toml $config 
-``` 
-| WARNING: Notice we are using forward slashes in the config! | 
-| --- | 
- 
-| WARNING: Depending on your client, you may need to concatenate the ```ca-pub.pem``` with ```srv-pub.pem``` | 
-| --- | 
- 
- 
-## Install the service 
- 
-```powershell 
-New-Service -Name rct-service ` 
-  "C:\Users\Administrator\rct\OpenStackService.exe rct-service C:\Users\Administrator\rct\rct-service.exe" ` 
-  -DisplayName rct-service -StartupType Automatic 
-``` 
- 
-## Start service 
- 
-```powershell 
-Start-Service rct-service 
-``` 
-</markdown>