Skip to content
This repository has been archived by the owner on May 20, 2020. It is now read-only.

AstroPlant/astroplant-server-deployment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This was used for the old AstroPlant server implementation and is no longer used. You can find the new AstroPlant back-end at https://github.com/AstroPlant/astroplant-backend.

AstroPlant deployment

AstroPlant server deployment using Ansible.

Requirements

Ansible 2.5

Configuring

You need to supply a secret key for the Django application and a password for the database user. Copy the files in ./conf and remove the .example suffix, and edit the newly created files.

Executing playbooks (on the Ansible controller machine)

Before executing playbooks, add your public SSH key to the target machines' authorized keys. Otherwise Ansible cannot connect.

Run the AstroPlant playbook to deploy the server:

ansible-playbook astroplant.yml

Perform manually (on the back-end machine)

Create/upgrade the database (make sure to backup the current database first):

source /home/astroplant/astro_venv/bin/activate && python manage.py migrate

If desired, you can import default AstroPlant data (such as measurement types, peripheral device definitions, etc.):

source /home/astroplant/astro_venv/bin/activate && python manage.py loaddata astroplant

Manually request a LetsEncrypt certificate for your domain:

$ /opt/certbot/certbot-auto certonly --webroot -w /var/www/astroplant -d example.com

Start the Daphne server to serve request:

source /home/astroplant/astro_venv/bin/activate && daphne server.asgi:application

About

Deployment scripts for the server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages