4.6 KiB
title |
---|
ao-cli |
ao-cli will do all the below stuff so it will be able to be removed from the manual soon.
The AO comes with a comprehensive install script, just download and run it and it will do everything.
-
Open a terminal (in your home directory).
-
`wget https://raw.githubusercontent.com/coalition-of-invisible-colleges/ao-react/master/install.sh`
-
`chmod +x install.sh`
-
`./install.sh`
-
Wait for installation to finish. It may take 15 minutes or up to several hours on slower computers.
Now, you must delete the autogenerated configuration.js file and run the install script a second time to regenerate it. (Do not delete your configuration.js file if you have already customized it!)
-
`rm ~/ao-react/configuration.js`
-
`./install.sh`
The second time you run the AO install script, it should say "already installed" for everything. If it doesn't, please tell an AO dev so they can update the install script., 'Configuring the AO': 'How to set up your configuration.js file and .env file. Sane defaults to be provided here.', 'Setting up nginx':
If you are running your AO on your own computer for personal use, you might not need to set up nginx. However, if you want your AO to be accessible from another computer, set up nginx to allow outside connections to be proxied to the AO.
The AO install script will install nginx, or you can install it yourself.
Create a file for each website you want to host with nginx in /etc/nginx/sites-available/, and then use ln -s to create a symbolic link to the configuration file in /etc/nginx/sites-enabled/.
Here is an example configuration file from DCTRL:
map $http_upgrade $connection_upgrade { default upgrade; '' close; }
server { server_name ao.dctrl.ca;
root /home/dctrl/ao-react/dist/;
location / {
index index.html index.htm index.nginx-debian.html;
try_files $uri $uri/ =404;
}
location ~ ^/(login|task/) {
try_files /index.html =404;
}
location ~ ^/(logout|meme|memes|events|search|session|state|upload|download|fetchTaskByID|fetchTaskByName) {
proxy_pass http://127.0.0.1:8003;
}
location /socket.io {
proxy_pass http://127.0.0.1:8003;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/dctrl.ca/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/dctrl.ca/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot }
server { if ($host = ao.dctrl.ca) { return 301 https://$host$request_uri; } # managed by Certbot
listen 80 default_server;
listen [::]:80 default_server;
server_name ao.dctrl.ca;
return 404; # managed by Certbot
}, 'Setting up file hosting':
When the AO starts, it scans the ~/.ao/memes folder for files. It hashes each file and checks to see if a card with that hash already exists. If not, it creates it.
When users drop a file on an empty grid square, it will be uploaded to this directory and linked with a new card via the file's hash. The text of the card will be the filename of the uploaded file.
In configuration.js, there are four configuration options related to files:
-
dir: The directory of the memes folder to scan, by default ~/.ao/memes
-
sshKey: The path to the id_rsa file for the ssh key to use to connect to other AOs for rsync-based filesharing
-
sshUsername: The username to use for the ssh key
-
videoCacher: The path to to the youtube-dl executable/bin file
For example:
memes: {
dir: '/home/dctrl/.ao/memes',
sshKey: '/home/dctrl/.ao/id_rsa'
sshUsername: 'doge',
videoCacher: '/usr/bin/youtube-dl',
},, 'Setting up filesharing over Tor':
You must create an SSH key using ssh-keygen (or use an existing key you have) to use the AO's automatic fle attachment synchronzation feature. See the previous section for the configuration options to set with the path to your SSH key.
You must also use ssh-copy-id or edit the known_hosts file on the other computer in order to give this AO access to the other one via SSH, for copyng files with rsync.`, 'Setting up Signal Notifications': 'The AO install script will soon install signal-cli automatically, or the AO will include a Signal library that does not need to be compiled separately. Compiling signal-cli yourself is a pain and not recommended, since the pieces must be compiled separately and the broken installation scripts modified by hand.',