server-origin

module
v0.0.0-...-6f358d4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2020 License: MIT

README

Voila-CDN: Origin Server

Origin server of voila-CDN

Check out the API document on Apiary

Deployment

  • Create a folder for storing files, for later to upload to replica server.
  • Create a config file called voila-CDN-origin.json, and put it under the folder configs
  • Configure the replicaHosts, which is the list of addresses of replica servers.
  • run the following command. You may also specify the port to map (e.g. add -p 13399:3399 after docker run ...)

  docker run -d \
  --name vcdn-ori-c1 \
  -v /path/2/configs:/www/voila-CDN-origin/configs \
  -v /path/2/localFileFolder:/www/voila-CDN-origin/statics/files \
  valorad/voila-cdn-origin

  # inspect id
  docker inspect vcdn-ori-c1 | grep '"IPAddress"' | head -n 1

Development

Fetch package
  $ go build
  $ go mod tidy
  $ go mod vendor
Get the dist folder ready
  • Create the dist folder
  • then create a voila-CDN-origin.json under dist/configs folder
  • put the files you like under statics/files folder
Run

Always run the program only when you are at dist folder.

  # Linux
  $ cd dist
  $ go build -o ./originServer ../src/originServer.go && ./originServer
  # Windows
  PS> cd dist
  PS> go build -o .\originServer.exe ..\src\originServer.go ; .\originServer.exe

Directories

Path Synopsis
src

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL