Updated README

This commit is contained in:
Eduard Urbach 2017-06-21 03:39:40 +02:00
parent 5ddf387f88
commit e52613019d

View File

@ -3,12 +3,16 @@
## Installation ## Installation
### Prerequisites ### Prerequisites
* Install a Debian based operating system
* Install [Go](https://golang.org/dl/) (1.9 or higher) * Install [Go](https://golang.org/dl/) (1.9 or higher)
* Install [Aerospike](http://www.aerospike.com/download) (3.14.0 or higher) * Install [Aerospike](http://www.aerospike.com/download) (3.14.0 or higher)
### Database ### Database
* Remove all namespaces in `/etc/aerospike/aerospike.conf` * Remove all namespaces in `/etc/aerospike/aerospike.conf`
* Add a namespace called `arn`: * Add a namespace called `arn`:
``` ```
namespace arn { namespace arn {
storage-engine device { storage-engine device {
@ -16,31 +20,36 @@ namespace arn {
filesize 60M filesize 60M
data-in-memory true data-in-memory true
# Maximum object size. 128K is ideal for SSDs # Maximum object size. 128K is ideal for SSDs but we need 1M for search indices.
write-block-size 128K write-block-size 1M
# Write block size x Post write queue = Cache size (for write block buffers) # Write block size x Post write queue = Cache memory usage (for write block buffers)
post-write-queue 128 post-write-queue 16
} }
} }
``` ```
* Start the database using `sudo service aerospike start` * Start the database using `sudo service aerospike start`
* Confirm that the status is "green": `sudo service aerospike status` * Confirm that the status is "green": `sudo service aerospike status`
### Hosts ### Hosts
* Add `127.0.0.1 arn-db` to `/etc/hosts` * Add `127.0.0.1 arn-db` to `/etc/hosts`
* Add `127.0.0.1 beta.notify.moe` to `/etc/hosts` * Add `127.0.0.1 beta.notify.moe` to `/etc/hosts`
### Download repository ### Download repository
* `go get github.com/animenotifier/notify.moe` * `go get github.com/animenotifier/notify.moe`
### HTTPS ### HTTPS
* Create directory `notify.moe/security` * Create directory `notify.moe/security`
* Create the certificate `notify.moe/security/fullchain.pem` (domain: `beta.notify.moe`) * Create the certificate `notify.moe/security/fullchain.pem` (domain: `beta.notify.moe`)
* Create the private key `notify.moe/security/privkey.pem` * Create the private key `notify.moe/security/privkey.pem`
* Add `notify.moe/security/fullchain.pem` * Add `notify.moe/security/fullchain.pem`
### API keys ### API keys
* Get a Google OAuth 2.0 client key & secret from [console.developers.google.com](https://console.developers.google.com) * Get a Google OAuth 2.0 client key & secret from [console.developers.google.com](https://console.developers.google.com)
* Create the file `notify.moe/security/api-keys.json`: * Create the file `notify.moe/security/api-keys.json`:
```json ```json
@ -53,14 +62,20 @@ namespace arn {
``` ```
### Build all ### Build all
* Run `make all` * Run `make all`
* Run `make ports` to set up local port forwarding (80 to 4000, 443 to 4001)
### Fetch data ### Fetch data
* Run `jobs/sync-anime/sync-anime` from this repository to fetch anime data * Run `jobs/sync-anime/sync-anime` from this repository to fetch anime data
### Install pack & run ### Install pack & run
* `go install github.com/aerogo/pack` * `go install github.com/aerogo/pack`
* `go install github.com/aerogo/run` * `go install github.com/aerogo/run`
### Run ### Run
* Start the web server in notify.moe directory: `run`
* Start the web server in notify.moe directory: `run`
* Open `https://beta.notify.moe` which should now resolve to localhost