Levi Olson 50e1475056 | 4 years ago | |
---|---|---|
assets | 6 years ago | |
.gitignore | 6 years ago | |
LICENSE | 6 years ago | |
README.md | 6 years ago | |
darksky.go | 6 years ago | |
main.go | 4 years ago | |
rest.go | 6 years ago | |
structs.go | 6 years ago | |
weather-api.service | 4 years ago |
A Golang Server that interfaces with the Dark Sky API so my Chrome Extension can get the weather.
sudo ufw status
sudo ufw allow OpenSSH
sudo ufw allow https
sudo ufw enable
curl -C - https://dl.google.com/go/go1.11.4.linux-amd64.tar.gz -o go1.11.4.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.11.4.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin"
go version
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
certbot certonly --standalone -d weather.l3vi.co
sudo useradd weatherapi -s /sbin/nologin -M
sudo cp weather-api.service /lib/systemd/system/.
ls -al /lib/systemd/system
sudo chmod 755 /lib/systemd/system/weather-api.service
# add the DARK_SKY_API_KEY to the weather-api.service file
sudo systemctl enable weather-api.service
sudo systemctl start weather-api.service
sudo journalctl -f -u weather-api
# or
sudo systemctl status weather-api.service
Much of the source I obtained from github.com/shawntoffel/darksky. So thank you shawntoffel and contributors for that amazing codebase!