|Bobby Wibowo d1b70d6b14 Added 1 new entry to TODO.md||1 day ago|
|.github||7 months ago|
|controllers||1 day ago|
|database||3 weeks ago|
|dist||5 days ago|
|pages||1 year ago|
|public||3 weeks ago|
|routes||1 week ago|
|scripts||3 weeks ago|
|src||5 days ago|
|views||5 days ago|
|.browserslistrc||1 month ago|
|.editorconfig||1 year ago|
|.eslintignore||4 weeks ago|
|.eslintrc.json||1 month ago|
|.gitignore||4 weeks ago|
|.stylelintignore||4 weeks ago|
|.stylelintrc.json||1 week ago|
|AUTHORS||1 month ago|
|Dockerfile||1 year ago|
|LICENSE||1 year ago|
|README.md||3 weeks ago|
|TODO.md||1 day ago|
|config.sample.js||4 days ago|
|gulpfile.js||2 days ago|
|logger.js||3 weeks ago|
|lolisafe.js||3 weeks ago|
|nginx-ssl.sample.conf||1 year ago|
|nginx.sample.conf||1 year ago|
|package.json||1 day ago|
|real-ip-from-cf||1 year ago|
|yarn.lock||1 day ago|
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.
yarn install --productionto install all production dependencies (Yes, use yarn).
yarn startto start the service.
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
This fork has a separate development mode, with which client-side CSS/JS files in
src directory will be automatically rebuilt using Gulp tasks.
yarn installto install all dependencies (including development ones).
yarn developto start the service in development mode.
You can configure the Gulp tasks through
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
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 $ 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.
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.