Commit Graph

166 Commits

Author SHA1 Message Date
Bobby Wibowo
209f5429cd
Updates
Added .tiff, .tif, and .svg to allowed image extensions for thumbs gen

Added .svg to allowed image extensions for preview in uploads result
2019-01-18 08:15:53 +07:00
Bobby Wibowo
f2a6daea46
Updated album.js and dashboard.js
Updated getPrettyBytes() function.
Previously it was doing something wrong with size under 1024 bytes.
2019-01-14 20:06:57 +07:00
Bobby Wibowo
907ba3960a
Updated render.js
Version string for random renders will now use globals.v4 (new variable)
instead of globals.v1, since globals.v1 changes a lot more often.
Hence to allow this to happen, data-version attribute will now be added
to <script> tag of render.js in home.njk.
2019-01-14 19:44:09 +07:00
Bobby Wibowo
20912a6dff
Updated dashboard
Display thumbnail feature in dashboard will now contain images smaller
than 200x200 in a 200x200 container and align them in the center.
2019-01-09 12:04:21 +07:00
Bobby Wibowo
244b327e19
Updated dashboard.js
Added loading animation to pagination buttons.
2019-01-08 05:54:12 +07:00
Bobby Wibowo
3c49d81b3a
Updated dashboard.js
Fix checkboxes
2019-01-06 05:53:08 +07:00
Bobby Wibowo
8072f2fdf7
Updates
Updated page.getPrettyBytes() in dashboard.js and album.js to support
non-SI units (which is by 1024 instead of 1000).
With that said, all "pretty bytes" display in dashboard and
album's public pages will now use non-SI units.

Bumped v1 version string.
2019-01-05 04:34:54 +07:00
Bobby Wibowo
36b204da64
Updates
Updated icon of View uploads button in Manage users page.

Updated fontello to include the icon.

Bumped v1 and v3 version strings.
2019-01-03 11:54:20 +07:00
Bobby Wibowo
2b0969dc77
Updates
Updated keys for local storage. They're now using camel case.
Not sure why I didn't use camel case in the first place.

View type and selected files of Uploads and Manage uploads (your own
uploads and all uploads, respectively) are now stored separately.

Added "filter by username" in Manage uploads.

Added "jump to page" in all uploads/users view.

Updated fontello (added filter icon).

Bumped v1 and v3 version string, due to dashboard.js and fontello
respectively.

Curly rule fix for routes/nojs.js.
2019-01-03 11:49:56 +07:00
Bobby Wibowo
765f8c9880
Better image thumbnailer
Images smaller than 200x200 will no longer be resized upwards, instead
they will be padded with transparent pixels.
This was the old behavior before we switched from GM to sharp.

With GM, its resize() function would do exactly that, but I couldn't
figure out how to do the same with only sharp's resize() function, so I
had to make do with a combination of resize() and extend().

Also updated error messages in dashboard when trying to load
out-of-index page in uploads/users lists.

Updated v1 version string due to dashboard.js being modified.
2019-01-03 08:54:46 +07:00
Bobby Wibowo
31a6940ab4
Updates
Added pagination to uploads and users list.
With that, /api/uploads and /api/users API routes will now add "count"
property to their response object.

Enabled Delete user button in users list.
With that also added /api/users/disable API route.
As usual, you can only disable users whose usergroup is lower than
your own.

Click event will no longer trigger on "disabled" elements (basically any
elements with "disabled" attribute).

Changed all arrow functions into regular functions in public JS files
(there were only a few that I somehow missed).

Bumped v1 version string.
2019-01-02 02:39:08 +07:00
Bobby Wibowo
00cbd3e76c
Updates
Updated ESLint rule: curly, again.
Mainly to also enabled "consistent" rule, which enforces curly into
else/elseif blocks, if its if block requires curly.

Added support for GET requests to /api/delete route.
Its usage is /api/delete/identifier, where identifier is the filename.
Though just like its POST route, it needs token in the header.
2018-12-19 00:41:42 +07:00
Bobby Wibowo
52d336cc45
Updated ESLint rule: curly
No more enforced curly for if/else/for/while/do blocks w/ one statement.

With that said, auto-fixed all JS files to follow the rule.

I'd also like to apologize for the inconveniences this commit cause,
after all it was me who intentionally enforced curly rule back then.

Why the change of heart?
After doing some more non-JS codes recently, I realized it was
pretty stupid of me to enforce that.
2018-12-19 00:01:28 +07:00
Bobby Wibowo
da86f605c6
Updates [!! run database/migration.js !!]
Added description column into albums.
So yeah, now albums can have description.
It'll only be shown in the album's edit popup and public link.

HTML chars will now be escaped from album's name and description.

Removed message warning about CDN cache from album's public link.
A shortened version will be shown as the download button's tooltip.

Darkened color of textarea's placeholder.

Bumped v1 version string.
2018-12-13 16:09:46 +07:00
Bobby Wibowo
53789a20c2
Updated uploadController.js
DuckDuckGo's proxy is no longer supported as it stops reporting Content-Length header, which is crucial so that the safe could predict the actual file size before downloading it.

If you have it enabled in your config file, it will now close the safe with error code 1. You can either disable url uploads completely or just disable duckduckgo's proxy (though I believe not many will choose the latter as to begin with it was implemented to hide origin IP).
2018-12-09 00:55:04 +07:00
Bobby Wibowo
1eafafe8a7
Updates
* Fixed home page going out of bound due to git commit message.

* Git commit message will no longer have dotted underline. The old solution by using border-bottom wasn't suitable when the text is being split by word-break, but text-decoration-style wouldn't look as good due to its distance from the text being too close.

* Updated bulma to 0.7.2.

* Bumped v1 and v3 version strings.

* Various other small tweaks.
2018-12-08 05:10:35 +07:00
Bobby Wibowo
07b4ef8fc2
Updates
Added a new config entry named "cacheFileIdentifiers". More info in config.sample.js file.

Improved some descriptions in config.sample.js file.

Added some CSS animations wherever applicable.

Bumped v1 version string.
2018-12-04 18:58:53 +07:00
Bobby Wibowo
6543a87b11
Updates
Reworked unique name generator to prevent the same unique identifier from being used if it was already used with a different extension (e.i. If a file named aBcD.jpg already exists, then files such as aBcD.png or aBcD.txt may not exist).
This is mainly to deal with the fact that thumbnails are only being saved as PNG, so if the same unique name is being used by multiple image/video extensions, then only one of them will have the proper thumbnail.
If you already have existing files with matching unique name but varying extensions, unfortunately you can only deal with them manually for now (either allocating new unique names or deleting them altogether).

Added a new config option to filter files with no extension.

Files with no extensions will no longer have their original name appended to the allocated random name (e.i. A file named "textfile" used to become something like "aBcDtextfile", where "aBcD" was the allocated random name. Now it will only just become "aBcD").
In relation to that, utils.extname() function will now always return blank string if the file name does not seem to have any extension.
Though files such as '.DS_Store' (basically anything that starts with a dot) will still be accepted.
Examples:
.hiddenfile => .hiddenfile
.hiddenfile.sh => .sh
.hiddenfile.001 => .hiddenfile.001
.hiddenfile.sh.001 => .sh.001

Simplified error messages of /api/upload/finishchunks.

Most, if not all, of the error responses for /api/upload* will now have HTTP status code 400 (bad request) instead of 200 (ok).
I plan to generalize this for the other API routes in the future.

Updated home.js to properly handle formatted error message when the response's status code is not 200 (ok).

Bumped v1 version string (due to home.js).
2018-11-29 00:52:12 +07:00
Bobby Wibowo
de87c37d66
Allows render.js to append version string to renders
Thus if you need to update an existing render, you just need to update v1 version string, and the new version string will be appended to the render's URL, thus forcing browser to refresh.

Also updated javelin_1.png since apparently I missed a tiny bit of watermark.
2018-10-23 18:02:19 +07:00
Bobby Wibowo
1517778ed7
Improve 2018-10-19 22:10:30 +07:00
Bobby Wibowo
e5417f0aa2
Restore modals to their original size after done with viewing originals 2018-10-19 21:57:15 +07:00
Bobby Wibowo
dd6934c540
Fixed lazyload breaking in uploads result 2018-10-18 20:40:47 +07:00
Bobby Wibowo
2bdb1d7245
Do not save into localStorage if render is enabled
We do not really want to save anything into user's storage/cookie unless necessary
2018-10-18 20:34:05 +07:00
Bobby Wibowo
cf570347e6
Updates
* Added ship waifu renders to homepage. These renders are toggleable since some of them maybe a bit NSFW-ish (state saved to browser's local storage).

* Updated lazyload to v10.19.0.

* Git commit URL is now have dotted bottom border.

* Thumbnail modal (the one that appears when you click display thumbnail button in lists view) now have a "Load original" button. For images it will simply load the original images, but for videos it will show a video player (relies on the browser's support for <video> tag). Thumbs view will now also have the "display thumbnail" button.

* Small changes to "add to album" modal.

* Small changes to alignment to modals in general.
2018-10-18 20:26:40 +07:00
Bobby Wibowo
0403684038
Fixed albums listing not working 2018-10-14 02:35:46 +07:00
Bobby Wibowo
c763d9b1ea
Fixed thumb/list view setting not being saved 2018-10-13 11:09:39 +07:00
Bobby Wibowo
94dbfa9d96
Fixed broken description in file name length menu 2018-10-12 17:28:42 +07:00
Bobby Wibowo
8e46eaf4ac
Added disk usage column to manage users 2018-10-12 17:19:14 +07:00
Bobby Wibowo
31f44a1b91
Added ID and uploads count columns into manage users
Updated client-side check of user's enabled status to match server-side

Removed a bunch of console.log()'s from development
2018-10-12 16:42:16 +07:00
Bobby Wibowo
f0998a8532
Merge branch 'safe.fiery.me' into account-manager 2018-10-12 02:24:41 +07:00
Bobby Wibowo
0e3ac72721
Fixed album pages
Previously album pages would still use utils.getPrettyBytes(), but one of the previous commits got rid of it in favor of client-side solution.

I forgot to update album pages to also use client-side solution, but this commit fixes it.

On a side note, I also switched all instances of consts to var in the function.
2018-10-12 02:21:19 +07:00
Bobby Wibowo
3708f53044
Added user group option to edit user modal
Also simplified selector for file's add to album modal
2018-10-11 00:33:11 +07:00
Bobby Wibowo
c3d4c237cb
Init account-manager branch 2018-10-10 02:52:41 +07:00
Bobby Wibowo
0745456cac
Updated sharex.js again
Haha, sorry about this, getting sleepy.
Removed a stray console.log().
2018-10-09 02:36:07 +07:00
Bobby Wibowo
57947df4db
Updated sharex.js
Oops, my bad, I forgot to include protocol into the URL field.
2018-10-09 02:33:06 +07:00
Bobby Wibowo
2f6c728e64
Updates
Moved page.prepareShareX() to a single JS file named sharex.js. It'll be loaded in home and dashboard pages, and both home.js and dashboard.js will rely on the function provided by it.

The generated ShareX config file will also properly support cases where the safe is being hosted in a subdir now (e.i. https://example.com/lolisafe).
2018-10-09 02:30:22 +07:00
Bobby Wibowo
5bd343638a
Updates
Moved utils.getPrettyBytes() and utils.getPrettySize() to client's dashboard.js.

Thus, server will no longer return prettified size and date (it'll be prettified by the client instead).

To be honest, I don't even know why I had them in server-side, it's obviously better this way.
2018-10-09 01:54:16 +07:00
Bobby Wibowo
a36062d33c
Updated dashboard.js
Add to album prompt will no longer ask for confirmation (i.e. Are you sure?), instead it will go directly to album selection. If you don't want to continue, you can always press Cancel.

Updated version string in _globals.njk.
2018-09-26 18:57:33 +07:00
Bobby Wibowo
8e74c7f5bd
Updated dashboard
* Added "ShareX user profile" menu item to administration sidebar. This do the same thing as the ShareX icon in the homepage, which is to download a ShareX config.

* Updated version string in _globals.njk. A few of the previous commits also modified some JS files, but I forgot to update the version string back then.
2018-09-07 22:22:17 +07:00
Bobby Wibowo
ed7612bd89
Fix .eslintrc.json for client-side JS files
I can't remember why I extended the config with "eslint:recommended" instead of "standard" back then. I know I wanted to force an older ecmaversion, but even then it would still work just fine with standard.
I've fixed it now to use standard. I've also applied auto-fix to dashboard.js and home.js, which fixed some stray or missing whitespaces, as well as the indenting of case's inside switch statement.
2018-09-07 22:02:04 +07:00
Bobby Wibowo
56bdd08ee7
Init 'browser-ecma5' branch (#7)
* Downgraded ecma version of client-side scripts to v5. This change means no more backtick strings and some others.

* Massively modified auth.js, dashboard.js and home.js to support the downgrade (dashboard.js had the most changes).

* Removed enter key event handler from auth page. The previous code had some small issues. I'd rather not have the handler than let the issues persist. I'll eventually look into adding this again in the future.

* Updated uploadController.js to handle some invalid requests into /api/delete and /api/bulkdelete.
2018-09-04 22:49:37 +07:00
Bobby Wibowo
5c365dc4a8
More changes related to the previous commit 2018-07-17 10:21:04 +07:00
Bobby Wibowo
c238f4f8ed
Updated auth page
Experimental changes:
* No more elements with "onclick" attribute.
* Form can now be submitted with Enter button as long as both the user and the pass inputs are filled.
2018-07-17 10:13:48 +07:00
Bobby Wibowo
fcdac004f3
Updated dashboard.js and home.js
Continuation of the previous commit.
2018-07-14 11:37:36 +07:00
Bobby Wibowo
5e765f4935
Updated home.js and dashboard.js
Use for-i-loop instead of for-of-loop on various places (I may have missed some spots though).
2018-07-14 11:35:31 +07:00
Bobby Wibowo
4d7b23bb39
Initial commit at browser-ecma6 branch
This commit is intended to downgrade codes in JS files used for browser to increase browsers compatibility.

This branch is still experimental and may require much more testing.
2018-07-14 10:42:18 +07:00
Bobby Wibowo
369b1137a7
Updates
* Some structure updates to the homepage and the No-JS uploader form. Making them both somewhat look better, especially in terms of spacing.

* Upload URLs form will now show an error alert when there the form is empty or only filled with whitespaces.

* Upload URLs form will now automatically remove empty lines or lines that consist of only whitespaces when the upload button is pressed.
2018-05-13 05:13:26 +07:00
Bobby Wibowo
c4eed6e478
Updates
* Added globals.v3 to _globals.njk, which will be used for CSS/JS files of libs (bulma, lazyload, etc.). globals.v1 will now only be used for lolisafe's JS and CSS files.
Since CSS/JS files of libs receive much less updates than lolisafe's (mainly since I push updates a lot), this will decrease the amount of files that users need to re-fetch on every updates.

* Added public/js/album.js which will be used by album.njk (albums public link). I'm going to disable inline scripts in safe.fiery.me.

* Better FAQ. Some points will now dynamically changes depending on the settings you have in your config.js. It's not perfect but certainly much better than before.
2018-05-12 23:34:19 +07:00
Bobby Wibowo
4d634196c5
Updated home.js
* Cache selected album the exact moment "Upload URLs" button is pressed, so that any in progress requests will not have its album id altered.

* All URLs will now be displayed in the uploads list (the thing in between upload buttons and footer links) the moment "Upload URLs" button is pressed. Previously it would only show the URLs one by one after each finished request.
Brief video: https://i.fiery.me/AByv.mp4.
2018-05-11 22:10:49 +07:00
Bobby Wibowo
bd722129de
Updates, now supports uploading by URLs!
* Added upload by URLs. It has its own max size (config.uploads.urlMaxSize), make sure your config matches config.sample.js.
Here's a brief video showing it in action: https://i.fiery.me/CUhQ.mp4.

* /api/upload now supports uploading by URLs. Devs will only need to POST a JSON request containing a key named "urls", which is an array of the urls to upload.

* Added file extension filter to /api/upload/finishchunks.

* Added proper total chunks size check to /api/upload/finishchunks.

* Various code improvements.
2018-05-11 21:34:13 +07:00