Commit Graph

132 Commits

Author SHA1 Message Date
Julian Lam
f96208a0c8 fix(uploads): ugly filenames on uploaded asset downloading
During regular processing, a timestamp is prepended to the filename
for any uploaded files. We don't want this to be part of the filename
if an end-user elects to download the file.

This commit adds a middleware to strip out that portion of the
basename and adds the appropriate Content-Disposition header for
files in /uploads/files

Fixes #6953
2018-11-13 13:56:33 -05:00
Barış Soner Uşaklı
69bb3293ee misc fixes
handle spider uids properly
2018-11-12 00:20:44 -05:00
Julian Lam
a5022ce425 fix: #6922, skin assets not including plugin LESS files 2018-11-07 19:18:11 -05:00
Julian Lam
501b3a79ca Refactor skins to be built on server-side (#6849)
* WIP

* using bootswatch from npm instead of bootswatch CDN url

* feat: on-demand client css building for skins

* added ability for client-side to select a skin

* updated loading and saving logic of bootstrapSkin on client side user settings

* fix: broken test for #6849
2018-11-07 13:44:35 -05:00
Barış Soner Uşaklı
9c022afae1 Parse int (#6853)
* Store config fields as JSON in the db

Fewer parseInts

* Remove unnecessary parseInts

* remove some dupe code add tests

* remove console.log

* remove more parseInts

* WIP: read meta.configs defaults from defaults.json

remove more parseInts

* more work

* add log for failing test

* update admin pwd

* fix tests, dont require posts/cache before configs are initialized

* handle saves

* Test boolean conditions

* remove more parseInts

* Fix boolean values

* remove lots more parseInts

* removed json parsing

* renamed var to number

* categories dont have timestamp
2018-10-21 16:47:51 -04:00
Barış Soner Uşaklı
26d4e0852f use includes instead of indexOf
use _.uniq instead of filter&indexOf
2018-10-20 14:40:48 -04:00
Peter Jaszkowiak
04d31fe1d4 Precompile all templates
- Benchpress compilation is 33x faster now
- Native module with JS fallback and pre-built binaries
- Dev template build is <1sec now
- Minified template build is ~5sec (uglify accounts for almost all)
2018-07-15 00:12:37 -06:00
Barış Soner Uşaklı
85a55d1740 closes 2018-07-09 14:57:42 -04:00
Barış Soner Uşaklı
d31d8fa806 move category pageview to controllers
so topic views are tracked as category views
2018-06-01 14:57:59 -04:00
Julian Lam
c25d752573 Merge remote-tracking branch 'origin/master' into develop 2018-02-23 14:48:38 -05:00
Barış Soner Uşaklı
c707e98423 closes #6331 2018-02-19 11:45:06 -05:00
Barış Soner Uşaklı
e36657d48c add tpl path to error messages 2018-02-19 11:17:15 -05:00
Julian Lam
1ce448f2a1 Merge remote-tracking branch 'origin/master' into develop 2018-02-16 21:23:25 -05:00
Barış Soner Uşaklı
575b70b5ab add some checks to templatesOnDemand 2018-02-14 16:29:33 -05:00
Barış Soner Uşaklı
ac1f7eefe5 closes #2304 2018-01-31 15:20:17 -05:00
Barış Soner Uşaklı
18ba08183c fix test 2018-01-26 19:26:48 -05:00
Peter Jaszkowiak
fc19f3af61 Misc fixes and improvements (#6143)
* `setup` command fixes and improvements

- Enable using the `./nodebb setup` command for auto-setup with a JSON argument
- Change CLI so package-install and dependency install are separate steps
- Fix #6142

* Prevent compiling templates multiple times

- Multiple requests for same template get pooled
- Hopefully fixes the "templateFunction is not a function" error which happens if site is restarted during high-traffic times

* More helpful upgrade template
2017-12-04 15:49:44 -05:00
Peter Jaszkowiak
c47c47f7e3 Use less memory to build translation files (#6070)
* Change languages build to use less memory

Add graceful-fs so no ned to worry about fs limits

* Specify encoding for fs.readFile

Use eachLimit since graceful-fs handles that now
2017-11-16 17:43:52 -05:00
Julian Lam
6852c92ed6 Merge remote-tracking branch 'origin/develop' 2017-10-03 13:37:43 -04:00
Peter Jaszkowiak
dc87d7fc0f Use .js instead of .jst
Fix #5934
2017-09-23 12:51:20 -06:00
Julian Lam
dea372a5c5 fixes #5932 2017-09-14 10:15:05 -04:00
Peter Jaszkowiak
abffc29128 Use Benchpress (#5901)
* Use Benchpress

* Use Benchpress.compileParse

* Error for template load failure

* Use benchpressjs package

* Compile templates on demand

* Fix user settings page

* Fix admin search to exclude `.jst` files

* Fix 500-embed

So ajaxify can still show an error if the server goes down
2017-08-24 19:26:50 -04:00
Julian Lam
6ec1bfd660 added artificial delay on reset route so that the heat death of the universe will arrive before you manage to identify a valid reset code 2017-08-16 12:51:02 -04:00
Julian Lam
f59f48c6e1 use setImmediate 2017-07-25 14:11:54 -04:00
Julian Lam
c9c27b86c4 added back logic to strip leading slashes, but after the fix to app.all 2017-07-25 13:50:37 -04:00
Baris Usakli
e9639833c5 add router.all 2017-07-25 12:11:11 -04:00
Julian Lam
233297367b strip leading slashes from path if double-slash is accidentally used, stripping trailing slash from relative path retrieved from config.json 2017-07-25 10:39:57 -04:00
Marc-Aurèle DARCHE
6248e5562f Fix /apple-touch-icon not sending uploaded file
This fixes the following error:

$ wget https://nodebb.yourdomain/apple-touch-icon

28/6 09:57:06 [28332] - error: /apple-touch-icon
 Error: ENOENT: no such file or directory, stat '/home/sweet/nodebb/public/assets/uploads/system/touchicon-orig.png'
    at Error (native)
2017-06-28 15:02:17 +02:00
Barış Soner Uşaklı
22131640fd closes #5749 2017-06-08 17:17:46 -04:00
Baris Usakli
062bced3dd cleanup and tests 2017-05-25 16:40:07 -04:00
Barış Soner Uşaklı
29135dfed3 timeago locale test 2017-05-23 23:32:38 -04:00
Barış Soner Uşaklı
01e2263c01 more tests 2017-05-12 17:53:23 -04:00
Barış Soner Uşaklı
608a7d120c error handler tests 2017-05-10 21:02:36 -04:00
Julian Lam
af2d9fb85b Merge branch 'master' into develop 2017-03-06 09:51:11 -05:00
barisusakli
2188036148 controllers/users refactor 2017-03-02 00:14:30 +03:00
Julian Lam
ddea9f534e running eslint again 2017-02-24 12:47:46 -05:00
Julian Lam
72e77772db Merge branch 'master' into develop 2017-02-24 12:46:40 -05:00
Peter Jaszkowiak
4bb49a7171 ESlint no-unused-vars 2017-02-18 15:05:36 -07:00
Peter Jaszkowiak
09e868ce5f ESlint no-useless-escape, no-else-return 2017-02-18 14:27:26 -07:00
Peter Jaszkowiak
896c8c7343 ESlint object-curly-spacing 2017-02-18 12:30:49 -07:00
Peter Jaszkowiak
a038c66549 ESlint quotes 2017-02-18 01:56:23 -07:00
Peter Jaszkowiak
604358ecc4 ESlint keyword-spacing, no-multi-spaces 2017-02-18 01:52:56 -07:00
Peter Jaszkowiak
2ba46808a1 ESlint one-var, fix comma-dangle 2017-02-17 20:20:42 -07:00
Peter Jaszkowiak
bc1d70c126 ESlint comma-dangle 2017-02-17 19:31:21 -07:00
Julian Lam
7f124a3ccf Merge branch 'master' into develop 2017-02-10 12:55:11 -05:00
Peter Jaszkowiak
aaacdb8413 Fix #5416, uploads path config setting
- Finish moving uploads route to `/assets/uploads`
- Remove `upload_url` config setting, it was broken
2017-02-08 11:41:34 -07:00
Julian Lam
ae279fe57f casting some values as int, in ensureSelfOrPrivileged middleware 2017-01-24 12:33:27 -05:00
Julian Lam
73879b824c Merge branch 'master' into develop 2017-01-20 12:33:17 -05:00
Peter Jaszkowiak
2f07c18c5a All hail the glorious translation prebuilding 2017-01-14 14:08:52 -07:00
Julian Lam
d29361f4c9 added additional visibility masks for profile menu hook, also added isPrivileged user method, closes #5306 2017-01-11 15:06:28 -05:00