2017-06-11 09:51:31 +00:00
|
|
|
# Anime Notifier
|
|
|
|
|
2017-06-25 16:06:03 +00:00
|
|
|
## Info
|
|
|
|
|
|
|
|
notify.moe is powered by the [Aero framework](https://github.com/aerogo/aero) from the same author. The project also uses Go and Aerospike.
|
|
|
|
|
2017-06-11 09:51:31 +00:00
|
|
|
## 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)
|
|
|
|
|
2017-06-21 20:25:38 +00:00
|
|
|
### Download the repository and its dependencies
|
|
|
|
|
|
|
|
* `go get github.com/animenotifier/notify.moe`
|
|
|
|
|
|
|
|
### Install pack & run
|
|
|
|
|
|
|
|
* `go get github.com/aerogo/pack`
|
|
|
|
* `go get github.com/aerogo/run`
|
|
|
|
* `go install github.com/aerogo/pack`
|
|
|
|
* `go install github.com/aerogo/run`
|
|
|
|
|
|
|
|
### Build all
|
|
|
|
|
|
|
|
* Run `make all`
|
|
|
|
* Run `make ports` to set up local port forwarding *(80 to 4000, 443 to 4001)*
|
|
|
|
* You should be able to start the server by executing `run` now
|
|
|
|
|
2017-06-11 09:51:31 +00:00
|
|
|
### 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-21 20:25:38 +00:00
|
|
|
filesize 64M
|
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)
|
2017-06-21 20:25:38 +00:00
|
|
|
post-write-queue 1
|
2017-06-11 09:51:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
2017-06-21 01:39:40 +00:00
|
|
|
|
2017-06-21 20:25:38 +00:00
|
|
|
* Download the [database for developers](https://mega.nz/#!iN4WTRxb!R_cRjBbnUUvGeXdtRGiqbZRrnvy0CHc2MjlyiGBxdP4) to notify.moe/db/arn-dev.dat
|
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`
|
|
|
|
|
|
|
|
### 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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### 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
|
|
|
|
|
|
|
### 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
|