On video thumbnails generation, skip video files that do not have any
video streams/channels.
This will prevent unnecessary spawning of ffmpeg for those files.
Also suppress error logging when video streams/channels are not found.
* Updated path resolving for upload folder option.
This SHOULD now allow using an absolute path, even those outside of
the lolisafe installation.
* Added a config option at uploads -> generateThumbs, named placeholder.
It's a string option that lets you set path of the placeholder image
for files whose thumbnail could not be generated.
It defaults to the old hard-coded path when set to falsy value.
* Fixed thumbs script not using upload folder from config file.
* Added filters for thumb generation error handling.
This is used to ignore some common error messages,
such as file formats not being supported.
* Replaced all instances of getElementById and getElementsByClassName
with querySelector or querySelectorAll.
* Updated utilsController.js to stop disabling
no-async-promise-executor eslint rule.
* Removed unused lines in dashboard.njk.
* Refactored maxFileSize to maxSize in home.{css,js,njk}.
* Updated ClamAV codes in lolisafe.js. No more pinging.
Since querying version will also check connection anyway.
* Option "Upload to album" in homepage is now selectable.
Selecting this option will restore the uploader to not associate files
with an album.
* Fixed uploader to properly respect server's max file size.
Also updated error message of file size to use MB instead of MiB.
* Creating an album from homepage will automatically select the album.
* Updated Dropzone.js to v5.5.0.
* Bumped v1 & v3 version strings.
* Various other small fixes.
Updated random render script.
Added a new render category (miku). Choice is currently hard-coded.
Added 50 renders for miku category.
Bumped v1 & v4 version strings.
Pressing Enter on the auth form will now properly make it try to login.
Slightly better error messages on auth page.
Bumped v1 version string.
Updated dependencies (knex & sqlite).
Updated deps.
Re-enabled eslint rule no-async-promise-executor.
Updated some codes to follow the said rule.
Though I had to disable the rule in a line at utilsController.js
due to complexity.
I'll give it more thoughts in the future.
Bumped v1 version string.
* Simplified some logics.
* Try to unlink thumbnail when failing to generate video thumbnail,
since ffmpeg may have already created an incomplete thumbnail.
tokenController.js + authController.js:
+ Added a standalone function to generate unique token.
Despite tokens being 64 characters long, meaning the chance to generate
the same token twice have very small chances, I would rather not leave
it to chances.
+ Some spacings.
config.sample.js:
+ Self-explanatory.
uploadController.js:
+ Close connection earlier when there are no upload when querying them.
dashboard.css + style.css:
+ Updated styling involving pagination and progress bar.
dashboard.js:
+ Fixed dashboard failing to handle cases where a user attemp to load
a next page when there are not enough uploads available.
+ Added a simple loading message as a placeholder when trying to view
Stastistics menu, since it may take a while in big servers.
bulma.min.css + LICENSE:
+ Updated bulma from 0.7.2 to 0.7.5.
_globals.njk:
+ Bumped v1 and v3 version strings.
+ Better pagination.
+ Added more advanced filtering system in Manage Uploads.
It now supports filtering with multiple usernames and/or IPs.
It also supports refining the matches with wildcards.
Todo?
Perhaps add simple file name filtering for regular users in the future?
config.sample.js + uploadController.js:
+ Added option uploads > storeIP to toggle whether to store uploader's
IPs into the database.
uploadController.js + dashboard.js:
+ Added IP column when listing all uploads.
+ Improved album query when listing uploads. In addition, no longer
query album when listing all uploads.
+ Delegate some tasks to client when listing uploads to save server's
processing power, kek.
Such as building the file's full URLs, and assigning album/user names.
_globals.njk:
+ Bumped v1 version string.
utilsController.js:
+ /api/stats: Cache invalidation requests will now only store timestamp
of the request instead of purging the cache entirely.
Subsequent requests to the API will no longer attempt to generate stats
if a previous request before it is still generating, since it can
take a while in big sites.
So instead, the cached stats will be returned to them, regardless of
whether it's still valid.
This should avoid "race condition" in sites with multiple admins.
* dashboard.js:
+ Added an appendix into "Delete by names" feature in dashboard to
inform staffs that they can use the feature to delete files by other
users as well.
+ Added comments explaning the need of page.domClick() function.
+ Addition to the change regarding /api/stats route: If there is no
cached stats, but a previous request is still generating, inform
the user about it.
config.sample.js + lolisafe.js:
+ We now support configuring rate limits through config file.
No more hard-coded rate limits.
Don't forget to update your config.js accordingly.
package.json + yarn.lock:
+ Updated dependencies.
File size when JavaScript is disabled will now properly use B suffix.
It's referring to the fact that their unit is bytes.
Disclaimer about this. Back-end will only return the file size in bytes,
front-end is supposed to convert them into prettier units (KB, MB, ...).
Nothing much can be done if front-end have JavaScript disabled.
I don't want to defer the task, prettying the units, to back-end.
Updated fontello (added block and doc-inv icons).
Upload results will now show either doc or block icon on top of the
file name depending on the status of the upload
(unless the uploads are images, in which case they will still show
thumbnails instead).
Added support for customizable timeout and chunkSize options for ClamAV
scanning to the config file.
Bumped v1 and v3 version strings.
Yes.
This gets rid of HEAD request prior to downloading the URL.
We will no longer check for Content-Length header, instead we will
forcibly limit maximum download size for the download stream to the
configured value.
So assuming someone try to download a bigger file, it will still try to
download up to the configured size, but then fail.
This will also speed up the general download process since sending HEAD
request delayed the whole operation.
* Added Statistics menu to Administration items in dashboard.
* Added /api/stats route.
Imo, my implementation of this whole thing is rather dirty-ish, but hey
as long as it works.
I'll be using lolisafe2 for future devs tbh.