Commit Graph

749 Commits

Author SHA1 Message Date
Bobby Wibowo
f4fa6b6a96
Updated
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.
2019-08-23 20:31:44 +07:00
Bobby Wibowo
e45d854c09
Updated
* 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.
2019-08-23 16:49:53 +07:00
Bobby Wibowo
3a398721b5
Updated
* 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.
2019-08-20 09:16:34 +07:00
Bobby Wibowo
14d69bf1c1
Updated dev dependencies 2019-08-20 06:04:27 +07:00
Bobby Wibowo
72f58e6eec
Updated
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.
2019-08-18 21:52:19 +07:00
Bobby Wibowo
63e26462ea
Updated
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).
2019-08-18 16:57:56 +07:00
Bobby Wibowo
e6bb94692b
Oversights 2019-08-04 06:42:35 +07:00
Bobby Wibowo
6496b03b71
Updates
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.
2019-08-04 06:37:55 +07:00
Bobby Wibowo
62b00210dc
Updated uploadController.js
Removed unnecessary slash from thumb URLs.
2019-07-26 23:54:45 +07:00
Bobby Wibowo
0e64942a6f
Updated package.json
Added an "echo" at the end of yarn pull script to avoid yarn recognizing
error from "git stash pop" if there were no local changes stashed.
2019-07-21 05:29:22 +07:00
Bobby Wibowo
6adf982fb6
Updated package.json
Use --production option by default for yarn pull shortcut.
2019-07-21 05:20:02 +07:00
Bobby Wibowo
aab8058b28
Updated dependencies 2019-07-21 05:17:45 +07:00
Bobby Wibowo
83eb4872e9
Updated utilsController.js
* Simplified some logics.

* Try to unlink thumbnail when failing to generate video thumbnail,
since ffmpeg may have already created an incomplete thumbnail.
2019-07-21 05:15:59 +07:00
Bobby Wibowo
cf20bdbd1a
Updated albumsController.js
Allow JSZip to be configured from config.js file.
2019-07-18 06:22:47 +07:00
Bobby Wibowo
1b79ee3e91
Updated dependencies 2019-07-18 06:02:45 +07:00
Bobby Wibowo
caafe1ac63
Updated .eslintrc.json
Temporarily disabled new eslint rule "no-async-promise-executor".
I'll fix the bits that emit the error at a later date.
2019-07-15 23:12:14 +07:00
Bobby Wibowo
34347915ab
Updated dependencies 2019-07-14 17:04:31 +07:00
Bobby Wibowo
32604bc35e
Updated dependencies 2019-07-11 05:08:13 +07:00
Bobby Wibowo
e275ab16ae
Updated
yarn.lock:
+ Rebuild dependencies. I'm starting to think dependabot isn't quite reliable.

auth.js + home.js + _globals.njk:
+ Updated a few error handlings to handle error messages better.
2019-07-03 22:56:45 +07:00
dependabot-preview[bot]
1e0e4efc83 Bump eslint-plugin-promise from 4.1.1 to 4.2.1 (#20)
Bumps [eslint-plugin-promise](https://github.com/xjamundx/eslint-plugin-promise) from 4.1.1 to 4.2.1.
- [Release notes](https://github.com/xjamundx/eslint-plugin-promise/releases)
- [Changelog](https://github.com/xjamundx/eslint-plugin-promise/blob/master/CHANGELOG.md)
- [Commits](https://github.com/xjamundx/eslint-plugin-promise/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-03 22:44:53 +07:00
dependabot-preview[bot]
762a3cadb7 Bump eslint-plugin-import from 2.17.3 to 2.18.0 (#19)
Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.17.3 to 2.18.0.
- [Release notes](https://github.com/benmosher/eslint-plugin-import/releases)
- [Changelog](https://github.com/benmosher/eslint-plugin-import/blob/master/CHANGELOG.md)
- [Commits](https://github.com/benmosher/eslint-plugin-import/compare/v2.17.3...v2.18.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-03 22:44:43 +07:00
dependabot-preview[bot]
5e42ce01e9 Bump knex from 0.17.6 to 0.18.1 (#22)
Bumps [knex](https://github.com/tgriesser/knex) from 0.17.6 to 0.18.1.
- [Release notes](https://github.com/tgriesser/knex/releases)
- [Changelog](https://github.com/tgriesser/knex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tgriesser/knex/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-03 22:44:27 +07:00
Bobby Wibowo
0516ec2f2f
Updated
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.
2019-06-19 04:04:14 +07:00
Bobby Wibowo
add2970ae6
Updated
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.
2019-06-19 01:48:30 +07:00
Bobby Wibowo
d2d41fc127
Rebuilt yarn.lock 2019-06-18 20:11:17 +07:00
Bobby Wibowo
f6cef67d9f
Updated
+ Do not query users table twice when filtering by usernames.
+ Removed redundant logic.
2019-06-18 02:48:42 +07:00
Bobby Wibowo
06ac31d02e
Updates (dashboard)
+ 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?
2019-06-18 02:34:15 +07:00
dependabot-preview[bot]
ec6069d962 Bump express-rate-limit from 4.0.4 to 5.0.0 (#18)
Bumps [express-rate-limit](https://github.com/nfriedly/express-rate-limit) from 4.0.4 to 5.0.0.
- [Release notes](https://github.com/nfriedly/express-rate-limit/releases)
- [Commits](https://github.com/nfriedly/express-rate-limit/compare/v4.0.4...v5.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-14 20:32:30 +07:00
dependabot-preview[bot]
8eb3ff9a0d Bump sqlite3 from 4.0.8 to 4.0.9 (#16)
Bumps [sqlite3](https://github.com/mapbox/node-sqlite3) from 4.0.8 to 4.0.9.
- [Release notes](https://github.com/mapbox/node-sqlite3/releases)
- [Changelog](https://github.com/mapbox/node-sqlite3/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mapbox/node-sqlite3/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-14 20:32:14 +07:00
dependabot-preview[bot]
9f29335214 Bump knex from 0.17.3 to 0.17.6 (#17)
Bumps [knex](https://github.com/tgriesser/knex) from 0.17.3 to 0.17.6.
- [Release notes](https://github.com/tgriesser/knex/releases)
- [Changelog](https://github.com/tgriesser/knex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tgriesser/knex/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-14 20:31:29 +07:00
Kana
60c9f36374
Merge pull request #194 from WeebDev/dependabot/npm_and_yarn/sshpk-1.16.1
Bump sshpk from 1.13.1 to 1.16.1
2019-06-06 17:06:31 +09:00
dependabot[bot]
677aa8f68e
Bump sshpk from 1.13.1 to 1.16.1
Bumps [sshpk](https://github.com/joyent/node-sshpk) from 1.13.1 to 1.16.1.
- [Release notes](https://github.com/joyent/node-sshpk/releases)
- [Commits](https://github.com/joyent/node-sshpk/compare/v1.13.1...v1.16.1)

Signed-off-by: dependabot[bot] <support@github.com>
2019-06-06 08:05:52 +00:00
Bobby Wibowo
f48cbd1960
Updates
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.
2019-06-04 07:57:37 +07:00
Bobby Wibowo
4bee2ef376
Updated _globals.njk
I forgot I need to bump this version after updating dashboard.js
in a previous commit.
2019-06-04 02:47:05 +07:00
Bobby Wibowo
d185265c0d
Updated config.sample.js
I blame vscode for weird paste behavior
when I copied-pasted this from my config.js.
2019-06-04 02:43:54 +07:00
Bobby Wibowo
5c41fc9249
Updates
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.
2019-06-04 02:40:24 +07:00
Bobby Wibowo
a8ae88babd
Updated dependencies 2019-05-07 19:35:56 +07:00
Bobby Wibowo
cbbebcf829
Updated unicorn_6.png
Forgot to remove render watermark, lmao
2019-04-20 17:08:40 +07:00
Bobby Wibowo
b754470630
Updated albums public page
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.
2019-04-19 11:56:57 +07:00
Bobby Wibowo
ecb8afbe40
Updates
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.
2019-04-18 16:06:14 +07:00
Bobby Wibowo
9b1cb06825
Updated dashboard.js
Oversight.
2019-04-12 07:53:44 +07:00
Bobby Wibowo
13081ef38a
Re-worked caching for statistics
I guess I'll work on adding charts someday.
2019-04-12 07:45:33 +07:00
Bobby Wibowo
b7600ec3fb
Restored DuckDuckGo's proxy for URL uploads
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.
2019-04-11 22:27:45 +07:00
Bobby Wibowo
3e336e8c6d
Updates
Got rid of caching of statistics.
The previous implementation wasn't perfect, and too lazy to improve it.
2019-04-06 00:42:38 +07:00
Bobby Wibowo
8c3fb78135
Upates
* 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.
2019-04-06 00:32:52 +07:00
Bobby Wibowo
5180005625
Updated faq.njk 2019-04-05 09:27:10 +07:00
Bobby Wibowo
e765b8d896
Updated package.json 2019-04-05 06:46:47 +07:00
Bobby Wibowo
458584d681
Updated _globals.njk
Forgot to bump v1 version string.
2019-03-28 03:49:03 +07:00
Bobby Wibowo
3791c95ac2
Updated README.md 2019-03-28 03:44:30 +07:00
Bobby Wibowo
2b8f52ff72
Merge branch 'master' into safe.fiery.me 2019-03-28 03:42:27 +07:00