-
Notifications
You must be signed in to change notification settings - Fork 13
Documentation of Setting Development Environment for CDN
Requirement: CDN can be set for LinuxOS and MacOS.
Prerequisites: git, go programming language (https://golang.org), gpg
Install Go Programming Language:
- Download the package from https://golang.org/dl/
- You can find the installation instructions for each OS in the following link: https://golang.org/doc/install
The next step is to set your GOPATH environment variable:
echo "GOPATH=$HOME/go" >> ~/.bashrc
echo "export GOPATH" >> ~/.bashrc
This will set GOPATH environment variable to your home directory/go
. You may want to use different path.
To check your changes open new terminal window and check your go
again with the command go env
. You must see the line GOPATH=/home/yourUserName/go
.
Now, in order to start with the beginnings, you need to download CDN repo to your computer. Follow these steps:
- Make sure you have
git
installed on your system. To install it usesudo apt-get install git
- Run
go get github.com/subutai-io/cdn
Then, start your CDN server:
- Open terminal
- Create a directory for CDN database:
sudo mkdir /opt/gorjun
- Give the CDN directory read/write permissions using this command:
sudo chown $USER /opt/gorjun
- Switch to CDN code directory:
cd $GOPATH/src/github.com/subutai-io/cdn
- Start CDN with
go run main.go
In order to establish and test your connection with CDN, follow these steps:
-
Generate your own GPG key if you don't have one
-
Create new file
registration.sh
and fill it with the script from the following link: https://github.com/subutai-io/cdn/wiki/Authentication#registration and substitute KEY with your public GPG key (KEY=”your public key”). -
Run your bash script
Before you run the script you have to make it executable: chmod +x registration.sh
.
Then run the script by typing: ./registration.sh
(make sure that your CDN server is running in the parallel terminal window).
- Check in the logs of server that you have registered on it.
You are all set now. For the next steps follow the aforementioned link: https://github.com/subutai-io/cdn/wiki/Authentication#token.