-
Setup Go, normal CentOS repos are old, use these fancy ones
rpm --import https://mirror.go-repo.io/centos/RPM-GPG-KEY-GO-REPcurl -s https://mirror.go-repo.io/centos/go-repo.repo | tee /etc/yum.repos.d/go-repo.repoyum install golang -y
-
Setup the Go environment
mkdir "$HOME/go"export GOPATH=$HOME/go && echo 'export GOPATH=$HOME/go' >> ~/.bashrcexport PATH=$PATH:$GOPATH/bin && echo 'export PATH=$PATH:$GOPATH/bin' >> ~/.bashrc
-
Clone repository
mkdir -p "$GOPATH/src/github.com/sillypears"cd "$GOPATH/src/github.com/sillypears"git clone https://github.com/sillypears/condor-standings.gitcd condor-standings
-
Create symlink to project in $HOME (optional, but recommended because easy)
ln -s $HOME/go/src/github.com/sillypears/condor-standings cs
-
Pull all go dependencies
cd src && go get ./... && cd ..
-
Setup environment file and configure
cp .env_template .envvim .env- Domain is the public domain name and is required
- Random 64 digit key is required
- Database connectivity is required
- Fill in the rest if wanted, HTTPS is suggested
-
cd "$GOPATH/src/github.com/sillypears/condor-standingsORcd $HOME/cs -
go run src/*.go -
Setting up HTTPS
yum install epel-release -yyum install certbot certbot-apache -yyum install httpd -yecho -e "<VirtualHost *:80>\nServerAdmin admin@test.com\nDocumentRoot "/usr/share/httpd"\nServerName test.com\nServerAlias www.test.com\n</VirtualHost>" > /etc/httpd/conf.d/test.confsystemctl start httpdcertbot certonly --apache -d <domain-name.com> -d <another.domain-name.com> --email <your@email.address> --agree-tos- TLS_CERT_FILE =
/etc/letsencrypt/live/some.pizza/fullchain.pem - TLS_KEY_FILE =
/etc/letsencrypt/live/some.pizza/privkey.pem