-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,31 @@ | ||
# Steps for deployment | ||
|
||
1. Create droplet on Digitalocean, specifying to use your SSH key at creation time (so it gets added in the root account automatically). | ||
2. Open the console (via browser) logged in as root: | ||
1. `useradd itacpc` | ||
2. `adduser itacpc sudo` | ||
3. Copy the right key from `/root/.ssh/authorized_keys` into `/home/itacpc/.ssh/authorized_keys` | ||
3. Close the browser console | ||
4. Create a section in your laptop's `~.ssh/config` file such as the following | ||
1. Update the `teams` DNS record on Cloudflare so that `teams.itacpc.it` points to the IP address of the newly created droplet. | ||
1. Create a new CNAME record for the year-specific subdomain (e.g. `teamsXX`) which points to `teams.itacpc.it`. | ||
1. Delete the CNAME record for the previous year. | ||
1. Open the console (via browser) logged in as root: | ||
1. `useradd itacpc`. | ||
1. `adduser itacpc sudo`. | ||
1. Copy the right key from `/root/.ssh/authorized_keys` into `/home/itacpc/.ssh/authorized_keys`. | ||
1. Close the browser console. | ||
1. Create a section in your laptop's `~.ssh/config` file such as the following: | ||
``` | ||
Host teams | ||
User itacpc | ||
Hostname IP_ADDRESS_OR_DOMAIN_HERE | ||
Hostname teamsXX.itacpc.it | ||
IdentityFile ~/.ssh/your_chosen_key_rsa | ||
``` | ||
5. Log in from a normal terminal with `ssh teams` | ||
6. Update ubuntu `sudo apt update && sudo apt upgrade` | ||
7. Run `sudo apt install pipenv git nginx certbot` | ||
8. Clone this repository `git clone [email protected]:itacpc/teams.git` | ||
9. Enter the repository and create the pipenv `pipenv install` | ||
10. Copy the nginx configuration `sudo cp nginx/itacpc /etc/nginx/sites-available/` | ||
11. Enable the nginx configuration `sudo ln -s /etc/nginx/sites-available/itacpc /etc/nginx/sites-enabled/itacpc` | ||
12. Update the systemd configuration in `systemd/gunicorn.service` with the correct Python virtual environment path. | ||
13. Copy the systemd configuration `sudo cp systemd/* /etc/systemd/system/` | ||
14. Enable the systemd configuration `sudo systemctl enable gunicorn --now` | ||
15. Run certbot to fix HTTPS stuff: `sudo certbot` | ||
1. Log in from a normal terminal with `ssh teams`. | ||
1. Update ubuntu `sudo apt update && sudo apt upgrade`. | ||
1. Run `sudo apt install pipenv git nginx certbot`. | ||
1. Clone this repository `git clone [email protected]:itacpc/teams.git`. | ||
1. Enter the repository and create the pipenv `pipenv install`. | ||
1. TODO: create database, add production `.env` file, initialize universities, create superuser. | ||
1. Update the systemd configuration in `systemd/gunicorn.service` with the correct Python virtual environment path. | ||
1. Copy the systemd configuration `sudo cp systemd/* /etc/systemd/system/`. | ||
1. Enable the systemd configuration `sudo systemctl enable gunicorn --now`. | ||
1. Copy the nginx configuration `sudo cp nginx/itacpc /etc/nginx/sites-available/`. | ||
1. Disable the default nginx configuration `sudo rm /etc/nginx/sites-enabled/default`. | ||
1. Enable the new nginx configuration `sudo ln -s /etc/nginx/sites-available/itacpc /etc/nginx/sites-enabled/itacpc`. | ||
1. Run certbot to fix HTTPS stuff: `sudo certbot`. |