773 Commits (4ffbd78df56cf0be9b76737dba85c7588f59f5fb)

Author SHA1 Message Date
psychobunny ea22cd302a fix: use req.ip instead, since guests can upload as well 4 years ago
psychobunny a9978fcfd2 feat: rate limit file uploads 4 years ago
Barış Soner Uşaklı 36f119a96a fix: #9492, keep query params on redirect 4 years ago
Julian Lam 9c52fd2e74 fix: #9450 express session saved even if saveUninitialized explicitly passed in 4 years ago
Julian Lam 166d65a1ba fix: add back middleware.authenticateOrGuest 4 years ago
Julian Lam e3b2c00db1 fix: request authentication called twice in account routes 4 years ago
Julian Lam 7da061f0d7
refactor: automatically authenticate all requests setup through route helpers (#9357)
* refactor: automatically authenticate all requests setup through route helpers

* fix: removed connect-ensure-login dependency

* fix: bug with some middlewares not defined outside route helper methods
4 years ago
Peter Jaszkowiak cc9d6fd08b chore: eslint max-len 4 years ago
Peter Jaszkowiak 5c2f0f0557 chore: eslint no-restricted-syntax 4 years ago
Peter Jaszkowiak 23f212a4c0 chore: eslint prefer-destructuring 4 years ago
Peter Jaszkowiak dab3b23575 chore: eslint no-var, vars-on-top 4 years ago
Peter Jaszkowiak b56d9e12b5 chore: eslint prefer-arrow-callback 4 years ago
Peter Jaszkowiak 707b55b6a5 chore: eslint prefer-template 4 years ago
gasoved 53e0d4d2e0 feat: banned-users group 4 years ago
Julian Lam 5f9f241e37 chore: remove deprecated `filter:admin/header.build` hook [breaking]
Use `filter:middleware.renderAdminHeader` instead.
4 years ago
Julian Lam f975063b7d fix: #7125, allow list for page route, configurable via plugin hook 4 years ago
Julian Lam 966c4117ec refactor(api): post move to write API 4 years ago
Barış Soner Uşaklı 1374e0eeba refactor: change var to const 4 years ago
Julian Lam c07e1e16af feat: add unread-count badge if navigator contains /flags route 4 years ago
Julian Lam 6cb5888c13 fix: unescape header navigation originalRoute [breaking] 4 years ago
Julian Lam 03a0e72fae refactor: split out logic dedicated to calculating unread counts, to a separate local method 4 years ago
Julian Lam 223f0a5515 feat(acp): admin tags privilege 4 years ago
Julian Lam fb46a8d975 feat(acp): admins-mods privilege 4 years ago
Barış Soner Uşaklı fcc1e24ad0 feat: rename admin middleware header hook 4 years ago
Julian Lam da191341e8 feat(acp): added new admin privilege for groups management 4 years ago
Julian Lam 34ccabe3ab fix: bad assignment logic in middleware.renderHeader 4 years ago
Julian Lam 75b1bbd09f feat: explicitly add filter:admin/header.build hook
As it is not fired during middleware.processRender
4 years ago
Julian Lam 4c87f30184 feat: allow plugins to override ACP relogin challenge
- used in 2factor
4 years ago
Julian Lam 90497e3ef5 feat: more work on topic thumbs refactor
- addThumb and deleteThumb are now protected routes (duh)
- new getThumbs route GET /api/v3/topics/<tid>/thumbs
- Updated `assert.path` middleware to better handle if relative paths are received with upload_url
- Slight refactor of thumbs lib to use validator to differentiate between tid and UUID
4 years ago
Julian Lam 708b1c338f fix: #9040 4 years ago
Julian Lam 7e9e08f718 feat: server-side routes for handling multiple topic thumbnails
closes #8994, requires 'topic-thumb-refactor' branch of composer-default
4 years ago
Julian Lam 6037f5ee2c chore: add comment for clarification 4 years ago
Julian Lam 970ccb5a68 fix: #9063, missing handler for passwordless accounts in admin.checkPrivileges middleware 4 years ago
Julian Lam 3ea66f84e1 fix: use file lib instead of directly accessing fs (for Assert.path) 4 years ago
Julian Lam 6e2da9966e refactor: move plugin hook methods to plugin.hooks.* 4 years ago
Barış Soner Uşaklı 120999bf63 feat: #7550, show message if post is queued when js is disabled 4 years ago
Barış Soner Uşaklı e4d2764d4c fix: #8884, remove header/footer cache 4 years ago
Barış Soner Uşaklı a0164b1c38 fix: use header/footer cache in prod 4 years ago
Barış Soner Uşaklı 2e44639210 fix: guest header/footer cache
allow clearing individual caches
4 years ago
Barış Soner Uşaklı 4b63f9937c fix: check is banned in buildHeader
remove unused banReason
remove generateHeader function
4 years ago
Julian Lam 87bff6cd65 fix: broken test 4 years ago
Julian Lam dda5d42610 fix: restore old behaviour of empty json w/ 401 code in admin middleware 4 years ago
Julian Lam 15e0731dd9 fix: deprecate middleware.isAdmin
Also, handle admin logout timer in middleware.admin.checkPrivileges
4 years ago
Julian Lam 57ed6be78b fix: #8805 define our own name for write API v3 4 years ago
Julian Lam 266d7587b2 refactor: remove usage of middlewares
Specifically, middleware.isAdmin|exposePrivilegeSet|exposePrivileges
4 years ago
Barış Soner Uşaklı a05905f196
performance improvements (#8795)
* perf: nconf/winston/render

cache nconf.get calls
modify middleware.pageView to call next earlier
don't call winston.verbose on every hook see https://github.com/winstonjs/winston/issues/1669
translate header/footer separately and cache results for guests

* fix: copy paste fail

* refactor: style and fire hook only log in dev mode

* fix: cache key, header changes based on template

* perf: change replace

* fix: add missing await

* perf: category

* perf: lodash clone

* perf: remove escapeRegexChars
4 years ago
Julian Lam d68ffea80d feat: send 'Vary' header when ACAO header set 4 years ago
Barış Soner Uşaklı bbafa1b82a Revert "fix: [breaking] send configured config URL as origin if not custom"
This reverts commit 205a10308e.
4 years ago
Julian Lam 205a10308e fix: [breaking] send configured config URL as origin if not custom
This is a breaking change if your install uses multiple URLs to access. You will need to update the Access-Control-Allow-Origin header in ACP > Advanced > Headers to supply all URLs you use to access your site
4 years ago
Julian Lam ff4fcc23b6
Update bundled logos with new branding (#8702)
* feat: updating logo assets, square logos missing still

* fix: squared logo for touch icon and notification fallback

* fix: update link to favicon

* feat: add default touch icon sizes, if one isn't uploaded

Co-authored-by: Barış Soner Uşaklı <barisusakli@gmail.com>
4 years ago
Barış Soner Uşaklı 1fd2eba6f2 refactor: async/await
src/cli/manage.js
src/meta/build.js
src/meta/css.js
src/meta/js.js
4 years ago
Julian Lam 1e07886f30 feat: require csrf token if not using bearer token 4 years ago
Barış Soner Uşaklı dc29f4dca2 refactor: switch to using slugify module 4 years ago
Barış Soner Uşaklı fda2aedfd8
feat: #8734, jquery-ui, jquery-form, timeago (#8748)
* feat: #8734, jquery-ui, jquery-form, timeago

get rid of forum/footer.js move that code to app.js & wait for app to load before calling ajaxify.end
make sockets.js a requirejs module
move jquery-ui to node_modules and load via requirejs
move jquery-form to node_modules and load via requirejs
move timeago to node_modules and load via requirejs
only include the css for needed jquery-ui widgets

* feat: keep socket/io global for backwards compat

* refactor: move socket listener to chat
4 years ago
Julian Lam 8ecef7b891 refactor: middleware.assert.* 4 years ago
Julian Lam f870721fca feat(writeapi): file deletion route 4 years ago
Julian Lam 2ec838fc59 feat(writeapi): token generation/delete routes, ACP updates 4 years ago
Julian Lam 414169fdfa feat(writeapi): post delete/restore/purge 4 years ago
Julian Lam 8e89f34dbf fix: bad logic in group assertion middleware 4 years ago
Julian Lam 8e7baac6ef fix(writeapi): calls to profile editing routes 200 even if user DNE 4 years ago
Julian Lam 549ca11056 fix: bug where middlewares seemingly ran in parallel 4 years ago
Julian Lam 4c833d0bf0 feat(writeapi): topic posting and replying 4 years ago
Julian Lam 952dc211dd feat(writeapi): added group joining and deletion 4 years ago
Julian Lam ba345e53e8 feat(writeapi): added POST /api/v1/groups 4 years ago
Julian Lam a1ddc210b2 feat: added DELETE /api/v1/users/:uid and DELETE /api/v1/users 4 years ago
Julian Lam bba2a4638c fix: user creation POST route returns user data, updated openapi spec 4 years ago
Julian Lam 7b6d43bcc8 feat: added checkRequired middleware for API calls 4 years ago
Julian Lam fd67355b03 fix(writeapi): authenticate middleware logic to work better with await 4 years ago
Julian Lam f6433ef2c5 fix(refactor): merging write-api auth middlewares with core middlewares 4 years ago
Julian Lam ec5c48b188 feat: migrating write-api skeleton into core 4 years ago
Barış Soner Uşaklı 46ab2711d4 fix: #8432, add CSP frame-ancestors 4 years ago
Barış Soner Uşaklı 6fc31df033 feat: use const/let 4 years ago
Julian Lam 4b0cb26b34 fix: empty "manage" menu showing in ACP
... if no privileges corresponding to those menu items
are given
5 years ago
Julian Lam cf2f1e956a refactor: changed way middleware was exported 5 years ago
Julian Lam f00595b32d fix: change how admin middlewares are exported 5 years ago
Julian Lam ae68a254d7 fix: one less return, to appease codeclimate 5 years ago
Julian Lam 03bd76dea2 fix: inability to access /admin if not superadmin
There was an odd issue where non-superadmins could not use
the /admin route to access the ACP, even though they had
appropriate access. For whatever reason, it could not
be reliably reproduced on my dev. As it turns out, the
reason was because I was checking the wrong privilege,
and my dev database had this wrong privilege leftover
from the initial development of the ACP admin privileges
feature. Dumb.

Anyhow, that fixes this issue.
5 years ago
Julian Lam 6521e4dac4 Revert "feat: expose global/admin privileges to all routes"
This reverts commit 4737f937ee.
5 years ago
Julian Lam 4737f937ee feat: expose global/admin privileges to all routes
@barisusakli revert if necessary 😬
5 years ago
Barış Soner Uşaklı 6e91885836 feat: use assetBaseUrl instead of hardcoding 5 years ago
Barış Soner Uşaklı 3f01f4a2b8 Revert "feat: load timeago strings client-side"
This reverts commit 558a2d739c.
5 years ago
Julian Lam 558a2d739c feat: load timeago strings client-side
9adaccd036 introduced the ability to
configure an assetBaseUrl, but the timeago strings were still
calling a hardcoded value as it was handled server-side. There's
no need for the strings to be loaded until timeago is initialised.
5 years ago
Barış Soner Uşaklı 3761f05c98 feat: change invalid language codes to default lang 5 years ago
Barış Soner Uşaklı 0cea713691 feat: remove deprecated checkGlobalPrivacySettings 5 years ago
Barış Soner Uşaklı a0da2ba774 feat: remove deprecated isAdmin method 5 years ago
Barış Soner Uşaklı 2355d9d5dd fix: escape navigation item fields, theme:id, category fields 5 years ago
Barış Soner Uşaklı e80379dc0e feat: display stack trace on winston.error 5 years ago
Julian Lam a82e9bd7f6
feat: privileges for Admin Control Panel (#8355)
* feat: acp privileges (WIP)

* fix: restore global privilege hooks

* refactor: using cid 0 in admin privs

* fix: no need for zebrastripe-reset

* feat: manage:categories privilege WIP

* feat: renamed prefix to admin:, settigns and dashboard privs

* fix: nofocus on acp privs group find modal

* refactor: privileges.x.get() to not used hardcoded privs

* fix: crash if unable to get latest version

* feat: setting acp priv

* Revert "fix: crash if unable to get latest version"

This reverts commit afdb235f48eb0072d88de45f3a1e0151281095b3.

* feat: user/privilege acp privs

* fix: category selector in manage/privileges

* fix: guests potentially becoming admins

* fix: bug in setting admin privs

* fix: some last minute things + api docs

* fix: some more last minute fixes
5 years ago
Barış Soner Uşaklı 842b8abb84
feat: add buildHeaderAsync (#8367)
* feat: add buildHeaderAsync

make helphers.notAllowed async

* fix: remove csrf from buildHeader

* fix: remove unused method, use middleware

* fix: /post/pid redirect doesn't need buildHeader

use buildHeaderAsync
5 years ago
Barış Soner Uşaklı dcb85ee7a1
#8344 (#8346)
* feat: wip

* feat: wrap middlewares

* feat: middleware errors

* feat: more middleware changes

* fix: remove unused async

* fix: prevent version errors from blocking acp render

* feat: wrap more middlewares
5 years ago
Julian Lam 023942da7d
refactor: making rendering of header and footer async functions
* refactor: make middleware.admin.renderHeader async

* refactor: making rendering of header and footer async functions

* fix: use app.renderAsync instead of promifying it
5 years ago
Barış Soner Uşaklı 5781a2dc65
feat: fix session mismatch errors by clearing cookie on logout (#8338)
* feat: fix session mismatch errors by clearing cookie on logout

* feat: remove app.upateHeader

ported from 2.0

* feat: handle if user doesn't click button and just refreshes page
5 years ago
Barış Soner Uşaklı 2727f472ed feat: add the data from page into filter:middleware.renderHeader 5 years ago
Julian Lam e327d1247e Revert "fix: #8142 invalid session warning if server-side session destroyed"
This reverts commit 526b3cd9ec.
5 years ago
Barış Soner Uşaklı 4263efa091 feat: don't overwrite req.query.lang if it exists 5 years ago
Julian Lam 526b3cd9ec fix: #8142 invalid session warning if server-side session destroyed
Resolved regression caused by 5a0c7c1497
5 years ago
Barış Soner Uşaklı ecd622fdf5 fix: failing tests @julianlam 5 years ago
Julian Lam 0053e779e8 feat: response:router.page, dep. filter variant 5 years ago
Julian Lam 5a1c6ee7ed fix: response hook logic
After some more thought, a response hook should be checking for
whether headers are sent, and executing (or not executing) the
default logic in that case.

Before, we were relying on hooks to call data.next() to continue
execution, but it makes more sense to have the listener either
send a response or not, and handle the behaviour afterwards.
5 years ago
Barış Soner Uşaklı 8e23dec84b fix: lint 5 years ago