Commit Graph

426 Commits

Author SHA1 Message Date
Bobby Wibowo
61e1896945
Updates
* A bunch of refactors in public JS files (home.js, dashboard.js, etcetera).

* Added lazyload to home page (for thumbs of uploaded images), dashboard (for thumbs view) and albums' public link.
Albums' public link will silently fallback to loading all thumbs at once if JavaScript is disabled.

* A bunch of others code improvements. Honestly I'm too lazy to track all the changes.
2018-04-29 19:47:24 +07:00
Bobby Wibowo
c51365adb5
Updated dashboard
Bulk deleting files and adding/removing selected files from album will no longer refresh the current view to the first page. It will now instead try to refresh the current page. There will be cases where the current page ends up empty (when bulk deleting or moving files from the current album), but I figured that isn't much of an issue when compared with the advantages.
2018-04-29 06:44:25 +07:00
Bobby Wibowo
4b7feb4c08
Updated config.sample.js
Oops, I forgot to add "uploads.albumIdentifierLength" from the previous commit.
2018-04-29 00:29:47 +07:00
Bobby Wibowo
4660200b1e
More improvements to albums, and others
Improvements related to albums:

* Changed "rename album" option with a better "edit album" feature. With it you can also disable download or public link and even request a new public link (https://i.fiery.me/fz1y.png).
This also adds a new API route: /api/albums/edit.
The old API route, /api/albums/rename, is still available but will silently be using the new API in backend.

* Deleting album will now also delete its zip archive if exists.

* Renaming albums will also rename its zip archive if exists.

* Generating zip will use async fs.readFile instead of fs.readFileSync. This should improve generating speed somewhat.

* The codes that tries to generate random identifier for album will now check whether an album with the same identifier already exists. It will also rely on "uploads.maxTries" config option to limit how many times it will try to re-generate a new random identifier.

* Added a new config option "uploads.albumIdentifierLength" which sets the length of the randomly generated identifier.

* Added "download" and  "public" columns to "albums" table in database/db.js.
Existing users can run "node database/migration.js" to add the columns.

Others:

* uploadsController.getUniqueRandomName will no longer accept 3 paramters (previously it would accept a callback in the third parameter). It will now instead return a Promise.

* Album name of disabled/deleted albums will no longer be shown in uploads list.

* Added "fileLength" column to "users" table in database/db.js.

* Renamed HTTP404.html and HTTP500.html in /pages/error to 404.html and 500.html respectively. I'm still using symlinks though.

* Added a new CSS named sweetalert.css which will be used in homepage, auth and dashboard. It will style all sweetalert modals with dark theme (matching the current color scheme used in this branch).

* Updated icons (added download icon).

* Some other improvements/tweaks here and there.
2018-04-29 00:26:39 +07:00
Bobby Wibowo
8496e69955
Updated config.sample.js 2018-04-27 10:32:36 +07:00
Bobby Wibowo
64b04abbe9
Updates (a small breaking change with config file)
"generateZips" is no longer merely accepting boolean value, it's now an object with 2 properties: "enabled" and "maxTotalSize". The former is of course to enable/disable zip generation, while the latter is to limit the total size of all the files in an album. If the total size exceeds the set limit, it will not generate a zip file. It'll probably be useful when used alongside Cloudflare's Cache Everything (since Cloudflare will only cache files with a maximum size of 512MB).
2018-04-27 10:27:34 +07:00
Bobby Wibowo
535d3df73f
Updated some things involving album zipping
* When version string is not specified in the URL query of /api/zip/:identifier (the API route to generate and download ZIP archive of the album), it will redirect the request with the album's editedAt timestamp as the value in the version string (only if editedAt timestamp exists). This will ensure that any bare calls to the API (without version string) will always be redirected to its latest state. This is mainly useful when being used with CDN that respects query string.

* Download button and CDN notice will no longer be visible in empty album pages.

* Matched empty album phrase as the one being used with the zipping API.
2018-04-27 10:03:13 +07:00
Bobby Wibowo
e01b007ea1
Updates
Restored CDN warning to album pages. Turns out adding Page Rule to /api/album/zip/* with Cache Level set to Cache Everything and Origin Cache Control set to On will work just fine. The version string is still necessary to ensure that clients are downloading the very latest version of the archive though.
Also last time I was using zipGeneratedAt timestamp, which was dumb, this time it is using editedAt timestamp, which was my original plan but kinda forgotten.
2018-04-27 04:30:11 +07:00
Bobby Wibowo
00123b95d2
Updated album.njk
Disabling CDN notice.
2018-04-27 04:13:34 +07:00
Bobby Wibowo
d46611ee57
Updates
Experimental CDN support for album zip downloads.
2018-04-27 04:04:21 +07:00
Bobby Wibowo
0bce5e6da3
Updated routes/albums.js
Thumbnails' alt will now be their file name instead of full thumb URL.
2018-04-27 02:54:00 +07:00
Bobby Wibowo
006907ff06
Bumped version string of CSS/JS files
I made changes to dashboard.js in the previous commit but forgot to bump version string of CSS/JS files.
2018-04-27 01:35:32 +07:00
Bobby Wibowo
d5bb5a5bac
Updates
* Better thumbnails view in album page (it's now using the same styling as the one in dashboard, minus the on-hover effects and uploader/album names).

* Fixed unenclosed p tag in thumbs view at dashboard.js. It did not cause any issue because it's optional to enclose it, but oh well.
2018-04-27 01:33:11 +07:00
Bobby Wibowo
21bf3b59c2
Updated home
Removed "dz-thumbnail" alt from dropzone's template and slightly changed ShareX's config template.
2018-04-26 20:14:18 +07:00
Bobby Wibowo
976e96c14f
Updated _layout.njk
Forgot to add globals.v2 to some images in meta tags.
2018-04-26 20:01:29 +07:00
Bobby Wibowo
5878434c12
Updated _globals.njk
Default ShareX config file will now have its URL appended by globals.v2 too.
2018-04-26 19:56:33 +07:00
Bobby Wibowo
1f6dfae78e
Updates
* Updated screenshot in README.md, as well as replaced fb_share.png with the same image.

* Removed 512px.png and replaced it with 512pxr.png (a round version) in manifest.json.

* globals.v is now split into globals.v1 and globals.v2. The former for CSS and JS files, the latter for images and config files (manifest.json, etcetera).

* All static images that are part of the layout will now have their URLs appended with globals.v2 (which means this does not include dynamically generated images such as thumbnails of uploaded files).
2018-04-26 19:53:19 +07:00
Bobby Wibowo
6cc6928c62
Merging all the changes from 'master'
There's nothing much really. Here's a summary:
* Added dmca.gripe to README.md.
* Updated chrome extension's instruction in README.md.
* Bumped year in LICENSE.
* Moved error pages from /pages/errors to /pages/error.
* Added a README.md to /pages/error clarifying the fact that this repo is using symlinks for error pages.
2018-04-26 19:28:31 +07:00
Kana
4d883de6ac
Merge pull request #99 from RyoshiKayo/patch-3
Removed Bold style from dmca.gripe
2018-04-26 04:06:42 -03:00
Kayo
c4993e5882
Removed Bold style from dmca.gripe 2018-04-25 23:57:04 -07:00
Shumatsu
44ca2dd53d De loli-safe (#77)
* Change all occurences of loli-safe to lolisafe

Saw that repository was renamed, links were changed, but a lot of files of lolisafe were unchanged. So I followed the links and changed what seemed safe to change. Which turned out to be all occurences. 

Also, bumped the copyright.

* Change year in LICENSE

This seems to be the proper format.

* Image fix

It was out of focus.

* Relative image path

Heard on StackOverflow it can be done like this.
2018-04-26 08:54:07 +02:00
Kosinus
717367320e added dmca.gripe (#96) 2018-04-26 08:51:35 +02:00
Bobby Wibowo
08637b9ea9 fixed "add to album" error on uploads (#92)
* Updates

Fixed the way error when adding album is being handled.

* I guess that sounds about right.
2018-04-26 08:51:17 +02:00
Bobby Wibowo
19e965a77a SEMICOLONS, ermahgerd (#93) 2018-04-26 08:50:35 +02:00
Bobby Wibowo
5a4bec6b00 no-useless-return (#94) 2018-04-26 08:48:56 +02:00
Bobby Wibowo
fa6c33e2e9 no-mixed-spaces-and-tabs (#95)
I wonder why I can't see the diffs from my vscode 🤔
2018-04-26 08:48:44 +02:00
Bobby Wibowo
17f9848ca5
Updates 2018-04-25 22:29:31 +07:00
Bobby Wibowo
ed7c53b869
Updated _globals.njk
I forgot to add 'rel="noopener"' here.
2018-04-25 21:24:31 +07:00
Bobby Wibowo
89b42cf652
Updates
* Added "short_name" to manifest.json.

* Added 512px icon to manifest.json.

* Increased brightness of links to satisfy WCAG 2 AA standard.

* Added 'rel="noopener"' to all instances of a[target="_blank"].

* Added 'alt' to all instances of img.

* Updated static files' version string yet again.

* Added 'lang="en"' to html (_layout.njk).
2018-04-25 21:11:15 +07:00
Bobby Wibowo
00d05ce97b
Updates
* Dashboard will now display "N/A" when the file does not have an extension. Previously it would display the full name, which was of course a mistake.

* Updated static files' version string again.
2018-04-25 20:39:07 +07:00
Bobby Wibowo
5bb960756f
Updates
uploadController.js:

 * Fixed chunk uploads failing when "blockedExtensions" is missing from the config file.

config.sample.js:

* Renamed "blockedExtensions" to "extensionsFilter", and added a new option named "filterBlacklist". When "filterBlacklist" is set to 'true', all extensions in "extensionsFilter" array will be blacklisted, otherwise it will be a whitelist, so only files with those extensions that can be uploaded.

* Renamed "uploads.chunkedUploads.maxSize" to "uploads.chunkedUploads.chunkSize".

* Added "uploads.chunkedUploads.noJsMaxSize" which can be used to change the 'displayed' file size on the No-JS uploader page.

* Some other phrases updates.

_globals.njk:

* Updated static files' version string since there is a small update to home.js.

other files:

* Regular code improvements/tweaks.
2018-04-25 20:16:34 +07:00
Bobby Wibowo
6a25eaac05
Updates
* Updated yarn.lock.

* Added resolution for chokidar. This is going to be used by nunjucks if "watch" is set to true. Although we don't really use it, chokidar 1.x has a vulnerability.
2018-04-25 18:39:54 +07:00
Bobby Wibowo
498002ee2d
Updated lolisafe.js
Removed file extension check from setHeaders function. It will now apply Cache-Control to all files in /public, and to all files in the uploads folder if they are being served by node.
2018-04-25 14:30:38 +07:00
Bobby Wibowo
ebf150938a
Cleaned some files 2018-04-24 03:01:11 +07:00
Bobby Wibowo
e5f5fb1038
Updates
* You can now disable using icons in home's footer links by setting "home_icons" to false in _globals.njk.

* Renamed "meta" block to "opengraph" in _layout.njk, since the block only represents opengraph tags anyways.

* Moved noscript warning to its own file at views/_partial/noscript.njk. It's also now being included in dashboard and auth pages.

* No-JS uploader will no longer use icons in its footer links. It will also no longer load fontello.css.

* Updated static files' version string in _globals.njk.

* Some other tweaks, mainly to get no-icons mode to work properly.
2018-04-24 02:58:44 +07:00
Bobby Wibowo
c854e416ae
Updates
I'm reverting 2 commits before this. It was mainly about changing icons size to 1.75x instead of 2x their size. This time I'm keeping it back to 2x. I did some more thinking and I just wasn't satisfied with 1.75x.
2018-04-23 03:22:26 +07:00
Bobby Wibowo
2da192602f
Updates 2018-04-23 00:08:08 +07:00
Bobby Wibowo
7376ce3d7c
Updates
* Added Firefox extension link. For now this will simply link my fork of the Chrome extension. You will have to build the extension by your own.

* Updated icons (added Firefox).

* Tiny refactor in home.js, thus I had to update version string in _globals.njk as well.
2018-04-22 02:08:09 +07:00
Bobby Wibowo
431be5cccd
Updated home
* Main upload button will no longer be "loading" if an error occurs with the API check request.

* It will now show a message asking user to try out the No-JS uploader when JavaScript is disabled.
2018-04-21 20:14:34 +07:00
Bobby Wibowo
674d20c62c
Updates
Regular code improvements.
2018-04-21 04:39:06 +07:00
Bobby Wibowo
a18d3a2e21
Updated views
* Moved links.njk to _partial/links.njk.

* Renamed layout.njk to _layout.njk.

* Cleaned some formatting in links.njk and nojs.njk (mainly had something to do with extraneous whitespaces).
2018-04-19 13:22:53 +07:00
Bobby Wibowo
f4b00b404b
Updated _globals.njk
Forgot to set github link to open in new tab.
2018-04-19 04:45:48 +07:00
Bobby Wibowo
c2db094e62
Updated dependencies
I forgot to remove handlebars completely, lmao.
Also updated vscode's settings. Temporarily only using "michelemelluso.code-beautifier" extension to beautify CSS until I find a better alternative.
2018-04-19 04:19:05 +07:00
Bobby Wibowo
65db88ae3f
Updated nojs.njk
Forgot to add safe filter to subtitle.
2018-04-19 04:09:57 +07:00
Bobby Wibowo
09f51c8448
Updates~ 😉
Thanks to Zephyrrus for the hints about nunjucks, sort of (he did not really give out any specific hints to me, I stalked his fork, lmao).

* Replaced Handlebars with Nunjucks.

* Replaced all static HTML files with their NJK-equivalent (excluding error pages).

* Renamed "albumDomain" to "homeDomain" in config.sample.js (make sure you update your config.js too).

* Updated dependencies: knex and eslint-plugin-import (dev).

* Updated vscode's settings.json (I may update this again very soon).
2018-04-19 04:00:36 +07:00
Bobby Wibowo
1aee22d6a2
Updated faq and dashboard
* Added box-shadow to thumbnail container in thumbs view.

* Added -webkit- prefix to box-shadow in faq.html (also applied to the new one in dashboard.css for dashboard).
2018-04-16 23:31:05 +07:00
Bobby Wibowo
f4c6b01f92
Updated faq.html
Removed border from and added box-shadow to message-body.
2018-04-16 23:17:02 +07:00
Bobby Wibowo
b83f4e3ce2
Updated home.css
Fixed wrong border-radius for logo.
2018-04-13 23:30:41 +07:00
Bobby Wibowo
dd43acecea
Updates
* Added VSCode settings to git repo. Now you can match yours with mine, if you want.

* Added .jsbeautifyrc for js-beautify (to be used by VSCode's Beautify extension).

* Refactored all instances of require('**/*.js') with require('**/*') wherever applicable (basically gotten rid of the .js extension).

* Refactored path in all instances of require() wherever applicable.

* Sorted instances of require() wherever applicable.

* Fixed 500 HTTP error trying to load an error page for 505 HTTP error.

* Removed special treatement of NoJS page from uploadsController.processFilesForDisplay().

* Updated version string of all static files.

* Beautified all HTML, HANDLEBARS and CSS files.

* Refactored the structure of footer links in homepage and No-JS uploader. This should now fix homepage going out-of-bound in smaller screens.

* Added CSS prefixes wherever applicable.

* Improved back-end side of No-JS uploader. This will now handle errors properly.

* No-JS uploader will now show max file size.

* No-JS uploader will now show a proper message when private mode is enabled and/or registration is disabled.
2018-04-13 23:20:57 +07:00
Bobby Wibowo
c12add2ace
Updated screenshot in README.md 2018-04-12 21:41:57 +07:00