mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-13 07:56:23 +00:00
7978325cd6
* Removed rimraf from dependency. Although really it'll still need to be used by other dependencies, such as eslint and bcrypt, so it'll still have to be downloaded by yarn either way. * Updated dashboard.css. Added "overflow: hidden" to thumbnail container. Previously potrait thumbnails will be visible outside of their container. * Removed notice about having "chunks" folder from config.sample.js. Added a line in lolisafe.js to create the folder if it doesn't exist instead. * Updated bcrypt to v2.0.0. I'm not really sure whatever has changed, but I've tested that it didn't require any additional changes for our current usage. * Chunks will no longer be saved with their original file's extension. Instead they'll only be saved as plain files named 0, 1, ..., n, without any extension whatsoever. Extension for joined chunks will be read from the original file's name in /api/upload/finishchunks. If the user doesn't pass that data when calling the API, the joined chunks will not have any extension. * Since rimraf has been removed, uploadsController.actuallyFinishChunks() will now use a combination of fs.unlink() and fs.rmdir(). Promise.all() will be used when running fs.unlink() so that all chunks will be deleted at the same time through multiple instances of async tasks (probably). * Some other small changes and tweaks in uploadController.js.
131 lines
4.2 KiB
JavaScript
131 lines
4.2 KiB
JavaScript
module.exports = {
|
|
|
|
/*
|
|
If set to true the user will need to specify the auto-generated token
|
|
on each API call, meaning random strangers won't be able to use the service
|
|
unless they have the token lolisafe provides you with.
|
|
If it's set to false, then upload will be public for anyone to use.
|
|
*/
|
|
private: true,
|
|
|
|
// If true, users will be able to create accounts and access their uploaded files
|
|
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',
|
|
|
|
/*
|
|
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).
|
|
*/
|
|
albumDomain: null,
|
|
|
|
// Port on which to run the server
|
|
port: 9999,
|
|
|
|
// Pages to process for the frontend
|
|
pages: ['home', 'auth', 'dashboard', 'faq'],
|
|
|
|
// Add file extensions here which should be blocked
|
|
blockedExtensions: [
|
|
'.jar',
|
|
'.exe',
|
|
'.msi',
|
|
'.com',
|
|
'.bat',
|
|
'.cmd',
|
|
'.scr',
|
|
'.ps1',
|
|
'.sh'
|
|
],
|
|
|
|
// Uploads config
|
|
uploads: {
|
|
|
|
// Folder where images should be stored
|
|
folder: 'uploads',
|
|
|
|
/*
|
|
Max file size allowed. Needs to be in MB
|
|
Note: When maxSize is greater than 1 MiB, you must set the client_max_body_size to the same as maxSize.
|
|
*/
|
|
maxSize: '512MB',
|
|
|
|
/*
|
|
Chunked uploads.
|
|
If this is enabled, every files uploaded from the home page will forcibly be chunked
|
|
by the size specified in uploads.chunkedUploads.maxSize. People will still be able to
|
|
upload bigger files through the API as long as they don't surpass the limit specified
|
|
in uploads.maxSize though.
|
|
Total size of the whole chunks will still be checked against uploads.maxSize too.
|
|
*/
|
|
chunkedUploads: {
|
|
enabled: true,
|
|
maxSize: '10MB'
|
|
},
|
|
|
|
/*
|
|
The length of the random generated name for the uploaded files.
|
|
If "userChangeable" is set to true, registered users will be able to change
|
|
their preferred file name length from the dashboard. The allowed range will
|
|
be set by "min" and "max". Otherwise it will use "default".
|
|
Technically it's possible to have "default" outside of the "min" and "max" range,
|
|
but please not. Once a user has changed to a number within the range, the user will
|
|
no longer be able to use the default value.
|
|
*/
|
|
fileLength: {
|
|
min: 4,
|
|
max: 32,
|
|
default: 32,
|
|
userChangeable: false
|
|
},
|
|
|
|
/*
|
|
This option will limit how many times it will try to generate random names
|
|
for uploaded files. If this value is higher than 1, it will help in cases
|
|
where files with the same name already exists (higher chance with shorter file name length).
|
|
*/
|
|
maxTries: 1,
|
|
|
|
/*
|
|
NOTE: Thumbnails are only for the admin panel and they require you
|
|
to install a separate binary called graphicsmagick (http://www.graphicsmagick.org)
|
|
for images and ffmpeg (https://ffmpeg.org/) for video files
|
|
*/
|
|
generateThumbnails: {
|
|
image: true,
|
|
video: false
|
|
},
|
|
|
|
/*
|
|
Allows users to download a .zip file of all files in an album.
|
|
The file is generated when the user clicks the download button in the view
|
|
and is re-used if the album has not changed between download requests
|
|
*/
|
|
generateZips: true
|
|
},
|
|
|
|
// Folder where to store logs
|
|
logsFolder: 'logs',
|
|
|
|
// The following values shouldn't be touched
|
|
database: {
|
|
client: 'sqlite3',
|
|
connection: { filename: './database/db' },
|
|
useNullAsDefault: true
|
|
}
|
|
}
|