-
Notifications
You must be signed in to change notification settings - Fork 10
Instructions
Requirements:
- yarn
- mongo
- nginx (optional)
- Clone the repository with
git clone https://github.com/Riku32/nekos.cafe.git
- Run the command
yarn
, this will install all the required packages for nekos.cafe
The default .env.example
file should look like this
MONGOURL=mongodb://database:port
DBNAME=dbname
UPLOAD_DIR=./uploads/
UPLOADS_SERVE=true
URL=http://localhost:8080/
INVITEONLY=false
PORT=8080
FILELENGTH=7
MAXUPLOADSIZE=100
ADMINREGISTER=false
ADMINKEY=supersecurekey
- Copy/rename this file to .env
- Put your mongo connection string in
MONGOURL
- Put your database name within mongo at
DBNAME
- Put your upload directory at
UPLOAD_DIR
-
URL
is where your file serve domain will be. If you aren't using a custom domain to serve files just put your domain name here. Make sure it ends with a/
-
UPLOADS_SERVE
is for serving your upload directory through the builtin webserver -
INVITEONLY
is true if you want the instance to be invite-only -
PORT
is the port that the server will be listening on -
FILELENGTH
is the length of randomly generated filenames that are uploaded -
MAXUPLOADSIZE
is the maximum upload filesize, this is in MB -
ADMINREGISTER
should always be false unless you are creating an admin user -
ADMINKEY
while creating an admin user this is the secret key needed to signup as admin
- Set
ADMINREGISTER
in .env totrue
and setADMINKEY
to something secure - Run
node app.js
to start the server - Navigate to
http://yourdomain.com/admin/signup
- Put your
username
andpassword
into the two fields, put theADMINKEY
you configured in .env as the last field. This should create your admin account. - Shut down the server by pressing
CTRL+C
in the console. - Set
ADMINREGISTER
to false
After this you should be good to go, just create an account regularly at http://yourdomain.com/signup
and continue, if you need to create a registration key for friends or yourself visit http://yourdomain.com/admin
and you should have access to the admin panel to create regkeys.
Follow these steps if you want to use SSL or need to reverse proxy the application. This will not tell you how to install nginx, research that elsewhere. This guide assumes you are using ubuntu as your operating system.
- Go to
/etc/nginx/sites-available
- Create a file here prefferably called
nekos
server {
listen 443 ssl;
server_name yourdomain.com;
ssl_certificate /etc/ssl/certs/server.pem;
ssl_certificate_key /etc/ssl/certs/server.key;
location / {
proxy_pass http://localhost:8080;
}
}
This should be the content of the file if you did not change the port settings in .env
Change server_name
to your domain and set the ssl options to your certificate.
If you do not want to use ssl then follow the additional instructions below
- Change
443 ssl;
to80;
- Remove
ssl_certificate
andssl_certificate_key
. Once you are sure that your config is complete run the two commands belowln -s /etc/nginx/sites-available/nekos /etc/nginx/sites-enabled/nekos
systemctl restart nginx
This is activating the config we just made and restarting nginx