-
Notifications
You must be signed in to change notification settings - Fork 8
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 -
URLis 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_SERVEis for serving your upload directory through the builtin webserver -
INVITEONLYis true if you want the instance to be invite-only -
PORTis the port that the server will be listening on -
FILELENGTHis the length of randomly generated filenames that are uploaded -
MAXUPLOADSIZEis the maximum upload filesize, this is in MB -
ADMINREGISTERshould always be false unless you are creating an admin user -
ADMINKEYwhile creating an admin user this is the secret key needed to signup as admin
- Set
ADMINREGISTERin .env totrueand setADMINKEYto something secure - Run
node app.jsto start the server - Navigate to
http://yourdomain.com/admin/signup - Put your
usernameandpasswordinto the two fields, put theADMINKEYyou configured in .env as the last field. This should create your admin account. - Shut down the server by pressing
CTRL+Cin the console. - Set
ADMINREGISTERto 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_certificateandssl_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/nekossystemctl restart nginx
This is activating the config we just made and restarting nginx