2017-06-11 09:51:31 +00:00
|
|
|
# Anime Notifier
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
### Prerequisites
|
2017-06-21 01:39:40 +00:00
|
|
|
|
|
|
|
* Install a Debian based operating system
|
2017-06-16 13:06:49 +00:00
|
|
|
* Install [Go](https://golang.org/dl/) (1.9 or higher)
|
2017-06-11 09:51:31 +00:00
|
|
|
* Install [Aerospike](http://www.aerospike.com/download) (3.14.0 or higher)
|
|
|
|
|
|
|
|
### Database
|
2017-06-21 01:39:40 +00:00
|
|
|
|
2017-06-11 09:51:31 +00:00
|
|
|
* Remove all namespaces in `/etc/aerospike/aerospike.conf`
|
|
|
|
* Add a namespace called `arn`:
|
2017-06-21 01:39:40 +00:00
|
|
|
|
2017-06-11 09:51:31 +00:00
|
|
|
```
|
|
|
|
namespace arn {
|
|
|
|
storage-engine device {
|
|
|
|
file /home/YOUR_NAME/YOUR_PATH/notify.moe/db/arn-dev.dat
|
2017-06-16 16:12:18 +00:00
|
|
|
filesize 60M
|
2017-06-11 10:02:28 +00:00
|
|
|
data-in-memory true
|
2017-06-11 09:51:31 +00:00
|
|
|
|
2017-06-21 01:39:40 +00:00
|
|
|
# Maximum object size. 128K is ideal for SSDs but we need 1M for search indices.
|
|
|
|
write-block-size 1M
|
2017-06-11 09:51:31 +00:00
|
|
|
|
2017-06-21 01:39:40 +00:00
|
|
|
# Write block size x Post write queue = Cache memory usage (for write block buffers)
|
|
|
|
post-write-queue 16
|
2017-06-11 09:51:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
2017-06-21 01:39:40 +00:00
|
|
|
|
2017-06-11 09:51:31 +00:00
|
|
|
* Start the database using `sudo service aerospike start`
|
|
|
|
* Confirm that the status is "green": `sudo service aerospike status`
|
|
|
|
|
|
|
|
### Hosts
|
2017-06-21 01:39:40 +00:00
|
|
|
|
2017-06-11 09:51:31 +00:00
|
|
|
* Add `127.0.0.1 arn-db` to `/etc/hosts`
|
|
|
|
* Add `127.0.0.1 beta.notify.moe` to `/etc/hosts`
|
|
|
|
|
|
|
|
### Download repository
|
2017-06-21 01:39:40 +00:00
|
|
|
|
2017-06-11 10:02:28 +00:00
|
|
|
* `go get github.com/animenotifier/notify.moe`
|
2017-06-11 09:51:31 +00:00
|
|
|
|
|
|
|
### HTTPS
|
2017-06-21 01:39:40 +00:00
|
|
|
|
2017-06-11 09:51:31 +00:00
|
|
|
* Create the certificate `notify.moe/security/fullchain.pem` (domain: `beta.notify.moe`)
|
|
|
|
* Create the private key `notify.moe/security/privkey.pem`
|
|
|
|
|
|
|
|
### API keys
|
2017-06-21 01:39:40 +00:00
|
|
|
|
2017-06-11 09:51:31 +00:00
|
|
|
* 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`:
|
2017-06-21 01:51:05 +00:00
|
|
|
|
2017-06-11 09:51:31 +00:00
|
|
|
```json
|
|
|
|
{
|
|
|
|
"google": {
|
|
|
|
"id": "YOUR_KEY",
|
|
|
|
"secret": "YOUR_SECRET"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2017-06-16 16:12:18 +00:00
|
|
|
### Build all
|
2017-06-21 01:39:40 +00:00
|
|
|
|
2017-06-16 16:12:18 +00:00
|
|
|
* Run `make all`
|
2017-06-21 01:39:40 +00:00
|
|
|
* Run `make ports` to set up local port forwarding (80 to 4000, 443 to 4001)
|
2017-06-16 16:12:18 +00:00
|
|
|
|
2017-06-11 09:51:31 +00:00
|
|
|
### Fetch data
|
2017-06-21 01:39:40 +00:00
|
|
|
|
2017-06-16 16:12:18 +00:00
|
|
|
* Run `jobs/sync-anime/sync-anime` from this repository to fetch anime data
|
2017-06-11 10:02:28 +00:00
|
|
|
|
|
|
|
### Install pack & run
|
2017-06-21 01:39:40 +00:00
|
|
|
|
2017-06-11 10:02:28 +00:00
|
|
|
* `go install github.com/aerogo/pack`
|
|
|
|
* `go install github.com/aerogo/run`
|
|
|
|
|
|
|
|
### Run
|
2017-06-21 01:39:40 +00:00
|
|
|
|
|
|
|
* Start the web server in notify.moe directory: `run`
|
|
|
|
* Open `https://beta.notify.moe` which should now resolve to localhost
|