· 6 years ago · Sep 30, 2019, 05:50 PM
1"use strict";
2
3const request = require("request");
4const express = require('express');
5const bodyparser = require('body-parser');
6const flash = require('connect-flash');
7const nodemailer = require("nodemailer");
8const path = require('path');
9const log = require('./Console');
10const displays = require ('./Engine/Displays')
11const operations = require ('./Engine/Operations')
12
13class Configuration{
14 constructor(){
15 this.database_host = 'localhost';
16 this.database_username = 'root';
17 this.database_password = 'passhere'; /* Enter your database password here */
18 this.database_port = 3306;
19 this.database_name = 'Houdini';
20 this.database_dialect = 'mysql';
21
22 this.salt = 'Y(02.>\'H}t":E1'; /* If you are using the AS3 client, just change this salt to: 'a1ebe00441f5aecb185d0ec178ca2305Y(02.>'H}t\":E1_root' */
23 this.port = 4444;
24 this.site_key = 'sitekey'; /* Register a pair of keys from google recaptcha (v3) and fill in your site key here */
25 this.secret_key = 'secretkey'; /* Register a pair of keys from google recaptcha (v3) and fill in your secret key here */
26
27 this.activation = 0; /* Set this to 1 if you want to use the activate email feature and fill in the below: */
28 this.gmail_user = ''; /* Register a new GMAIL account as the email used to send the reset password link, or change the service from GMAIL to your preference.*/
29 this.gmail_pass = ''; /* Enter the GMAIL accounts password here*/
30 this.cpps_name = 'Flake'; /* The name of your CPPS that will appear in the activation email */
31 this.sub_domain = 'create.flake'; /* The sub-domain that you are using to host the manager, as the link has to be i.e. create.yourcpps.com/activate, if this isn't set properly it'll break the activate account via email feature. It should load from the same subdomain that you use to register i.e. register.cpps.com or create.cpps.com */
32
33 this.approval = 1; /* Change to 0 if you want to approve usernames upon registration */
34 this.bad_names = ['Rockhopper', 'fuck'] /* Add mascot names, swear words etc whatever you don't want users to have as a username */
35
36 /* Don't touch anything below unless you know what you are doing */
37
38 this.operations = new operations();
39 this.displays = new displays(this.site_key);
40 this.error = this.displays.find('/error');
41 this.log = log;
42 this.nodemailer = nodemailer;
43 this._request = request;
44 }
45
46 setup_flake(){
47 this.flake = express();
48 this.flake.engine('html', require('ejs').renderFile);
49 this.flake.set('view engine', 'html');
50 this.flake.set('views', path.join(__dirname, './views')); /* Change directories if necessary for loading frontend */
51 this.flake.use('/css', express.static(path.join(__dirname, './views/css'))); /* Change directories if necessary for loading frontend */
52 this.flake.use('/js', express.static(path.join(__dirname, './views/js'))); /* Change directories if necessary for loading frontend */
53 this.flake.use('/colors', express.static(path.join(__dirname, './views/colors'))); /* Change directories if necessary for loading frontend */
54 this.flake.use(bodyparser.urlencoded({extended : true}));
55 this.flake.use(bodyparser.json());
56 this.flake.use(flash());
57 this.flake.listen(this.port, () => this.log.success(`Running your flake registration system on port: ${this.port}!`))
58 }
59}
60
61
62module.exports = Configuration;