You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Sarah Jamie Lewis 819c766aa2 Merge pull request 'add flags: dir, disableMetrics and env var DISABLE_METRICS to the app' (#26) from appFlags into trunk 5 days ago
app add flags: dir, disableMetrics and env var DISABLE_METRICS to the app 1 week ago
docker change -exportTofuBundle to -exportServerBundle 1 month ago
metrics refactor monitors, remove pidusage, fix logging optionality, improve fetch stats, improve reporting 1 week ago
storage refactor monitors, remove pidusage, fix logging optionality, improve fetch stats, improve reporting 1 week ago
testing golint -> staticcheck and required changes 4 weeks ago
.drone.yml golint -> staticcheck and required changes 4 weeks ago
.gitignore Replace legacy message store with sqlite3 message store 7 months ago
README.md add flags: dir, disableMetrics and env var DISABLE_METRICS to the app 1 week ago
go.mod refactor monitors, remove pidusage, fix logging optionality, improve fetch stats, improve reporting 1 week ago
go.sum refactor monitors, remove pidusage, fix logging optionality, improve fetch stats, improve reporting 1 week ago
server.go refactor monitors, remove pidusage, fix logging optionality, improve fetch stats, improve reporting 1 week ago
serverConfig.go refactor monitors, remove pidusage, fix logging optionality, improve fetch stats, improve reporting 1 week ago
server_tokenboard.go adding 'servers' interface to manage multiple servers and support for encrypted configs 2 months ago
servers.go refactor monitors, remove pidusage, fix logging optionality, improve fetch stats, improve reporting 1 week ago
servers_test.go server need .Stop() and .Destroy() 1 month ago

README.md

Cwtch Server

Building

Pretty straight forward:

  • build the app in app/ with go build
  • build the docker container in docker/ with docker build . -t openpriv/server

Windows

The server package relies on sqlite which in turn requires the use of CGO. As per this issue that means TDM-GCC is required to be installed and used to compile on Windows

Running

  • cd app
  • go build
  • ./app

The app takes the following arguments

  • -debug: enabled debug logging
  • -exportServerBundle: Export the server bundle to a file called serverbundle
  • -disableMetrics: Disable metrics reporting to serverMonitor.txt and associated tracking routines
  • -dir [directory]: specify a directory to store server files (default is current directory)

The app takes the following environment variables

  • CWTCH_HOME: sets the config dir for the app
  • DISABLE_METRICS: if set to any value ('1') it disables metrics reporting to serverMonitor.txt and associated tracking routines

env CONFIG_HOME=./conf ./app

Using the Server

When run the app will output standard log lines, one of which will contain the tofubundle in purple. This is the part you need to capture and import into a Cwtch client app so you can use the server for hosting groups

Docker

Build by executing docker build -f docker/Dockerfile .

or run our prebuild ones with

pull openpriv/cwtch-server

and run it. It stores all Cwtch data in a Volume at /var/lib/cwtch so if you want the server data to persist you would run

docker run openpriv/cwtch-server -v /var/lib/cwtch/server01:/var/lib/cwtch

to create a persistent container you might try a command like:

docker run openpriv/cwtch-server --name cwtch -v /var/lib/cwtch/server01:/var/lib/cwtch --restart always