Initial import

This commit is contained in:
2020-11-26 19:57:37 -06:00
commit 81032e3b0b
33 changed files with 5986 additions and 0 deletions

21
config/app.config.js Normal file
View File

@@ -0,0 +1,21 @@
const app_config = {
/*
* The name of the application.
* Used through-out the application as the proper display name.
*/
name: env('APP_NAME', 'Flitter'),
/*
* URL of the application.
* Can be used to generate fully-qualified links.
*/
url: env('APP_URL', 'http://localhost:8000/'),
/*
* The default locale that new users to the site will be assigned.
*/
default_locale: env('APP_DEFAULT_LOCALE', 'en_US'),
}
module.exports = app_config

34
config/database.config.js Normal file
View File

@@ -0,0 +1,34 @@
const database_config = {
/*
* The name of the database.
*/
name: env('DATABASE_NAME', 'flitter'),
/*
* The hostname of the database server.
* Should be fully-qualified or resolvable.
*/
host: env('DATABASE_HOST', 'localhost'),
/*
* MongoDB port on the database host.
*/
port: env('DATABASE_PORT', 27017),
auth: {
/*
* Boolean true if the database connection requires auth.
*/
require: env('DATABASE_AUTH', false),
/*
* MongoDB username and password.
*/
username: env('DATABASE_USERNAME', ''),
password: env('DATABASE_PASSWORD', ''),
},
}
module.exports = database_config

96
config/server.config.js Normal file
View File

@@ -0,0 +1,96 @@
const server_config = {
/*
* The server port.
* Currently, Flitter supports HTTP/S natively.
*/
port: env('SERVER_PORT', 80),
stream_port: env('SERVER_STREAM_PORT', 5746),
/*
* The type of environment the application is running in.
* Usually, either "production" or "development".
* Development mode may cause the application to output extra
* debugging information not secure enough for production.
*/
environment: env('ENVIRONMENT', 'production'),
data_dir: env('PIED_DATA_DIR', 'data'),
logging: {
/*
* The logging level. Usually, 1-4.
* The higher the level, the more information is logged.
*/
level: env('LOGGING_LEVEL', 2),
/*
* If true, API responses will be logged to the database.
*/
api_logging: env('LOG_API_RESPONSES', false),
/*
* If true, caught request errors will be logged to the database.
*/
error_logging: env('LOG_REQUEST_ERRORS', true),
},
session: {
/*
* The secret used to encrypt the session.
* This should be set in the environment.
*/
secret: env('SECRET', 'changeme'),
/*
* The max age (in milliseconds) of the session cookie.
* If undefined, the max-age will be set to "Session" so it is
* cleared when the browser exits.
*/
max_age: env('SESSION_MAX_AGE', undefined),
},
uploads: {
/*
* If true, the server will accept files uploaded in the request.
*/
enable: env('SERVER_ENABLE_UPLOADS', false),
/*
* Regex to match routes that file uploads are accepted from.
* By default, this accepts files uploaded on all routes.
*/
allowed_path: /./,
/*
* Path for uploaded files.
* Should be relative to the application root.
*
* Note that this is NOT the config for flitter-upload.
*/
destination: './tmp.uploads'
},
ssl: {
/*
* If true, the server will be HTTPS, not HTTP.
*/
enable: env('SSL_ENABLE', false),
/*
* Path to your domain's certificate file.
* This should contain any intermediate certificates as well.
*/
cert_file: env('SSL_CERT_FILE', 'cert.pem'),
/*
* Path to your domain's certificate key.
*/
key_file: env('SSL_KEY_FILE', 'cert.key'),
},
}
module.exports = server_config

45
config/upload.config.js Normal file
View File

@@ -0,0 +1,45 @@
/*
* flitter-upload configuration
* ---------------------------------------------------------------
* Specifies the configuration for various uploader aspects. Mainly,
* contains the configuration for the different file upload backends.
*/
const upload_config = {
/*
* The name of the upload backend to use by default.
*/
default_store: env('UPLOAD_DEFAULT_STORE', 's3'),
enabled: true,
/*
* Stores available to the uploader.
*/
stores: {
/*
* Example of an Amazon AWS S3 (or compatible) uploader.
*/
s3: {
enabled: true,
// Backed by an S3 bucket.
type: 'AWSS3Store',
// AWS SDK credentials and configuration
aws: {
region: env('AWS_REGION', 'us-east-1'),
key_id: env('AWS_ACCESS_KEY_ID'),
key_secret: env('AWS_SECRET_ACCESS_KEY'),
endpoint: env('AWS_S3_ENDPOINT'),
},
// The bucket to which the files should be uploaded
bucket: env('AWS_UPLOAD_BUCKET', 'flitter.localhost'),
// The prefix to be used for file uploads
prefix: env('AWS_UPLOAD_PREFIX', ''),
},
},
}
module.exports = exports = upload_config