2017-01-13 07:48:18 +00:00
|
|
|
module.exports = {
|
2018-01-23 20:06:30 +00:00
|
|
|
/*
|
|
|
|
If set to true the user will need to specify the auto-generated token
|
2018-03-24 19:47:41 +00:00
|
|
|
on each API call, meaning random strangers won't be able to use the service
|
2018-04-04 16:47:20 +00:00
|
|
|
unless they have the token lolisafe provides you with.
|
2018-01-23 20:06:30 +00:00
|
|
|
If it's set to false, then upload will be public for anyone to use.
|
|
|
|
*/
|
|
|
|
private: true,
|
|
|
|
|
2018-05-09 08:41:30 +00:00
|
|
|
/*
|
|
|
|
If true, users will be able to create accounts and access their uploaded files.
|
|
|
|
*/
|
2018-01-23 20:06:30 +00:00
|
|
|
enableUserAccounts: true,
|
|
|
|
|
|
|
|
/*
|
|
|
|
Here you can decide if you want lolisafe to serve the files or if you prefer doing so via nginx.
|
|
|
|
The main difference between the two is the ease of use and the chance of analytics in the future.
|
|
|
|
If you set it to `true`, the uploaded files will be located after the host like:
|
|
|
|
https://lolisafe.moe/yourFile.jpg
|
|
|
|
|
|
|
|
If you set it to `false`, you need to set nginx to directly serve whatever folder it is you are serving your
|
|
|
|
downloads in. This also gives you the ability to serve them, for example, like this:
|
|
|
|
https://files.lolisafe.moe/yourFile.jpg
|
|
|
|
|
|
|
|
Both cases require you to type the domain where the files will be served on the `domain` key below.
|
|
|
|
Which one you use is ultimately up to you.
|
|
|
|
*/
|
|
|
|
serveFilesWithNode: false,
|
|
|
|
domain: 'https://lolisafe.moe',
|
|
|
|
|
2018-02-07 06:45:18 +00:00
|
|
|
/*
|
|
|
|
If you are serving your files with a different domain than your lolisafe homepage,
|
|
|
|
then fill this option with your lolisafe homepage, otherwise leave it null (or other falsy value).
|
2018-04-18 21:00:36 +00:00
|
|
|
This will be used when listing album links in the dashboard.
|
2018-02-07 06:45:18 +00:00
|
|
|
*/
|
2018-04-18 21:00:36 +00:00
|
|
|
homeDomain: null,
|
2018-02-07 06:45:18 +00:00
|
|
|
|
2018-05-09 08:41:30 +00:00
|
|
|
/*
|
|
|
|
Port on which to run the server.
|
|
|
|
*/
|
2018-01-23 20:06:30 +00:00
|
|
|
port: 9999,
|
|
|
|
|
2018-05-09 08:41:30 +00:00
|
|
|
/*
|
|
|
|
Pages to process for the frontend.
|
|
|
|
*/
|
2018-01-23 20:06:30 +00:00
|
|
|
pages: ['home', 'auth', 'dashboard', 'faq'],
|
|
|
|
|
2018-04-25 13:16:34 +00:00
|
|
|
/*
|
|
|
|
If set to true, all extensions in "extensionsFilter" array will be blacklisted,
|
|
|
|
otherwise only files with those extensions that can be uploaded.
|
|
|
|
*/
|
|
|
|
filterBlacklist: true,
|
|
|
|
|
|
|
|
extensionsFilter: [
|
2018-03-15 07:54:14 +00:00
|
|
|
'.jar',
|
2018-01-23 20:06:30 +00:00
|
|
|
'.exe',
|
2018-09-22 14:04:07 +00:00
|
|
|
'.exec',
|
2018-03-15 07:54:14 +00:00
|
|
|
'.msi',
|
|
|
|
'.com',
|
2018-01-23 20:06:30 +00:00
|
|
|
'.bat',
|
|
|
|
'.cmd',
|
2018-06-06 01:51:53 +00:00
|
|
|
'.nt',
|
2018-03-15 07:54:14 +00:00
|
|
|
'.scr',
|
|
|
|
'.ps1',
|
2018-06-06 01:51:53 +00:00
|
|
|
'.psm1',
|
|
|
|
'.sh',
|
|
|
|
'.bash',
|
|
|
|
'.bsh',
|
|
|
|
'.csh',
|
|
|
|
'.bash_profile',
|
|
|
|
'.bashrc',
|
|
|
|
'.profile'
|
2018-01-23 20:06:30 +00:00
|
|
|
],
|
|
|
|
|
2018-11-28 17:52:12 +00:00
|
|
|
/*
|
|
|
|
If set to true, files with no extensions will always be rejected.
|
|
|
|
*/
|
|
|
|
filterNoExtension: false,
|
|
|
|
|
2018-09-20 11:41:17 +00:00
|
|
|
/*
|
|
|
|
Show hash of the current git commit in homepage.
|
|
|
|
*/
|
|
|
|
showGitHash: false,
|
|
|
|
|
|
|
|
/*
|
|
|
|
Path to error pages. Only 404 and 500 will be used.
|
|
|
|
Note: rootDir can either be relative or absolute path.
|
|
|
|
*/
|
|
|
|
errorPages: {
|
|
|
|
rootDir: './pages/error',
|
|
|
|
404: '404.html',
|
|
|
|
500: '500.html'
|
|
|
|
},
|
|
|
|
|
2018-05-09 08:41:30 +00:00
|
|
|
/*
|
|
|
|
Uploads config.
|
|
|
|
*/
|
2018-01-23 20:06:30 +00:00
|
|
|
uploads: {
|
2018-05-09 08:41:30 +00:00
|
|
|
/*
|
|
|
|
Folder where images should be stored.
|
|
|
|
*/
|
2018-01-23 20:06:30 +00:00
|
|
|
folder: 'uploads',
|
|
|
|
|
|
|
|
/*
|
2018-05-09 08:41:30 +00:00
|
|
|
Max file size allowed. Needs to be in MB.
|
2018-12-04 11:58:53 +00:00
|
|
|
Note: When maxSize is greater than 1 MiB and using nginx as reverse proxy,
|
|
|
|
you must set client_max_body_size to the same as maxSize.
|
|
|
|
https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size
|
2018-01-23 20:06:30 +00:00
|
|
|
*/
|
|
|
|
maxSize: '512MB',
|
|
|
|
|
2018-05-11 14:34:13 +00:00
|
|
|
/*
|
|
|
|
Max file size allowed for upload by URLs. Needs to be in MB.
|
|
|
|
NOTE: Set to falsy value (false, null, etc.) to disable upload by URLs.
|
|
|
|
*/
|
|
|
|
urlMaxSize: '32MB',
|
|
|
|
|
2018-09-01 20:37:26 +00:00
|
|
|
/*
|
2018-09-04 16:11:20 +00:00
|
|
|
Scan files using ClamAV through clamd.
|
2018-09-01 20:37:26 +00:00
|
|
|
*/
|
2018-09-04 16:11:20 +00:00
|
|
|
scan: {
|
|
|
|
enabled: false,
|
|
|
|
ip: '127.0.0.1',
|
|
|
|
port: 3310
|
|
|
|
},
|
2018-09-01 20:37:26 +00:00
|
|
|
|
2018-06-05 17:16:41 +00:00
|
|
|
/*
|
2018-12-04 11:58:53 +00:00
|
|
|
Use DuckDuckGo's proxy when fetching URL uploads.
|
2018-06-05 17:16:41 +00:00
|
|
|
This may be considered a hack and not supported by DuckDuckGo, so USE AT YOUR OWN RISK.
|
2018-09-29 22:38:13 +00:00
|
|
|
This should work with any type of URLs, but they have to be direct links,
|
|
|
|
since DuckDuckGo's proxy will not follow redirects.
|
2018-06-05 17:16:41 +00:00
|
|
|
*/
|
|
|
|
urlDuckDuckGoProxy: false,
|
|
|
|
|
2018-03-28 11:36:28 +00:00
|
|
|
/*
|
2018-05-09 08:41:30 +00:00
|
|
|
Chunk size for chunk uploads. Needs to be in MB.
|
2018-04-25 13:16:34 +00:00
|
|
|
If this is enabled, every files uploaded from the homepage uploader will forcibly be chunked
|
|
|
|
by the size specified in "chunkSize". People will still be able to upload bigger files with
|
|
|
|
the API as long as they don't surpass the limit specified in the "maxSize" option above.
|
|
|
|
Total size of the whole chunks will also later be checked against the "maxSize" option.
|
2018-05-11 14:34:13 +00:00
|
|
|
NOTE: Set to falsy value (false, null, etc.) to disable chunked uploads.
|
2018-03-28 11:36:28 +00:00
|
|
|
*/
|
2018-05-09 08:41:30 +00:00
|
|
|
chunkSize: '10MB',
|
2018-03-28 11:36:28 +00:00
|
|
|
|
2018-03-24 13:52:47 +00:00
|
|
|
/*
|
2018-12-04 11:58:53 +00:00
|
|
|
The length of the randomly generated identifier for uploaded files.
|
2018-03-24 13:52:47 +00:00
|
|
|
If "userChangeable" is set to true, registered users will be able to change
|
2018-12-04 11:58:53 +00:00
|
|
|
their preferred length from the dashboard. The allowed range will be set
|
|
|
|
by "min" and "max". Otherwise it will use "default".
|
|
|
|
|
|
|
|
It's possible to have "default" be outside of the "min" and "max" range,
|
|
|
|
but be aware that once a user has changed their preferred length to be somewhere
|
|
|
|
within the range, they will no longer be able to restore it back to "default".
|
2018-03-24 13:52:47 +00:00
|
|
|
*/
|
|
|
|
fileLength: {
|
|
|
|
min: 4,
|
|
|
|
max: 32,
|
|
|
|
default: 32,
|
|
|
|
userChangeable: false
|
|
|
|
},
|
2018-01-23 20:06:30 +00:00
|
|
|
|
2018-12-04 11:58:53 +00:00
|
|
|
/*
|
|
|
|
Cache file identifiers.
|
|
|
|
|
|
|
|
They will be used for a stricter collision check, such that a single identifier
|
|
|
|
may not be used by more than a single file (e.i. if "abcd.jpg" already exists, a new PNG
|
|
|
|
file may not be named as "abcd.png").
|
|
|
|
|
|
|
|
If this is enabled, the safe will attempt to read file list of the uploads directory
|
|
|
|
during first launch, parse the names, then cache the identifiers into memory.
|
|
|
|
Its downside is that it will use a bit more memory, generally a few MBs increase
|
|
|
|
on a safe with over >10k uploads.
|
|
|
|
|
|
|
|
If this is disabled, the safe will instead read file list of the uploads directory EVERYTIME
|
|
|
|
there is a new upload.
|
|
|
|
Its downside will be slower upload handling and memory usage "spikes",
|
|
|
|
since reading the file list will still consume memory,
|
|
|
|
just that it will only stay in memory for a few moments.
|
|
|
|
|
|
|
|
On most caces, leaving this enabled is recommended.
|
|
|
|
*/
|
|
|
|
cacheFileIdentifiers: true,
|
|
|
|
|
2018-05-09 08:41:30 +00:00
|
|
|
/*
|
|
|
|
The length of the randomly generated identifier for albums.
|
|
|
|
*/
|
2018-04-28 17:29:47 +00:00
|
|
|
albumIdentifierLength: 8,
|
|
|
|
|
2018-03-18 13:13:08 +00:00
|
|
|
/*
|
2018-04-28 17:29:47 +00:00
|
|
|
This option will limit how many times it will try to
|
|
|
|
generate a new random name when a collision occurrs.
|
|
|
|
The shorter the length is, the higher the chance for a collision to occur.
|
2018-12-04 11:58:53 +00:00
|
|
|
This applies to both file name and album identifier.
|
2018-04-28 17:29:47 +00:00
|
|
|
*/
|
2018-03-18 13:13:08 +00:00
|
|
|
maxTries: 1,
|
|
|
|
|
2018-01-23 20:06:30 +00:00
|
|
|
/*
|
2018-12-03 07:20:13 +00:00
|
|
|
Thumbnails are only for the dashboard.
|
|
|
|
You need to install a separate binary called ffmpeg (https://ffmpeg.org/) for video thumbnails.
|
2018-01-23 20:06:30 +00:00
|
|
|
*/
|
2018-05-09 08:41:30 +00:00
|
|
|
generateThumbs: {
|
2018-03-24 13:52:47 +00:00
|
|
|
image: true,
|
|
|
|
video: false
|
|
|
|
},
|
2018-01-23 20:06:30 +00:00
|
|
|
|
|
|
|
/*
|
2018-12-04 11:58:53 +00:00
|
|
|
Allow users to download a ZIP archive of all files in an album.
|
2018-01-23 20:06:30 +00:00
|
|
|
The file is generated when the user clicks the download button in the view
|
2018-04-27 03:27:34 +00:00
|
|
|
and is re-used if the album has not changed between download requests.
|
2018-01-23 20:06:30 +00:00
|
|
|
*/
|
2018-05-09 08:41:30 +00:00
|
|
|
generateZips: true
|
|
|
|
},
|
|
|
|
|
|
|
|
/*
|
|
|
|
Cloudflare support.
|
|
|
|
*/
|
|
|
|
cloudflare: {
|
|
|
|
/*
|
|
|
|
No-JS uploader page will not chunk the uploads, so it's recommended to change this
|
|
|
|
into the maximum upload size you have in Cloudflare.
|
|
|
|
This limit will only be applied to the subtitle in the page.
|
2018-05-11 14:34:13 +00:00
|
|
|
NOTE: Set to falsy value (false, null, etc.) to inherit "maxSize" option.
|
2018-05-09 08:41:30 +00:00
|
|
|
*/
|
|
|
|
noJsMaxSize: '100MB',
|
|
|
|
|
|
|
|
/*
|
2018-12-04 11:58:53 +00:00
|
|
|
If you have a Page Rule in Cloudflare to cache everything in the album zip
|
|
|
|
API route (homeDomain/api/album/zip/*), with this option you can limit the
|
2018-05-09 08:41:30 +00:00
|
|
|
maximum total size of files in an album that can be zipped.
|
|
|
|
Cloudflare will not cache files bigger than 512MB.
|
2018-05-11 14:34:13 +00:00
|
|
|
NOTE: Set to falsy value (false, null, etc.) to disable max total size.
|
2018-05-09 08:41:30 +00:00
|
|
|
*/
|
2018-05-09 09:53:27 +00:00
|
|
|
zipMaxTotalSize: '512MB',
|
|
|
|
|
|
|
|
/*
|
2018-12-04 11:58:53 +00:00
|
|
|
If you want to make it automatically call Cloudflare's API to purge cache on file delete,
|
|
|
|
fill your API key, email and your site's zone ID below, then set "purgeCache" to true.
|
2018-05-09 09:53:27 +00:00
|
|
|
This will only purge cache of the deleted file and its associated thumb.
|
|
|
|
*/
|
|
|
|
apiKey: '',
|
|
|
|
email: '',
|
|
|
|
zoneId: '',
|
|
|
|
purgeCache: false
|
2018-01-23 20:06:30 +00:00
|
|
|
},
|
|
|
|
|
2018-05-09 08:41:30 +00:00
|
|
|
/*
|
|
|
|
Folder where to store logs.
|
2018-12-04 11:58:53 +00:00
|
|
|
NOTE: This is currently unused.
|
2018-05-09 08:41:30 +00:00
|
|
|
*/
|
2018-01-23 20:06:30 +00:00
|
|
|
logsFolder: 'logs',
|
|
|
|
|
2018-05-09 08:41:30 +00:00
|
|
|
/*
|
|
|
|
The following values shouldn't be touched, unless you know what you are doing.
|
|
|
|
*/
|
2018-01-23 20:06:30 +00:00
|
|
|
database: {
|
|
|
|
client: 'sqlite3',
|
|
|
|
connection: { filename: './database/db' },
|
|
|
|
useNullAsDefault: true
|
|
|
|
}
|
|
|
|
}
|