A very specific Golang interface to the Dark Sky API for my Chrome Extension
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.

40 lines
1.4 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. # Dark Sky API Interface
  2. A Golang Server that interfaces with the Dark Sky API so my Chrome Extension can get the weather.
  3. ## Firewall
  4. sudo ufw status
  5. sudo ufw allow OpenSSH
  6. sudo ufw allow https
  7. sudo ufw enable
  8. ## Install Go
  9. curl -C - https://dl.google.com/go/go1.11.4.linux-amd64.tar.gz -o go1.11.4.linux-amd64.tar.gz
  10. tar -C /usr/local -xzf go1.11.4.linux-amd64.tar.gz
  11. echo "export PATH=$PATH:/usr/local/go/bin"
  12. go version
  13. ## Letsencrypt
  14. sudo add-apt-repository ppa:certbot/certbot
  15. sudo apt-get update
  16. sudo apt-get install python-certbot-nginx
  17. certbot certonly --standalone -d weather.l3vi.co
  18. ## Systemd
  19. sudo useradd weatherapi -s /sbin/nologin -M
  20. sudo cp weather-api.service /lib/systemd/system/.
  21. ls -al /lib/systemd/system
  22. sudo chmod 755 /lib/systemd/system/weather-api.service
  23. # add the DARK_SKY_API_KEY to the weather-api.service file
  24. sudo systemctl enable weather-api.service
  25. sudo systemctl start weather-api.service
  26. sudo journalctl -f -u weather-api
  27. # or
  28. sudo systemctl status weather-api.service
  29. ## Thanks
  30. Much of the source I obtained from [github.com/shawntoffel/darksky](https://github.com/shawntoffel/darksky). So thank you [shawntoffel](https://github.com/shawntoffel) and [contributors](https://github.com/shawntoffel/darksky/graphs/contributors) for that amazing codebase!