No Description

Bobby Wibowo 32e4f8a71c Upgraded dependencies 1 week ago
.github 94bc88191e Update issue templates 9 months ago
controllers d9ddfe8e9a Implemented stripping tags from images 2 weeks ago
database a884ef8d01 Bug fix 1 month ago
dist d9ddfe8e9a Implemented stripping tags from images 2 weeks ago
pages 0d38995b2b Updates 1 year ago
public c3d61733af Updated 2 months ago
routes d9ddfe8e9a Implemented stripping tags from images 2 weeks ago
scripts e22c180edd Updated scripts/README.md again again 2 months ago
src d9ddfe8e9a Implemented stripping tags from images 2 weeks ago
views 5ff512bc7f Updated FAQ 1 week ago
.browserslistrc c9ba16e1d6 Updates (very important to read) 3 months ago
.editorconfig dd43acecea Updates 1 year ago
.eslintignore 9e9b0d4439 Updated 2 months ago
.eslintrc.json 02e2e402c3 !!! MASSIVE OVERHAUL !!! 3 months ago
.gitignore 9e9b0d4439 Updated 2 months ago
.stylelintignore 9e9b0d4439 Updated 2 months ago
.stylelintrc.json 411d17e1fb Updated 2 months ago
AUTHORS 10a464bc73 Updated 3 months ago
Dockerfile 8a75ab91a6 update deps and add dockerfile 1 year ago
LICENSE 44ca2dd53d De loli-safe (#77) 1 year ago
README.md a884ef8d01 Bug fix 1 month ago
TODO.md 08751dd128 Checked DMCA request logs from TODO list 1 week ago
config.sample.js 806acecdbb Updated explanation of stripTags option in config 1 week ago
gulpfile.js b38bde3da0 Enabled verbose output for gulp linter tasks 2 months ago
logger.js 2e40124c62 Updated logger.js 2 months ago
lolisafe.js a884ef8d01 Bug fix 1 month ago
nginx-ssl.sample.conf 0b6df9efe4 Merged changes from master 1 year ago
nginx.sample.conf 0b6df9efe4 Merged changes from master 1 year ago
package.json 32e4f8a71c Upgraded dependencies 1 week ago
real-ip-from-cf 6f7ec5d282 Updated IP's 1 year ago
yarn.lock 32e4f8a71c Upgraded dependencies 1 week ago

README.md

lolisafe, a small safe worth protecting

safe.fiery.me

GitHub license

safe.fiery.me

JavaScript Style Guide

This fork is the one being used at https://safe.fiery.me. If you are looking for the original, head to WeebDev/lolisafe.

If you want to use an existing lolisafe database with this fork, run node ./database/migration.js at least once to create the new columns introduced in this branch (don't forget to make a backup).

Configuration file of lolisafe, config.js, is also NOT fully compatible with this fork. There are some options that had been renamed and/or restructured. Please make sure your config matches the sample in config.sample.js before starting.

Running in production mode

  1. Ensure you have at least Node v8.0.0 installed (v10.x is recommended).
  2. Clone this repo.
  3. Copy config.sample.js as config.js.
  4. Modify port, domain and privacy options if desired.
  5. Run yarn install --production to install all production dependencies (Yes, use yarn).
  6. Run yarn start to start the service.

Default admin account:
Username: root
Password: changeme

You can also start it with yarn pm2 if you have PM2.

When running in production mode, the safe will use pre-built client-side CSS/JS files from dist directory, while the actual source codes are in src directory.

The pre-built files were processed with postcss-preset-env, cssnano, bublé, and terser.

Running in development mode

This fork has a separate development mode, with which client-side CSS/JS files in src directory will be automatically rebuilt using Gulp tasks.

  1. Follow step 1 to 4 from the production instructions above.
  2. Run yarn install to install all dependencies (including development ones).
  3. Run yarn develop to start the service in development mode.

You can configure the Gulp tasks through gulpfile.js file.

During development, the rebuilt files will be saved in dist-dev directory instead of dist directory. The service will also automatically serve the files from dist-dev directory instead. This is to avoid your IDE's Git from unnecessarily rebuilding diff of the modified files.

Once you feel like your modifications are ready for production usage, you can then run yarn build to build production-ready files that will actually go to dist directory.

Script for missing thumbnails

Thumbnails will not be automatically generated for existing files, that had been uploaded prior to enabling thumbnails in the config file.

To generate thumbnails for those files, you can use yarn thumbs.

$ yarn thumbs
$ node ./scripts/thumbs.js

Generate thumbnails.

Usage  :
node scripts/thumbs.js <mode=1|2|3> [force=0|1] [verbose=0|1] [cfcache=0|1]

mode   : 1 = images only, 2 = videos only, 3 = both images and videos
force  : 0 = no force (default), 1 = overwrite existing thumbnails
verbose: 0 = only print missing thumbs (default), 1 = print all
cfcache: 0 = do not clear cloudflare cache (default), 1 = clear cloudflare cache

For example, if you only want to generate thumbnails for image files without overwriting existing ones, you can run yarn thumbs 1.

Or if you want to generate thumbnails for both image and video files, while also overwriting existsing ones, you can run yarn thumbs 3 1.

ClamAV support

This fork has an optional virus scanning support using ClamAV, through clamdjs library.

It will scan new files right after they are uploaded. It will then print error messages to the uploaders (as in the virus names in ClamAV's databases) if the files are dirty.

On the down side, this will slow down uploads processing (as it has to wait for the scan results before responding the uploader's requests), however it's still highly recommended for public usage.

To enable this, make sure you have ClamAV daemon running, then fill in the daemon's IP and port into your config file.