Merge branch 'develop' of https://github.com/NodeBB/NodeBB into develop

isekai-main
Barış Soner Uşaklı 3 years ago
commit b663c620ce

@ -21,13 +21,13 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub - name: Login to Docker Hub
uses: docker/login-action@v1 uses: docker/login-action@v2
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
@ -43,7 +43,7 @@ jobs:
type=raw,value=latest type=raw,value=latest
- name: Build and push Docker images - name: Build and push Docker images
uses: docker/build-push-action@v2 uses: docker/build-push-action@v3
with: with:
context: . context: .
file: ./Dockerfile file: ./Dockerfile

@ -69,7 +69,7 @@ jobs:
- 6379:6379 - 6379:6379
mongo: mongo:
image: 'mongo:3.6' image: 'mongo:3.7'
ports: ports:
# Maps port 27017 on service container to the host # Maps port 27017 on service container to the host
- 27017:27017 - 27017:27017

@ -1,3 +1,20 @@
#### v2.4.1 (2022-08-14)
##### Chores
* **deps:**
* update docker/build-push-action action to v3 (bfd6318c)
* update docker/login-action action to v2 (3d68accf)
* update docker/setup-buildx-action action to v2 (371ac032)
* incrementing version number - v2.4.0 (4834cde3)
* update changelog for v2.4.0 (c4714ff7)
* incrementing version number - v2.3.1 (d2425942)
* incrementing version number - v2.3.0 (046ea120)
##### Bug Fixes
* return at least one in sizeCalculation (#10832) (15ca460c)
#### v2.4.0 (2022-08-10) #### v2.4.0 (2022-08-10)
##### Chores ##### Chores

@ -2,7 +2,7 @@
"name": "nodebb", "name": "nodebb",
"license": "GPL-3.0", "license": "GPL-3.0",
"description": "NodeBB Forum", "description": "NodeBB Forum",
"version": "2.4.0", "version": "2.4.1",
"homepage": "http://www.nodebb.org", "homepage": "http://www.nodebb.org",
"repository": { "repository": {
"type": "git", "type": "git",
@ -29,8 +29,8 @@
}, },
"dependencies": { "dependencies": {
"@adactive/bootstrap-tagsinput": "0.8.2", "@adactive/bootstrap-tagsinput": "0.8.2",
"@isaacs/ttlcache": "^1.2.0", "@isaacs/ttlcache": "1.2.0",
"ace-builds": "1.8.1", "ace-builds": "1.9.5",
"archiver": "5.3.1", "archiver": "5.3.1",
"async": "3.2.4", "async": "3.2.4",
"autoprefixer": "10.4.8", "autoprefixer": "10.4.8",
@ -78,7 +78,7 @@
"less": "4.1.3", "less": "4.1.3",
"lodash": "4.17.21", "lodash": "4.17.21",
"logrotate-stream": "0.2.8", "logrotate-stream": "0.2.8",
"lru-cache": "7.13.1", "lru-cache": "7.13.2",
"material-design-lite": "1.3.0", "material-design-lite": "1.3.0",
"mime": "3.0.0", "mime": "3.0.0",
"mkdirp": "1.0.4", "mkdirp": "1.0.4",
@ -102,9 +102,9 @@
"nodebb-theme-slick": "2.0.2", "nodebb-theme-slick": "2.0.2",
"nodebb-theme-vanilla": "12.1.18", "nodebb-theme-vanilla": "12.1.18",
"nodebb-widget-essentials": "6.0.0", "nodebb-widget-essentials": "6.0.0",
"nodemailer": "6.7.7", "nodemailer": "6.7.8",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"passport": "0.5.2", "passport": "0.6.0",
"passport-http-bearer": "1.0.1", "passport-http-bearer": "1.0.1",
"passport-local": "1.0.0", "passport-local": "1.0.0",
"pg": "8.7.3", "pg": "8.7.3",
@ -150,7 +150,7 @@
"@commitlint/cli": "17.0.3", "@commitlint/cli": "17.0.3",
"@commitlint/config-angular": "17.0.3", "@commitlint/config-angular": "17.0.3",
"coveralls": "3.1.1", "coveralls": "3.1.1",
"eslint": "8.21.0", "eslint": "8.22.0",
"eslint-config-nodebb": "0.1.1", "eslint-config-nodebb": "0.1.1",
"eslint-plugin-import": "2.26.0", "eslint-plugin-import": "2.26.0",
"grunt": "1.5.3", "grunt": "1.5.3",

@ -1,5 +1,8 @@
{ {
"post-cache": "التخزين المؤقت للمشاركات", "post-cache": "التخزين المؤقت للمشاركات",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "1% كاملة", "percent-full": "1% كاملة",
"post-cache-size": "حجم التخزين المؤقت للمشاركات", "post-cache-size": "حجم التخزين المؤقت للمشاركات",
"items-in-cache": "العناصر في التخزين المؤقت" "items-in-cache": "العناصر في التخزين المؤقت"

@ -1,5 +1,8 @@
{ {
"post-cache": "Кеш за публикации", "post-cache": "Кеш за публикации",
"group-cache": "Кеш за групи",
"local-cache": "Локален кеш",
"object-cache": "Кеш за обекти",
"percent-full": "Запълненост: %1%", "percent-full": "Запълненост: %1%",
"post-cache-size": "Размер на кеша за публикации", "post-cache-size": "Размер на кеша за публикации",
"items-in-cache": "Елементи в кеша" "items-in-cache": "Елементи в кеша"

@ -1,5 +1,8 @@
{ {
"post-cache": "Post Cache", "post-cache": "Post Cache",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Full", "percent-full": "%1% Full",
"post-cache-size": "Post Cache Size", "post-cache-size": "Post Cache Size",
"items-in-cache": "Items in Cache" "items-in-cache": "Items in Cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "Mezipaměť příspěvku", "post-cache": "Mezipaměť příspěvku",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% plný", "percent-full": "%1% plný",
"post-cache-size": "Velikost mezipaměti příspěvku", "post-cache-size": "Velikost mezipaměti příspěvku",
"items-in-cache": "Položek v mezipaměti" "items-in-cache": "Položek v mezipaměti"

@ -1,5 +1,8 @@
{ {
"post-cache": "Indlægs Cache", "post-cache": "Indlægs Cache",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Fuld", "percent-full": "%1% Fuld",
"post-cache-size": "Indlægs Cache Størrelse", "post-cache-size": "Indlægs Cache Størrelse",
"items-in-cache": "Ting i Cache" "items-in-cache": "Ting i Cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "Post-Cache", "post-cache": "Post-Cache",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Voll", "percent-full": "%1% Voll",
"post-cache-size": "Post-Cache-Größe", "post-cache-size": "Post-Cache-Größe",
"items-in-cache": "Elemente im Cache" "items-in-cache": "Elemente im Cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "Προσωρινή μνήμη ανάρτησης", "post-cache": "Προσωρινή μνήμη ανάρτησης",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Πλήρες", "percent-full": "%1% Πλήρες",
"post-cache-size": "Μέγεθος προσωρινής μνήμης ανάρτησης", "post-cache-size": "Μέγεθος προσωρινής μνήμης ανάρτησης",
"items-in-cache": "Αντικείμενα στην προσωρινή μνήμη" "items-in-cache": "Αντικείμενα στην προσωρινή μνήμη"

@ -1,5 +1,8 @@
{ {
"post-cache": "Post Cache", "post-cache": "Post Cache",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Full", "percent-full": "%1% Full",
"post-cache-size": "Post Cache Size", "post-cache-size": "Post Cache Size",
"items-in-cache": "Items in Cache" "items-in-cache": "Items in Cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "Post Cache", "post-cache": "Post Cache",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Full", "percent-full": "%1% Full",
"post-cache-size": "Post Cache Size", "post-cache-size": "Post Cache Size",
"items-in-cache": "Items in Cache" "items-in-cache": "Items in Cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "Post Cache", "post-cache": "Post Cache",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Full", "percent-full": "%1% Full",
"post-cache-size": "Post Cache Size", "post-cache-size": "Post Cache Size",
"items-in-cache": "Items in Cache" "items-in-cache": "Items in Cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "Publicar Cache", "post-cache": "Publicar Cache",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Completo", "percent-full": "%1% Completo",
"post-cache-size": "Tamaño de cache del post", "post-cache-size": "Tamaño de cache del post",
"items-in-cache": "Artículos en cache" "items-in-cache": "Artículos en cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "Postituste vahemälu", "post-cache": "Postituste vahemälu",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Täis", "percent-full": "%1% Täis",
"post-cache-size": "Postituse vahemälu suurus", "post-cache-size": "Postituse vahemälu suurus",
"items-in-cache": "Esemed vahemälus" "items-in-cache": "Esemed vahemälus"

@ -1,5 +1,8 @@
{ {
"post-cache": "کش دیدگاه ", "post-cache": "کش دیدگاه ",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% تمام شده", "percent-full": "%1% تمام شده",
"post-cache-size": "سایز کش دیدگاه", "post-cache-size": "سایز کش دیدگاه",
"items-in-cache": "موارد موجود در کش" "items-in-cache": "موارد موجود در کش"

@ -1,5 +1,8 @@
{ {
"post-cache": "Viestivälimuisti", "post-cache": "Viestivälimuisti",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Täynnä", "percent-full": "%1% Täynnä",
"post-cache-size": "Viestivälimuistin koko", "post-cache-size": "Viestivälimuistin koko",
"items-in-cache": "Asioita välimuistissa" "items-in-cache": "Asioita välimuistissa"

@ -1,5 +1,8 @@
{ {
"post-cache": "Cache des messages", "post-cache": "Cache des messages",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "Plein à %1%", "percent-full": "Plein à %1%",
"post-cache-size": "Taille du cache des messages", "post-cache-size": "Taille du cache des messages",
"items-in-cache": "Objets en cache" "items-in-cache": "Objets en cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "Post Cache", "post-cache": "Post Cache",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Full", "percent-full": "%1% Full",
"post-cache-size": "Post Cache Size", "post-cache-size": "Post Cache Size",
"items-in-cache": "Items in Cache" "items-in-cache": "Items in Cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "מטמון פוסטים", "post-cache": "מטמון פוסטים",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Full", "percent-full": "%1% Full",
"post-cache-size": "גודל מטמון פוסטים", "post-cache-size": "גודל מטמון פוסטים",
"items-in-cache": "פריטים במטמון" "items-in-cache": "פריטים במטמון"

@ -1,5 +1,5 @@
{ {
"name": "אנגלית (בריטניה/קנדה)", "name": "עברית (ישראל)",
"code": "he", "code": "he",
"dir": "rtl" "dir": "rtl"
} }

@ -1,5 +1,8 @@
{ {
"post-cache": "Objava predmemorija", "post-cache": "Objava predmemorija",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Puno", "percent-full": "%1% Puno",
"post-cache-size": "Veličina predmemorije objave", "post-cache-size": "Veličina predmemorije objave",
"items-in-cache": "Artikli u predmemoriji" "items-in-cache": "Artikli u predmemoriji"

@ -1,5 +1,8 @@
{ {
"post-cache": "Hozzászólás gyorsítótár", "post-cache": "Hozzászólás gyorsítótár",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Tele", "percent-full": "%1% Tele",
"post-cache-size": "Hozzászólás gyorsítótáras mérete", "post-cache-size": "Hozzászólás gyorsítótáras mérete",
"items-in-cache": "Elemek a gyorsítótárban" "items-in-cache": "Elemek a gyorsítótárban"

@ -1,5 +1,8 @@
{ {
"post-cache": "Cache Kiriman", "post-cache": "Cache Kiriman",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Penuh", "percent-full": "%1% Penuh",
"post-cache-size": "Ukuran Cache Kiriman", "post-cache-size": "Ukuran Cache Kiriman",
"items-in-cache": "Item di Cache" "items-in-cache": "Item di Cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "Cache Post", "post-cache": "Cache Post",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Pieno", "percent-full": "%1% Pieno",
"post-cache-size": "Dimensione Cache dei Post", "post-cache-size": "Dimensione Cache dei Post",
"items-in-cache": "Elementi nella Cache" "items-in-cache": "Elementi nella Cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "投稿キャッシュ", "post-cache": "投稿キャッシュ",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% がフル", "percent-full": "%1% がフル",
"post-cache-size": "投稿キャッシュのサイズ", "post-cache-size": "投稿キャッシュのサイズ",
"items-in-cache": "キャッシュ内のアイテム" "items-in-cache": "キャッシュ内のアイテム"

@ -1,5 +1,8 @@
{ {
"post-cache": "포스트 캐시", "post-cache": "포스트 캐시",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1%꽉참", "percent-full": "%1%꽉참",
"post-cache-size": "포스트 캐시 크기", "post-cache-size": "포스트 캐시 크기",
"items-in-cache": "캐시된 항목들" "items-in-cache": "캐시된 항목들"

@ -1,5 +1,8 @@
{ {
"post-cache": "Post Cache", "post-cache": "Post Cache",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Full", "percent-full": "%1% Full",
"post-cache-size": "Post Cache Size", "post-cache-size": "Post Cache Size",
"items-in-cache": "Items in Cache" "items-in-cache": "Items in Cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "Rakstu kešatmiņa", "post-cache": "Rakstu kešatmiņa",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Aizņemts", "percent-full": "%1% Aizņemts",
"post-cache-size": "Rakstu kešatmiņas lielums", "post-cache-size": "Rakstu kešatmiņas lielums",
"items-in-cache": "Rakstu skaits kešatmiņā" "items-in-cache": "Rakstu skaits kešatmiņā"

@ -1,5 +1,8 @@
{ {
"post-cache": "Post Cache", "post-cache": "Post Cache",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Full", "percent-full": "%1% Full",
"post-cache-size": "Post Cache Size", "post-cache-size": "Post Cache Size",
"items-in-cache": "Items in Cache" "items-in-cache": "Items in Cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "Post-buffer", "post-cache": "Post-buffer",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1%full ", "percent-full": "%1%full ",
"post-cache-size": "Post-buffer størrelse", "post-cache-size": "Post-buffer størrelse",
"items-in-cache": "Element i buffer" "items-in-cache": "Element i buffer"

@ -1,5 +1,8 @@
{ {
"post-cache": "Onderwerpcache", "post-cache": "Onderwerpcache",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1%vol", "percent-full": "%1%vol",
"post-cache-size": "Onderwerpcache grootte", "post-cache-size": "Onderwerpcache grootte",
"items-in-cache": "Items in cache" "items-in-cache": "Items in cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "Pamięć podręczna postów", "post-cache": "Pamięć podręczna postów",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1%", "percent-full": "%1%",
"post-cache-size": "Rozmiar pamięci podręcznej postów", "post-cache-size": "Rozmiar pamięci podręcznej postów",
"items-in-cache": "Elementów w pamięci podręcznej" "items-in-cache": "Elementów w pamięci podręcznej"

@ -1,5 +1,8 @@
{ {
"post-cache": "Cache de Posts", "post-cache": "Cache de Posts",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Cheio", "percent-full": "%1% Cheio",
"post-cache-size": "Tamanho do Cache de Posts", "post-cache-size": "Tamanho do Cache de Posts",
"items-in-cache": "Itens no Cache" "items-in-cache": "Itens no Cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "Cache de Publicações", "post-cache": "Cache de Publicações",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Cheio", "percent-full": "%1% Cheio",
"post-cache-size": "Tamanho da Cache de Publicações", "post-cache-size": "Tamanho da Cache de Publicações",
"items-in-cache": "Itens em Cache" "items-in-cache": "Itens em Cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "Post Cache", "post-cache": "Post Cache",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Full", "percent-full": "%1% Full",
"post-cache-size": "Post Cache Size", "post-cache-size": "Post Cache Size",
"items-in-cache": "Items in Cache" "items-in-cache": "Items in Cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "Кэш сообщений", "post-cache": "Кэш сообщений",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "Заполнен на%1%", "percent-full": "Заполнен на%1%",
"post-cache-size": "Размер кэша сообщений", "post-cache-size": "Размер кэша сообщений",
"items-in-cache": "Закешировано элементов" "items-in-cache": "Закешировано элементов"

@ -1,5 +1,8 @@
{ {
"post-cache": "Post Cache", "post-cache": "Post Cache",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Full", "percent-full": "%1% Full",
"post-cache-size": "Post Cache Size", "post-cache-size": "Post Cache Size",
"items-in-cache": "Items in Cache" "items-in-cache": "Items in Cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "Post Cache", "post-cache": "Post Cache",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Full", "percent-full": "%1% Full",
"post-cache-size": "Post Cache Size", "post-cache-size": "Post Cache Size",
"items-in-cache": "Items in Cache" "items-in-cache": "Items in Cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "Vyrovnávacia pamäť príspevku", "post-cache": "Vyrovnávacia pamäť príspevku",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% plné", "percent-full": "%1% plné",
"post-cache-size": "Veľkosť vyrovnávacej pamäti príspevku", "post-cache-size": "Veľkosť vyrovnávacej pamäti príspevku",
"items-in-cache": "Položky vo vyrovnávacej pamäti" "items-in-cache": "Položky vo vyrovnávacej pamäti"

@ -1,5 +1,8 @@
{ {
"post-cache": "Predpomnilnik objav", "post-cache": "Predpomnilnik objav",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1%Zasedeno", "percent-full": "%1%Zasedeno",
"post-cache-size": "Velikost predpomnilnika objav", "post-cache-size": "Velikost predpomnilnika objav",
"items-in-cache": "Elementi v predpomnilniku" "items-in-cache": "Elementi v predpomnilniku"

@ -1,5 +1,8 @@
{ {
"post-cache": "Post Cache", "post-cache": "Post Cache",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Plot ", "percent-full": "%1% Plot ",
"post-cache-size": "Post Cache Size", "post-cache-size": "Post Cache Size",
"items-in-cache": "Items in Cache" "items-in-cache": "Items in Cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "Post Cache", "post-cache": "Post Cache",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Full", "percent-full": "%1% Full",
"post-cache-size": "Post Cache Size", "post-cache-size": "Post Cache Size",
"items-in-cache": "Items in Cache" "items-in-cache": "Items in Cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "Inläggscache", "post-cache": "Inläggscache",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Full", "percent-full": "%1% Full",
"post-cache-size": "Storlek på inläggscache", "post-cache-size": "Storlek på inläggscache",
"items-in-cache": "Föremål i cache" "items-in-cache": "Föremål i cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "แคชข้อความ", "post-cache": "แคชข้อความ",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "เต็ม %1%", "percent-full": "เต็ม %1%",
"post-cache-size": "ขนาดแคชของข้อความ", "post-cache-size": "ขนาดแคชของข้อความ",
"items-in-cache": "รายการที่ถูกแคช" "items-in-cache": "รายการที่ถูกแคช"

@ -1,5 +1,8 @@
{ {
"post-cache": "İleti Önbelleği", "post-cache": "İleti Önbelleği",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Tam", "percent-full": "%1% Tam",
"post-cache-size": "İleti Önbellek Boyutu", "post-cache-size": "İleti Önbellek Boyutu",
"items-in-cache": "Önbellekteki Öğeler" "items-in-cache": "Önbellekteki Öğeler"

@ -1,5 +1,8 @@
{ {
"post-cache": "Кеш постів", "post-cache": "Кеш постів",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "Заповнений на %1%", "percent-full": "Заповнений на %1%",
"post-cache-size": "Розмір кешу постів", "post-cache-size": "Розмір кешу постів",
"items-in-cache": "Елементів у кеші" "items-in-cache": "Елементів у кеші"

@ -1,5 +1,8 @@
{ {
"post-cache": "Bộ nhớ đệm bài viết", "post-cache": "Bộ nhớ đệm bài viết",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% Đầy", "percent-full": "%1% Đầy",
"post-cache-size": "Kích thước cache bài viết", "post-cache-size": "Kích thước cache bài viết",
"items-in-cache": "Thành phần trong Cache" "items-in-cache": "Thành phần trong Cache"

@ -1,5 +1,8 @@
{ {
"post-cache": "帖子缓存", "post-cache": "帖子缓存",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% 容量", "percent-full": "%1% 容量",
"post-cache-size": "帖子缓存大小", "post-cache-size": "帖子缓存大小",
"items-in-cache": "缓存中的条目数量" "items-in-cache": "缓存中的条目数量"

@ -1,5 +1,8 @@
{ {
"post-cache": "貼文快取", "post-cache": "貼文快取",
"group-cache": "Group Cache",
"local-cache": "Local Cache",
"object-cache": "Object Cache",
"percent-full": "%1% 容量", "percent-full": "%1% 容量",
"post-cache-size": "貼文快取大小", "post-cache-size": "貼文快取大小",
"items-in-cache": "快取中的項目數量" "items-in-cache": "快取中的項目數量"

@ -196,7 +196,7 @@ module.exports = function (utils, Benchpress, relative_path) {
function renderEvents(events) { function renderEvents(events) {
return events.reduce((html, event) => { return events.reduce((html, event) => {
html += `<li component="topic/event" class="timeline-event" data-topic-event-id="${event.id}"> html += `<li component="topic/event" class="timeline-event" data-topic-event-id="${event.id}" data-topic-event-type="${event.type}">
<div class="timeline-badge"> <div class="timeline-badge">
<i class="fa ${event.icon || 'fa-circle'}"></i> <i class="fa ${event.icon || 'fa-circle'}"></i>
</div> </div>
@ -216,7 +216,7 @@ module.exports = function (utils, Benchpress, relative_path) {
html += `<span class="timeago timeline-text" title="${event.timestampISO}"></span>`; html += `<span class="timeago timeline-text" title="${event.timestampISO}"></span>`;
if (this.privileges.isAdminOrMod) { if (this.privileges.isAdminOrMod) {
html += `&nbsp;<span component="topic/event/delete" data-topic-event-id="${event.id}" class="timeline-text pointer" title="[[topic:delete-event]]"><i class="fa fa-trash"></i></span>`; html += `&nbsp;<span component="topic/event/delete" data-topic-event-id="${event.id}" data-topic-event-type="${event.type} class="timeline-text pointer" title="[[topic:delete-event]]"><i class="fa fa-trash"></i></span>`;
} }
return html; return html;

5
src/cache/lru.js vendored

@ -37,12 +37,15 @@ module.exports = function (opts) {
cache.enabled = opts.hasOwnProperty('enabled') ? opts.enabled : true; cache.enabled = opts.hasOwnProperty('enabled') ? opts.enabled : true;
const cacheSet = lruCache.set; const cacheSet = lruCache.set;
// backwards compatibility // expose properties while keeping backwards compatibility
const propertyMap = new Map([ const propertyMap = new Map([
['length', 'calculatedSize'], ['length', 'calculatedSize'],
['calculatedSize', 'calculatedSize'],
['max', 'max'], ['max', 'max'],
['maxSize', 'maxSize'], ['maxSize', 'maxSize'],
['itemCount', 'size'], ['itemCount', 'size'],
['size', 'size'],
['ttl', 'ttl'],
]); ]);
propertyMap.forEach((lruProp, cacheProp) => { propertyMap.forEach((lruProp, cacheProp) => {
Object.defineProperty(cache, cacheProp, { Object.defineProperty(cache, cacheProp, {

25
src/cache/ttl.js vendored

@ -13,6 +13,23 @@ module.exports = function (opts) {
cache.enabled = opts.hasOwnProperty('enabled') ? opts.enabled : true; cache.enabled = opts.hasOwnProperty('enabled') ? opts.enabled : true;
const cacheSet = ttlCache.set; const cacheSet = ttlCache.set;
// expose properties
const propertyMap = new Map([
['max', 'max'],
['itemCount', 'size'],
['size', 'size'],
['ttl', 'ttl'],
]);
propertyMap.forEach((ttlProp, cacheProp) => {
Object.defineProperty(cache, cacheProp, {
get: function () {
return ttlCache[ttlProp];
},
configurable: true,
enumerable: true,
});
});
cache.set = function (key, value, ttl) { cache.set = function (key, value, ttl) {
if (!cache.enabled) { if (!cache.enabled) {
return; return;
@ -90,5 +107,13 @@ module.exports = function (opts) {
return unCachedKeys; return unCachedKeys;
}; };
cache.dump = function () {
return Array.from(ttlCache.entries());
};
cache.peek = function (key) {
return ttlCache.get(key, { updateAgeOnGet: false });
};
return cache; return cache;
}; };

@ -3,8 +3,9 @@
const cacheController = module.exports; const cacheController = module.exports;
const utils = require('../../utils'); const utils = require('../../utils');
const plugins = require('../../plugins');
cacheController.get = function (req, res) { cacheController.get = async function (req, res) {
const postCache = require('../../posts/cache'); const postCache = require('../../posts/cache');
const groupCache = require('../../groups').cache; const groupCache = require('../../groups').cache;
const { objectCache } = require('../../database'); const { objectCache } = require('../../database');
@ -23,29 +24,33 @@ cacheController.get = function (req, res) {
misses: utils.addCommas(String(cache.misses)), misses: utils.addCommas(String(cache.misses)),
hitRatio: ((cache.hits / (cache.hits + cache.misses) || 0)).toFixed(4), hitRatio: ((cache.hits / (cache.hits + cache.misses) || 0)).toFixed(4),
enabled: cache.enabled, enabled: cache.enabled,
ttl: cache.ttl,
}; };
} }
let caches = {
const data = { post: postCache,
postCache: getInfo(postCache), group: groupCache,
groupCache: getInfo(groupCache), local: localCache,
localCache: getInfo(localCache),
}; };
if (objectCache) { if (objectCache) {
data.objectCache = getInfo(objectCache); caches.object = objectCache;
}
caches = await plugins.hooks.fire('filter:admin.cache.get', caches);
for (const [key, value] of Object.entries(caches)) {
caches[key] = getInfo(value);
} }
res.render('admin/advanced/cache', data); res.render('admin/advanced/cache', { caches });
}; };
cacheController.dump = function (req, res, next) { cacheController.dump = async function (req, res, next) {
const caches = { let caches = {
post: require('../../posts/cache'), post: require('../../posts/cache'),
object: require('../../database').objectCache, object: require('../../database').objectCache,
group: require('../../groups').cache, group: require('../../groups').cache,
local: require('../../cache'), local: require('../../cache'),
}; };
caches = await plugins.hooks.fire('filter:admin.cache.get', caches);
if (!caches[req.query.name]) { if (!caches[req.query.name]) {
return next(); return next();
} }

@ -351,7 +351,7 @@ authenticationController.doLogin = async function (req, uid) {
} }
} }
await loginAsync({ uid: uid }); await loginAsync({ uid: uid }, { keepSessionInfo: true });
await authenticationController.onSuccessfulLogin(req, uid); await authenticationController.onSuccessfulLogin(req, uid);
}; };
@ -459,6 +459,7 @@ authenticationController.localLogin = async function (req, username, password, n
}; };
const destroyAsync = util.promisify((req, callback) => req.session.destroy(callback)); const destroyAsync = util.promisify((req, callback) => req.session.destroy(callback));
const logoutAsync = util.promisify((req, callback) => req.logout(callback));
authenticationController.logout = async function (req, res, next) { authenticationController.logout = async function (req, res, next) {
if (!req.loggedIn || !req.sessionID) { if (!req.loggedIn || !req.sessionID) {
@ -470,7 +471,7 @@ authenticationController.logout = async function (req, res, next) {
try { try {
await user.auth.revokeSession(sessionID, uid); await user.auth.revokeSession(sessionID, uid);
req.logout(); await logoutAsync();
await destroyAsync(req); await destroyAsync(req);
res.clearCookie(nconf.get('sessionKey'), meta.configs.cookie.get()); res.clearCookie(nconf.get('sessionKey'), meta.configs.cookie.get());

@ -41,8 +41,10 @@ middleware.buildHeader = helpers.try(async (req, res, next) => {
]); ]);
if (!canLoginIfBanned && req.loggedIn) { if (!canLoginIfBanned && req.loggedIn) {
req.logout(); req.logout(() => {
return res.redirect('/'); res.redirect('/');
});
return;
} }
res.locals.config = config; res.locals.config = config;

@ -35,7 +35,7 @@ module.exports = function (middleware) {
async function authenticate(req, res) { async function authenticate(req, res) {
async function finishLogin(req, user) { async function finishLogin(req, user) {
const loginAsync = util.promisify(req.login).bind(req); const loginAsync = util.promisify(req.login).bind(req);
await loginAsync(user); await loginAsync(user, { keepSessionInfo: true });
await controllers.authentication.onSuccessfulLogin(req, user.uid); await controllers.authentication.onSuccessfulLogin(req, user.uid);
req.uid = user.uid; req.uid = user.uid;
req.loggedIn = req.uid > 0; req.loggedIn = req.uid > 0;

@ -6,7 +6,7 @@ const meta = require('../meta');
module.exports = cacheCreate({ module.exports = cacheCreate({
name: 'post', name: 'post',
maxSize: meta.config.postCacheSize, maxSize: meta.config.postCacheSize,
sizeCalculation: function (n) { return n.length; }, sizeCalculation: function (n) { return n.length || 1; },
ttl: 0, ttl: 0,
enabled: global.env === 'production', enabled: global.env === 'production',
}); });

@ -93,7 +93,7 @@ Posts.getPostIndices = async function (posts, uid) {
}; };
Posts.modifyPostByPrivilege = function (post, privileges) { Posts.modifyPostByPrivilege = function (post, privileges) {
if (post.deleted && !(post.selfPost || privileges['posts:view_deleted'])) { if (post && post.deleted && !(post.selfPost || privileges['posts:view_deleted'])) {
post.content = '[[topic:post_is_deleted]]'; post.content = '[[topic:post_is_deleted]]';
if (post.user) { if (post.user) {
post.user.signature = ''; post.user.signature = '';

@ -139,7 +139,7 @@ Auth.reloadRoutes = async function (params) {
})(req, res, next); })(req, res, next);
}, Auth.middleware.validateAuth, (req, res, next) => { }, Auth.middleware.validateAuth, (req, res, next) => {
async.waterfall([ async.waterfall([
async.apply(req.login.bind(req), res.locals.user), async.apply(req.login.bind(req), res.locals.user, { keepSessionInfo: true }),
async.apply(controllers.authentication.onSuccessfulLogin, req, req.uid), async.apply(controllers.authentication.onSuccessfulLogin, req, req.uid),
], (err) => { ], (err) => {
if (err) { if (err) {

@ -3,26 +3,30 @@
const SocketCache = module.exports; const SocketCache = module.exports;
const db = require('../../database'); const db = require('../../database');
const plugins = require('../../plugins');
SocketCache.clear = async function (socket, data) { SocketCache.clear = async function (socket, data) {
if (data.name === 'post') { let caches = {
require('../../posts/cache').reset(); post: require('../../posts/cache'),
} else if (data.name === 'object' && db.objectCache) { object: db.objectCache,
db.objectCache.reset(); group: require('../../groups').cache,
} else if (data.name === 'group') { local: require('../../cache'),
require('../../groups').cache.reset(); };
} else if (data.name === 'local') { caches = await plugins.hooks.fire('filter:admin.cache.get', caches);
require('../../cache').reset(); if (!caches[data.name]) {
return;
} }
caches[data.name].reset();
}; };
SocketCache.toggle = async function (socket, data) { SocketCache.toggle = async function (socket, data) {
const caches = { let caches = {
post: require('../../posts/cache'), post: require('../../posts/cache'),
object: db.objectCache, object: db.objectCache,
group: require('../../groups').cache, group: require('../../groups').cache,
local: require('../../cache'), local: require('../../cache'),
}; };
caches = await plugins.hooks.fire('filter:admin.cache.get', caches);
if (!caches[data.name]) { if (!caches[data.name]) {
return; return;
} }

@ -2,118 +2,43 @@
<div class="row post-cache"> <div class="row post-cache">
<div class="col-lg-12"> <div class="col-lg-12">
<div class="row"> <div class="row">
{{{each caches}}}
<div class="col-lg-3"> <div class="col-lg-3">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">[[admin/advanced/cache:post-cache]]</div> <div class="panel-heading">[[admin/advanced/cache:{@key}-cache]]</div>
<div class="panel-body"> <div class="panel-body">
<div class="checkbox" data-name="post"> <div class="checkbox" data-name="{@key}">
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect"> <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input class="mdl-switch__input" type="checkbox" {{{if postCache.enabled}}}checked{{{end}}}> <input class="mdl-switch__input" type="checkbox" {{{if caches.enabled}}}checked{{{end}}}>
</label> </label>
</div> </div>
<span>{postCache.length} / {postCache.maxSize}</span><br/> <span>{{{if ../length}}}{../length}{{{else}}}{../itemCount}{{{end}}} / {{{if ../max}}}{../max}{{{else}}}{../maxSize}{{{end}}}</span><br/>
<div class="progress"> <div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="{postCache.percentFull}" aria-valuemin="0" aria-valuemax="100" style="width: {postCache.percentFull}%;"> <div class="progress-bar" role="progressbar" aria-valuenow="{../percentFull}" aria-valuemin="0" aria-valuemax="100" style="width: {../percentFull}%;">
[[admin/advanced/cache:percent-full, {postCache.percentFull}]] [[admin/advanced/cache:percent-full, {../percentFull}]]
</div> </div>
</div> </div>
<label>Hits:</label> <span>{postCache.hits}</span><br/> <label>Hits:</label> <span>{../hits}</span><br/>
<label>Misses:</label> <span>{postCache.misses}</span><br/> <label>Misses:</label> <span>{../misses}</span><br/>
<label>Hit Ratio:</label> <span>{postCache.hitRatio}</span><br/> <label>Hit Ratio:</label> <span>{../hitRatio}</span><br/>
{{{if ../ttl}}}<label>TTL:</label> <span>{../ttl}</span></br>{{{end}}}
{{{if (@key == "post")}}}
<hr/> <hr/>
<div class="form-group"> <div class="form-group">
<label for="postCacheSize">[[admin/advanced/cache:post-cache-size]]</label> <label for="postCacheSize">[[admin/advanced/cache:post-cache-size]]</label>
<input id="postCacheSize" type="text" class="form-control" value="" data-field="postCacheSize"> <input id="postCacheSize" type="text" class="form-control" value="" data-field="postCacheSize">
</div> </div>
<a href="{config.relative_path}/api/admin/advanced/cache/dump?name=post" class="btn btn-sm btn-default"><i class="fa fa-download"></i></a> {{{end}}}
<a class="btn btn-sm btn-danger clear" data-name="post"><i class="fa fa-trash"></i></a> <a href="{config.relative_path}/api/admin/advanced/cache/dump?name={@key}" class="btn btn-sm btn-default"><i class="fa fa-download"></i></a>
</div> <a class="btn btn-sm btn-danger clear" data-name="{@key}"><i class="fa fa-trash"></i></a>
</div>
</div>
<!-- IF objectCache -->
<div class="col-lg-3">
<div class="panel panel-default">
<div class="panel-heading">Object Cache</div>
<div class="panel-body">
<div class="checkbox" data-name="object">
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input class="mdl-switch__input" type="checkbox" {{{if objectCache.enabled}}}checked{{{end}}}>
</label>
</div>
<span>{objectCache.itemCount} / {objectCache.max}</span><br/>
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="{objectCache.percentFull}" aria-valuemin="0" aria-valuemax="100" style="width: {objectCache.percentFull}%;">
[[admin/advanced/cache:percent-full, {objectCache.percentFull}]]
</div>
</div>
<label>Hits:</label> <span>{objectCache.hits}</span><br/>
<label>Misses:</label> <span>{objectCache.misses}</span><br/>
<label>Hit Ratio:</label> <span>{objectCache.hitRatio}</span><br/>
<a href="{config.relative_path}/api/admin/advanced/cache/dump?name=object" class="btn btn-sm btn-default"><i class="fa fa-download"></i></a>
<a class="btn btn-sm btn-danger clear" data-name="object"><i class="fa fa-trash"></i></a>
</div>
</div>
</div>
<!-- ENDIF objectCache -->
<div class="col-lg-3">
<div class="panel panel-default">
<div class="panel-heading">Group Cache</div>
<div class="panel-body">
<div class="checkbox" data-name="group">
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input class="mdl-switch__input" type="checkbox" {{{if groupCache.enabled}}}checked{{{end}}}>
</label>
</div>
<span>{groupCache.itemCount} / {groupCache.max}</span><br/>
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="{groupCache.percentFull}" aria-valuemin="0" aria-valuemax="100" style="width: {groupCache.percentFull}%;">
[[admin/advanced/cache:percent-full, {groupCache.percentFull}]]
</div>
</div>
<label>Hits:</label> <span>{groupCache.hits}</span><br/>
<label>Misses:</label> <span>{groupCache.misses}</span><br/>
<label>Hit Ratio:</label> <span>{groupCache.hitRatio}</span><br/>
<a href="{config.relative_path}/api/admin/advanced/cache/dump?name=group" class="btn btn-sm btn-default"><i class="fa fa-download"></i></a>
<a class="btn btn-sm btn-danger clear" data-name="group"><i class="fa fa-trash"></i></a>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="panel panel-default">
<div class="panel-heading">Local Cache</div>
<div class="panel-body">
<div class="checkbox" data-name="local">
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input class="mdl-switch__input" type="checkbox" {{{if localCache.enabled}}}checked{{{end}}}>
</label>
</div>
<span>{localCache.itemCount} / {localCache.max}</span><br/>
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="{localCache.percentFull}" aria-valuemin="0" aria-valuemax="100" style="width: {localCache.percentFull}%;">
[[admin/advanced/cache:percent-full, {localCache.percentFull}]]
</div>
</div>
<label>Hits:</label> <span>{localCache.hits}</span><br/>
<label>Misses:</label> <span>{localCache.misses}</span><br/>
<label>Hit Ratio:</label> <span>{localCache.hitRatio}</span><br/>
<a href="{config.relative_path}/api/admin/advanced/cache/dump?name=local" class="btn btn-sm btn-default"><i class="fa fa-download"></i></a>
<a class="btn btn-sm btn-danger clear" data-name="local"><i class="fa fa-trash"></i></a>
</div> </div>
</div> </div>
</div> </div>
{{{end}}}
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save