Compare commits
108 Commits
455783e414
...
c7be019fdd
Author | SHA1 | Date |
---|---|---|
まっちゃとーにゅ | c7be019fdd | |
kakkokari-gtyih | e898f98b34 | |
かっこかり | 7d7a12d7d6 | |
dependabot[bot] | 887c709647 | |
かっこかり | 0e4b6d1dad | |
Juan Aguilar Santillana | 07f26bc8dd | |
syuilo | 366b79e459 | |
Kisaragi | 6b2072f4b1 | |
かっこかり | 1544ba9153 | |
かっこかり | be0906a6c7 | |
かっこかり | e0f54d6a68 | |
かっこかり | 837a8e15d8 | |
KanariKanaru | 0c2cfe31a3 | |
かっこかり | 05c944c2cc | |
かっこかり | f393b6b898 | |
かっこかり | 672779a15f | |
かっこかり | 2cbe1d1210 | |
かっこかり | 0d0cd738f8 | |
かっこかり | 567acea2a3 | |
かっこかり | 8d19bdbb65 | |
かっこかり | cdb0566c5b | |
かっこかり | f7398faeac | |
taiy | c8f49b6ae7 | |
syuilo | 74c93fcebe | |
zyoshoka | 8be624aa44 | |
zyoshoka | 3fe7e37f10 | |
zyoshoka | 7fe3035059 | |
zyoshoka | 06855f769f | |
zyoshoka | 3e85052754 | |
syuilo | b6fdd71957 | |
syuilo | 36dff66883 | |
Kisaragi | 255c8bd1b9 | |
syuilo | 44f62160cb | |
syuilo | 8032a4e12a | |
syuilo | 2f009f7d49 | |
syuilo | f85aa7b641 | |
syuilo | 1008fa32a0 | |
atsuchan | 043ab1f69b | |
かっこかり | 21a3095eb0 | |
syuilo | 1b5f0571f7 | |
syuilo | 59e83605ac | |
syuilo | 130ff361c3 | |
syuilo | e78110a5cd | |
github-actions[bot] | 6c5593d456 | |
github-actions[bot] | 621626aad3 | |
syuilo | f4f55ef012 | |
github-actions[bot] | 2e8a1029a4 | |
かっこかり | b53ee54e4f | |
github-actions[bot] | b708b27bc8 | |
Hazel K | 9ce44b24b8 | |
syuilo | 3cd5f86510 | |
syuilo | 9b78ce8047 | |
syuilo | 1629c0e50d | |
syuilo | 427f4a2cda | |
woxtu | ba9c5c37b8 | |
syuilo | e790aa0548 | |
taichan | bf8c42eecd | |
かっこかり | 129af06198 | |
かっこかり | 83c04c55ad | |
かっこかり | 0b98554319 | |
かっこかり | 4e0d57000c | |
syuilo | c0de57c08d | |
かっこかり | 75b0315ace | |
github-actions[bot] | 6cdecd72ee | |
taichan | 9fbc1b7f7b | |
zyoshoka | fd744f44c1 | |
syuilo | 383c41bdb6 | |
github-actions[bot] | 68ec7450af | |
かっこかり | 06684fe49b | |
かっこかり | 059eb6d379 | |
syuilo | 61cc3b5642 | |
github-actions[bot] | 2ab5ee81b1 | |
syuilo | ef950a345b | |
syuilo | bfaf938609 | |
syuilo | d3cdc08802 | |
かっこかり | 571566d476 | |
anatawa12 | 748a7e8f6a | |
かっこかり | 6db3c50e32 | |
zyoshoka | 26322048db | |
かっこかり | a8810af8d9 | |
syuilo | 45d88574c3 | |
zyoshoka | b68b2ee8c6 | |
syuilo | 86dd4abadc | |
syuilo | cd210001e6 | |
timesince | 41936c16c4 | |
github-actions[bot] | 4d757865f4 | |
syuilo | 2a2bbcd1bc | |
shika | 94b8c00c66 | |
かっこかり | ab7bbd4e57 | |
かっこかり | 93fc06d18b | |
かっこかり | 0aaf74ee22 | |
かっこかり | 046f2435b2 | |
syuilo | 37c9d91ba0 | |
syuilo | 93c569c2cd | |
かっこかり | cb10156f01 | |
anatawa12 | 1532d5f390 | |
かっこかり | 7e3dedb045 | |
zyoshoka | 01a815f8a7 | |
anatawa12 | f50941389d | |
Daiki Mizukami | 0d508db8a7 | |
anatawa12 | f244d42500 | |
syuilo | 820becb4e4 | |
syuilo | 6e3e7d7df1 | |
github-actions[bot] | 008a66d73f | |
github-actions[bot] | 59e2e43a68 | |
syuilo | 1a521a44c0 | |
taichan | d6ba12e24c | |
taichan | 4b04b2989b |
|
@ -0,0 +1,203 @@
|
||||||
|
#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
# Misskey configuration
|
||||||
|
#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
|
||||||
|
# ┌─────┐
|
||||||
|
#───┘ URL └─────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
# Final accessible URL seen by a user.
|
||||||
|
url: 'http://misskey.local'
|
||||||
|
|
||||||
|
# ONCE YOU HAVE STARTED THE INSTANCE, DO NOT CHANGE THE
|
||||||
|
# URL SETTINGS AFTER THAT!
|
||||||
|
|
||||||
|
# ┌───────────────────────┐
|
||||||
|
#───┘ Port and TLS settings └───────────────────────────────────
|
||||||
|
|
||||||
|
#
|
||||||
|
# Misskey requires a reverse proxy to support HTTPS connections.
|
||||||
|
#
|
||||||
|
# +----- https://example.tld/ ------------+
|
||||||
|
# +------+ |+-------------+ +----------------+|
|
||||||
|
# | User | ---> || Proxy (443) | ---> | Misskey (3000) ||
|
||||||
|
# +------+ |+-------------+ +----------------+|
|
||||||
|
# +---------------------------------------+
|
||||||
|
#
|
||||||
|
# You need to set up a reverse proxy. (e.g. nginx)
|
||||||
|
# An encrypted connection with HTTPS is highly recommended
|
||||||
|
# because tokens may be transferred in GET requests.
|
||||||
|
|
||||||
|
# The port that your Misskey server should listen on.
|
||||||
|
port: 61812
|
||||||
|
|
||||||
|
# ┌──────────────────────────┐
|
||||||
|
#───┘ PostgreSQL configuration └────────────────────────────────
|
||||||
|
|
||||||
|
db:
|
||||||
|
host: db
|
||||||
|
port: 5432
|
||||||
|
|
||||||
|
# Database name
|
||||||
|
db: misskey
|
||||||
|
|
||||||
|
# Auth
|
||||||
|
user: postgres
|
||||||
|
pass: postgres
|
||||||
|
|
||||||
|
# Whether disable Caching queries
|
||||||
|
#disableCache: true
|
||||||
|
|
||||||
|
# Extra Connection options
|
||||||
|
#extra:
|
||||||
|
# ssl: true
|
||||||
|
|
||||||
|
dbReplications: false
|
||||||
|
|
||||||
|
# You can configure any number of replicas here
|
||||||
|
#dbSlaves:
|
||||||
|
# -
|
||||||
|
# host:
|
||||||
|
# port:
|
||||||
|
# db:
|
||||||
|
# user:
|
||||||
|
# pass:
|
||||||
|
# -
|
||||||
|
# host:
|
||||||
|
# port:
|
||||||
|
# db:
|
||||||
|
# user:
|
||||||
|
# pass:
|
||||||
|
|
||||||
|
# ┌─────────────────────┐
|
||||||
|
#───┘ Redis configuration └─────────────────────────────────────
|
||||||
|
|
||||||
|
redis:
|
||||||
|
host: redis
|
||||||
|
port: 6379
|
||||||
|
#family: 0 # 0=Both, 4=IPv4, 6=IPv6
|
||||||
|
#pass: example-pass
|
||||||
|
#prefix: example-prefix
|
||||||
|
#db: 1
|
||||||
|
|
||||||
|
#redisForPubsub:
|
||||||
|
# host: redis
|
||||||
|
# port: 6379
|
||||||
|
# #family: 0 # 0=Both, 4=IPv4, 6=IPv6
|
||||||
|
# #pass: example-pass
|
||||||
|
# #prefix: example-prefix
|
||||||
|
# #db: 1
|
||||||
|
|
||||||
|
#redisForJobQueue:
|
||||||
|
# host: redis
|
||||||
|
# port: 6379
|
||||||
|
# #family: 0 # 0=Both, 4=IPv4, 6=IPv6
|
||||||
|
# #pass: example-pass
|
||||||
|
# #prefix: example-prefix
|
||||||
|
# #db: 1
|
||||||
|
|
||||||
|
#redisForTimelines:
|
||||||
|
# host: redis
|
||||||
|
# port: 6379
|
||||||
|
# #family: 0 # 0=Both, 4=IPv4, 6=IPv6
|
||||||
|
# #pass: example-pass
|
||||||
|
# #prefix: example-prefix
|
||||||
|
# #db: 1
|
||||||
|
|
||||||
|
# ┌───────────────────────────┐
|
||||||
|
#───┘ MeiliSearch configuration └─────────────────────────────
|
||||||
|
|
||||||
|
#meilisearch:
|
||||||
|
# host: meilisearch
|
||||||
|
# port: 7700
|
||||||
|
# apiKey: ''
|
||||||
|
# ssl: true
|
||||||
|
# index: ''
|
||||||
|
|
||||||
|
# ┌───────────────┐
|
||||||
|
#───┘ ID generation └───────────────────────────────────────────
|
||||||
|
|
||||||
|
# You can select the ID generation method.
|
||||||
|
# You don't usually need to change this setting, but you can
|
||||||
|
# change it according to your preferences.
|
||||||
|
|
||||||
|
# Available methods:
|
||||||
|
# aid ... Short, Millisecond accuracy
|
||||||
|
# aidx ... Millisecond accuracy
|
||||||
|
# meid ... Similar to ObjectID, Millisecond accuracy
|
||||||
|
# ulid ... Millisecond accuracy
|
||||||
|
# objectid ... This is left for backward compatibility
|
||||||
|
|
||||||
|
# ONCE YOU HAVE STARTED THE INSTANCE, DO NOT CHANGE THE
|
||||||
|
# ID SETTINGS AFTER THAT!
|
||||||
|
|
||||||
|
id: 'aidx'
|
||||||
|
|
||||||
|
# ┌────────────────┐
|
||||||
|
#───┘ Error tracking └──────────────────────────────────────────
|
||||||
|
|
||||||
|
# Sentry is available for error tracking.
|
||||||
|
# See the Sentry documentation for more details on options.
|
||||||
|
|
||||||
|
#sentryForBackend:
|
||||||
|
# enableNodeProfiling: true
|
||||||
|
# options:
|
||||||
|
# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0'
|
||||||
|
|
||||||
|
#sentryForFrontend:
|
||||||
|
# options:
|
||||||
|
# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0'
|
||||||
|
|
||||||
|
# ┌─────────────────────┐
|
||||||
|
#───┘ Other configuration └─────────────────────────────────────
|
||||||
|
|
||||||
|
# Whether disable HSTS
|
||||||
|
#disableHsts: true
|
||||||
|
|
||||||
|
# Number of worker processes
|
||||||
|
#clusterLimit: 1
|
||||||
|
|
||||||
|
# Job concurrency per worker
|
||||||
|
# deliverJobConcurrency: 128
|
||||||
|
# inboxJobConcurrency: 16
|
||||||
|
|
||||||
|
# Job rate limiter
|
||||||
|
# deliverJobPerSec: 128
|
||||||
|
# inboxJobPerSec: 32
|
||||||
|
|
||||||
|
# Job attempts
|
||||||
|
# deliverJobMaxAttempts: 12
|
||||||
|
# inboxJobMaxAttempts: 8
|
||||||
|
|
||||||
|
# IP address family used for outgoing request (ipv4, ipv6 or dual)
|
||||||
|
#outgoingAddressFamily: ipv4
|
||||||
|
|
||||||
|
# Proxy for HTTP/HTTPS
|
||||||
|
#proxy: http://127.0.0.1:3128
|
||||||
|
|
||||||
|
proxyBypassHosts:
|
||||||
|
- api.deepl.com
|
||||||
|
- api-free.deepl.com
|
||||||
|
- www.recaptcha.net
|
||||||
|
- hcaptcha.com
|
||||||
|
- challenges.cloudflare.com
|
||||||
|
|
||||||
|
# Proxy for SMTP/SMTPS
|
||||||
|
#proxySmtp: http://127.0.0.1:3128 # use HTTP/1.1 CONNECT
|
||||||
|
#proxySmtp: socks4://127.0.0.1:1080 # use SOCKS4
|
||||||
|
#proxySmtp: socks5://127.0.0.1:1080 # use SOCKS5
|
||||||
|
|
||||||
|
# Media Proxy
|
||||||
|
#mediaProxy: https://example.com/proxy
|
||||||
|
|
||||||
|
# Proxy remote files (default: true)
|
||||||
|
proxyRemoteFiles: true
|
||||||
|
|
||||||
|
# Sign to ActivityPub GET request (default: true)
|
||||||
|
signToActivityPubGet: true
|
||||||
|
|
||||||
|
allowedPrivateNetworks: [
|
||||||
|
'127.0.0.1/32'
|
||||||
|
]
|
||||||
|
|
||||||
|
# Upload or download file size limits (bytes)
|
||||||
|
#maxFileSize: 262144000
|
|
@ -3,6 +3,8 @@
|
||||||
set -xe
|
set -xe
|
||||||
|
|
||||||
sudo chown node node_modules
|
sudo chown node node_modules
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get -y install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb
|
||||||
git config --global --add safe.directory /workspace
|
git config --global --add safe.directory /workspace
|
||||||
git submodule update --init
|
git submodule update --init
|
||||||
corepack install
|
corepack install
|
||||||
|
@ -12,3 +14,4 @@ pnpm install --frozen-lockfile
|
||||||
cp .devcontainer/devcontainer.yml .config/default.yml
|
cp .devcontainer/devcontainer.yml .config/default.yml
|
||||||
pnpm build
|
pnpm build
|
||||||
pnpm migrate
|
pnpm migrate
|
||||||
|
pnpm exec cypress install
|
||||||
|
|
|
@ -48,12 +48,14 @@ jobs:
|
||||||
"packages/backend/migration"
|
"packages/backend/migration"
|
||||||
"packages/backend/src"
|
"packages/backend/src"
|
||||||
"packages/backend/test"
|
"packages/backend/test"
|
||||||
|
"packages/frontend-shared/src"
|
||||||
"packages/frontend/.storybook"
|
"packages/frontend/.storybook"
|
||||||
"packages/frontend/@types"
|
"packages/frontend/@types"
|
||||||
"packages/frontend/lib"
|
"packages/frontend/lib"
|
||||||
"packages/frontend/public"
|
"packages/frontend/public"
|
||||||
"packages/frontend/src"
|
"packages/frontend/src"
|
||||||
"packages/frontend/test"
|
"packages/frontend/test"
|
||||||
|
"packages/frontend-embed/src"
|
||||||
"packages/misskey-bubble-game/src"
|
"packages/misskey-bubble-game/src"
|
||||||
"packages/misskey-reversi/src"
|
"packages/misskey-reversi/src"
|
||||||
"packages/sw/src"
|
"packages/sw/src"
|
||||||
|
|
|
@ -8,6 +8,8 @@ on:
|
||||||
paths:
|
paths:
|
||||||
- packages/backend/**
|
- packages/backend/**
|
||||||
- packages/frontend/**
|
- packages/frontend/**
|
||||||
|
- packages/frontend-shared/**
|
||||||
|
- packages/frontend-embed/**
|
||||||
- packages/sw/**
|
- packages/sw/**
|
||||||
- packages/misskey-js/**
|
- packages/misskey-js/**
|
||||||
- packages/shared/eslint.config.js
|
- packages/shared/eslint.config.js
|
||||||
|
@ -16,6 +18,8 @@ on:
|
||||||
paths:
|
paths:
|
||||||
- packages/backend/**
|
- packages/backend/**
|
||||||
- packages/frontend/**
|
- packages/frontend/**
|
||||||
|
- packages/frontend-shared/**
|
||||||
|
- packages/frontend-embed/**
|
||||||
- packages/sw/**
|
- packages/sw/**
|
||||||
- packages/misskey-js/**
|
- packages/misskey-js/**
|
||||||
- packages/shared/eslint.config.js
|
- packages/shared/eslint.config.js
|
||||||
|
@ -40,15 +44,18 @@ jobs:
|
||||||
needs: [pnpm_install]
|
needs: [pnpm_install]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
env:
|
|
||||||
eslint-cache-version: v1
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
workspace:
|
workspace:
|
||||||
- backend
|
- backend
|
||||||
- frontend
|
- frontend
|
||||||
|
- frontend-shared
|
||||||
|
- frontend-embed
|
||||||
- sw
|
- sw
|
||||||
- misskey-js
|
- misskey-js
|
||||||
|
env:
|
||||||
|
eslint-cache-version: v1
|
||||||
|
eslint-cache-path: ${{ github.workspace }}/node_modules/.cache/eslint-${{ matrix.workspace }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.1
|
- uses: actions/checkout@v4.1.1
|
||||||
with:
|
with:
|
||||||
|
@ -64,11 +71,10 @@ jobs:
|
||||||
- name: Restore eslint cache
|
- name: Restore eslint cache
|
||||||
uses: actions/cache@v4.0.2
|
uses: actions/cache@v4.0.2
|
||||||
with:
|
with:
|
||||||
path: node_modules/.cache/eslint
|
path: ${{ env.eslint-cache-path }}
|
||||||
key: eslint-${{ env.eslint-cache-version }}-${{ hashFiles('/pnpm-lock.yaml') }}-${{ github.ref_name }}-${{ github.sha }}
|
key: eslint-${{ env.eslint-cache-version }}-${{ matrix.workspace }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.ref_name }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: eslint-${{ env.eslint-cache-version }}-${{ matrix.workspace }}-${{ hashFiles('**/pnpm-lock.yaml') }}-
|
||||||
eslint-${{ env.eslint-cache-version }}-${{ hashFiles('/pnpm-lock.yaml') }}-
|
- run: pnpm --filter ${{ matrix.workspace }} run eslint --cache --cache-location ${{ env.eslint-cache-path }} --cache-strategy content
|
||||||
- run: pnpm --filter ${{ matrix.workspace }} run eslint --cache --cache-location node_modules/.cache/eslint --cache-strategy content
|
|
||||||
|
|
||||||
typecheck:
|
typecheck:
|
||||||
needs: [pnpm_install]
|
needs: [pnpm_install]
|
||||||
|
@ -78,6 +84,7 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
workspace:
|
workspace:
|
||||||
- backend
|
- backend
|
||||||
|
- sw
|
||||||
- misskey-js
|
- misskey-js
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.1
|
- uses: actions/checkout@v4.1.1
|
||||||
|
@ -92,7 +99,7 @@ jobs:
|
||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
- run: pnpm i --frozen-lockfile
|
- run: pnpm i --frozen-lockfile
|
||||||
- run: pnpm --filter misskey-js run build
|
- run: pnpm --filter misskey-js run build
|
||||||
if: ${{ matrix.workspace == 'backend' }}
|
if: ${{ matrix.workspace == 'backend' || matrix.workspace == 'sw' }}
|
||||||
- run: pnpm --filter misskey-reversi run build
|
- run: pnpm --filter misskey-reversi run build
|
||||||
if: ${{ matrix.workspace == 'backend' }}
|
if: ${{ matrix.workspace == 'backend' }}
|
||||||
- run: pnpm --filter ${{ matrix.workspace }} run typecheck
|
- run: pnpm --filter ${{ matrix.workspace }} run typecheck
|
||||||
|
|
|
@ -6,7 +6,7 @@ on:
|
||||||
- develop
|
- develop
|
||||||
paths:
|
paths:
|
||||||
- 'CHANGELOG.md'
|
- 'CHANGELOG.md'
|
||||||
# - .github/workflows/release-edit-with-push.yml
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,10 @@ on:
|
||||||
type: boolean
|
type: boolean
|
||||||
description: 'MERGE RELEASE BRANCH TO MAIN'
|
description: 'MERGE RELEASE BRANCH TO MAIN'
|
||||||
default: false
|
default: false
|
||||||
|
start-rc:
|
||||||
|
type: boolean
|
||||||
|
description: 'Start Release Candidate'
|
||||||
|
default: false
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@ -56,13 +60,13 @@ jobs:
|
||||||
|
|
||||||
### General
|
### General
|
||||||
-
|
-
|
||||||
|
|
||||||
### Client
|
### Client
|
||||||
-
|
-
|
||||||
|
|
||||||
### Server
|
### Server
|
||||||
-
|
-
|
||||||
|
|
||||||
use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }}
|
use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }}
|
||||||
indent: ${{ vars.INDENT }}
|
indent: ${{ vars.INDENT }}
|
||||||
secrets:
|
secrets:
|
||||||
|
@ -79,6 +83,9 @@ jobs:
|
||||||
package_jsons_to_rewrite: ${{ vars.PACKAGE_JSONS_TO_REWRITE }}
|
package_jsons_to_rewrite: ${{ vars.PACKAGE_JSONS_TO_REWRITE }}
|
||||||
use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }}
|
use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }}
|
||||||
indent: ${{ vars.INDENT }}
|
indent: ${{ vars.INDENT }}
|
||||||
|
draft_prerelease_channel: alpha
|
||||||
|
ready_start_prerelease_channel: beta
|
||||||
|
prerelease_channel: ${{ inputs.start-rc && 'rc' || '' }}
|
||||||
secrets:
|
secrets:
|
||||||
RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }}
|
RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }}
|
||||||
RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
|
RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
|
||||||
|
@ -122,6 +129,7 @@ jobs:
|
||||||
use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }}
|
use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }}
|
||||||
indent: ${{ vars.INDENT }}
|
indent: ${{ vars.INDENT }}
|
||||||
stable_branch: ${{ vars.STABLE_BRANCH }}
|
stable_branch: ${{ vars.STABLE_BRANCH }}
|
||||||
|
draft_prerelease_channel: alpha
|
||||||
secrets:
|
secrets:
|
||||||
RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }}
|
RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }}
|
||||||
RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
|
RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
|
||||||
|
|
|
@ -39,6 +39,8 @@ jobs:
|
||||||
package_jsons_to_rewrite: ${{ vars.PACKAGE_JSONS_TO_REWRITE }}
|
package_jsons_to_rewrite: ${{ vars.PACKAGE_JSONS_TO_REWRITE }}
|
||||||
use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }}
|
use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }}
|
||||||
indent: ${{ vars.INDENT }}
|
indent: ${{ vars.INDENT }}
|
||||||
|
draft_prerelease_channel: alpha
|
||||||
|
ready_start_prerelease_channel: beta
|
||||||
secrets:
|
secrets:
|
||||||
RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }}
|
RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }}
|
||||||
RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
|
RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
|
||||||
|
|
|
@ -7,6 +7,11 @@ on:
|
||||||
- develop
|
- develop
|
||||||
- dev/storybook8 # for testing
|
- dev/storybook8 # for testing
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
|
branches-ignore:
|
||||||
|
# Since pull requests targets master mostly is the "develop" branch.
|
||||||
|
# Storybook CI is checked on the "push" event of "develop" branch so it would cause a duplicate build.
|
||||||
|
# This is a waste of chromatic build quota, so we don't run storybook CI on pull requests targets master.
|
||||||
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
|
@ -35,6 +35,9 @@ coverage
|
||||||
!/.config/example.yml
|
!/.config/example.yml
|
||||||
!/.config/docker_example.yml
|
!/.config/docker_example.yml
|
||||||
!/.config/docker_example.env
|
!/.config/docker_example.env
|
||||||
|
!/.config/cypress-devcontainer.yml
|
||||||
|
docker-compose.yml
|
||||||
|
compose.yml
|
||||||
.devcontainer/compose.yml
|
.devcontainer/compose.yml
|
||||||
!/.devcontainer/compose.yml
|
!/.devcontainer/compose.yml
|
||||||
|
|
||||||
|
@ -42,6 +45,7 @@ coverage
|
||||||
/build
|
/build
|
||||||
built
|
built
|
||||||
built-test
|
built-test
|
||||||
|
js-built
|
||||||
/data
|
/data
|
||||||
/.cache-loader
|
/.cache-loader
|
||||||
/db
|
/db
|
||||||
|
|
59
CHANGELOG.md
59
CHANGELOG.md
|
@ -1,3 +1,62 @@
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
### General
|
||||||
|
-
|
||||||
|
|
||||||
|
### Client
|
||||||
|
- Feat: ノート単体・ユーザーのノート・クリップのノートの埋め込み機能
|
||||||
|
- 埋め込みコードやウェブサイトへの実装方法の詳細はMisskey Hubに掲載予定です
|
||||||
|
- Enhance: サイズ制限を超過するファイルをアップロードしようとした際にエラーを出すように
|
||||||
|
- Enhance: アイコンデコレーション管理画面にプレビューを追加
|
||||||
|
- Enhance: コントロールパネル内のファイル一覧でセンシティブなファイルを区別しやすく
|
||||||
|
- Fix: サーバーメトリクスが2つ以上あるとリロード直後の表示がおかしくなる問題を修正
|
||||||
|
- Fix: 月の違う同じ日はセパレータが表示されないのを修正
|
||||||
|
|
||||||
|
### Server
|
||||||
|
- Fix: アンテナの書き込み時にキーワードが与えられなかった場合のエラーをApiErrorとして投げるように
|
||||||
|
- この変更により、公式フロントエンドでは入力の不備が内部エラーとして報告される代わりに一般的なエラーダイアログで報告されます
|
||||||
|
- Fix: ファイルがサイズの制限を超えてアップロードされた際にエラーを返さなかった問題を修正
|
||||||
|
- Fix: 外部ページを解析する際に、ページに紐づけられた関連リソースも読み込まれてしまう問題を修正
|
||||||
|
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/commit/26e0412fbb91447c37e8fb06ffb0487346063bb8)
|
||||||
|
|
||||||
|
## 2024.8.0
|
||||||
|
|
||||||
|
### General
|
||||||
|
- Enhance: モデレーターはすべてのユーザーのフォロー・フォロワーの一覧を見られるように
|
||||||
|
- Enhance: アカウントの削除のモデレーションログを残すように
|
||||||
|
- Enhance: 不適切なページ、ギャラリー、Playを管理者権限で削除できるように
|
||||||
|
- Fix: リモートユーザのフォロー・フォロワーの一覧が非公開設定の場合も表示できてしまう問題を修正
|
||||||
|
|
||||||
|
### Client
|
||||||
|
- Enhance: 「自分のPlay」ページにおいてPlayが非公開かどうかが一目でわかるように
|
||||||
|
- Enhance: 不適切なページ、ギャラリー、Playを通報できるように
|
||||||
|
- Fix: Play編集時に公開範囲が「パブリック」にリセットされる問題を修正
|
||||||
|
- Fix: ページ遷移に失敗することがある問題を修正
|
||||||
|
- Fix: iOSでユーザー名などがリンクとして誤検知される現象を抑制
|
||||||
|
- Fix: mCaptchaを使用していてもbotプロテクションに関する警告が消えないのを修正
|
||||||
|
- Fix: ユーザーのモデレーションページにおいてユーザー名にドットが入っているとシステムアカウントとして表示されてしまう問題を修正
|
||||||
|
- Fix: 特定の条件下でノートの削除ボタンが出ないのを修正
|
||||||
|
|
||||||
|
### Server
|
||||||
|
- Enhance: 照会時にURLがhtmlかつheadタグ内に`rel="alternate"`, `type="application/activity+json"`の`link`タグがある場合に追ってリンク先を照会できるように
|
||||||
|
- Enhance: 凍結されたアカウントのフォローリクエストを表示しないように
|
||||||
|
- Fix: WSの`readAllNotifications` メッセージが `body` を持たない場合に動作しない問題 #14374
|
||||||
|
- 通知ページや通知カラム(デッキ)を開いている状態において、新たに発生した通知が既読されない問題が修正されます。
|
||||||
|
- これにより、プッシュ通知が有効な同条件下の環境において、プッシュ通知が常に発生してしまう問題も修正されます。
|
||||||
|
- Fix: Play各種エンドポイントの返り値に`visibility`が含まれていない問題を修正
|
||||||
|
- Fix: サーバー情報取得の際にモデレーター限定の情報が取得できないことがあるのを修正
|
||||||
|
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/582)
|
||||||
|
- Fix: 公開範囲がダイレクトのノートをユーザーアクティビティのチャート生成に使用しないように
|
||||||
|
(Cherry-picked from https://github.com/MisskeyIO/misskey/pull/679)
|
||||||
|
- Fix: ActivityPubのエンティティタイプ判定で不明なタイプを受け取った場合でも処理を継続するように
|
||||||
|
- キュー処理のつまりが改善される可能性があります
|
||||||
|
- Fix: リバーシの対局設定の変更が反映されないのを修正
|
||||||
|
- Fix: 無制限にストリーミングのチャンネルに接続できる問題を修正
|
||||||
|
- Fix: ベースロールのポリシーを変更した際にモデログに記録されないのを修正
|
||||||
|
(Cherry-picked from https://github.com/MisskeyIO/misskey/pull/700)
|
||||||
|
- Fix: Prevent memory leak from memory caches (#14310)
|
||||||
|
- Fix: More reliable memory cache eviction (#14311)
|
||||||
|
|
||||||
## 2024.7.0
|
## 2024.7.0
|
||||||
|
|
||||||
### Note
|
### Note
|
||||||
|
|
|
@ -21,7 +21,9 @@ WORKDIR /misskey
|
||||||
COPY --link ["pnpm-lock.yaml", "pnpm-workspace.yaml", "package.json", "./"]
|
COPY --link ["pnpm-lock.yaml", "pnpm-workspace.yaml", "package.json", "./"]
|
||||||
COPY --link ["scripts", "./scripts"]
|
COPY --link ["scripts", "./scripts"]
|
||||||
COPY --link ["packages/backend/package.json", "./packages/backend/"]
|
COPY --link ["packages/backend/package.json", "./packages/backend/"]
|
||||||
|
COPY --link ["packages/frontend-shared/package.json", "./packages/frontend-shared/"]
|
||||||
COPY --link ["packages/frontend/package.json", "./packages/frontend/"]
|
COPY --link ["packages/frontend/package.json", "./packages/frontend/"]
|
||||||
|
COPY --link ["packages/frontend-embed/package.json", "./packages/frontend-embed/"]
|
||||||
COPY --link ["packages/sw/package.json", "./packages/sw/"]
|
COPY --link ["packages/sw/package.json", "./packages/sw/"]
|
||||||
COPY --link ["packages/misskey-js/package.json", "./packages/misskey-js/"]
|
COPY --link ["packages/misskey-js/package.json", "./packages/misskey-js/"]
|
||||||
COPY --link ["packages/misskey-reversi/package.json", "./packages/misskey-reversi/"]
|
COPY --link ["packages/misskey-reversi/package.json", "./packages/misskey-reversi/"]
|
||||||
|
|
|
@ -2010,7 +2010,6 @@ _webhookSettings:
|
||||||
createWebhook: "Vytvořit Webhook"
|
createWebhook: "Vytvořit Webhook"
|
||||||
name: "Jméno"
|
name: "Jméno"
|
||||||
secret: "Tajné"
|
secret: "Tajné"
|
||||||
events: "Události Webhook"
|
|
||||||
active: "Zapnuto"
|
active: "Zapnuto"
|
||||||
_events:
|
_events:
|
||||||
follow: "Při sledování uživatele"
|
follow: "Při sledování uživatele"
|
||||||
|
|
|
@ -2191,7 +2191,6 @@ _webhookSettings:
|
||||||
createWebhook: "Webhook erstellen"
|
createWebhook: "Webhook erstellen"
|
||||||
name: "Name"
|
name: "Name"
|
||||||
secret: "Secret"
|
secret: "Secret"
|
||||||
events: "Webhook-Ereignisse"
|
|
||||||
active: "Aktiviert"
|
active: "Aktiviert"
|
||||||
_events:
|
_events:
|
||||||
follow: "Wenn du jemandem folgst"
|
follow: "Wenn du jemandem folgst"
|
||||||
|
|
|
@ -182,7 +182,7 @@ addAccount: "Add account"
|
||||||
reloadAccountsList: "Reload account list"
|
reloadAccountsList: "Reload account list"
|
||||||
loginFailed: "Failed to sign in"
|
loginFailed: "Failed to sign in"
|
||||||
showOnRemote: "View on remote instance"
|
showOnRemote: "View on remote instance"
|
||||||
continueOnRemote: "リモートで続行"
|
continueOnRemote: "Continue on a remote server"
|
||||||
chooseServerOnMisskeyHub: "Choose a server from the Misskey Hub"
|
chooseServerOnMisskeyHub: "Choose a server from the Misskey Hub"
|
||||||
specifyServerHost: "Specify a server host directly"
|
specifyServerHost: "Specify a server host directly"
|
||||||
inputHostName: "Enter the domain"
|
inputHostName: "Enter the domain"
|
||||||
|
@ -398,7 +398,7 @@ mcaptcha: "mCaptcha"
|
||||||
enableMcaptcha: "Enable mCaptcha"
|
enableMcaptcha: "Enable mCaptcha"
|
||||||
mcaptchaSiteKey: "Site key"
|
mcaptchaSiteKey: "Site key"
|
||||||
mcaptchaSecretKey: "Secret key"
|
mcaptchaSecretKey: "Secret key"
|
||||||
mcaptchaInstanceUrl: "mCaptcha instance URL"
|
mcaptchaInstanceUrl: "mCaptcha server URL"
|
||||||
recaptcha: "reCAPTCHA"
|
recaptcha: "reCAPTCHA"
|
||||||
enableRecaptcha: "Enable reCAPTCHA"
|
enableRecaptcha: "Enable reCAPTCHA"
|
||||||
recaptchaSiteKey: "Site key"
|
recaptchaSiteKey: "Site key"
|
||||||
|
@ -487,7 +487,7 @@ noMessagesYet: "No messages yet"
|
||||||
newMessageExists: "There are new messages"
|
newMessageExists: "There are new messages"
|
||||||
onlyOneFileCanBeAttached: "You can only attach one file to a message"
|
onlyOneFileCanBeAttached: "You can only attach one file to a message"
|
||||||
signinRequired: "Please register or sign in before continuing"
|
signinRequired: "Please register or sign in before continuing"
|
||||||
signinOrContinueOnRemote: "To continue, you need to move your server or sign up / log in to this server."
|
signinOrContinueOnRemote: "To continue, you need to move your server or sign up / log in to this server."
|
||||||
invitations: "Invites"
|
invitations: "Invites"
|
||||||
invitationCode: "Invitation code"
|
invitationCode: "Invitation code"
|
||||||
checking: "Checking..."
|
checking: "Checking..."
|
||||||
|
@ -1255,7 +1255,7 @@ launchApp: "Launch the app"
|
||||||
useNativeUIForVideoAudioPlayer: "Use UI of browser when play video and audio"
|
useNativeUIForVideoAudioPlayer: "Use UI of browser when play video and audio"
|
||||||
keepOriginalFilename: "Keep original file name"
|
keepOriginalFilename: "Keep original file name"
|
||||||
keepOriginalFilenameDescription: "If you turn off this setting, files names will be replaced with random string automatically when you upload files."
|
keepOriginalFilenameDescription: "If you turn off this setting, files names will be replaced with random string automatically when you upload files."
|
||||||
noDescription: "There is not the explanation"
|
noDescription: "There is no explanation"
|
||||||
alwaysConfirmFollow: "Always confirm when following"
|
alwaysConfirmFollow: "Always confirm when following"
|
||||||
inquiry: "Contact"
|
inquiry: "Contact"
|
||||||
tryAgain: "Please try again later"
|
tryAgain: "Please try again later"
|
||||||
|
@ -1365,7 +1365,7 @@ _initialTutorial:
|
||||||
_exampleNote:
|
_exampleNote:
|
||||||
cw: "This will surely make you hungry!"
|
cw: "This will surely make you hungry!"
|
||||||
note: "Just had a chocolate-glazed donut 🍩😋"
|
note: "Just had a chocolate-glazed donut 🍩😋"
|
||||||
useCases: "This is used when following the server guidelines for necessary notes or for self-restriction of spoiler or sensitive text."
|
useCases: "This is used when following the server guidelines, for necessary notes, or for self-restriction of spoiler or sensitive text."
|
||||||
_howToMakeAttachmentsSensitive:
|
_howToMakeAttachmentsSensitive:
|
||||||
title: "How to Mark Attachments as Sensitive?"
|
title: "How to Mark Attachments as Sensitive?"
|
||||||
description: "For attachments that are required by server guidelines or that should not be left intact, add a \"sensitive\" flag."
|
description: "For attachments that are required by server guidelines or that should not be left intact, add a \"sensitive\" flag."
|
||||||
|
@ -2316,6 +2316,7 @@ _pages:
|
||||||
eyeCatchingImageSet: "Set thumbnail"
|
eyeCatchingImageSet: "Set thumbnail"
|
||||||
eyeCatchingImageRemove: "Delete thumbnail"
|
eyeCatchingImageRemove: "Delete thumbnail"
|
||||||
chooseBlock: "Add a block"
|
chooseBlock: "Add a block"
|
||||||
|
enterSectionTitle: "Enter a section title"
|
||||||
selectType: "Select a type"
|
selectType: "Select a type"
|
||||||
contentBlocks: "Content"
|
contentBlocks: "Content"
|
||||||
inputBlocks: "Input"
|
inputBlocks: "Input"
|
||||||
|
@ -2426,7 +2427,7 @@ _webhookSettings:
|
||||||
modifyWebhook: "Modify Webhook"
|
modifyWebhook: "Modify Webhook"
|
||||||
name: "Name"
|
name: "Name"
|
||||||
secret: "Secret"
|
secret: "Secret"
|
||||||
events: "Webhook Events"
|
trigger: "Trigger"
|
||||||
active: "Enabled"
|
active: "Enabled"
|
||||||
_events:
|
_events:
|
||||||
follow: "When following a user"
|
follow: "When following a user"
|
||||||
|
@ -2494,11 +2495,15 @@ _moderationLogTypes:
|
||||||
unsetUserAvatar: "Unset this user's avatar"
|
unsetUserAvatar: "Unset this user's avatar"
|
||||||
unsetUserBanner: "Unset this user's banner"
|
unsetUserBanner: "Unset this user's banner"
|
||||||
createSystemWebhook: "Create SystemWebhook"
|
createSystemWebhook: "Create SystemWebhook"
|
||||||
updateSystemWebhook: "Update SystemWebHook"
|
updateSystemWebhook: "Update SystemWebhook"
|
||||||
deleteSystemWebhook: "Delete SystemWebhook"
|
deleteSystemWebhook: "Delete SystemWebhook"
|
||||||
createAbuseReportNotificationRecipient: "Create a recipient for abuse reports"
|
createAbuseReportNotificationRecipient: "Create a recipient for abuse reports"
|
||||||
updateAbuseReportNotificationRecipient: "Update recipients for abuse reports"
|
updateAbuseReportNotificationRecipient: "Update recipients for abuse reports"
|
||||||
deleteAbuseReportNotificationRecipient: "Delete a recipient for abuse reports"
|
deleteAbuseReportNotificationRecipient: "Delete a recipient for abuse reports"
|
||||||
|
deleteAccount: "Delete the account"
|
||||||
|
deletePage: "Delete the page"
|
||||||
|
deleteFlash: "Delete Play"
|
||||||
|
deleteGalleryPost: "Delete the gallery post"
|
||||||
_fileViewer:
|
_fileViewer:
|
||||||
title: "File details"
|
title: "File details"
|
||||||
type: "File type"
|
type: "File type"
|
||||||
|
|
|
@ -60,6 +60,7 @@ copyFileId: "Copiar ID del archivo"
|
||||||
copyFolderId: "Copiar ID de carpeta"
|
copyFolderId: "Copiar ID de carpeta"
|
||||||
copyProfileUrl: "Copiar la URL del perfil"
|
copyProfileUrl: "Copiar la URL del perfil"
|
||||||
searchUser: "Buscar un usuario"
|
searchUser: "Buscar un usuario"
|
||||||
|
searchThisUsersNotes: ""
|
||||||
reply: "Responder"
|
reply: "Responder"
|
||||||
loadMore: "Ver más"
|
loadMore: "Ver más"
|
||||||
showMore: "Ver más"
|
showMore: "Ver más"
|
||||||
|
@ -2382,7 +2383,6 @@ _webhookSettings:
|
||||||
createWebhook: "Crear Webhook"
|
createWebhook: "Crear Webhook"
|
||||||
name: "Nombre"
|
name: "Nombre"
|
||||||
secret: "Secreto"
|
secret: "Secreto"
|
||||||
events: "Eventos de webhook"
|
|
||||||
active: "Activado"
|
active: "Activado"
|
||||||
_events:
|
_events:
|
||||||
follow: "Cuando se sigue a alguien"
|
follow: "Cuando se sigue a alguien"
|
||||||
|
|
|
@ -1094,6 +1094,8 @@ preservedUsernames: "Noms d'utilisateur·rice réservés"
|
||||||
preservedUsernamesDescription: "Énumérez les noms d'utilisateur à réserver, séparés par des nouvelles lignes. Les noms d'utilisateur spécifiés ici ne seront plus utilisables lors de la création d'un compte, sauf la création manuelle par un administrateur. De plus, les comptes existants ne seront pas affectés."
|
preservedUsernamesDescription: "Énumérez les noms d'utilisateur à réserver, séparés par des nouvelles lignes. Les noms d'utilisateur spécifiés ici ne seront plus utilisables lors de la création d'un compte, sauf la création manuelle par un administrateur. De plus, les comptes existants ne seront pas affectés."
|
||||||
createNoteFromTheFile: "Rédiger une note de ce fichier"
|
createNoteFromTheFile: "Rédiger une note de ce fichier"
|
||||||
archive: "Archive"
|
archive: "Archive"
|
||||||
|
archived: "Archivé"
|
||||||
|
unarchive: "Annuler l'archivage"
|
||||||
channelArchiveConfirmTitle: "Voulez-vous vraiment archiver {name} ?"
|
channelArchiveConfirmTitle: "Voulez-vous vraiment archiver {name} ?"
|
||||||
channelArchiveConfirmDescription: "Une fois archivé, le canal n'apparaîtra plus dans la liste des canaux ni dans les résultats de recherche, et la publication des nouvelles notes sera impossible."
|
channelArchiveConfirmDescription: "Une fois archivé, le canal n'apparaîtra plus dans la liste des canaux ni dans les résultats de recherche, et la publication des nouvelles notes sera impossible."
|
||||||
thisChannelArchived: "Ce canal a été archivé."
|
thisChannelArchived: "Ce canal a été archivé."
|
||||||
|
@ -1224,7 +1226,10 @@ enableHorizontalSwipe: "Glisser pour changer d'onglet"
|
||||||
loading: "Chargement en cours"
|
loading: "Chargement en cours"
|
||||||
surrender: "Annuler"
|
surrender: "Annuler"
|
||||||
gameRetry: "Réessayer"
|
gameRetry: "Réessayer"
|
||||||
|
launchApp: "Lancer l'app"
|
||||||
|
inquiry: "Contact"
|
||||||
_delivery:
|
_delivery:
|
||||||
|
status: "Statut de la diffusion"
|
||||||
stop: "Suspendu·e"
|
stop: "Suspendu·e"
|
||||||
_type:
|
_type:
|
||||||
none: "Publié"
|
none: "Publié"
|
||||||
|
|
|
@ -2403,7 +2403,6 @@ _webhookSettings:
|
||||||
modifyWebhook: "Sunting Webhook"
|
modifyWebhook: "Sunting Webhook"
|
||||||
name: "Nama"
|
name: "Nama"
|
||||||
secret: "Secret"
|
secret: "Secret"
|
||||||
events: "Webhook Events"
|
|
||||||
active: "Aktif"
|
active: "Aktif"
|
||||||
_events:
|
_events:
|
||||||
follow: "Ketika mengikuti pengguna"
|
follow: "Ketika mengikuti pengguna"
|
||||||
|
|
|
@ -2829,7 +2829,7 @@ export interface Locale extends ILocale {
|
||||||
*/
|
*/
|
||||||
"reportAbuseOf": ParameterizedString<"name">;
|
"reportAbuseOf": ParameterizedString<"name">;
|
||||||
/**
|
/**
|
||||||
* 通報理由の詳細を記入してください。対象のノートがある場合はそのURLも記入してください。
|
* 通報理由の詳細を記入してください。対象のノートやページなどがある場合はそのURLも記入してください。
|
||||||
*/
|
*/
|
||||||
"fillAbuseReportDescription": string;
|
"fillAbuseReportDescription": string;
|
||||||
/**
|
/**
|
||||||
|
@ -5068,6 +5068,22 @@ export interface Locale extends ILocale {
|
||||||
* 作成したアンテナ
|
* 作成したアンテナ
|
||||||
*/
|
*/
|
||||||
"createdAntennas": string;
|
"createdAntennas": string;
|
||||||
|
/**
|
||||||
|
* {x}から
|
||||||
|
*/
|
||||||
|
"fromX": ParameterizedString<"x">;
|
||||||
|
/**
|
||||||
|
* 埋め込みコードを生成
|
||||||
|
*/
|
||||||
|
"genEmbedCode": string;
|
||||||
|
/**
|
||||||
|
* このユーザーのノート一覧
|
||||||
|
*/
|
||||||
|
"noteOfThisUser": string;
|
||||||
|
/**
|
||||||
|
* これ以上このクリップにノートを追加できません。
|
||||||
|
*/
|
||||||
|
"clipNoteLimitExceeded": string;
|
||||||
/**
|
/**
|
||||||
* ページ閲覧数
|
* ページ閲覧数
|
||||||
*/
|
*/
|
||||||
|
@ -8997,6 +9013,10 @@ export interface Locale extends ILocale {
|
||||||
* ブロックを追加
|
* ブロックを追加
|
||||||
*/
|
*/
|
||||||
"chooseBlock": string;
|
"chooseBlock": string;
|
||||||
|
/**
|
||||||
|
* セクションタイトルを入力
|
||||||
|
*/
|
||||||
|
"enterSectionTitle": string;
|
||||||
/**
|
/**
|
||||||
* 種類を選択
|
* 種類を選択
|
||||||
*/
|
*/
|
||||||
|
@ -9414,9 +9434,9 @@ export interface Locale extends ILocale {
|
||||||
*/
|
*/
|
||||||
"secret": string;
|
"secret": string;
|
||||||
/**
|
/**
|
||||||
* Webhookを実行するタイミング
|
* トリガー
|
||||||
*/
|
*/
|
||||||
"events": string;
|
"trigger": string;
|
||||||
/**
|
/**
|
||||||
* 有効
|
* 有効
|
||||||
*/
|
*/
|
||||||
|
@ -9691,6 +9711,22 @@ export interface Locale extends ILocale {
|
||||||
* 通報の通知先を削除
|
* 通報の通知先を削除
|
||||||
*/
|
*/
|
||||||
"deleteAbuseReportNotificationRecipient": string;
|
"deleteAbuseReportNotificationRecipient": string;
|
||||||
|
/**
|
||||||
|
* アカウントを削除
|
||||||
|
*/
|
||||||
|
"deleteAccount": string;
|
||||||
|
/**
|
||||||
|
* ページを削除
|
||||||
|
*/
|
||||||
|
"deletePage": string;
|
||||||
|
/**
|
||||||
|
* Playを削除
|
||||||
|
*/
|
||||||
|
"deleteFlash": string;
|
||||||
|
/**
|
||||||
|
* ギャラリーの投稿を削除
|
||||||
|
*/
|
||||||
|
"deleteGalleryPost": string;
|
||||||
};
|
};
|
||||||
"_fileViewer": {
|
"_fileViewer": {
|
||||||
/**
|
/**
|
||||||
|
@ -10184,6 +10220,60 @@ export interface Locale extends ILocale {
|
||||||
*/
|
*/
|
||||||
"native": string;
|
"native": string;
|
||||||
};
|
};
|
||||||
|
"_embedCodeGen": {
|
||||||
|
/**
|
||||||
|
* 埋め込みコードをカスタマイズ
|
||||||
|
*/
|
||||||
|
"title": string;
|
||||||
|
/**
|
||||||
|
* ヘッダーを表示
|
||||||
|
*/
|
||||||
|
"header": string;
|
||||||
|
/**
|
||||||
|
* 自動で続きを読み込む(非推奨)
|
||||||
|
*/
|
||||||
|
"autoload": string;
|
||||||
|
/**
|
||||||
|
* 高さの最大値
|
||||||
|
*/
|
||||||
|
"maxHeight": string;
|
||||||
|
/**
|
||||||
|
* 0で最大値の設定が無効になります。ウィジェットが縦に伸び続けるのを防ぐために、何らかの値に指定してください。
|
||||||
|
*/
|
||||||
|
"maxHeightDescription": string;
|
||||||
|
/**
|
||||||
|
* 高さの最大値制限が無効(0)になっています。これが意図した変更ではない場合は、高さの最大値を何らかの値に設定してください。
|
||||||
|
*/
|
||||||
|
"maxHeightWarn": string;
|
||||||
|
/**
|
||||||
|
* プレビュー画面で表示可能な範囲を超えたため、実際に埋め込んだ際とは表示が異なります。
|
||||||
|
*/
|
||||||
|
"previewIsNotActual": string;
|
||||||
|
/**
|
||||||
|
* 角丸にする
|
||||||
|
*/
|
||||||
|
"rounded": string;
|
||||||
|
/**
|
||||||
|
* 外枠に枠線をつける
|
||||||
|
*/
|
||||||
|
"border": string;
|
||||||
|
/**
|
||||||
|
* プレビューに反映
|
||||||
|
*/
|
||||||
|
"applyToPreview": string;
|
||||||
|
/**
|
||||||
|
* 埋め込みコードを作成
|
||||||
|
*/
|
||||||
|
"generateCode": string;
|
||||||
|
/**
|
||||||
|
* コードが生成されました
|
||||||
|
*/
|
||||||
|
"codeGenerated": string;
|
||||||
|
/**
|
||||||
|
* 生成されたコードをウェブサイトに貼り付けてご利用ください。
|
||||||
|
*/
|
||||||
|
"codeGeneratedDescription": string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
declare const locales: {
|
declare const locales: {
|
||||||
[lang: string]: Locale;
|
[lang: string]: Locale;
|
||||||
|
|
|
@ -2412,7 +2412,6 @@ _webhookSettings:
|
||||||
modifyWebhook: "Modifica Webhook"
|
modifyWebhook: "Modifica Webhook"
|
||||||
name: "Nome"
|
name: "Nome"
|
||||||
secret: "Segreto"
|
secret: "Segreto"
|
||||||
events: "Quando eseguire il Webhook"
|
|
||||||
active: "Attivo"
|
active: "Attivo"
|
||||||
_events:
|
_events:
|
||||||
follow: "Quando segui un profilo"
|
follow: "Quando segui un profilo"
|
||||||
|
|
|
@ -703,7 +703,7 @@ abuseReports: "通報"
|
||||||
reportAbuse: "通報"
|
reportAbuse: "通報"
|
||||||
reportAbuseRenote: "リノートを通報"
|
reportAbuseRenote: "リノートを通報"
|
||||||
reportAbuseOf: "{name}を通報する"
|
reportAbuseOf: "{name}を通報する"
|
||||||
fillAbuseReportDescription: "通報理由の詳細を記入してください。対象のノートがある場合はそのURLも記入してください。"
|
fillAbuseReportDescription: "通報理由の詳細を記入してください。対象のノートやページなどがある場合はそのURLも記入してください。"
|
||||||
abuseReported: "内容が送信されました。ご報告ありがとうございました。"
|
abuseReported: "内容が送信されました。ご報告ありがとうございました。"
|
||||||
reporter: "通報者"
|
reporter: "通報者"
|
||||||
reporteeOrigin: "通報先"
|
reporteeOrigin: "通報先"
|
||||||
|
@ -1263,6 +1263,10 @@ confirmWhenRevealingSensitiveMedia: "センシティブなメディアを表示
|
||||||
sensitiveMediaRevealConfirm: "センシティブなメディアです。表示しますか?"
|
sensitiveMediaRevealConfirm: "センシティブなメディアです。表示しますか?"
|
||||||
createdLists: "作成したリスト"
|
createdLists: "作成したリスト"
|
||||||
createdAntennas: "作成したアンテナ"
|
createdAntennas: "作成したアンテナ"
|
||||||
|
fromX: "{x}から"
|
||||||
|
genEmbedCode: "埋め込みコードを生成"
|
||||||
|
noteOfThisUser: "このユーザーのノート一覧"
|
||||||
|
clipNoteLimitExceeded: "これ以上このクリップにノートを追加できません。"
|
||||||
pageViewCount: "ページ閲覧数"
|
pageViewCount: "ページ閲覧数"
|
||||||
preferPopularUserFactor: "人気のユーザーの算出基準"
|
preferPopularUserFactor: "人気のユーザーの算出基準"
|
||||||
preferPopularUserFactorDescription: "ページ閲覧数はローカルユーザーにのみ適用されます(リモートユーザーはフォロワー数で表示されます)。「無効」に設定すると、ローカル・リモートどちらの「人気のユーザー」セクションも表示されなくなります。"
|
preferPopularUserFactorDescription: "ページ閲覧数はローカルユーザーにのみ適用されます(リモートユーザーはフォロワー数で表示されます)。「無効」に設定すると、ローカル・リモートどちらの「人気のユーザー」セクションも表示されなくなります。"
|
||||||
|
@ -2374,6 +2378,7 @@ _pages:
|
||||||
eyeCatchingImageSet: "アイキャッチ画像を設定"
|
eyeCatchingImageSet: "アイキャッチ画像を設定"
|
||||||
eyeCatchingImageRemove: "アイキャッチ画像を削除"
|
eyeCatchingImageRemove: "アイキャッチ画像を削除"
|
||||||
chooseBlock: "ブロックを追加"
|
chooseBlock: "ブロックを追加"
|
||||||
|
enterSectionTitle: "セクションタイトルを入力"
|
||||||
selectType: "種類を選択"
|
selectType: "種類を選択"
|
||||||
contentBlocks: "コンテンツ"
|
contentBlocks: "コンテンツ"
|
||||||
inputBlocks: "入力"
|
inputBlocks: "入力"
|
||||||
|
@ -2570,6 +2575,10 @@ _moderationLogTypes:
|
||||||
createAbuseReportNotificationRecipient: "通報の通知先を作成"
|
createAbuseReportNotificationRecipient: "通報の通知先を作成"
|
||||||
updateAbuseReportNotificationRecipient: "通報の通知先を更新"
|
updateAbuseReportNotificationRecipient: "通報の通知先を更新"
|
||||||
deleteAbuseReportNotificationRecipient: "通報の通知先を削除"
|
deleteAbuseReportNotificationRecipient: "通報の通知先を削除"
|
||||||
|
deleteAccount: "アカウントを削除"
|
||||||
|
deletePage: "ページを削除"
|
||||||
|
deleteFlash: "Playを削除"
|
||||||
|
deleteGalleryPost: "ギャラリーの投稿を削除"
|
||||||
|
|
||||||
_fileViewer:
|
_fileViewer:
|
||||||
title: "ファイルの詳細"
|
title: "ファイルの詳細"
|
||||||
|
@ -2715,3 +2724,18 @@ _contextMenu:
|
||||||
app: "アプリケーション"
|
app: "アプリケーション"
|
||||||
appWithShift: "Shiftキーでアプリケーション"
|
appWithShift: "Shiftキーでアプリケーション"
|
||||||
native: "ブラウザのUI"
|
native: "ブラウザのUI"
|
||||||
|
|
||||||
|
_embedCodeGen:
|
||||||
|
title: "埋め込みコードをカスタマイズ"
|
||||||
|
header: "ヘッダーを表示"
|
||||||
|
autoload: "自動で続きを読み込む(非推奨)"
|
||||||
|
maxHeight: "高さの最大値"
|
||||||
|
maxHeightDescription: "0で最大値の設定が無効になります。ウィジェットが縦に伸び続けるのを防ぐために、何らかの値に指定してください。"
|
||||||
|
maxHeightWarn: "高さの最大値制限が無効(0)になっています。これが意図した変更ではない場合は、高さの最大値を何らかの値に設定してください。"
|
||||||
|
previewIsNotActual: "プレビュー画面で表示可能な範囲を超えたため、実際に埋め込んだ際とは表示が異なります。"
|
||||||
|
rounded: "角丸にする"
|
||||||
|
border: "外枠に枠線をつける"
|
||||||
|
applyToPreview: "プレビューに反映"
|
||||||
|
generateCode: "埋め込みコードを作成"
|
||||||
|
codeGenerated: "コードが生成されました"
|
||||||
|
codeGeneratedDescription: "生成されたコードをウェブサイトに貼り付けてご利用ください。"
|
||||||
|
|
|
@ -60,6 +60,7 @@ copyFileId: "ファイルIDをコピー"
|
||||||
copyFolderId: "フォルダーIDをコピー"
|
copyFolderId: "フォルダーIDをコピー"
|
||||||
copyProfileUrl: "プロフィールURLをコピー"
|
copyProfileUrl: "プロフィールURLをコピー"
|
||||||
searchUser: "ユーザーを探す"
|
searchUser: "ユーザーを探す"
|
||||||
|
searchThisUsersNotes: "ユーザーのノートを検索"
|
||||||
reply: "返事"
|
reply: "返事"
|
||||||
loadMore: "まだまだあるで!"
|
loadMore: "まだまだあるで!"
|
||||||
showMore: "まだまだあるで!"
|
showMore: "まだまだあるで!"
|
||||||
|
@ -114,6 +115,8 @@ cantReRenote: "リノート自体はリノートできへんで。"
|
||||||
quote: "引用"
|
quote: "引用"
|
||||||
inChannelRenote: "チャンネルの中でリノート"
|
inChannelRenote: "チャンネルの中でリノート"
|
||||||
inChannelQuote: "チャンネル内引用"
|
inChannelQuote: "チャンネル内引用"
|
||||||
|
renoteToChannel: "チャンネルにリノート"
|
||||||
|
renoteToOtherChannel: "他のチャンネルにリノート"
|
||||||
pinnedNote: "ピン留めされとるノート"
|
pinnedNote: "ピン留めされとるノート"
|
||||||
pinned: "ピン留めしとく"
|
pinned: "ピン留めしとく"
|
||||||
you: "あんた"
|
you: "あんた"
|
||||||
|
@ -152,6 +155,7 @@ editList: "リストいじる"
|
||||||
selectChannel: "チャンネルを選ぶ"
|
selectChannel: "チャンネルを選ぶ"
|
||||||
selectAntenna: "アンテナを選ぶ"
|
selectAntenna: "アンテナを選ぶ"
|
||||||
editAntenna: "アンテナいじる"
|
editAntenna: "アンテナいじる"
|
||||||
|
createAntenna: "アンテナを作成"
|
||||||
selectWidget: "ウィジェットを選ぶ"
|
selectWidget: "ウィジェットを選ぶ"
|
||||||
editWidgets: "ウィジェットをいじる"
|
editWidgets: "ウィジェットをいじる"
|
||||||
editWidgetsExit: "いじるのをやめる"
|
editWidgetsExit: "いじるのをやめる"
|
||||||
|
@ -178,6 +182,10 @@ addAccount: "アカウントを追加"
|
||||||
reloadAccountsList: "アカウントリストの情報を更新"
|
reloadAccountsList: "アカウントリストの情報を更新"
|
||||||
loginFailed: "ログインに失敗してもうた…"
|
loginFailed: "ログインに失敗してもうた…"
|
||||||
showOnRemote: "リモートで見る"
|
showOnRemote: "リモートで見る"
|
||||||
|
continueOnRemote: "リモートで続行"
|
||||||
|
chooseServerOnMisskeyHub: "Misskey Hubからサーバーを選択"
|
||||||
|
specifyServerHost: "サーバーのドメインを直接指定"
|
||||||
|
inputHostName: "ドメインを入力せえや"
|
||||||
general: "全般"
|
general: "全般"
|
||||||
wallpaper: "壁紙"
|
wallpaper: "壁紙"
|
||||||
setWallpaper: "壁紙を設定"
|
setWallpaper: "壁紙を設定"
|
||||||
|
@ -188,6 +196,7 @@ followConfirm: "{name}をフォローしてええか?"
|
||||||
proxyAccount: "プロキシアカウント"
|
proxyAccount: "プロキシアカウント"
|
||||||
proxyAccountDescription: "プロキシアカウントは、代わりにフォローしてくれるアカウントや。例えば、551に豚まんが無いときやったり、ユーザーがリモートユーザーをアカウントに入れたとき、リストに入れられたユーザーが誰からもフォローされてないと寂しいやん。寂しいし、アクティビティも配達されへんから、プロキシアカウントがフォローしてくれるで。ええやつやん…"
|
proxyAccountDescription: "プロキシアカウントは、代わりにフォローしてくれるアカウントや。例えば、551に豚まんが無いときやったり、ユーザーがリモートユーザーをアカウントに入れたとき、リストに入れられたユーザーが誰からもフォローされてないと寂しいやん。寂しいし、アクティビティも配達されへんから、プロキシアカウントがフォローしてくれるで。ええやつやん…"
|
||||||
host: "ホスト"
|
host: "ホスト"
|
||||||
|
selectSelf: "自分を選択"
|
||||||
selectUser: "ユーザーを選ぶ"
|
selectUser: "ユーザーを選ぶ"
|
||||||
recipient: "宛先"
|
recipient: "宛先"
|
||||||
annotation: "注釈"
|
annotation: "注釈"
|
||||||
|
@ -203,6 +212,7 @@ perDay: "1日ごと"
|
||||||
stopActivityDelivery: "アクティビティの配送をやめる"
|
stopActivityDelivery: "アクティビティの配送をやめる"
|
||||||
blockThisInstance: "このサーバーをブロックすんで"
|
blockThisInstance: "このサーバーをブロックすんで"
|
||||||
silenceThisInstance: "サーバーサイレンスすんで?"
|
silenceThisInstance: "サーバーサイレンスすんで?"
|
||||||
|
mediaSilenceThisInstance: "サーバーをメディアサイレンス"
|
||||||
operations: "操作"
|
operations: "操作"
|
||||||
software: "ソフトウェア"
|
software: "ソフトウェア"
|
||||||
version: "バージョン"
|
version: "バージョン"
|
||||||
|
@ -224,6 +234,8 @@ blockedInstances: "ブロックしたサーバー"
|
||||||
blockedInstancesDescription: "ブロックしたいサーバーのホストを改行で区切って設定してな。ブロックされてもうたサーバーとはもう金輪際やり取りできひんくなるで。"
|
blockedInstancesDescription: "ブロックしたいサーバーのホストを改行で区切って設定してな。ブロックされてもうたサーバーとはもう金輪際やり取りできひんくなるで。"
|
||||||
silencedInstances: "サーバーサイレンスされてんねん"
|
silencedInstances: "サーバーサイレンスされてんねん"
|
||||||
silencedInstancesDescription: "サイレンスしたいサーバーのホストを改行で区切って設定すんで。サイレンスされたサーバーに所属するアカウントはすべて「サイレンス」として扱われ、フォローがすべてリクエストになり、フォロワーでないローカルアカウントにはメンションできなくなんねん。ブロックしたインスタンスには影響せーへんで。"
|
silencedInstancesDescription: "サイレンスしたいサーバーのホストを改行で区切って設定すんで。サイレンスされたサーバーに所属するアカウントはすべて「サイレンス」として扱われ、フォローがすべてリクエストになり、フォロワーでないローカルアカウントにはメンションできなくなんねん。ブロックしたインスタンスには影響せーへんで。"
|
||||||
|
mediaSilencedInstances: "メディアサイレンスしたサーバー"
|
||||||
|
mediaSilencedInstancesDescription: "メディアサイレンスしたいサーバーのホストを改行で区切って設定するで。メディアサイレンスされたサーバーに所属するアカウントによるファイルはすべてセンシティブとして扱われてな、カスタム絵文字が使えへんようになるで。ブロックしたインスタンスには影響せえへんで。"
|
||||||
muteAndBlock: "ミュートとブロック"
|
muteAndBlock: "ミュートとブロック"
|
||||||
mutedUsers: "ミュートしとるユーザー"
|
mutedUsers: "ミュートしとるユーザー"
|
||||||
blockedUsers: "ブロックしとるユーザー"
|
blockedUsers: "ブロックしとるユーザー"
|
||||||
|
@ -475,6 +487,7 @@ noMessagesYet: "まだチャットはあらへんで"
|
||||||
newMessageExists: "新しいメッセージがきたで"
|
newMessageExists: "新しいメッセージがきたで"
|
||||||
onlyOneFileCanBeAttached: "ごめんな、メッセージに添付できるファイルはひとつだけなんよ。"
|
onlyOneFileCanBeAttached: "ごめんな、メッセージに添付できるファイルはひとつだけなんよ。"
|
||||||
signinRequired: "ログインしてくれへん?"
|
signinRequired: "ログインしてくれへん?"
|
||||||
|
signinOrContinueOnRemote: "続行するには、お使いのサーバーに移動するか、このサーバーに登録・ログインする必要があるで"
|
||||||
invitations: "来てや"
|
invitations: "来てや"
|
||||||
invitationCode: "招待コード"
|
invitationCode: "招待コード"
|
||||||
checking: "確認しとるで"
|
checking: "確認しとるで"
|
||||||
|
@ -1025,6 +1038,7 @@ thisPostMayBeAnnoyingHome: "ホームに投稿"
|
||||||
thisPostMayBeAnnoyingCancel: "やめとく"
|
thisPostMayBeAnnoyingCancel: "やめとく"
|
||||||
thisPostMayBeAnnoyingIgnore: "このまま投稿"
|
thisPostMayBeAnnoyingIgnore: "このまま投稿"
|
||||||
collapseRenotes: "見たことあるリノートは飛ばして表示するで"
|
collapseRenotes: "見たことあるリノートは飛ばして表示するで"
|
||||||
|
collapseRenotesDescription: "リアクションやリノートをしたことがあるノートをたたんで表示するで。"
|
||||||
internalServerError: "サーバー内部エラー"
|
internalServerError: "サーバー内部エラー"
|
||||||
internalServerErrorDescription: "サーバーでなんか変なこと起こっとるわ。"
|
internalServerErrorDescription: "サーバーでなんか変なこと起こっとるわ。"
|
||||||
copyErrorInfo: "エラー情報をコピるで"
|
copyErrorInfo: "エラー情報をコピるで"
|
||||||
|
@ -1098,6 +1112,8 @@ preservedUsernames: "予約ユーザー名"
|
||||||
preservedUsernamesDescription: "予約しとくユーザー名を行ごとに挙げるで。ここで指定されたユーザー名はアカウント作るときに使えへんくなるけど、管理者は例外や。あと、もうあるアカウントも例外やな。"
|
preservedUsernamesDescription: "予約しとくユーザー名を行ごとに挙げるで。ここで指定されたユーザー名はアカウント作るときに使えへんくなるけど、管理者は例外や。あと、もうあるアカウントも例外やな。"
|
||||||
createNoteFromTheFile: "このファイル使うてノート作るで"
|
createNoteFromTheFile: "このファイル使うてノート作るで"
|
||||||
archive: "アーカイブ"
|
archive: "アーカイブ"
|
||||||
|
archived: "アーカイブ済み"
|
||||||
|
unarchive: "アーカイブ解除"
|
||||||
channelArchiveConfirmTitle: "{name}をアーカイブしてええか?"
|
channelArchiveConfirmTitle: "{name}をアーカイブしてええか?"
|
||||||
channelArchiveConfirmDescription: "アーカイブしたら、チャンネル一覧とか検索結果からなくなるし、新しく書き込みもできへんなるで。"
|
channelArchiveConfirmDescription: "アーカイブしたら、チャンネル一覧とか検索結果からなくなるし、新しく書き込みもできへんなるで。"
|
||||||
thisChannelArchived: "このチャンネル、アーカイブされとるで。"
|
thisChannelArchived: "このチャンネル、アーカイブされとるで。"
|
||||||
|
@ -1108,6 +1124,9 @@ preventAiLearning: "生成AIの学習に使わんといて"
|
||||||
preventAiLearningDescription: "他の文章生成AIとか画像生成AIに、投稿したノートとか画像なんかを勝手に使わんように頼むで。具体的にはnoaiフラグをHTMLレスポンスに含めるんやけど、これ聞いてくれるんはAIの気分次第やから、使われる可能性もちょっとはあるな。"
|
preventAiLearningDescription: "他の文章生成AIとか画像生成AIに、投稿したノートとか画像なんかを勝手に使わんように頼むで。具体的にはnoaiフラグをHTMLレスポンスに含めるんやけど、これ聞いてくれるんはAIの気分次第やから、使われる可能性もちょっとはあるな。"
|
||||||
options: "オプション"
|
options: "オプション"
|
||||||
specifyUser: "ユーザー指定"
|
specifyUser: "ユーザー指定"
|
||||||
|
lookupConfirm: "照会するけどええか?"
|
||||||
|
openTagPageConfirm: "ハッシュタグのページを開くんか?"
|
||||||
|
specifyHost: "ホスト指定"
|
||||||
failedToPreviewUrl: "プレビューできへん"
|
failedToPreviewUrl: "プレビューできへん"
|
||||||
update: "更新"
|
update: "更新"
|
||||||
rolesThatCanBeUsedThisEmojiAsReaction: "ツッコミとして使えるロール"
|
rolesThatCanBeUsedThisEmojiAsReaction: "ツッコミとして使えるロール"
|
||||||
|
@ -1239,10 +1258,20 @@ keepOriginalFilenameDescription: "この設定をオフにすると、アップ
|
||||||
noDescription: "説明文はあらへんで"
|
noDescription: "説明文はあらへんで"
|
||||||
alwaysConfirmFollow: "フォローの際常に確認する"
|
alwaysConfirmFollow: "フォローの際常に確認する"
|
||||||
inquiry: "問い合わせ"
|
inquiry: "問い合わせ"
|
||||||
|
tryAgain: "もう一度試しいや。"
|
||||||
|
confirmWhenRevealingSensitiveMedia: "センシティブなメディアを表示するとき確認する"
|
||||||
|
sensitiveMediaRevealConfirm: "センシティブなメディアやで。表示するんか?"
|
||||||
|
createdLists: "作成したリスト"
|
||||||
|
createdAntennas: "作成したアンテナ"
|
||||||
_delivery:
|
_delivery:
|
||||||
|
status: "配信状態"
|
||||||
stop: "配信せぇへん"
|
stop: "配信せぇへん"
|
||||||
|
resume: "配信再開"
|
||||||
_type:
|
_type:
|
||||||
none: "配信しとる"
|
none: "配信しとる"
|
||||||
|
manuallySuspended: "手動停止中"
|
||||||
|
goneSuspended: "サーバー削除のため停止中"
|
||||||
|
autoSuspendedForNotResponding: "サーバー応答せえへんから停止中"
|
||||||
_bubbleGame:
|
_bubbleGame:
|
||||||
howToPlay: "遊び方"
|
howToPlay: "遊び方"
|
||||||
hold: "ホールド"
|
hold: "ホールド"
|
||||||
|
@ -1368,6 +1397,8 @@ _serverSettings:
|
||||||
fanoutTimelineDescription: "入れると、おのおのタイムラインを取得するときにめちゃめちゃ動きが良うなって、データベースが軽くなるわ。でも、Redisのメモリ使う量が増えるから注意な。サーバーのメモリが足りんときとか、動きが変なときは切れるで。"
|
fanoutTimelineDescription: "入れると、おのおのタイムラインを取得するときにめちゃめちゃ動きが良うなって、データベースが軽くなるわ。でも、Redisのメモリ使う量が増えるから注意な。サーバーのメモリが足りんときとか、動きが変なときは切れるで。"
|
||||||
fanoutTimelineDbFallback: "データベースにフォールバックする"
|
fanoutTimelineDbFallback: "データベースにフォールバックする"
|
||||||
fanoutTimelineDbFallbackDescription: "有効にしたら、タイムラインがキャッシュん中に入ってないときにDBにもっかい問い合わせるフォールバック処理ってのをやっとくで。切ったらフォールバック処理をやらんからサーバーはもっと軽くなんねんけど、タイムラインの取得範囲がちょっと減るで。"
|
fanoutTimelineDbFallbackDescription: "有効にしたら、タイムラインがキャッシュん中に入ってないときにDBにもっかい問い合わせるフォールバック処理ってのをやっとくで。切ったらフォールバック処理をやらんからサーバーはもっと軽くなんねんけど、タイムラインの取得範囲がちょっと減るで。"
|
||||||
|
inquiryUrl: "問い合わせ先URL"
|
||||||
|
inquiryUrlDescription: "サーバー運営者へのお問い合わせフォームのURLや、運営者の連絡先等が記載されたWebページのURLを指定するで。"
|
||||||
_accountMigration:
|
_accountMigration:
|
||||||
moveFrom: "別のアカウントからこのアカウントに引っ越す"
|
moveFrom: "別のアカウントからこのアカウントに引っ越す"
|
||||||
moveFromSub: "別のアカウントへエイリアスを作る"
|
moveFromSub: "別のアカウントへエイリアスを作る"
|
||||||
|
@ -1684,6 +1715,7 @@ _role:
|
||||||
canManageAvatarDecorations: "アバターを飾るモンの管理"
|
canManageAvatarDecorations: "アバターを飾るモンの管理"
|
||||||
driveCapacity: "ドライブ容量"
|
driveCapacity: "ドライブ容量"
|
||||||
alwaysMarkNsfw: "勝手にファイルにNSFWをくっつける"
|
alwaysMarkNsfw: "勝手にファイルにNSFWをくっつける"
|
||||||
|
canUpdateBioMedia: "アイコンとバナーの更新を許可"
|
||||||
pinMax: "ノートピン留めできる数"
|
pinMax: "ノートピン留めできる数"
|
||||||
antennaMax: "アンテナ作れる数"
|
antennaMax: "アンテナ作れる数"
|
||||||
wordMuteMax: "ワードミュートの最大文字数"
|
wordMuteMax: "ワードミュートの最大文字数"
|
||||||
|
@ -1935,6 +1967,7 @@ _soundSettings:
|
||||||
driveFileTypeWarnDescription: "音声ファイルを選びや"
|
driveFileTypeWarnDescription: "音声ファイルを選びや"
|
||||||
driveFileDurationWarn: "音が長すぎるわ"
|
driveFileDurationWarn: "音が長すぎるわ"
|
||||||
driveFileDurationWarnDescription: "長い音使うたらMisskey使うのに良うないかもしれへんで。それでもええか?"
|
driveFileDurationWarnDescription: "長い音使うたらMisskey使うのに良うないかもしれへんで。それでもええか?"
|
||||||
|
driveFileError: "音声が読み込めへんかったで。設定を変更せえや"
|
||||||
_ago:
|
_ago:
|
||||||
future: "未来"
|
future: "未来"
|
||||||
justNow: "ついさっき"
|
justNow: "ついさっき"
|
||||||
|
@ -2351,6 +2384,7 @@ _deck:
|
||||||
alwaysShowMainColumn: "いつもメインカラムを表示"
|
alwaysShowMainColumn: "いつもメインカラムを表示"
|
||||||
columnAlign: "カラムの寄せ"
|
columnAlign: "カラムの寄せ"
|
||||||
addColumn: "カラムを追加"
|
addColumn: "カラムを追加"
|
||||||
|
newNoteNotificationSettings: "新着ノート通知の設定"
|
||||||
configureColumn: "カラムの設定"
|
configureColumn: "カラムの設定"
|
||||||
swapLeft: "左に移動"
|
swapLeft: "左に移動"
|
||||||
swapRight: "右に移動"
|
swapRight: "右に移動"
|
||||||
|
@ -2389,9 +2423,10 @@ _drivecleaner:
|
||||||
orderByCreatedAtAsc: "追加日の古い順"
|
orderByCreatedAtAsc: "追加日の古い順"
|
||||||
_webhookSettings:
|
_webhookSettings:
|
||||||
createWebhook: "Webhookをつくる"
|
createWebhook: "Webhookをつくる"
|
||||||
|
modifyWebhook: "Webhookを編集"
|
||||||
name: "名前"
|
name: "名前"
|
||||||
secret: "シークレット"
|
secret: "シークレット"
|
||||||
events: "Webhookを投げるタイミング"
|
trigger: "トリガー"
|
||||||
active: "有効"
|
active: "有効"
|
||||||
_events:
|
_events:
|
||||||
follow: "フォローしたとき~!"
|
follow: "フォローしたとき~!"
|
||||||
|
@ -2401,11 +2436,25 @@ _webhookSettings:
|
||||||
renote: "リノートされるとき~!"
|
renote: "リノートされるとき~!"
|
||||||
reaction: "ツッコまれたとき~!"
|
reaction: "ツッコまれたとき~!"
|
||||||
mention: "メンションがあるとき~!"
|
mention: "メンションがあるとき~!"
|
||||||
|
_systemEvents:
|
||||||
|
abuseReport: "ユーザーから通報があったとき"
|
||||||
|
abuseReportResolved: "ユーザーからの通報を処理したとき"
|
||||||
|
userCreated: "ユーザーが作成されたとき"
|
||||||
deleteConfirm: "ほんまにWebhookをほかしてもええんか?"
|
deleteConfirm: "ほんまにWebhookをほかしてもええんか?"
|
||||||
_abuseReport:
|
_abuseReport:
|
||||||
_notificationRecipient:
|
_notificationRecipient:
|
||||||
|
createRecipient: "通報の通知先を追加"
|
||||||
|
modifyRecipient: "通報の通知先を編集"
|
||||||
|
recipientType: "通知先の種類"
|
||||||
_recipientType:
|
_recipientType:
|
||||||
mail: "メール"
|
mail: "メール"
|
||||||
|
webhook: "Webhook"
|
||||||
|
_captions:
|
||||||
|
mail: "モデレーター権限を持つユーザーのメアドに通知を送るで(通報を受けた時のみ)"
|
||||||
|
webhook: "指定したSystemWebhookに通知を送るで(通報を受けた時と通報を解決した時にそれぞれ発信)"
|
||||||
|
keywords: "キーワード"
|
||||||
|
notifiedUser: "通知先ユーザー"
|
||||||
|
notifiedWebhook: "使用するWebhook"
|
||||||
deleteConfirm: "通知先を削除してもええか?"
|
deleteConfirm: "通知先を削除してもええか?"
|
||||||
_moderationLogTypes:
|
_moderationLogTypes:
|
||||||
createRole: "ロールを追加すんで"
|
createRole: "ロールを追加すんで"
|
||||||
|
@ -2444,6 +2493,8 @@ _moderationLogTypes:
|
||||||
deleteAvatarDecoration: "アイコンデコレーションを削除"
|
deleteAvatarDecoration: "アイコンデコレーションを削除"
|
||||||
unsetUserAvatar: "この子のアイコン元に戻す"
|
unsetUserAvatar: "この子のアイコン元に戻す"
|
||||||
unsetUserBanner: "この子のバナー元に戻す"
|
unsetUserBanner: "この子のバナー元に戻す"
|
||||||
|
createSystemWebhook: "SystemWebhookを作成"
|
||||||
|
updateSystemWebhook: "SystemWebhookを更新"
|
||||||
_fileViewer:
|
_fileViewer:
|
||||||
title: "ファイルの詳しい情報"
|
title: "ファイルの詳しい情報"
|
||||||
type: "ファイルの種類"
|
type: "ファイルの種類"
|
||||||
|
|
|
@ -2411,7 +2411,6 @@ _webhookSettings:
|
||||||
modifyWebhook: "Webhook 수정"
|
modifyWebhook: "Webhook 수정"
|
||||||
name: "이름"
|
name: "이름"
|
||||||
secret: "시크릿"
|
secret: "시크릿"
|
||||||
events: "Webhook을 실행할 타이밍"
|
|
||||||
active: "활성화"
|
active: "활성화"
|
||||||
_events:
|
_events:
|
||||||
follow: "누군가를 팔로우했을 때"
|
follow: "누군가를 팔로우했을 때"
|
||||||
|
|
|
@ -1544,7 +1544,6 @@ _webhookSettings:
|
||||||
createWebhook: "Stwórz Webhook"
|
createWebhook: "Stwórz Webhook"
|
||||||
name: "Nazwa"
|
name: "Nazwa"
|
||||||
secret: "Sekret"
|
secret: "Sekret"
|
||||||
events: "Uruchomienie Webhooka"
|
|
||||||
active: "Właczono"
|
active: "Właczono"
|
||||||
_events:
|
_events:
|
||||||
follow: "Po zaobserwowaniu użytkownika"
|
follow: "Po zaobserwowaniu użytkownika"
|
||||||
|
|
1252
locales/pt-PT.yml
1252
locales/pt-PT.yml
File diff suppressed because it is too large
Load Diff
|
@ -60,6 +60,7 @@ copyFileId: "คัดลอกไฟล์ ID"
|
||||||
copyFolderId: "คัดลอกโฟลเดอร์ ID"
|
copyFolderId: "คัดลอกโฟลเดอร์ ID"
|
||||||
copyProfileUrl: "คัดลอกโปรไฟล์ URL"
|
copyProfileUrl: "คัดลอกโปรไฟล์ URL"
|
||||||
searchUser: "ค้นหาผู้ใช้"
|
searchUser: "ค้นหาผู้ใช้"
|
||||||
|
searchThisUsersNotes: "ค้นหาโน้ตของผู้ใช้"
|
||||||
reply: "ตอบกลับ"
|
reply: "ตอบกลับ"
|
||||||
loadMore: "แสดงเพิ่มเติม"
|
loadMore: "แสดงเพิ่มเติม"
|
||||||
showMore: "แสดงเพิ่มเติม"
|
showMore: "แสดงเพิ่มเติม"
|
||||||
|
@ -154,6 +155,7 @@ editList: "แก้ไขรายชื่อ"
|
||||||
selectChannel: "เลือกช่อง"
|
selectChannel: "เลือกช่อง"
|
||||||
selectAntenna: "เลือกเสาอากาศ"
|
selectAntenna: "เลือกเสาอากาศ"
|
||||||
editAntenna: "แก้ไขเสาอากาศ"
|
editAntenna: "แก้ไขเสาอากาศ"
|
||||||
|
createAntenna: "สร้างเสาอากาศ"
|
||||||
selectWidget: "เลือกวิดเจ็ต"
|
selectWidget: "เลือกวิดเจ็ต"
|
||||||
editWidgets: "แก้ไขวิดเจ็ต"
|
editWidgets: "แก้ไขวิดเจ็ต"
|
||||||
editWidgetsExit: "เรียบร้อย"
|
editWidgetsExit: "เรียบร้อย"
|
||||||
|
@ -194,6 +196,7 @@ followConfirm: "ต้องการติดตาม {name} ใช่ไห
|
||||||
proxyAccount: "บัญชีพร็อกซี่"
|
proxyAccount: "บัญชีพร็อกซี่"
|
||||||
proxyAccountDescription: "บัญชีพร็อกซี คือ บัญชีที่ทำหน้าที่ติดตาม(ผู้ใช้)ระยะไกลภายใต้เงื่อนไขบางประการ ตัวอย่างเช่น เมื่อผู้ใช้ท้องถิ่นเพิ่มผู้ใช้ระยะไกลลงรายชื่อ หากไม่มีใครติดตามผู้ใช้ระยะไกลในรายชื่อนั้น กิจกรรมก็จะไม่ถูกส่งมายังเซิร์ฟเวอร์ ดังนั้นจึงมีบัญชีพร็อกซีไว้ติดตามผู้ใช้ระยะไกลเหล่านั้น"
|
proxyAccountDescription: "บัญชีพร็อกซี คือ บัญชีที่ทำหน้าที่ติดตาม(ผู้ใช้)ระยะไกลภายใต้เงื่อนไขบางประการ ตัวอย่างเช่น เมื่อผู้ใช้ท้องถิ่นเพิ่มผู้ใช้ระยะไกลลงรายชื่อ หากไม่มีใครติดตามผู้ใช้ระยะไกลในรายชื่อนั้น กิจกรรมก็จะไม่ถูกส่งมายังเซิร์ฟเวอร์ ดังนั้นจึงมีบัญชีพร็อกซีไว้ติดตามผู้ใช้ระยะไกลเหล่านั้น"
|
||||||
host: "โฮสต์"
|
host: "โฮสต์"
|
||||||
|
selectSelf: "เลือกตัวเอง"
|
||||||
selectUser: "เลือกผู้ใช้งาน"
|
selectUser: "เลือกผู้ใช้งาน"
|
||||||
recipient: "ผู้รับ"
|
recipient: "ผู้รับ"
|
||||||
annotation: "หมายเหตุประกอบ"
|
annotation: "หมายเหตุประกอบ"
|
||||||
|
@ -209,6 +212,7 @@ perDay: "ต่อวัน"
|
||||||
stopActivityDelivery: "หยุดส่งกิจกรรม"
|
stopActivityDelivery: "หยุดส่งกิจกรรม"
|
||||||
blockThisInstance: "บล็อกเซิร์ฟเวอร์นี้"
|
blockThisInstance: "บล็อกเซิร์ฟเวอร์นี้"
|
||||||
silenceThisInstance: "ปิดปากเซิร์ฟเวอร์นี้"
|
silenceThisInstance: "ปิดปากเซิร์ฟเวอร์นี้"
|
||||||
|
mediaSilenceThisInstance: "ปิดปากสื่อของเซิร์ฟเวอร์นี้"
|
||||||
operations: "ดำเนินการ"
|
operations: "ดำเนินการ"
|
||||||
software: "ซอฟต์แวร์"
|
software: "ซอฟต์แวร์"
|
||||||
version: "เวอร์ชั่น"
|
version: "เวอร์ชั่น"
|
||||||
|
@ -230,6 +234,8 @@ blockedInstances: "เซิร์ฟเวอร์ที่ถูกบล็
|
||||||
blockedInstancesDescription: "ระบุโฮสต์ของเซิร์ฟเวอร์ที่ต้องการบล็อก คั่นด้วยการขึ้นบรรทัดใหม่ เซิร์ฟเวอร์ที่ถูกบล็อกจะไม่สามารถติดต่อกับอินสแตนซ์นี้ได้"
|
blockedInstancesDescription: "ระบุโฮสต์ของเซิร์ฟเวอร์ที่ต้องการบล็อก คั่นด้วยการขึ้นบรรทัดใหม่ เซิร์ฟเวอร์ที่ถูกบล็อกจะไม่สามารถติดต่อกับอินสแตนซ์นี้ได้"
|
||||||
silencedInstances: "ปิดปากเซิร์ฟเวอร์นี้แล้ว"
|
silencedInstances: "ปิดปากเซิร์ฟเวอร์นี้แล้ว"
|
||||||
silencedInstancesDescription: "ระบุโฮสต์ของเซิร์ฟเวอร์ที่ต้องการปิดปาก คั่นด้วยการขึ้นบรรทัดใหม่, บัญชีทั้งหมดของเซิร์ฟเวอร์ดังกล่าวจะถือว่าถูกปิดปากเช่นกัน ทำได้เฉพาะคำขอติดตามเท่านั้น และไม่สามารถกล่าวถึงบัญชีในเซิร์ฟเวอร์นี้ได้หากไม่ได้ถูกติดตามกลับ | สิ่งนี้ไม่มีผลต่ออินสแตนซ์ที่ถูกบล็อก"
|
silencedInstancesDescription: "ระบุโฮสต์ของเซิร์ฟเวอร์ที่ต้องการปิดปาก คั่นด้วยการขึ้นบรรทัดใหม่, บัญชีทั้งหมดของเซิร์ฟเวอร์ดังกล่าวจะถือว่าถูกปิดปากเช่นกัน ทำได้เฉพาะคำขอติดตามเท่านั้น และไม่สามารถกล่าวถึงบัญชีในเซิร์ฟเวอร์นี้ได้หากไม่ได้ถูกติดตามกลับ | สิ่งนี้ไม่มีผลต่ออินสแตนซ์ที่ถูกบล็อก"
|
||||||
|
mediaSilencedInstances: "เซิร์ฟเวอร์ที่ถูกปิดปากสื่อ"
|
||||||
|
mediaSilencedInstancesDescription: "ระบุโฮสต์ของเซิร์ฟเวอร์ที่ต้องการปิดปากสื่อ คั่นด้วยการขึ้นบรรทัดใหม่, ไฟล์ที่ถูกส่งจากบัญชีของเซิร์ฟเวอร์ดังกล่าวจะถือว่าถูกปิดปาก แล้วจะถูกติดเครื่องหมายว่ามีเนื้อหาละเอียดอ่อน และเอโมจิแบบกำหนดเองก็จะใช้ไม่ได้ด้วย | สิ่งนี้ไม่มีผลต่ออินสแตนซ์ที่ถูกบล็อก"
|
||||||
muteAndBlock: "ปิดเสียงและบล็อก"
|
muteAndBlock: "ปิดเสียงและบล็อก"
|
||||||
mutedUsers: "ผู้ใช้ที่ถูกปิดเสียง"
|
mutedUsers: "ผู้ใช้ที่ถูกปิดเสียง"
|
||||||
blockedUsers: "ผู้ใช้ที่ถูกบล็อก"
|
blockedUsers: "ผู้ใช้ที่ถูกบล็อก"
|
||||||
|
@ -881,7 +887,7 @@ accountDeletionInProgress: "กำลังดำเนินการลบบ
|
||||||
usernameInfo: "ชื่อที่ระบุบัญชีของคุณจากผู้อื่นในเซิร์ฟเวอร์นี้ คุณสามารถใช้ตัวอักษร (a~z, A~Z), ตัวเลข (0~9) หรือขีดล่าง (_) ชื่อผู้ใช้ไม่สามารถเปลี่ยนแปลงได้ในภายหลัง"
|
usernameInfo: "ชื่อที่ระบุบัญชีของคุณจากผู้อื่นในเซิร์ฟเวอร์นี้ คุณสามารถใช้ตัวอักษร (a~z, A~Z), ตัวเลข (0~9) หรือขีดล่าง (_) ชื่อผู้ใช้ไม่สามารถเปลี่ยนแปลงได้ในภายหลัง"
|
||||||
aiChanMode: "โหมด Ai "
|
aiChanMode: "โหมด Ai "
|
||||||
devMode: "โหมดนักพัฒนา"
|
devMode: "โหมดนักพัฒนา"
|
||||||
keepCw: "เก็บคำเตือนเนื้อหา"
|
keepCw: "คงการเตือนเนื้อหาไว้"
|
||||||
pubSub: "บัญชี Pub/Sub"
|
pubSub: "บัญชี Pub/Sub"
|
||||||
lastCommunication: "การสื่อสารครั้งสุดท้ายล่าสุด"
|
lastCommunication: "การสื่อสารครั้งสุดท้ายล่าสุด"
|
||||||
resolved: "คลี่คลายแล้ว"
|
resolved: "คลี่คลายแล้ว"
|
||||||
|
@ -1028,15 +1034,15 @@ achievements: "ความสำเร็จ"
|
||||||
gotInvalidResponseError: "การตอบสนองเซิร์ฟเวอร์ไม่ถูกต้อง"
|
gotInvalidResponseError: "การตอบสนองเซิร์ฟเวอร์ไม่ถูกต้อง"
|
||||||
gotInvalidResponseErrorDescription: "เซิร์ฟเวอร์อาจไม่สามารถเข้าถึงได้หรืออาจจะกำลังอยู่ในระหว่างปรับปรุง กรุณาลองใหม่อีกครั้งในภายหลังนะคะ"
|
gotInvalidResponseErrorDescription: "เซิร์ฟเวอร์อาจไม่สามารถเข้าถึงได้หรืออาจจะกำลังอยู่ในระหว่างปรับปรุง กรุณาลองใหม่อีกครั้งในภายหลังนะคะ"
|
||||||
thisPostMayBeAnnoying: "โน้ตนี้อาจจะเป็นการรบกวนผู้อื่นนะคะ"
|
thisPostMayBeAnnoying: "โน้ตนี้อาจจะเป็นการรบกวนผู้อื่นนะคะ"
|
||||||
thisPostMayBeAnnoyingHome: "โพสต์ไปยังไทม์ไลน์หลัก"
|
thisPostMayBeAnnoyingHome: "โพสต์ลงไทม์ไลน์หลักเท่านั้น"
|
||||||
thisPostMayBeAnnoyingCancel: "เลิก"
|
thisPostMayBeAnnoyingCancel: "ยกเลิก"
|
||||||
thisPostMayBeAnnoyingIgnore: "โพสต์ยังไงก็แล้วแต่"
|
thisPostMayBeAnnoyingIgnore: "โพสต์ไปเลย ไม่ต้องปรับการมองเห็น"
|
||||||
collapseRenotes: "ยุบรีโน้ตที่คุณเคยเห็นแล้ว"
|
collapseRenotes: "ยุบรีโน้ตที่คุณเคยเห็นแล้ว"
|
||||||
collapseRenotesDescription: "พับย่อโน้ตที่เคยตอบสนองหรือรีโน้ตแล้ว"
|
collapseRenotesDescription: "พับย่อโน้ตที่เคยตอบสนองหรือรีโน้ตแล้ว"
|
||||||
internalServerError: "เซิร์ฟเวอร์ภายในเกิดข้อผิดพลาด"
|
internalServerError: "เซิร์ฟเวอร์ภายในเกิดข้อผิดพลาด"
|
||||||
internalServerErrorDescription: "เกิดข้อผิดพลาดที่ไม่คาดคิดภายในเซิร์ฟเวอร์"
|
internalServerErrorDescription: "เกิดข้อผิดพลาดที่ไม่คาดคิดภายในเซิร์ฟเวอร์"
|
||||||
copyErrorInfo: "คัดลอกรายละเอียดข้อผิดพลาด"
|
copyErrorInfo: "คัดลอกรายละเอียดข้อผิดพลาด"
|
||||||
joinThisServer: "ลงทะเบียนบนเซิร์ฟเวอร์นี้"
|
joinThisServer: "ลงทะเบียนในเซิร์ฟเวอร์นี้"
|
||||||
exploreOtherServers: "มองหาเซิร์ฟเวอร์อื่น"
|
exploreOtherServers: "มองหาเซิร์ฟเวอร์อื่น"
|
||||||
letsLookAtTimeline: "มาดูไทม์ไลน์กัน"
|
letsLookAtTimeline: "มาดูไทม์ไลน์กัน"
|
||||||
disableFederationConfirm: "ปิดใช้งานสหพันธ์เลยใช่ไหม?"
|
disableFederationConfirm: "ปิดใช้งานสหพันธ์เลยใช่ไหม?"
|
||||||
|
@ -1099,13 +1105,15 @@ vertical: "แนวตั้ง"
|
||||||
horizontal: "แนวนอน"
|
horizontal: "แนวนอน"
|
||||||
position: "ตำแหน่ง"
|
position: "ตำแหน่ง"
|
||||||
serverRules: "กฎของเซิร์ฟเวอร์"
|
serverRules: "กฎของเซิร์ฟเวอร์"
|
||||||
pleaseConfirmBelowBeforeSignup: "หากต้องการลงทะเบียนบนเซิร์ฟเวอร์นี้ คุณต้องตรวจสอบและยอมรับสิ่งต่อไปนี้"
|
pleaseConfirmBelowBeforeSignup: "หากต้องการลงทะเบียนในเซิร์ฟเวอร์นี้ คุณต้องตรวจสอบและยอมรับสิ่งต่อไปนี้"
|
||||||
pleaseAgreeAllToContinue: "คุณต้องยอมรับทุกช่องตรงด้านบนเพื่อดำเนินการต่อค่ะ"
|
pleaseAgreeAllToContinue: "คุณต้องยอมรับทุกช่องตรงด้านบนเพื่อดำเนินการต่อค่ะ"
|
||||||
continue: "ดำเนินการต่อ"
|
continue: "ดำเนินการต่อ"
|
||||||
preservedUsernames: "ชื่อผู้ใช้ที่สงวนไว้"
|
preservedUsernames: "ชื่อผู้ใช้ที่สงวนไว้"
|
||||||
preservedUsernamesDescription: "ระบุชื่อผู้ใช้ที่จะสงวนชื่อไว้ คั่นด้วยการขึ้นบรรทัดใหม่ ชื่อผู้ใช้ที่ระบุที่นี่จะไม่สามารถใช้งานได้อีกต่อไปเมื่อสร้างบัญชีใหม่ ยกเว้นเมื่อผู้ดูแลระบบสร้างบัญชี นอกจากนี้ บัญชีที่มีอยู่แล้วจะไม่ได้รับผลกระทบ"
|
preservedUsernamesDescription: "ระบุชื่อผู้ใช้ที่จะสงวนชื่อไว้ คั่นด้วยการขึ้นบรรทัดใหม่ ชื่อผู้ใช้ที่ระบุที่นี่จะไม่สามารถใช้งานได้อีกต่อไปเมื่อสร้างบัญชีใหม่ ยกเว้นเมื่อผู้ดูแลระบบสร้างบัญชี นอกจากนี้ บัญชีที่มีอยู่แล้วจะไม่ได้รับผลกระทบ"
|
||||||
createNoteFromTheFile: "เรียบเรียงโน้ตจากไฟล์นี้"
|
createNoteFromTheFile: "เรียบเรียงโน้ตจากไฟล์นี้"
|
||||||
archive: "เก็บถาวร"
|
archive: "เก็บถาวร"
|
||||||
|
archived: "เก็บถาวรแล้ว"
|
||||||
|
unarchive: "เลิกการเก็บถาวร"
|
||||||
channelArchiveConfirmTitle: "ต้องการเก็บถาวรเจ้า {name} ใช่ไหม?"
|
channelArchiveConfirmTitle: "ต้องการเก็บถาวรเจ้า {name} ใช่ไหม?"
|
||||||
channelArchiveConfirmDescription: "เมื่อเก็บถาวรแล้ว จะไม่ปรากฏในรายการช่องหรือผลการค้นหาอีกต่อไป และจะไม่สามารถโพสต์ใหม่ได้อีกต่อไป"
|
channelArchiveConfirmDescription: "เมื่อเก็บถาวรแล้ว จะไม่ปรากฏในรายการช่องหรือผลการค้นหาอีกต่อไป และจะไม่สามารถโพสต์ใหม่ได้อีกต่อไป"
|
||||||
thisChannelArchived: "ช่องนี้ถูกเก็บถาวรแล้วนะ"
|
thisChannelArchived: "ช่องนี้ถูกเก็บถาวรแล้วนะ"
|
||||||
|
@ -1116,6 +1124,9 @@ preventAiLearning: "ปฏิเสธการเรียนรู้ด้ว
|
||||||
preventAiLearningDescription: "ส่งคำร้องขอไม่ให้ใช้ ข้อความในโน้ตที่โพสต์, หรือเนื้อหารูปภาพ ฯลฯ ในการเรียนรู้ของเครื่อง(machine learning) / Predictive AI / Generative AI โดยการเพิ่มแฟล็ก “noai” ลง HTML-Response ให้กับเนื้อหาที่เกี่ยวข้อง แต่ทั้งนี้ ไม่ได้ป้องกัน AI จากการเรียนรู้ได้อย่างสมบูรณ์ เนื่องจากมี AI บางตัวเท่านั้นที่จะเคารพคำขอดังกล่าว"
|
preventAiLearningDescription: "ส่งคำร้องขอไม่ให้ใช้ ข้อความในโน้ตที่โพสต์, หรือเนื้อหารูปภาพ ฯลฯ ในการเรียนรู้ของเครื่อง(machine learning) / Predictive AI / Generative AI โดยการเพิ่มแฟล็ก “noai” ลง HTML-Response ให้กับเนื้อหาที่เกี่ยวข้อง แต่ทั้งนี้ ไม่ได้ป้องกัน AI จากการเรียนรู้ได้อย่างสมบูรณ์ เนื่องจากมี AI บางตัวเท่านั้นที่จะเคารพคำขอดังกล่าว"
|
||||||
options: "ตัวเลือกบทบาท"
|
options: "ตัวเลือกบทบาท"
|
||||||
specifyUser: "ผู้ใช้เฉพาะ"
|
specifyUser: "ผู้ใช้เฉพาะ"
|
||||||
|
lookupConfirm: "ต้องการเรียกดูข้อมูลใช่ไหม?"
|
||||||
|
openTagPageConfirm: "ต้องการเปิดหน้าแฮชแท็กใช่ไหม?"
|
||||||
|
specifyHost: "ระบุโฮสต์"
|
||||||
failedToPreviewUrl: "ไม่สามารถดูตัวอย่างได้"
|
failedToPreviewUrl: "ไม่สามารถดูตัวอย่างได้"
|
||||||
update: "อัปเดต"
|
update: "อัปเดต"
|
||||||
rolesThatCanBeUsedThisEmojiAsReaction: "บทบาทที่สามารถใช้เอโมจินี้เป็นรีแอคชั่นได้"
|
rolesThatCanBeUsedThisEmojiAsReaction: "บทบาทที่สามารถใช้เอโมจินี้เป็นรีแอคชั่นได้"
|
||||||
|
@ -1250,6 +1261,8 @@ inquiry: "ติดต่อเรา"
|
||||||
tryAgain: "โปรดลองอีกครั้ง"
|
tryAgain: "โปรดลองอีกครั้ง"
|
||||||
confirmWhenRevealingSensitiveMedia: "ตรวจสอบก่อนแสดงสื่อที่มีเนื้อหาละเอียดอ่อน"
|
confirmWhenRevealingSensitiveMedia: "ตรวจสอบก่อนแสดงสื่อที่มีเนื้อหาละเอียดอ่อน"
|
||||||
sensitiveMediaRevealConfirm: "สื่อนี้มีเนื้อหาละเอียดอ่อน, ต้องการแสดงใช่ไหม?"
|
sensitiveMediaRevealConfirm: "สื่อนี้มีเนื้อหาละเอียดอ่อน, ต้องการแสดงใช่ไหม?"
|
||||||
|
createdLists: "รายชื่อที่ถูกสร้าง"
|
||||||
|
createdAntennas: "เสาอากาศที่ถูกสร้าง"
|
||||||
_delivery:
|
_delivery:
|
||||||
status: "สถานะการจัดส่ง"
|
status: "สถานะการจัดส่ง"
|
||||||
stop: "ระงับการส่ง"
|
stop: "ระงับการส่ง"
|
||||||
|
@ -1348,9 +1361,9 @@ _initialTutorial:
|
||||||
localOnly: "การโพสต์ด้วย flag นี้จะไม่รวมโน้ตไปยังเซิร์ฟเวอร์อื่น ผู้ใช้บนเซิร์ฟเวอร์อื่นจะไม่สามารถดูโน้ตเหล่านี้ได้โดยตรง โดยไม่คำนึงถึงการตั้งค่าการแสดงผลข้างต้น"
|
localOnly: "การโพสต์ด้วย flag นี้จะไม่รวมโน้ตไปยังเซิร์ฟเวอร์อื่น ผู้ใช้บนเซิร์ฟเวอร์อื่นจะไม่สามารถดูโน้ตเหล่านี้ได้โดยตรง โดยไม่คำนึงถึงการตั้งค่าการแสดงผลข้างต้น"
|
||||||
_cw:
|
_cw:
|
||||||
title: "คำเตือนเกี่ยวกับเนื้อหา"
|
title: "คำเตือนเกี่ยวกับเนื้อหา"
|
||||||
description: "เนื้อหาที่เขียนด้วย “คำอธิบายประกอบ” จะแสดงแทนข้อความหลัก คลิก “ดูเพิ่มเติม” เพื่อแสดงข้อความเต็ม"
|
description: "เนื้อหาที่เขียนใน “คำอธิบายประกอบ” จะแสดงแทนเนื้อหาหลัก ต้องคลิก “ดูเพิ่มเติม” เพื่อให้เนื้อหาหลักแสดง"
|
||||||
_exampleNote:
|
_exampleNote:
|
||||||
cw: "นี่อาจจะทำให้คุณหิวอย่างแน่นอน!"
|
cw: " ห้ามดู ระวังหิว"
|
||||||
note: "เพิ่งไปกินโดนัทเคลือบช็อคโกแลตมา 🍩😋"
|
note: "เพิ่งไปกินโดนัทเคลือบช็อคโกแลตมา 🍩😋"
|
||||||
useCases: "ใช้สิ่งนี้เพื่อระบุโน้ตที่ต้องตามแนวทางปฏิบัติของเซิร์ฟเวอร์ หรือเพื่อควบคุมการสปอยล์และข้อความที่ละเอียดอ่อนด้วยตนเอง"
|
useCases: "ใช้สิ่งนี้เพื่อระบุโน้ตที่ต้องตามแนวทางปฏิบัติของเซิร์ฟเวอร์ หรือเพื่อควบคุมการสปอยล์และข้อความที่ละเอียดอ่อนด้วยตนเอง"
|
||||||
_howToMakeAttachmentsSensitive:
|
_howToMakeAttachmentsSensitive:
|
||||||
|
@ -1466,15 +1479,15 @@ _achievements:
|
||||||
title: "มือใหม่ III"
|
title: "มือใหม่ III"
|
||||||
description: "เข้าสู่ระบบเป็นเวลารวม 15 วัน"
|
description: "เข้าสู่ระบบเป็นเวลารวม 15 วัน"
|
||||||
_login30:
|
_login30:
|
||||||
title: "มิสคิสท์ I"
|
title: "มิสคิสต์ I"
|
||||||
description: "เข้าสู่ระบบเป็นเวลารวม 30 วัน"
|
description: "เข้าสู่ระบบเป็นเวลารวม 30 วัน"
|
||||||
_login60:
|
_login60:
|
||||||
title: "มิสคิสท์ II"
|
title: "มิสคิสต์ II"
|
||||||
description: "เข้าสู่ระบบเป็นเวลารวม 60 วัน"
|
description: "เข้าสู่ระบบเป็นเวลารวม 60 วัน"
|
||||||
_login100:
|
_login100:
|
||||||
title: "มิสคิสท์ III"
|
title: "มิสคิสต์ III"
|
||||||
description: "เข้าสู่ระบบเป็นเวลารวม 100 วัน"
|
description: "เข้าสู่ระบบเป็นเวลารวม 100 วัน"
|
||||||
flavor: "มิสคิสต์หัวรุนแรง"
|
flavor: "Violent Misskist (ทำไมเหมือนชื่อหนังสักเรื่องจังเลยนะ)"
|
||||||
_login200:
|
_login200:
|
||||||
title: "ลูกค้าประจำ I"
|
title: "ลูกค้าประจำ I"
|
||||||
description: "เข้าสู่ระบบเป็นเวลารวม 200 วัน"
|
description: "เข้าสู่ระบบเป็นเวลารวม 200 วัน"
|
||||||
|
@ -1954,6 +1967,7 @@ _soundSettings:
|
||||||
driveFileTypeWarnDescription: "กรุณาเลือกไฟล์เสียง"
|
driveFileTypeWarnDescription: "กรุณาเลือกไฟล์เสียง"
|
||||||
driveFileDurationWarn: "เสียงยาวเกินไป"
|
driveFileDurationWarn: "เสียงยาวเกินไป"
|
||||||
driveFileDurationWarnDescription: "การใช้เสียงที่ยาว อาจรบกวนการใช้งาน Misskey, ต้องการดำเนินการต่อใช่ไหม?"
|
driveFileDurationWarnDescription: "การใช้เสียงที่ยาว อาจรบกวนการใช้งาน Misskey, ต้องการดำเนินการต่อใช่ไหม?"
|
||||||
|
driveFileError: "ไม่สามารถโหลดไฟล์เสียงได้ กรุณาเปลี่ยนแปลงการตั้งค่า"
|
||||||
_ago:
|
_ago:
|
||||||
future: "อนาคต"
|
future: "อนาคต"
|
||||||
justNow: "เมื่อกี๊นี้"
|
justNow: "เมื่อกี๊นี้"
|
||||||
|
@ -2141,7 +2155,7 @@ _widgets:
|
||||||
serverMetric: "ตัวชี้วัดเซิร์ฟเวอร์"
|
serverMetric: "ตัวชี้วัดเซิร์ฟเวอร์"
|
||||||
aiscript: " คอนโซล AiScript"
|
aiscript: " คอนโซล AiScript"
|
||||||
aiscriptApp: "แอป AiScript"
|
aiscriptApp: "แอป AiScript"
|
||||||
aichan: "ไอ"
|
aichan: "藍 (ไอ)"
|
||||||
userList: "รายชื่อผู้ใช้"
|
userList: "รายชื่อผู้ใช้"
|
||||||
_userList:
|
_userList:
|
||||||
chooseList: "เลือกรายชื่อ"
|
chooseList: "เลือกรายชื่อ"
|
||||||
|
@ -2183,7 +2197,7 @@ _visibility:
|
||||||
followersDescription: "เฉพาะผู้ติดตามเท่านั้นที่มองเห็นได้"
|
followersDescription: "เฉพาะผู้ติดตามเท่านั้นที่มองเห็นได้"
|
||||||
specified: "ไดเร็ค"
|
specified: "ไดเร็ค"
|
||||||
specifiedDescription: "ทำให้มองเห็นได้เฉพาะผู้ใช้ที่ระบุเท่านั้น"
|
specifiedDescription: "ทำให้มองเห็นได้เฉพาะผู้ใช้ที่ระบุเท่านั้น"
|
||||||
disableFederation: "ไม่มีสหพันธ์"
|
disableFederation: "การปิดใช้งานสหพันธ์"
|
||||||
disableFederationDescription: "อย่าส่งข้อมูลไปยังเซิร์ฟเวอร์อื่น"
|
disableFederationDescription: "อย่าส่งข้อมูลไปยังเซิร์ฟเวอร์อื่น"
|
||||||
_postForm:
|
_postForm:
|
||||||
replyPlaceholder: "ตอบกลับโน้ตนี้..."
|
replyPlaceholder: "ตอบกลับโน้ตนี้..."
|
||||||
|
@ -2412,7 +2426,7 @@ _webhookSettings:
|
||||||
modifyWebhook: "แก้ไข Webhook"
|
modifyWebhook: "แก้ไข Webhook"
|
||||||
name: "ชื่อ"
|
name: "ชื่อ"
|
||||||
secret: "ความลับ"
|
secret: "ความลับ"
|
||||||
events: "อีเว้นท์ Webhook"
|
trigger: "ทริกเกอร์"
|
||||||
active: "เปิดใช้งาน"
|
active: "เปิดใช้งาน"
|
||||||
_events:
|
_events:
|
||||||
follow: "เมื่อกำลังติดตามผู้ใช้"
|
follow: "เมื่อกำลังติดตามผู้ใช้"
|
||||||
|
@ -2536,7 +2550,7 @@ _externalResourceInstaller:
|
||||||
description: "เกิดปัญหาระหว่างการติดตั้งธีม กรุณาลองอีกครั้ง. รายละเอียดข้อผิดพลาดสามารถดูได้ในคอนโซล Javascript"
|
description: "เกิดปัญหาระหว่างการติดตั้งธีม กรุณาลองอีกครั้ง. รายละเอียดข้อผิดพลาดสามารถดูได้ในคอนโซล Javascript"
|
||||||
_dataSaver:
|
_dataSaver:
|
||||||
_media:
|
_media:
|
||||||
title: "โหลดมีเดีย"
|
title: "โหลดสื่อ"
|
||||||
description: "กันไม่ให้ภาพและวิดีโอโหลดโดยอัตโนมัติ แตะรูปภาพ/วิดีโอที่ซ่อนอยู่เพื่อโหลด"
|
description: "กันไม่ให้ภาพและวิดีโอโหลดโดยอัตโนมัติ แตะรูปภาพ/วิดีโอที่ซ่อนอยู่เพื่อโหลด"
|
||||||
_avatar:
|
_avatar:
|
||||||
title: "รูปไอคอน"
|
title: "รูปไอคอน"
|
||||||
|
@ -2616,3 +2630,8 @@ _mediaControls:
|
||||||
pip: "รูปภาพในรูปภาม"
|
pip: "รูปภาพในรูปภาม"
|
||||||
playbackRate: "ความเร็วในการเล่น"
|
playbackRate: "ความเร็วในการเล่น"
|
||||||
loop: "เล่นวนซ้ำ"
|
loop: "เล่นวนซ้ำ"
|
||||||
|
_contextMenu:
|
||||||
|
title: "เมนูเนื้อหา"
|
||||||
|
app: "แอปพลิเคชัน"
|
||||||
|
appWithShift: "แอปฟลิเคชันด้วยปุ่มยกแคร่ (Shift)"
|
||||||
|
native: "UI ของเบราว์เซอร์"
|
||||||
|
|
|
@ -1918,7 +1918,6 @@ _webhookSettings:
|
||||||
createWebhook: "Tạo Webhook"
|
createWebhook: "Tạo Webhook"
|
||||||
name: "Tên"
|
name: "Tên"
|
||||||
secret: "Mã bí mật"
|
secret: "Mã bí mật"
|
||||||
events: "Sự kiện Webhook"
|
|
||||||
active: "Đã bật"
|
active: "Đã bật"
|
||||||
_events:
|
_events:
|
||||||
reaction: "Khi nhận được sự kiện"
|
reaction: "Khi nhận được sự kiện"
|
||||||
|
|
|
@ -1665,6 +1665,7 @@ _achievements:
|
||||||
_bubbleGameDoubleExplodingHead:
|
_bubbleGameDoubleExplodingHead:
|
||||||
title: "两个🤯"
|
title: "两个🤯"
|
||||||
description: "你合成出了2个游戏里最大的Emoji"
|
description: "你合成出了2个游戏里最大的Emoji"
|
||||||
|
flavor: ""
|
||||||
_role:
|
_role:
|
||||||
new: "创建角色"
|
new: "创建角色"
|
||||||
edit: "编辑角色"
|
edit: "编辑角色"
|
||||||
|
@ -2315,6 +2316,7 @@ _pages:
|
||||||
eyeCatchingImageSet: "设置封面图片"
|
eyeCatchingImageSet: "设置封面图片"
|
||||||
eyeCatchingImageRemove: "删除封面图片"
|
eyeCatchingImageRemove: "删除封面图片"
|
||||||
chooseBlock: "添加块"
|
chooseBlock: "添加块"
|
||||||
|
enterSectionTitle: "输入会话标题"
|
||||||
selectType: "选择类型"
|
selectType: "选择类型"
|
||||||
contentBlocks: "内容"
|
contentBlocks: "内容"
|
||||||
inputBlocks: "输入"
|
inputBlocks: "输入"
|
||||||
|
@ -2425,7 +2427,7 @@ _webhookSettings:
|
||||||
modifyWebhook: "编辑 webhook"
|
modifyWebhook: "编辑 webhook"
|
||||||
name: "名称"
|
name: "名称"
|
||||||
secret: "密钥"
|
secret: "密钥"
|
||||||
events: "何时运行 Webhook"
|
trigger: "触发器"
|
||||||
active: "已启用"
|
active: "已启用"
|
||||||
_events:
|
_events:
|
||||||
follow: "关注时"
|
follow: "关注时"
|
||||||
|
@ -2498,6 +2500,10 @@ _moderationLogTypes:
|
||||||
createAbuseReportNotificationRecipient: "新建了举报通知"
|
createAbuseReportNotificationRecipient: "新建了举报通知"
|
||||||
updateAbuseReportNotificationRecipient: "更新了举报通知"
|
updateAbuseReportNotificationRecipient: "更新了举报通知"
|
||||||
deleteAbuseReportNotificationRecipient: "删除了举报通知"
|
deleteAbuseReportNotificationRecipient: "删除了举报通知"
|
||||||
|
deleteAccount: "删除了账户"
|
||||||
|
deletePage: "删除了页面"
|
||||||
|
deleteFlash: "删除了 Play"
|
||||||
|
deleteGalleryPost: "删除了图库稿件"
|
||||||
_fileViewer:
|
_fileViewer:
|
||||||
title: "文件信息"
|
title: "文件信息"
|
||||||
type: "文件类型"
|
type: "文件类型"
|
||||||
|
|
|
@ -1967,7 +1967,7 @@ _soundSettings:
|
||||||
driveFileTypeWarnDescription: "請選擇音效檔案"
|
driveFileTypeWarnDescription: "請選擇音效檔案"
|
||||||
driveFileDurationWarn: "音效太長了"
|
driveFileDurationWarn: "音效太長了"
|
||||||
driveFileDurationWarnDescription: "使用長音效檔可能會影響 Misskey 的使用體驗。仍要使用此檔案嗎?"
|
driveFileDurationWarnDescription: "使用長音效檔可能會影響 Misskey 的使用體驗。仍要使用此檔案嗎?"
|
||||||
driveFileError: "無法載入語音。請更改設定"
|
driveFileError: "無法載入語音。請變更設定"
|
||||||
_ago:
|
_ago:
|
||||||
future: "未來"
|
future: "未來"
|
||||||
justNow: "剛剛"
|
justNow: "剛剛"
|
||||||
|
@ -2316,6 +2316,7 @@ _pages:
|
||||||
eyeCatchingImageSet: "設定封面影像"
|
eyeCatchingImageSet: "設定封面影像"
|
||||||
eyeCatchingImageRemove: "刪除封面影像"
|
eyeCatchingImageRemove: "刪除封面影像"
|
||||||
chooseBlock: "新增方塊"
|
chooseBlock: "新增方塊"
|
||||||
|
enterSectionTitle: "輸入區段的標題"
|
||||||
selectType: "選擇類型"
|
selectType: "選擇類型"
|
||||||
contentBlocks: "內容"
|
contentBlocks: "內容"
|
||||||
inputBlocks: "輸入"
|
inputBlocks: "輸入"
|
||||||
|
@ -2426,7 +2427,7 @@ _webhookSettings:
|
||||||
modifyWebhook: "編輯 Webhook"
|
modifyWebhook: "編輯 Webhook"
|
||||||
name: "名字"
|
name: "名字"
|
||||||
secret: "密鑰"
|
secret: "密鑰"
|
||||||
events: "何時運行 Webhook"
|
trigger: "觸發器"
|
||||||
active: "已啟用"
|
active: "已啟用"
|
||||||
_events:
|
_events:
|
||||||
follow: "當你追隨時"
|
follow: "當你追隨時"
|
||||||
|
@ -2439,6 +2440,7 @@ _webhookSettings:
|
||||||
_systemEvents:
|
_systemEvents:
|
||||||
abuseReport: "當使用者檢舉時"
|
abuseReport: "當使用者檢舉時"
|
||||||
abuseReportResolved: "當處理了使用者的檢舉時"
|
abuseReportResolved: "當處理了使用者的檢舉時"
|
||||||
|
userCreated: "使用者被新增時"
|
||||||
deleteConfirm: "請問是否要刪除 Webhook?"
|
deleteConfirm: "請問是否要刪除 Webhook?"
|
||||||
_abuseReport:
|
_abuseReport:
|
||||||
_notificationRecipient:
|
_notificationRecipient:
|
||||||
|
@ -2498,6 +2500,10 @@ _moderationLogTypes:
|
||||||
createAbuseReportNotificationRecipient: "建立接收檢舉的通知對象"
|
createAbuseReportNotificationRecipient: "建立接收檢舉的通知對象"
|
||||||
updateAbuseReportNotificationRecipient: "更新接收檢舉的通知對象"
|
updateAbuseReportNotificationRecipient: "更新接收檢舉的通知對象"
|
||||||
deleteAbuseReportNotificationRecipient: "刪除接收檢舉的通知對象"
|
deleteAbuseReportNotificationRecipient: "刪除接收檢舉的通知對象"
|
||||||
|
deleteAccount: "刪除帳戶"
|
||||||
|
deletePage: "刪除頁面"
|
||||||
|
deleteFlash: "刪除 Play"
|
||||||
|
deleteGalleryPost: "刪除相簿的貼文"
|
||||||
_fileViewer:
|
_fileViewer:
|
||||||
title: "檔案詳細資訊"
|
title: "檔案詳細資訊"
|
||||||
type: "檔案類型 "
|
type: "檔案類型 "
|
||||||
|
@ -2632,4 +2638,5 @@ _mediaControls:
|
||||||
_contextMenu:
|
_contextMenu:
|
||||||
title: "內容功能表"
|
title: "內容功能表"
|
||||||
app: "應用程式"
|
app: "應用程式"
|
||||||
|
appWithShift: "Shift 鍵應用程式"
|
||||||
native: "瀏覽器的使用者介面"
|
native: "瀏覽器的使用者介面"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "misskey",
|
"name": "misskey",
|
||||||
"version": "2024.7.0-rc.8",
|
"version": "2024.8.0",
|
||||||
"codename": "nasubi",
|
"codename": "nasubi",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -8,7 +8,9 @@
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@9.6.0",
|
"packageManager": "pnpm@9.6.0",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
|
"packages/frontend-shared",
|
||||||
"packages/frontend",
|
"packages/frontend",
|
||||||
|
"packages/frontend-embed",
|
||||||
"packages/backend",
|
"packages/backend",
|
||||||
"packages/sw",
|
"packages/sw",
|
||||||
"packages/misskey-js",
|
"packages/misskey-js",
|
||||||
|
@ -35,6 +37,7 @@
|
||||||
"cy:open": "pnpm cypress open --browser --e2e --config-file=cypress.config.ts",
|
"cy:open": "pnpm cypress open --browser --e2e --config-file=cypress.config.ts",
|
||||||
"cy:run": "pnpm cypress run",
|
"cy:run": "pnpm cypress run",
|
||||||
"e2e": "pnpm start-server-and-test start:test http://localhost:61812 cy:run",
|
"e2e": "pnpm start-server-and-test start:test http://localhost:61812 cy:run",
|
||||||
|
"e2e-dev-container": "cp ./.config/cypress-devcontainer.yml ./.config/test.yml && pnpm start-server-and-test start:test http://localhost:61812 cy:run",
|
||||||
"jest": "cd packages/backend && pnpm jest",
|
"jest": "cd packages/backend && pnpm jest",
|
||||||
"jest-and-coverage": "cd packages/backend && pnpm jest-and-coverage",
|
"jest-and-coverage": "cd packages/backend && pnpm jest-and-coverage",
|
||||||
"test": "pnpm -r test",
|
"test": "pnpm -r test",
|
||||||
|
@ -61,7 +64,7 @@
|
||||||
"glob": "11.0.0"
|
"glob": "11.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@misskey-dev/eslint-plugin": "2.0.2",
|
"@misskey-dev/eslint-plugin": "2.0.3",
|
||||||
"@types/node": "20.14.12",
|
"@types/node": "20.14.12",
|
||||||
"@typescript-eslint/eslint-plugin": "7.17.0",
|
"@typescript-eslint/eslint-plugin": "7.17.0",
|
||||||
"@typescript-eslint/parser": "7.17.0",
|
"@typescript-eslint/parser": "7.17.0",
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
//@ts-check
|
||||||
|
(() => {
|
||||||
|
/** @type {NodeListOf<HTMLIFrameElement>} */
|
||||||
|
const els = document.querySelectorAll('iframe[data-misskey-embed-id]');
|
||||||
|
|
||||||
|
window.addEventListener('message', function (event) {
|
||||||
|
els.forEach((el) => {
|
||||||
|
if (event.source !== el.contentWindow) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const id = el.dataset.misskeyEmbedId;
|
||||||
|
|
||||||
|
if (event.data.type === 'misskey:embed:ready') {
|
||||||
|
el.contentWindow?.postMessage({
|
||||||
|
type: 'misskey:embedParent:registerIframeId',
|
||||||
|
payload: {
|
||||||
|
iframeId: id,
|
||||||
|
}
|
||||||
|
}, '*');
|
||||||
|
}
|
||||||
|
if (event.data.type === 'misskey:embed:changeHeight' && event.data.iframeId === id) {
|
||||||
|
el.style.height = event.data.payload.height + 'px';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})();
|
|
@ -100,7 +100,7 @@
|
||||||
"async-mutex": "0.5.0",
|
"async-mutex": "0.5.0",
|
||||||
"bcryptjs": "2.4.3",
|
"bcryptjs": "2.4.3",
|
||||||
"blurhash": "2.0.5",
|
"blurhash": "2.0.5",
|
||||||
"body-parser": "1.20.2",
|
"body-parser": "1.20.3",
|
||||||
"bullmq": "5.10.4",
|
"bullmq": "5.10.4",
|
||||||
"cacheable-lookup": "7.0.0",
|
"cacheable-lookup": "7.0.0",
|
||||||
"cbor": "9.0.2",
|
"cbor": "9.0.2",
|
||||||
|
@ -119,7 +119,7 @@
|
||||||
"fluent-ffmpeg": "2.1.3",
|
"fluent-ffmpeg": "2.1.3",
|
||||||
"form-data": "4.0.0",
|
"form-data": "4.0.0",
|
||||||
"got": "14.4.2",
|
"got": "14.4.2",
|
||||||
"happy-dom": "10.0.3",
|
"happy-dom": "15.6.1",
|
||||||
"hpagent": "1.2.0",
|
"hpagent": "1.2.0",
|
||||||
"htmlescape": "1.1.1",
|
"htmlescape": "1.1.1",
|
||||||
"http-link-header": "1.1.3",
|
"http-link-header": "1.1.3",
|
||||||
|
|
|
@ -133,7 +133,7 @@ export type Config = {
|
||||||
proxySmtp: string | undefined;
|
proxySmtp: string | undefined;
|
||||||
proxyBypassHosts: string[] | undefined;
|
proxyBypassHosts: string[] | undefined;
|
||||||
allowedPrivateNetworks: string[] | undefined;
|
allowedPrivateNetworks: string[] | undefined;
|
||||||
maxFileSize: number | undefined;
|
maxFileSize: number;
|
||||||
clusterLimit: number | undefined;
|
clusterLimit: number | undefined;
|
||||||
id: string;
|
id: string;
|
||||||
outgoingAddress: string | undefined;
|
outgoingAddress: string | undefined;
|
||||||
|
@ -160,8 +160,10 @@ export type Config = {
|
||||||
authUrl: string;
|
authUrl: string;
|
||||||
driveUrl: string;
|
driveUrl: string;
|
||||||
userAgent: string;
|
userAgent: string;
|
||||||
clientEntry: string;
|
frontendEntry: string;
|
||||||
clientManifestExists: boolean;
|
frontendManifestExists: boolean;
|
||||||
|
frontendEmbedEntry: string;
|
||||||
|
frontendEmbedManifestExists: boolean;
|
||||||
mediaProxy: string;
|
mediaProxy: string;
|
||||||
externalMediaProxyEnabled: boolean;
|
externalMediaProxyEnabled: boolean;
|
||||||
videoThumbnailGenerator: string | null;
|
videoThumbnailGenerator: string | null;
|
||||||
|
@ -196,10 +198,16 @@ const path = process.env.MISSKEY_CONFIG_YML
|
||||||
|
|
||||||
export function loadConfig(): Config {
|
export function loadConfig(): Config {
|
||||||
const meta = JSON.parse(fs.readFileSync(`${_dirname}/../../../built/meta.json`, 'utf-8'));
|
const meta = JSON.parse(fs.readFileSync(`${_dirname}/../../../built/meta.json`, 'utf-8'));
|
||||||
const clientManifestExists = fs.existsSync(_dirname + '/../../../built/_vite_/manifest.json');
|
|
||||||
const clientManifest = clientManifestExists ?
|
const frontendManifestExists = fs.existsSync(_dirname + '/../../../built/_frontend_vite_/manifest.json');
|
||||||
JSON.parse(fs.readFileSync(`${_dirname}/../../../built/_vite_/manifest.json`, 'utf-8'))
|
const frontendEmbedManifestExists = fs.existsSync(_dirname + '/../../../built/_frontend_embed_vite_/manifest.json');
|
||||||
|
const frontendManifest = frontendManifestExists ?
|
||||||
|
JSON.parse(fs.readFileSync(`${_dirname}/../../../built/_frontend_vite_/manifest.json`, 'utf-8'))
|
||||||
: { 'src/_boot_.ts': { file: 'src/_boot_.ts' } };
|
: { 'src/_boot_.ts': { file: 'src/_boot_.ts' } };
|
||||||
|
const frontendEmbedManifest = frontendEmbedManifestExists ?
|
||||||
|
JSON.parse(fs.readFileSync(`${_dirname}/../../../built/_frontend_embed_vite_/manifest.json`, 'utf-8'))
|
||||||
|
: { 'src/boot.ts': { file: 'src/boot.ts' } };
|
||||||
|
|
||||||
const config = yaml.load(fs.readFileSync(path, 'utf-8')) as Source;
|
const config = yaml.load(fs.readFileSync(path, 'utf-8')) as Source;
|
||||||
|
|
||||||
const url = tryCreateUrl(config.url ?? process.env.MISSKEY_URL ?? '');
|
const url = tryCreateUrl(config.url ?? process.env.MISSKEY_URL ?? '');
|
||||||
|
@ -250,7 +258,7 @@ export function loadConfig(): Config {
|
||||||
proxySmtp: config.proxySmtp,
|
proxySmtp: config.proxySmtp,
|
||||||
proxyBypassHosts: config.proxyBypassHosts,
|
proxyBypassHosts: config.proxyBypassHosts,
|
||||||
allowedPrivateNetworks: config.allowedPrivateNetworks,
|
allowedPrivateNetworks: config.allowedPrivateNetworks,
|
||||||
maxFileSize: config.maxFileSize,
|
maxFileSize: config.maxFileSize ?? 262144000,
|
||||||
clusterLimit: config.clusterLimit,
|
clusterLimit: config.clusterLimit,
|
||||||
outgoingAddress: config.outgoingAddress,
|
outgoingAddress: config.outgoingAddress,
|
||||||
outgoingAddressFamily: config.outgoingAddressFamily,
|
outgoingAddressFamily: config.outgoingAddressFamily,
|
||||||
|
@ -270,8 +278,10 @@ export function loadConfig(): Config {
|
||||||
config.videoThumbnailGenerator.endsWith('/') ? config.videoThumbnailGenerator.substring(0, config.videoThumbnailGenerator.length - 1) : config.videoThumbnailGenerator
|
config.videoThumbnailGenerator.endsWith('/') ? config.videoThumbnailGenerator.substring(0, config.videoThumbnailGenerator.length - 1) : config.videoThumbnailGenerator
|
||||||
: null,
|
: null,
|
||||||
userAgent: `Misskey/${version} (${config.url})`,
|
userAgent: `Misskey/${version} (${config.url})`,
|
||||||
clientEntry: clientManifest['src/_boot_.ts'],
|
frontendEntry: frontendManifest['src/_boot_.ts'],
|
||||||
clientManifestExists: clientManifestExists,
|
frontendManifestExists: frontendManifestExists,
|
||||||
|
frontendEmbedEntry: frontendEmbedManifest['src/boot.ts'],
|
||||||
|
frontendEmbedManifestExists: frontendEmbedManifestExists,
|
||||||
perChannelMaxNoteCacheCount: config.perChannelMaxNoteCacheCount ?? 1000,
|
perChannelMaxNoteCacheCount: config.perChannelMaxNoteCacheCount ?? 1000,
|
||||||
perUserNotificationsMaxCount: config.perUserNotificationsMaxCount ?? 500,
|
perUserNotificationsMaxCount: config.perUserNotificationsMaxCount ?? 500,
|
||||||
deactivateAntennaThreshold: config.deactivateAntennaThreshold ?? (1000 * 60 * 60 * 24 * 7),
|
deactivateAntennaThreshold: config.deactivateAntennaThreshold ?? (1000 * 60 * 60 * 24 * 7),
|
||||||
|
|
|
@ -29,7 +29,7 @@ export class AvatarDecorationService implements OnApplicationShutdown {
|
||||||
private moderationLogService: ModerationLogService,
|
private moderationLogService: ModerationLogService,
|
||||||
private globalEventService: GlobalEventService,
|
private globalEventService: GlobalEventService,
|
||||||
) {
|
) {
|
||||||
this.cache = new MemorySingleCache<MiAvatarDecoration[]>(1000 * 60 * 30);
|
this.cache = new MemorySingleCache<MiAvatarDecoration[]>(1000 * 60 * 30); // 30s
|
||||||
|
|
||||||
this.redisForSub.on('message', this.onMessage);
|
this.redisForSub.on('message', this.onMessage);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,10 +56,10 @@ export class CacheService implements OnApplicationShutdown {
|
||||||
) {
|
) {
|
||||||
//this.onMessage = this.onMessage.bind(this);
|
//this.onMessage = this.onMessage.bind(this);
|
||||||
|
|
||||||
this.userByIdCache = new MemoryKVCache<MiUser>(Infinity);
|
this.userByIdCache = new MemoryKVCache<MiUser>(1000 * 60 * 5); // 5m
|
||||||
this.localUserByNativeTokenCache = new MemoryKVCache<MiLocalUser | null>(Infinity);
|
this.localUserByNativeTokenCache = new MemoryKVCache<MiLocalUser | null>(1000 * 60 * 5); // 5m
|
||||||
this.localUserByIdCache = new MemoryKVCache<MiLocalUser>(Infinity);
|
this.localUserByIdCache = new MemoryKVCache<MiLocalUser>(1000 * 60 * 5); // 5m
|
||||||
this.uriPersonCache = new MemoryKVCache<MiUser | null>(Infinity);
|
this.uriPersonCache = new MemoryKVCache<MiUser | null>(1000 * 60 * 5); // 5m
|
||||||
|
|
||||||
this.userProfileCache = new RedisKVCache<MiUserProfile>(this.redisClient, 'userProfile', {
|
this.userProfileCache = new RedisKVCache<MiUserProfile>(this.redisClient, 'userProfile', {
|
||||||
lifetime: 1000 * 60 * 30, // 30m
|
lifetime: 1000 * 60 * 30, // 30m
|
||||||
|
@ -135,14 +135,14 @@ export class CacheService implements OnApplicationShutdown {
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
this.userByIdCache.delete(body.id);
|
this.userByIdCache.delete(body.id);
|
||||||
this.localUserByIdCache.delete(body.id);
|
this.localUserByIdCache.delete(body.id);
|
||||||
for (const [k, v] of this.uriPersonCache.cache.entries()) {
|
for (const [k, v] of this.uriPersonCache.entries) {
|
||||||
if (v.value?.id === body.id) {
|
if (v.value?.id === body.id) {
|
||||||
this.uriPersonCache.delete(k);
|
this.uriPersonCache.delete(k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.userByIdCache.set(user.id, user);
|
this.userByIdCache.set(user.id, user);
|
||||||
for (const [k, v] of this.uriPersonCache.cache.entries()) {
|
for (const [k, v] of this.uriPersonCache.entries) {
|
||||||
if (v.value?.id === user.id) {
|
if (v.value?.id === user.id) {
|
||||||
this.uriPersonCache.set(k, user);
|
this.uriPersonCache.set(k, user);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ const parseEmojiStrRegexp = /^([-\w]+)(?:@([\w.-]+))?$/;
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class CustomEmojiService implements OnApplicationShutdown {
|
export class CustomEmojiService implements OnApplicationShutdown {
|
||||||
private cache: MemoryKVCache<MiEmoji | null>;
|
private emojisCache: MemoryKVCache<MiEmoji | null>;
|
||||||
public localEmojisCache: RedisSingleCache<Map<string, MiEmoji>>;
|
public localEmojisCache: RedisSingleCache<Map<string, MiEmoji>>;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
@ -40,7 +40,7 @@ export class CustomEmojiService implements OnApplicationShutdown {
|
||||||
private moderationLogService: ModerationLogService,
|
private moderationLogService: ModerationLogService,
|
||||||
private globalEventService: GlobalEventService,
|
private globalEventService: GlobalEventService,
|
||||||
) {
|
) {
|
||||||
this.cache = new MemoryKVCache<MiEmoji | null>(1000 * 60 * 60 * 12);
|
this.emojisCache = new MemoryKVCache<MiEmoji | null>(1000 * 60 * 60 * 12); // 12h
|
||||||
|
|
||||||
this.localEmojisCache = new RedisSingleCache<Map<string, MiEmoji>>(this.redisClient, 'localEmojis', {
|
this.localEmojisCache = new RedisSingleCache<Map<string, MiEmoji>>(this.redisClient, 'localEmojis', {
|
||||||
lifetime: 1000 * 60 * 30, // 30m
|
lifetime: 1000 * 60 * 30, // 30m
|
||||||
|
@ -334,7 +334,7 @@ export class CustomEmojiService implements OnApplicationShutdown {
|
||||||
host,
|
host,
|
||||||
})) ?? null;
|
})) ?? null;
|
||||||
|
|
||||||
const emoji = await this.cache.fetch(`${name} ${host}`, queryOrNull);
|
const emoji = await this.emojisCache.fetch(`${name} ${host}`, queryOrNull);
|
||||||
|
|
||||||
if (emoji == null) return null;
|
if (emoji == null) return null;
|
||||||
return emoji.publicUrl || emoji.originalUrl; // || emoji.originalUrl してるのは後方互換性のため(publicUrlはstringなので??はだめ)
|
return emoji.publicUrl || emoji.originalUrl; // || emoji.originalUrl してるのは後方互換性のため(publicUrlはstringなので??はだめ)
|
||||||
|
@ -361,7 +361,7 @@ export class CustomEmojiService implements OnApplicationShutdown {
|
||||||
*/
|
*/
|
||||||
@bindThis
|
@bindThis
|
||||||
public async prefetchEmojis(emojis: { name: string; host: string | null; }[]): Promise<void> {
|
public async prefetchEmojis(emojis: { name: string; host: string | null; }[]): Promise<void> {
|
||||||
const notCachedEmojis = emojis.filter(emoji => this.cache.get(`${emoji.name} ${emoji.host}`) == null);
|
const notCachedEmojis = emojis.filter(emoji => this.emojisCache.get(`${emoji.name} ${emoji.host}`) == null);
|
||||||
const emojisQuery: any[] = [];
|
const emojisQuery: any[] = [];
|
||||||
const hosts = new Set(notCachedEmojis.map(e => e.host));
|
const hosts = new Set(notCachedEmojis.map(e => e.host));
|
||||||
for (const host of hosts) {
|
for (const host of hosts) {
|
||||||
|
@ -376,7 +376,7 @@ export class CustomEmojiService implements OnApplicationShutdown {
|
||||||
select: ['name', 'host', 'originalUrl', 'publicUrl'],
|
select: ['name', 'host', 'originalUrl', 'publicUrl'],
|
||||||
}) : [];
|
}) : [];
|
||||||
for (const emoji of _emojis) {
|
for (const emoji of _emojis) {
|
||||||
this.cache.set(`${emoji.name} ${emoji.host}`, emoji);
|
this.emojisCache.set(`${emoji.name} ${emoji.host}`, emoji);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -401,7 +401,7 @@ export class CustomEmojiService implements OnApplicationShutdown {
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public dispose(): void {
|
public dispose(): void {
|
||||||
this.cache.dispose();
|
this.emojisCache.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
|
|
|
@ -4,12 +4,15 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import type { UsersRepository } from '@/models/_.js';
|
import { Not, IsNull } from 'typeorm';
|
||||||
|
import type { FollowingsRepository, MiUser, UsersRepository } from '@/models/_.js';
|
||||||
import { QueueService } from '@/core/QueueService.js';
|
import { QueueService } from '@/core/QueueService.js';
|
||||||
import { UserSuspendService } from '@/core/UserSuspendService.js';
|
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
import { GlobalEventService } from '@/core/GlobalEventService.js';
|
import { GlobalEventService } from '@/core/GlobalEventService.js';
|
||||||
|
import { UserEntityService } from '@/core/entities/UserEntityService.js';
|
||||||
|
import { ApRendererService } from '@/core/activitypub/ApRendererService.js';
|
||||||
|
import { ModerationLogService } from '@/core/ModerationLogService.js';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class DeleteAccountService {
|
export class DeleteAccountService {
|
||||||
|
@ -17,9 +20,14 @@ export class DeleteAccountService {
|
||||||
@Inject(DI.usersRepository)
|
@Inject(DI.usersRepository)
|
||||||
private usersRepository: UsersRepository,
|
private usersRepository: UsersRepository,
|
||||||
|
|
||||||
private userSuspendService: UserSuspendService,
|
@Inject(DI.followingsRepository)
|
||||||
|
private followingsRepository: FollowingsRepository,
|
||||||
|
|
||||||
|
private userEntityService: UserEntityService,
|
||||||
|
private apRendererService: ApRendererService,
|
||||||
private queueService: QueueService,
|
private queueService: QueueService,
|
||||||
private globalEventService: GlobalEventService,
|
private globalEventService: GlobalEventService,
|
||||||
|
private moderationLogService: ModerationLogService,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,16 +35,52 @@ export class DeleteAccountService {
|
||||||
public async deleteAccount(user: {
|
public async deleteAccount(user: {
|
||||||
id: string;
|
id: string;
|
||||||
host: string | null;
|
host: string | null;
|
||||||
}): Promise<void> {
|
}, moderator?: MiUser): Promise<void> {
|
||||||
const _user = await this.usersRepository.findOneByOrFail({ id: user.id });
|
const _user = await this.usersRepository.findOneByOrFail({ id: user.id });
|
||||||
if (_user.isRoot) throw new Error('cannot delete a root account');
|
if (_user.isRoot) throw new Error('cannot delete a root account');
|
||||||
|
|
||||||
// 物理削除する前にDelete activityを送信する
|
if (moderator != null) {
|
||||||
await this.userSuspendService.doPostSuspend(user).catch(e => {});
|
this.moderationLogService.log(moderator, 'deleteAccount', {
|
||||||
|
userId: user.id,
|
||||||
|
userUsername: _user.username,
|
||||||
|
userHost: user.host,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.queueService.createDeleteAccountJob(user, {
|
// 物理削除する前にDelete activityを送信する
|
||||||
soft: false,
|
if (this.userEntityService.isLocalUser(user)) {
|
||||||
});
|
// 知り得る全SharedInboxにDelete配信
|
||||||
|
const content = this.apRendererService.addContext(this.apRendererService.renderDelete(this.userEntityService.genLocalUserUri(user.id), user));
|
||||||
|
|
||||||
|
const queue: string[] = [];
|
||||||
|
|
||||||
|
const followings = await this.followingsRepository.find({
|
||||||
|
where: [
|
||||||
|
{ followerSharedInbox: Not(IsNull()) },
|
||||||
|
{ followeeSharedInbox: Not(IsNull()) },
|
||||||
|
],
|
||||||
|
select: ['followerSharedInbox', 'followeeSharedInbox'],
|
||||||
|
});
|
||||||
|
|
||||||
|
const inboxes = followings.map(x => x.followerSharedInbox ?? x.followeeSharedInbox);
|
||||||
|
|
||||||
|
for (const inbox of inboxes) {
|
||||||
|
if (inbox != null && !queue.includes(inbox)) queue.push(inbox);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const inbox of queue) {
|
||||||
|
this.queueService.deliver(user, content, inbox, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.queueService.createDeleteAccountJob(user, {
|
||||||
|
soft: false,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// リモートユーザーの削除は、完全にDBから物理削除してしまうと再度連合してきてアカウントが復活する可能性があるため、soft指定する
|
||||||
|
this.queueService.createDeleteAccountJob(user, {
|
||||||
|
soft: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
await this.usersRepository.update(user.id, {
|
await this.usersRepository.update(user.id, {
|
||||||
isDeleted: true,
|
isDeleted: true,
|
||||||
|
|
|
@ -42,7 +42,7 @@ export class DownloadService {
|
||||||
|
|
||||||
const timeout = 30 * 1000;
|
const timeout = 30 * 1000;
|
||||||
const operationTimeout = 60 * 1000;
|
const operationTimeout = 60 * 1000;
|
||||||
const maxSize = this.config.maxFileSize ?? 262144000;
|
const maxSize = this.config.maxFileSize;
|
||||||
|
|
||||||
const urlObj = new URL(url);
|
const urlObj = new URL(url);
|
||||||
let filename = urlObj.pathname.split('/').pop() ?? 'untitled';
|
let filename = urlObj.pathname.split('/').pop() ?? 'untitled';
|
||||||
|
|
|
@ -15,7 +15,7 @@ import isSvg from 'is-svg';
|
||||||
import probeImageSize from 'probe-image-size';
|
import probeImageSize from 'probe-image-size';
|
||||||
import { type predictionType } from 'nsfwjs';
|
import { type predictionType } from 'nsfwjs';
|
||||||
import { sharpBmp } from '@misskey-dev/sharp-read-bmp';
|
import { sharpBmp } from '@misskey-dev/sharp-read-bmp';
|
||||||
import { encode } from 'blurhash';
|
import * as blurhash from 'blurhash';
|
||||||
import { createTempDir } from '@/misc/create-temp.js';
|
import { createTempDir } from '@/misc/create-temp.js';
|
||||||
import { AiService } from '@/core/AiService.js';
|
import { AiService } from '@/core/AiService.js';
|
||||||
import { LoggerService } from '@/core/LoggerService.js';
|
import { LoggerService } from '@/core/LoggerService.js';
|
||||||
|
@ -452,7 +452,7 @@ export class FileInfoService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate average color of image
|
* Calculate blurhash string of image
|
||||||
*/
|
*/
|
||||||
@bindThis
|
@bindThis
|
||||||
private getBlurhash(path: string, type: string): Promise<string> {
|
private getBlurhash(path: string, type: string): Promise<string> {
|
||||||
|
@ -467,7 +467,7 @@ export class FileInfoService {
|
||||||
let hash;
|
let hash;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
hash = encode(new Uint8ClampedArray(buffer), info.width, info.height, 5, 5);
|
hash = blurhash.encode(new Uint8ClampedArray(buffer), info.width, info.height, 5, 5);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return reject(e);
|
return reject(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,8 @@ import type { ModerationLogsRepository } from '@/models/_.js';
|
||||||
import type { MiUser } from '@/models/User.js';
|
import type { MiUser } from '@/models/User.js';
|
||||||
import { IdService } from '@/core/IdService.js';
|
import { IdService } from '@/core/IdService.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
import { ModerationLogPayloads, moderationLogTypes } from '@/types.js';
|
import type { ModerationLogPayloads } from '@/types.js';
|
||||||
|
import { moderationLogTypes } from '@/types.js';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ModerationLogService {
|
export class ModerationLogService {
|
||||||
|
|
|
@ -509,7 +509,7 @@ export class NoteCreateService implements OnApplicationShutdown {
|
||||||
const meta = await this.metaService.fetch();
|
const meta = await this.metaService.fetch();
|
||||||
|
|
||||||
this.notesChart.update(note, true);
|
this.notesChart.update(note, true);
|
||||||
if (meta.enableChartsForRemoteUser || (user.host == null)) {
|
if (note.visibility !== 'specified' && (meta.enableChartsForRemoteUser || (user.host == null))) {
|
||||||
this.perUserNotesChart.update(user, note, true);
|
this.perUserNotesChart.update(user, note, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ export class NoteDeleteService {
|
||||||
this.deliverToConcerned(user, note, content);
|
this.deliverToConcerned(user, note, content);
|
||||||
}
|
}
|
||||||
|
|
||||||
// also deliever delete activity to cascaded notes
|
// also deliver delete activity to cascaded notes
|
||||||
const federatedLocalCascadingNotes = (cascadingNotes).filter(note => !note.localOnly && note.userHost == null); // filter out local-only notes
|
const federatedLocalCascadingNotes = (cascadingNotes).filter(note => !note.localOnly && note.userHost == null); // filter out local-only notes
|
||||||
for (const cascadingNote of federatedLocalCascadingNotes) {
|
for (const cascadingNote of federatedLocalCascadingNotes) {
|
||||||
if (!cascadingNote.user) continue;
|
if (!cascadingNote.user) continue;
|
||||||
|
|
|
@ -35,7 +35,7 @@ export class RelayService {
|
||||||
private createSystemUserService: CreateSystemUserService,
|
private createSystemUserService: CreateSystemUserService,
|
||||||
private apRendererService: ApRendererService,
|
private apRendererService: ApRendererService,
|
||||||
) {
|
) {
|
||||||
this.relaysCache = new MemorySingleCache<MiRelay[]>(1000 * 60 * 10);
|
this.relaysCache = new MemorySingleCache<MiRelay[]>(1000 * 60 * 10); // 10m
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import * as Redis from 'ioredis';
|
import * as Redis from 'ioredis';
|
||||||
import { ModuleRef } from '@nestjs/core';
|
import { ModuleRef } from '@nestjs/core';
|
||||||
|
import { reversiUpdateKeys } from 'misskey-js';
|
||||||
import * as Reversi from 'misskey-reversi';
|
import * as Reversi from 'misskey-reversi';
|
||||||
import { IsNull, LessThan, MoreThan } from 'typeorm';
|
import { IsNull, LessThan, MoreThan } from 'typeorm';
|
||||||
import type {
|
import type {
|
||||||
|
@ -399,7 +400,33 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public async updateSettings(gameId: MiReversiGame['id'], user: MiUser, key: string, value: any) {
|
public isValidReversiUpdateKey(key: unknown): key is typeof reversiUpdateKeys[number] {
|
||||||
|
if (typeof key !== 'string') return false;
|
||||||
|
return (reversiUpdateKeys as string[]).includes(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
@bindThis
|
||||||
|
public isValidReversiUpdateValue<K extends typeof reversiUpdateKeys[number]>(key: K, value: unknown): value is MiReversiGame[K] {
|
||||||
|
switch (key) {
|
||||||
|
case 'map':
|
||||||
|
return Array.isArray(value) && value.every(row => typeof row === 'string');
|
||||||
|
case 'bw':
|
||||||
|
return typeof value === 'string' && ['random', '1', '2'].includes(value);
|
||||||
|
case 'isLlotheo':
|
||||||
|
return typeof value === 'boolean';
|
||||||
|
case 'canPutEverywhere':
|
||||||
|
return typeof value === 'boolean';
|
||||||
|
case 'loopedBoard':
|
||||||
|
return typeof value === 'boolean';
|
||||||
|
case 'timeLimitForEachTurn':
|
||||||
|
return typeof value === 'number' && value >= 0;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@bindThis
|
||||||
|
public async updateSettings<K extends typeof reversiUpdateKeys[number]>(gameId: MiReversiGame['id'], user: MiUser, key: K, value: MiReversiGame[K]) {
|
||||||
const game = await this.get(gameId);
|
const game = await this.get(gameId);
|
||||||
if (game == null) throw new Error('game not found');
|
if (game == null) throw new Error('game not found');
|
||||||
if (game.isStarted) return;
|
if (game.isStarted) return;
|
||||||
|
@ -407,10 +434,6 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit {
|
||||||
if ((game.user1Id === user.id) && game.user1Ready) return;
|
if ((game.user1Id === user.id) && game.user1Ready) return;
|
||||||
if ((game.user2Id === user.id) && game.user2Ready) return;
|
if ((game.user2Id === user.id) && game.user2Ready) return;
|
||||||
|
|
||||||
if (!['map', 'bw', 'isLlotheo', 'canPutEverywhere', 'loopedBoard', 'timeLimitForEachTurn'].includes(key)) return;
|
|
||||||
|
|
||||||
// TODO: より厳格なバリデーション
|
|
||||||
|
|
||||||
const updatedGame = {
|
const updatedGame = {
|
||||||
...game,
|
...game,
|
||||||
[key]: value,
|
[key]: value,
|
||||||
|
|
|
@ -127,10 +127,8 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
|
||||||
private moderationLogService: ModerationLogService,
|
private moderationLogService: ModerationLogService,
|
||||||
private fanoutTimelineService: FanoutTimelineService,
|
private fanoutTimelineService: FanoutTimelineService,
|
||||||
) {
|
) {
|
||||||
//this.onMessage = this.onMessage.bind(this);
|
this.rolesCache = new MemorySingleCache<MiRole[]>(1000 * 60 * 60); // 1h
|
||||||
|
this.roleAssignmentByUserIdCache = new MemoryKVCache<MiRoleAssignment[]>(1000 * 60 * 5); // 5m
|
||||||
this.rolesCache = new MemorySingleCache<MiRole[]>(1000 * 60 * 60 * 1);
|
|
||||||
this.roleAssignmentByUserIdCache = new MemoryKVCache<MiRoleAssignment[]>(1000 * 60 * 60 * 1);
|
|
||||||
|
|
||||||
this.redisForSub.on('message', this.onMessage);
|
this.redisForSub.on('message', this.onMessage);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ export class UserKeypairService implements OnApplicationShutdown {
|
||||||
) {
|
) {
|
||||||
this.cache = new RedisKVCache<MiUserKeypair>(this.redisClient, 'userKeypair', {
|
this.cache = new RedisKVCache<MiUserKeypair>(this.redisClient, 'userKeypair', {
|
||||||
lifetime: 1000 * 60 * 60 * 24, // 24h
|
lifetime: 1000 * 60 * 60 * 24, // 24h
|
||||||
memoryCacheLifetime: Infinity,
|
memoryCacheLifetime: 1000 * 60 * 60, // 1h
|
||||||
fetcher: (key) => this.userKeypairsRepository.findOneByOrFail({ userId: key }),
|
fetcher: (key) => this.userKeypairsRepository.findOneByOrFail({ userId: key }),
|
||||||
toRedisConverter: (value) => JSON.stringify(value),
|
toRedisConverter: (value) => JSON.stringify(value),
|
||||||
fromRedisConverter: (value) => JSON.parse(value),
|
fromRedisConverter: (value) => JSON.parse(value),
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { Not, IsNull } from 'typeorm';
|
import { Not, IsNull } from 'typeorm';
|
||||||
import type { FollowingsRepository } from '@/models/_.js';
|
import type { FollowingsRepository, FollowRequestsRepository, UsersRepository } from '@/models/_.js';
|
||||||
import type { MiUser } from '@/models/User.js';
|
import type { MiUser } from '@/models/User.js';
|
||||||
import { QueueService } from '@/core/QueueService.js';
|
import { QueueService } from '@/core/QueueService.js';
|
||||||
import { GlobalEventService } from '@/core/GlobalEventService.js';
|
import { GlobalEventService } from '@/core/GlobalEventService.js';
|
||||||
|
@ -13,24 +13,75 @@ import { DI } from '@/di-symbols.js';
|
||||||
import { ApRendererService } from '@/core/activitypub/ApRendererService.js';
|
import { ApRendererService } from '@/core/activitypub/ApRendererService.js';
|
||||||
import { UserEntityService } from '@/core/entities/UserEntityService.js';
|
import { UserEntityService } from '@/core/entities/UserEntityService.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
|
import { RelationshipJobData } from '@/queue/types.js';
|
||||||
|
import { ModerationLogService } from '@/core/ModerationLogService.js';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class UserSuspendService {
|
export class UserSuspendService {
|
||||||
constructor(
|
constructor(
|
||||||
|
@Inject(DI.usersRepository)
|
||||||
|
private usersRepository: UsersRepository,
|
||||||
|
|
||||||
@Inject(DI.followingsRepository)
|
@Inject(DI.followingsRepository)
|
||||||
private followingsRepository: FollowingsRepository,
|
private followingsRepository: FollowingsRepository,
|
||||||
|
|
||||||
|
@Inject(DI.followRequestsRepository)
|
||||||
|
private followRequestsRepository: FollowRequestsRepository,
|
||||||
|
|
||||||
private userEntityService: UserEntityService,
|
private userEntityService: UserEntityService,
|
||||||
private queueService: QueueService,
|
private queueService: QueueService,
|
||||||
private globalEventService: GlobalEventService,
|
private globalEventService: GlobalEventService,
|
||||||
private apRendererService: ApRendererService,
|
private apRendererService: ApRendererService,
|
||||||
|
private moderationLogService: ModerationLogService,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public async doPostSuspend(user: { id: MiUser['id']; host: MiUser['host'] }): Promise<void> {
|
public async suspend(user: MiUser, moderator: MiUser): Promise<void> {
|
||||||
|
await this.usersRepository.update(user.id, {
|
||||||
|
isSuspended: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
this.moderationLogService.log(moderator, 'suspend', {
|
||||||
|
userId: user.id,
|
||||||
|
userUsername: user.username,
|
||||||
|
userHost: user.host,
|
||||||
|
});
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
await this.postSuspend(user).catch(e => {});
|
||||||
|
await this.unFollowAll(user).catch(e => {});
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
|
||||||
|
@bindThis
|
||||||
|
public async unsuspend(user: MiUser, moderator: MiUser): Promise<void> {
|
||||||
|
await this.usersRepository.update(user.id, {
|
||||||
|
isSuspended: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
this.moderationLogService.log(moderator, 'unsuspend', {
|
||||||
|
userId: user.id,
|
||||||
|
userUsername: user.username,
|
||||||
|
userHost: user.host,
|
||||||
|
});
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
await this.postUnsuspend(user).catch(e => {});
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
|
||||||
|
@bindThis
|
||||||
|
private async postSuspend(user: { id: MiUser['id']; host: MiUser['host'] }): Promise<void> {
|
||||||
this.globalEventService.publishInternalEvent('userChangeSuspendedState', { id: user.id, isSuspended: true });
|
this.globalEventService.publishInternalEvent('userChangeSuspendedState', { id: user.id, isSuspended: true });
|
||||||
|
|
||||||
|
this.followRequestsRepository.delete({
|
||||||
|
followeeId: user.id,
|
||||||
|
});
|
||||||
|
this.followRequestsRepository.delete({
|
||||||
|
followerId: user.id,
|
||||||
|
});
|
||||||
|
|
||||||
if (this.userEntityService.isLocalUser(user)) {
|
if (this.userEntityService.isLocalUser(user)) {
|
||||||
// 知り得る全SharedInboxにDelete配信
|
// 知り得る全SharedInboxにDelete配信
|
||||||
const content = this.apRendererService.addContext(this.apRendererService.renderDelete(this.userEntityService.genLocalUserUri(user.id), user));
|
const content = this.apRendererService.addContext(this.apRendererService.renderDelete(this.userEntityService.genLocalUserUri(user.id), user));
|
||||||
|
@ -58,7 +109,7 @@ export class UserSuspendService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public async doPostUnsuspend(user: MiUser): Promise<void> {
|
private async postUnsuspend(user: MiUser): Promise<void> {
|
||||||
this.globalEventService.publishInternalEvent('userChangeSuspendedState', { id: user.id, isSuspended: false });
|
this.globalEventService.publishInternalEvent('userChangeSuspendedState', { id: user.id, isSuspended: false });
|
||||||
|
|
||||||
if (this.userEntityService.isLocalUser(user)) {
|
if (this.userEntityService.isLocalUser(user)) {
|
||||||
|
@ -86,4 +137,26 @@ export class UserSuspendService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@bindThis
|
||||||
|
private async unFollowAll(follower: MiUser) {
|
||||||
|
const followings = await this.followingsRepository.find({
|
||||||
|
where: {
|
||||||
|
followerId: follower.id,
|
||||||
|
followeeId: Not(IsNull()),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const jobs: RelationshipJobData[] = [];
|
||||||
|
for (const following of followings) {
|
||||||
|
if (following.followeeId && following.followerId) {
|
||||||
|
jobs.push({
|
||||||
|
from: { id: following.followerId },
|
||||||
|
to: { id: following.followeeId },
|
||||||
|
silent: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.queueService.createUnfollowJob(jobs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,8 +54,8 @@ export class ApDbResolverService implements OnApplicationShutdown {
|
||||||
private cacheService: CacheService,
|
private cacheService: CacheService,
|
||||||
private apPersonService: ApPersonService,
|
private apPersonService: ApPersonService,
|
||||||
) {
|
) {
|
||||||
this.publicKeyCache = new MemoryKVCache<MiUserPublickey | null>(Infinity);
|
this.publicKeyCache = new MemoryKVCache<MiUserPublickey | null>(1000 * 60 * 60 * 12); // 12h
|
||||||
this.publicKeyByUserIdCache = new MemoryKVCache<MiUserPublickey | null>(Infinity);
|
this.publicKeyByUserIdCache = new MemoryKVCache<MiUserPublickey | null>(1000 * 60 * 60 * 12); // 12h
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
import * as crypto from 'node:crypto';
|
import * as crypto from 'node:crypto';
|
||||||
import { URL } from 'node:url';
|
import { URL } from 'node:url';
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
|
import { Window } from 'happy-dom';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import type { Config } from '@/config.js';
|
import type { Config } from '@/config.js';
|
||||||
import type { MiUser } from '@/models/User.js';
|
import type { MiUser } from '@/models/User.js';
|
||||||
|
@ -180,7 +181,8 @@ export class ApRequestService {
|
||||||
* @param url URL to fetch
|
* @param url URL to fetch
|
||||||
*/
|
*/
|
||||||
@bindThis
|
@bindThis
|
||||||
public async signedGet(url: string, user: { id: MiUser['id'] }): Promise<unknown> {
|
public async signedGet(url: string, user: { id: MiUser['id'] }, followAlternate?: boolean): Promise<unknown> {
|
||||||
|
const _followAlternate = followAlternate ?? true;
|
||||||
const keypair = await this.userKeypairService.getUserKeypair(user.id);
|
const keypair = await this.userKeypairService.getUserKeypair(user.id);
|
||||||
|
|
||||||
const req = ApRequestCreator.createSignedGet({
|
const req = ApRequestCreator.createSignedGet({
|
||||||
|
@ -198,9 +200,54 @@ export class ApRequestService {
|
||||||
headers: req.request.headers,
|
headers: req.request.headers,
|
||||||
}, {
|
}, {
|
||||||
throwErrorWhenResponseNotOk: true,
|
throwErrorWhenResponseNotOk: true,
|
||||||
validators: [validateContentTypeSetAsActivityPub],
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//#region リクエスト先がhtmlかつactivity+jsonへのalternate linkタグがあるとき
|
||||||
|
const contentType = res.headers.get('content-type');
|
||||||
|
|
||||||
|
if ((contentType ?? '').split(';')[0].trimEnd().toLowerCase() === 'text/html' && _followAlternate === true) {
|
||||||
|
const html = await res.text();
|
||||||
|
const window = new Window({
|
||||||
|
settings: {
|
||||||
|
disableJavaScriptEvaluation: true,
|
||||||
|
disableJavaScriptFileLoading: true,
|
||||||
|
disableCSSFileLoading: true,
|
||||||
|
disableComputedStyleRendering: true,
|
||||||
|
handleDisabledFileLoadingAsSuccess: true,
|
||||||
|
navigation: {
|
||||||
|
disableMainFrameNavigation: true,
|
||||||
|
disableChildFrameNavigation: true,
|
||||||
|
disableChildPageNavigation: true,
|
||||||
|
disableFallbackToSetURL: true,
|
||||||
|
},
|
||||||
|
timer: {
|
||||||
|
maxTimeout: 0,
|
||||||
|
maxIntervalTime: 0,
|
||||||
|
maxIntervalIterations: 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const document = window.document;
|
||||||
|
try {
|
||||||
|
document.documentElement.innerHTML = html;
|
||||||
|
|
||||||
|
const alternate = document.querySelector('head > link[rel="alternate"][type="application/activity+json"]');
|
||||||
|
if (alternate) {
|
||||||
|
const href = alternate.getAttribute('href');
|
||||||
|
if (href) {
|
||||||
|
return await this.signedGet(href, user, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// something went wrong parsing the HTML, ignore the whole thing
|
||||||
|
} finally {
|
||||||
|
window.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
validateContentTypeSetAsActivityPub(res);
|
||||||
|
|
||||||
return await res.json();
|
return await res.json();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,9 +78,10 @@ export class ApNoteService {
|
||||||
@bindThis
|
@bindThis
|
||||||
public validateNote(object: IObject, uri: string): Error | null {
|
public validateNote(object: IObject, uri: string): Error | null {
|
||||||
const expectHost = this.utilityService.extractDbHost(uri);
|
const expectHost = this.utilityService.extractDbHost(uri);
|
||||||
|
const apType = getApType(object);
|
||||||
|
|
||||||
if (!validPost.includes(getApType(object))) {
|
if (apType == null || !validPost.includes(apType)) {
|
||||||
return new IdentifiableError('d450b8a9-48e4-4dab-ae36-f4db763fda7c', `invalid Note: invalid object type ${getApType(object)}`);
|
return new IdentifiableError('d450b8a9-48e4-4dab-ae36-f4db763fda7c', `invalid Note: invalid object type ${apType ?? 'undefined'}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (object.id && this.utilityService.extractDbHost(object.id) !== expectHost) {
|
if (object.id && this.utilityService.extractDbHost(object.id) !== expectHost) {
|
||||||
|
|
|
@ -48,7 +48,7 @@ import type { ApResolverService, Resolver } from '../ApResolverService.js';
|
||||||
import type { ApLoggerService } from '../ApLoggerService.js';
|
import type { ApLoggerService } from '../ApLoggerService.js';
|
||||||
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
||||||
import type { ApImageService } from './ApImageService.js';
|
import type { ApImageService } from './ApImageService.js';
|
||||||
import type { IActor, IObject } from '../type.js';
|
import type { IActor, ICollection, IObject, IOrderedCollection } from '../type.js';
|
||||||
|
|
||||||
const nameLength = 128;
|
const nameLength = 128;
|
||||||
const summaryLength = 2048;
|
const summaryLength = 2048;
|
||||||
|
@ -296,6 +296,21 @@ export class ApPersonService implements OnModuleInit {
|
||||||
|
|
||||||
const isBot = getApType(object) === 'Service' || getApType(object) === 'Application';
|
const isBot = getApType(object) === 'Service' || getApType(object) === 'Application';
|
||||||
|
|
||||||
|
const [followingVisibility, followersVisibility] = await Promise.all(
|
||||||
|
[
|
||||||
|
this.isPublicCollection(person.following, resolver),
|
||||||
|
this.isPublicCollection(person.followers, resolver),
|
||||||
|
].map((p): Promise<'public' | 'private'> => p
|
||||||
|
.then(isPublic => isPublic ? 'public' : 'private')
|
||||||
|
.catch(err => {
|
||||||
|
if (!(err instanceof StatusError) || err.isRetryable) {
|
||||||
|
this.logger.error('error occurred while fetching following/followers collection', { stack: err });
|
||||||
|
}
|
||||||
|
return 'private';
|
||||||
|
})
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
const bday = person['vcard:bday']?.match(/^\d{4}-\d{2}-\d{2}/);
|
const bday = person['vcard:bday']?.match(/^\d{4}-\d{2}-\d{2}/);
|
||||||
|
|
||||||
const url = getOneApHrefNullable(person.url);
|
const url = getOneApHrefNullable(person.url);
|
||||||
|
@ -357,6 +372,8 @@ export class ApPersonService implements OnModuleInit {
|
||||||
description: _description,
|
description: _description,
|
||||||
url,
|
url,
|
||||||
fields,
|
fields,
|
||||||
|
followingVisibility,
|
||||||
|
followersVisibility,
|
||||||
birthday: bday?.[0] ?? null,
|
birthday: bday?.[0] ?? null,
|
||||||
location: person['vcard:Address'] ?? null,
|
location: person['vcard:Address'] ?? null,
|
||||||
userHost: host,
|
userHost: host,
|
||||||
|
@ -464,6 +481,23 @@ export class ApPersonService implements OnModuleInit {
|
||||||
|
|
||||||
const tags = extractApHashtags(person.tag).map(normalizeForSearch).splice(0, 32);
|
const tags = extractApHashtags(person.tag).map(normalizeForSearch).splice(0, 32);
|
||||||
|
|
||||||
|
const [followingVisibility, followersVisibility] = await Promise.all(
|
||||||
|
[
|
||||||
|
this.isPublicCollection(person.following, resolver),
|
||||||
|
this.isPublicCollection(person.followers, resolver),
|
||||||
|
].map((p): Promise<'public' | 'private' | undefined> => p
|
||||||
|
.then(isPublic => isPublic ? 'public' : 'private')
|
||||||
|
.catch(err => {
|
||||||
|
if (!(err instanceof StatusError) || err.isRetryable) {
|
||||||
|
this.logger.error('error occurred while fetching following/followers collection', { stack: err });
|
||||||
|
// Do not update the visibiility on transient errors.
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
return 'private';
|
||||||
|
})
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
const bday = person['vcard:bday']?.match(/^\d{4}-\d{2}-\d{2}/);
|
const bday = person['vcard:bday']?.match(/^\d{4}-\d{2}-\d{2}/);
|
||||||
|
|
||||||
const url = getOneApHrefNullable(person.url);
|
const url = getOneApHrefNullable(person.url);
|
||||||
|
@ -532,6 +566,8 @@ export class ApPersonService implements OnModuleInit {
|
||||||
url,
|
url,
|
||||||
fields,
|
fields,
|
||||||
description: _description,
|
description: _description,
|
||||||
|
followingVisibility,
|
||||||
|
followersVisibility,
|
||||||
birthday: bday?.[0] ?? null,
|
birthday: bday?.[0] ?? null,
|
||||||
location: person['vcard:Address'] ?? null,
|
location: person['vcard:Address'] ?? null,
|
||||||
});
|
});
|
||||||
|
@ -703,4 +739,16 @@ export class ApPersonService implements OnModuleInit {
|
||||||
|
|
||||||
return 'ok';
|
return 'ok';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@bindThis
|
||||||
|
private async isPublicCollection(collection: string | ICollection | IOrderedCollection | undefined, resolver: Resolver): Promise<boolean> {
|
||||||
|
if (collection) {
|
||||||
|
const resolved = await resolver.resolveCollection(collection);
|
||||||
|
if (resolved.first || (resolved as ICollection).items || (resolved as IOrderedCollection).orderedItems) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,11 +60,14 @@ export function getApId(value: string | IObject): string {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get ActivityStreams Object type
|
* Get ActivityStreams Object type
|
||||||
|
*
|
||||||
|
* タイプ判定ができなかった場合に、あえてエラーではなくnullを返すようにしている。
|
||||||
|
* 詳細: https://github.com/misskey-dev/misskey/issues/14239
|
||||||
*/
|
*/
|
||||||
export function getApType(value: IObject): string {
|
export function getApType(value: IObject): string | null {
|
||||||
if (typeof value.type === 'string') return value.type;
|
if (typeof value.type === 'string') return value.type;
|
||||||
if (Array.isArray(value.type) && typeof value.type[0] === 'string') return value.type[0];
|
if (Array.isArray(value.type) && typeof value.type[0] === 'string') return value.type[0];
|
||||||
throw new Error('cannot detect type');
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getOneApHrefNullable(value: ApObject | undefined): string | undefined {
|
export function getOneApHrefNullable(value: ApObject | undefined): string | undefined {
|
||||||
|
@ -97,19 +100,23 @@ export interface IActivity extends IObject {
|
||||||
export interface ICollection extends IObject {
|
export interface ICollection extends IObject {
|
||||||
type: 'Collection';
|
type: 'Collection';
|
||||||
totalItems: number;
|
totalItems: number;
|
||||||
items: ApObject;
|
first?: IObject | string;
|
||||||
|
items?: ApObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IOrderedCollection extends IObject {
|
export interface IOrderedCollection extends IObject {
|
||||||
type: 'OrderedCollection';
|
type: 'OrderedCollection';
|
||||||
totalItems: number;
|
totalItems: number;
|
||||||
orderedItems: ApObject;
|
first?: IObject | string;
|
||||||
|
orderedItems?: ApObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const validPost = ['Note', 'Question', 'Article', 'Audio', 'Document', 'Image', 'Page', 'Video', 'Event'];
|
export const validPost = ['Note', 'Question', 'Article', 'Audio', 'Document', 'Image', 'Page', 'Video', 'Event'];
|
||||||
|
|
||||||
export const isPost = (object: IObject): object is IPost =>
|
export const isPost = (object: IObject): object is IPost => {
|
||||||
validPost.includes(getApType(object));
|
const type = getApType(object);
|
||||||
|
return type != null && validPost.includes(type);
|
||||||
|
};
|
||||||
|
|
||||||
export interface IPost extends IObject {
|
export interface IPost extends IObject {
|
||||||
type: 'Note' | 'Question' | 'Article' | 'Audio' | 'Document' | 'Image' | 'Page' | 'Video' | 'Event';
|
type: 'Note' | 'Question' | 'Article' | 'Audio' | 'Document' | 'Image' | 'Page' | 'Video' | 'Event';
|
||||||
|
@ -156,8 +163,10 @@ export const isTombstone = (object: IObject): object is ITombstone =>
|
||||||
|
|
||||||
export const validActor = ['Person', 'Service', 'Group', 'Organization', 'Application'];
|
export const validActor = ['Person', 'Service', 'Group', 'Organization', 'Application'];
|
||||||
|
|
||||||
export const isActor = (object: IObject): object is IActor =>
|
export const isActor = (object: IObject): object is IActor => {
|
||||||
validActor.includes(getApType(object));
|
const type = getApType(object);
|
||||||
|
return type != null && validActor.includes(type);
|
||||||
|
};
|
||||||
|
|
||||||
export interface IActor extends IObject {
|
export interface IActor extends IObject {
|
||||||
type: 'Person' | 'Service' | 'Organization' | 'Group' | 'Application';
|
type: 'Person' | 'Service' | 'Organization' | 'Group' | 'Application';
|
||||||
|
@ -240,12 +249,16 @@ export interface IKey extends IObject {
|
||||||
publicKeyPem: string | Buffer;
|
publicKeyPem: string | Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const validDocumentTypes = ['Audio', 'Document', 'Image', 'Page', 'Video'];
|
||||||
|
|
||||||
export interface IApDocument extends IObject {
|
export interface IApDocument extends IObject {
|
||||||
type: 'Audio' | 'Document' | 'Image' | 'Page' | 'Video';
|
type: 'Audio' | 'Document' | 'Image' | 'Page' | 'Video';
|
||||||
}
|
}
|
||||||
|
|
||||||
export const isDocument = (object: IObject): object is IApDocument =>
|
export const isDocument = (object: IObject): object is IApDocument => {
|
||||||
['Audio', 'Document', 'Image', 'Page', 'Video'].includes(getApType(object));
|
const type = getApType(object);
|
||||||
|
return type != null && validDocumentTypes.includes(type);
|
||||||
|
};
|
||||||
|
|
||||||
export interface IApImage extends IApDocument {
|
export interface IApImage extends IApDocument {
|
||||||
type: 'Image';
|
type: 'Image';
|
||||||
|
@ -323,7 +336,10 @@ export const isAccept = (object: IObject): object is IAccept => getApType(object
|
||||||
export const isReject = (object: IObject): object is IReject => getApType(object) === 'Reject';
|
export const isReject = (object: IObject): object is IReject => getApType(object) === 'Reject';
|
||||||
export const isAdd = (object: IObject): object is IAdd => getApType(object) === 'Add';
|
export const isAdd = (object: IObject): object is IAdd => getApType(object) === 'Add';
|
||||||
export const isRemove = (object: IObject): object is IRemove => getApType(object) === 'Remove';
|
export const isRemove = (object: IObject): object is IRemove => getApType(object) === 'Remove';
|
||||||
export const isLike = (object: IObject): object is ILike => getApType(object) === 'Like' || getApType(object) === 'EmojiReaction' || getApType(object) === 'EmojiReact';
|
export const isLike = (object: IObject): object is ILike => {
|
||||||
|
const type = getApType(object);
|
||||||
|
return type != null && ['Like', 'EmojiReaction', 'EmojiReact'].includes(type);
|
||||||
|
};
|
||||||
export const isAnnounce = (object: IObject): object is IAnnounce => getApType(object) === 'Announce';
|
export const isAnnounce = (object: IObject): object is IAnnounce => getApType(object) === 'Announce';
|
||||||
export const isBlock = (object: IObject): object is IBlock => getApType(object) === 'Block';
|
export const isBlock = (object: IObject): object is IBlock => getApType(object) === 'Block';
|
||||||
export const isFlag = (object: IObject): object is IFlag => getApType(object) === 'Flag';
|
export const isFlag = (object: IObject): object is IFlag => getApType(object) === 'Flag';
|
||||||
|
|
|
@ -65,21 +65,21 @@ export default class FederationChart extends Chart<typeof schema> { // eslint-di
|
||||||
this.followingsRepository.createQueryBuilder('following')
|
this.followingsRepository.createQueryBuilder('following')
|
||||||
.select('COUNT(DISTINCT following.followeeHost)')
|
.select('COUNT(DISTINCT following.followeeHost)')
|
||||||
.where('following.followeeHost IS NOT NULL')
|
.where('following.followeeHost IS NOT NULL')
|
||||||
.andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'following.followeeHost NOT ILIKE ANY(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
|
.andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'following.followeeHost NOT ILIKE ALL(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
|
||||||
.andWhere(`following.followeeHost NOT IN (${ suspendedInstancesQuery.getQuery() })`)
|
.andWhere(`following.followeeHost NOT IN (${ suspendedInstancesQuery.getQuery() })`)
|
||||||
.getRawOne()
|
.getRawOne()
|
||||||
.then(x => parseInt(x.count, 10)),
|
.then(x => parseInt(x.count, 10)),
|
||||||
this.followingsRepository.createQueryBuilder('following')
|
this.followingsRepository.createQueryBuilder('following')
|
||||||
.select('COUNT(DISTINCT following.followerHost)')
|
.select('COUNT(DISTINCT following.followerHost)')
|
||||||
.where('following.followerHost IS NOT NULL')
|
.where('following.followerHost IS NOT NULL')
|
||||||
.andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'following.followerHost NOT ILIKE ANY(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
|
.andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'following.followerHost NOT ILIKE ALL(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
|
||||||
.andWhere(`following.followerHost NOT IN (${ suspendedInstancesQuery.getQuery() })`)
|
.andWhere(`following.followerHost NOT IN (${ suspendedInstancesQuery.getQuery() })`)
|
||||||
.getRawOne()
|
.getRawOne()
|
||||||
.then(x => parseInt(x.count, 10)),
|
.then(x => parseInt(x.count, 10)),
|
||||||
this.followingsRepository.createQueryBuilder('following')
|
this.followingsRepository.createQueryBuilder('following')
|
||||||
.select('COUNT(DISTINCT following.followeeHost)')
|
.select('COUNT(DISTINCT following.followeeHost)')
|
||||||
.where('following.followeeHost IS NOT NULL')
|
.where('following.followeeHost IS NOT NULL')
|
||||||
.andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'following.followeeHost NOT ILIKE ANY(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
|
.andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'following.followeeHost NOT ILIKE ALL(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
|
||||||
.andWhere(`following.followeeHost NOT IN (${ suspendedInstancesQuery.getQuery() })`)
|
.andWhere(`following.followeeHost NOT IN (${ suspendedInstancesQuery.getQuery() })`)
|
||||||
.andWhere(`following.followeeHost IN (${ pubsubSubQuery.getQuery() })`)
|
.andWhere(`following.followeeHost IN (${ pubsubSubQuery.getQuery() })`)
|
||||||
.setParameters(pubsubSubQuery.getParameters())
|
.setParameters(pubsubSubQuery.getParameters())
|
||||||
|
@ -88,7 +88,7 @@ export default class FederationChart extends Chart<typeof schema> { // eslint-di
|
||||||
this.instancesRepository.createQueryBuilder('instance')
|
this.instancesRepository.createQueryBuilder('instance')
|
||||||
.select('COUNT(instance.id)')
|
.select('COUNT(instance.id)')
|
||||||
.where(`instance.host IN (${ subInstancesQuery.getQuery() })`)
|
.where(`instance.host IN (${ subInstancesQuery.getQuery() })`)
|
||||||
.andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'instance.host NOT ILIKE ANY(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
|
.andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'instance.host NOT ILIKE ALL(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
|
||||||
.andWhere('instance.suspensionState = \'none\'')
|
.andWhere('instance.suspensionState = \'none\'')
|
||||||
.andWhere('instance.isNotResponding = false')
|
.andWhere('instance.isNotResponding = false')
|
||||||
.getRawOne()
|
.getRawOne()
|
||||||
|
@ -96,7 +96,7 @@ export default class FederationChart extends Chart<typeof schema> { // eslint-di
|
||||||
this.instancesRepository.createQueryBuilder('instance')
|
this.instancesRepository.createQueryBuilder('instance')
|
||||||
.select('COUNT(instance.id)')
|
.select('COUNT(instance.id)')
|
||||||
.where(`instance.host IN (${ pubInstancesQuery.getQuery() })`)
|
.where(`instance.host IN (${ pubInstancesQuery.getQuery() })`)
|
||||||
.andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'instance.host NOT ILIKE ANY(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
|
.andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'instance.host NOT ILIKE ALL(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) })
|
||||||
.andWhere('instance.suspensionState = \'none\'')
|
.andWhere('instance.suspensionState = \'none\'')
|
||||||
.andWhere('instance.isNotResponding = false')
|
.andWhere('instance.isNotResponding = false')
|
||||||
.getRawOne()
|
.getRawOne()
|
||||||
|
|
|
@ -54,10 +54,10 @@ export default class PerUserPvChart extends Chart<typeof schema> { // eslint-dis
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public async getChartUsers(span: 'hour' | 'day', amount: number, cursor: Date | null, limit = 0, offset = 0): Promise<{
|
public async getChartUsers(span: 'hour' | 'day', order: 'ASC' | 'DESC', amount: number, cursor: Date | null, limit = 0, offset = 0): Promise<{
|
||||||
userId: string;
|
userId: string;
|
||||||
count: number;
|
count: number;
|
||||||
}[]> {
|
}[]> {
|
||||||
return await this.getChartPv(span, amount, cursor, limit, offset);
|
return await this.getChartPv(span, amount, cursor, limit, offset, order);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -734,7 +734,7 @@ export default abstract class Chart<T extends Schema> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public async getChartPv(span: 'hour' | 'day', amount: number, cursor: Date | null, limit: number, offset: number): Promise<
|
public async getChartPv(span: 'hour' | 'day', amount: number, cursor: Date | null, limit: number, offset: number, order: 'ASC' | 'DESC'): Promise<
|
||||||
{
|
{
|
||||||
userId: string,
|
userId: string,
|
||||||
count: number,
|
count: number,
|
||||||
|
@ -756,27 +756,13 @@ export default abstract class Chart<T extends Schema> {
|
||||||
new Error('not happen') as never;
|
new Error('not happen') as never;
|
||||||
|
|
||||||
// ログ取得
|
// ログ取得
|
||||||
const logs = await repository.createQueryBuilder()
|
return await repository.createQueryBuilder()
|
||||||
|
.select('"group" as "userId", sum("___upv_user" + "___upv_visitor") as "count"')
|
||||||
.where('date BETWEEN :gt AND :lt', { gt: Chart.dateToTimestamp(gt), lt: Chart.dateToTimestamp(lt) })
|
.where('date BETWEEN :gt AND :lt', { gt: Chart.dateToTimestamp(gt), lt: Chart.dateToTimestamp(lt) })
|
||||||
.orderBy('___pv_visitor + ___upv_visitor + ___pv_user + ___upv_user', 'DESC')
|
.groupBy('"userId"')
|
||||||
.skip(offset)
|
.orderBy('"count"', order)
|
||||||
.take(limit)
|
.offset(offset)
|
||||||
.getMany() as {
|
.limit(limit)
|
||||||
___pv_visitor: number,
|
.getRawMany<{ userId: string, count: number }>();
|
||||||
___upv_visitor: number,
|
|
||||||
___pv_user: number,
|
|
||||||
___upv_user: number,
|
|
||||||
group: string,
|
|
||||||
}[];
|
|
||||||
const result = [] as {
|
|
||||||
userId: string,
|
|
||||||
count: number,
|
|
||||||
}[];
|
|
||||||
for (const row of logs) {
|
|
||||||
const userId = row.group;
|
|
||||||
const count = row.___pv_user + row.___upv_user + row.___pv_visitor + row.___upv_visitor;
|
|
||||||
result.push({ userId, count });
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,7 @@ export class FlashEntityService {
|
||||||
title: flash.title,
|
title: flash.title,
|
||||||
summary: flash.summary,
|
summary: flash.summary,
|
||||||
script: flash.script,
|
script: flash.script,
|
||||||
|
visibility: flash.visibility,
|
||||||
likedCount: flash.likedCount,
|
likedCount: flash.likedCount,
|
||||||
isLiked: meId ? await this.flashLikesRepository.exists({ where: { flashId: flash.id, userId: meId } }) : undefined,
|
isLiked: meId ? await this.flashLikesRepository.exists({ where: { flashId: flash.id, userId: meId } }) : undefined,
|
||||||
});
|
});
|
||||||
|
|
|
@ -63,8 +63,9 @@ export class InstanceEntityService {
|
||||||
@bindThis
|
@bindThis
|
||||||
public packMany(
|
public packMany(
|
||||||
instances: MiInstance[],
|
instances: MiInstance[],
|
||||||
|
me?: { id: MiUser['id']; } | null | undefined,
|
||||||
) {
|
) {
|
||||||
return Promise.all(instances.map(x => this.pack(x)));
|
return Promise.all(instances.map(x => this.pack(x, me)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,6 +129,7 @@ export class MetaEntityService {
|
||||||
mediaProxy: this.config.mediaProxy,
|
mediaProxy: this.config.mediaProxy,
|
||||||
enableUrlPreview: instance.urlPreviewEnabled,
|
enableUrlPreview: instance.urlPreviewEnabled,
|
||||||
noteSearchableScope: (this.config.meilisearch == null || this.config.meilisearch.scope !== 'local') ? 'global' : 'local',
|
noteSearchableScope: (this.config.meilisearch == null || this.config.meilisearch.scope !== 'local') ? 'global' : 'local',
|
||||||
|
maxFileSize: this.config.maxFileSize,
|
||||||
preferPopularUserFactor: instance.preferPopularUserFactor,
|
preferPopularUserFactor: instance.preferPopularUserFactor,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -454,12 +454,12 @@ export class UserEntityService implements OnModuleInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
const followingCount = profile == null ? null :
|
const followingCount = profile == null ? null :
|
||||||
(profile.followingVisibility === 'public') || isMe ? user.followingCount :
|
(profile.followingVisibility === 'public') || isMe || iAmModerator ? user.followingCount :
|
||||||
(profile.followingVisibility === 'followers') && (relation && relation.isFollowing) ? user.followingCount :
|
(profile.followingVisibility === 'followers') && (relation && relation.isFollowing) ? user.followingCount :
|
||||||
null;
|
null;
|
||||||
|
|
||||||
const followersCount = profile == null ? null :
|
const followersCount = profile == null ? null :
|
||||||
(profile.followersVisibility === 'public') || isMe ? user.followersCount :
|
(profile.followersVisibility === 'public') || isMe || iAmModerator ? user.followersCount :
|
||||||
(profile.followersVisibility === 'followers') && (relation && relation.isFollowing) ? user.followersCount :
|
(profile.followersVisibility === 'followers') && (relation && relation.isFollowing) ? user.followersCount :
|
||||||
null;
|
null;
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,9 @@
|
||||||
* The getter will return a .bind version of the function
|
* The getter will return a .bind version of the function
|
||||||
* and memoize the result against a symbol on the instance
|
* and memoize the result against a symbol on the instance
|
||||||
*/
|
*/
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
export function bindThis(target: any, key: string, descriptor: any) {
|
export function bindThis(target: any, key: string, descriptor: any) {
|
||||||
let fn = descriptor.value;
|
const fn = descriptor.value;
|
||||||
|
|
||||||
if (typeof fn !== 'function') {
|
if (typeof fn !== 'function') {
|
||||||
throw new TypeError(`@bindThis decorator can only be applied to methods not: ${typeof fn}`);
|
throw new TypeError(`@bindThis decorator can only be applied to methods not: ${typeof fn}`);
|
||||||
|
@ -21,26 +22,18 @@ export function bindThis(target: any, key: string, descriptor: any) {
|
||||||
configurable: true,
|
configurable: true,
|
||||||
get() {
|
get() {
|
||||||
// eslint-disable-next-line no-prototype-builtins
|
// eslint-disable-next-line no-prototype-builtins
|
||||||
if (this === target.prototype || this.hasOwnProperty(key) ||
|
if (this === target.prototype || this.hasOwnProperty(key)) {
|
||||||
typeof fn !== 'function') {
|
|
||||||
return fn;
|
return fn;
|
||||||
}
|
}
|
||||||
|
|
||||||
const boundFn = fn.bind(this);
|
const boundFn = fn.bind(this);
|
||||||
Object.defineProperty(this, key, {
|
Reflect.defineProperty(this, key, {
|
||||||
|
value: boundFn,
|
||||||
configurable: true,
|
configurable: true,
|
||||||
get() {
|
writable: true,
|
||||||
return boundFn;
|
|
||||||
},
|
|
||||||
set(value) {
|
|
||||||
fn = value;
|
|
||||||
delete this[key];
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return boundFn;
|
return boundFn;
|
||||||
},
|
},
|
||||||
set(value: any) {
|
|
||||||
fn = value;
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,23 +7,23 @@ import * as Redis from 'ioredis';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
|
|
||||||
export class RedisKVCache<T> {
|
export class RedisKVCache<T> {
|
||||||
private redisClient: Redis.Redis;
|
private readonly lifetime: number;
|
||||||
private name: string;
|
private readonly memoryCache: MemoryKVCache<T>;
|
||||||
private lifetime: number;
|
private readonly fetcher: (key: string) => Promise<T>;
|
||||||
private memoryCache: MemoryKVCache<T>;
|
private readonly toRedisConverter: (value: T) => string;
|
||||||
private fetcher: (key: string) => Promise<T>;
|
private readonly fromRedisConverter: (value: string) => T | undefined;
|
||||||
private toRedisConverter: (value: T) => string;
|
|
||||||
private fromRedisConverter: (value: string) => T | undefined;
|
|
||||||
|
|
||||||
constructor(redisClient: RedisKVCache<T>['redisClient'], name: RedisKVCache<T>['name'], opts: {
|
constructor(
|
||||||
lifetime: RedisKVCache<T>['lifetime'];
|
private redisClient: Redis.Redis,
|
||||||
memoryCacheLifetime: number;
|
private name: string,
|
||||||
fetcher: RedisKVCache<T>['fetcher'];
|
opts: {
|
||||||
toRedisConverter: RedisKVCache<T>['toRedisConverter'];
|
lifetime: RedisKVCache<T>['lifetime'];
|
||||||
fromRedisConverter: RedisKVCache<T>['fromRedisConverter'];
|
memoryCacheLifetime: number;
|
||||||
}) {
|
fetcher: RedisKVCache<T>['fetcher'];
|
||||||
this.redisClient = redisClient;
|
toRedisConverter: RedisKVCache<T>['toRedisConverter'];
|
||||||
this.name = name;
|
fromRedisConverter: RedisKVCache<T>['fromRedisConverter'];
|
||||||
|
},
|
||||||
|
) {
|
||||||
this.lifetime = opts.lifetime;
|
this.lifetime = opts.lifetime;
|
||||||
this.memoryCache = new MemoryKVCache(opts.memoryCacheLifetime);
|
this.memoryCache = new MemoryKVCache(opts.memoryCacheLifetime);
|
||||||
this.fetcher = opts.fetcher;
|
this.fetcher = opts.fetcher;
|
||||||
|
@ -55,7 +55,13 @@ export class RedisKVCache<T> {
|
||||||
|
|
||||||
const cached = await this.redisClient.get(`kvcache:${this.name}:${key}`);
|
const cached = await this.redisClient.get(`kvcache:${this.name}:${key}`);
|
||||||
if (cached == null) return undefined;
|
if (cached == null) return undefined;
|
||||||
return this.fromRedisConverter(cached);
|
|
||||||
|
const value = this.fromRedisConverter(cached);
|
||||||
|
if (value !== undefined) {
|
||||||
|
this.memoryCache.set(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
|
@ -66,6 +72,10 @@ export class RedisKVCache<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* キャッシュがあればそれを返し、無ければfetcherを呼び出して結果をキャッシュ&返します
|
* キャッシュがあればそれを返し、無ければfetcherを呼び出して結果をキャッシュ&返します
|
||||||
|
* This awaits the call to Redis to ensure that the write succeeded, which is important for a few reasons:
|
||||||
|
* * Other code uses this to synchronize changes between worker processes. A failed write can internally de-sync the cluster.
|
||||||
|
* * Without an `await`, consecutive calls could race. An unlucky race could result in the older write overwriting the newer value.
|
||||||
|
* * Not awaiting here makes the entire cache non-consistent. The prevents many possible uses.
|
||||||
*/
|
*/
|
||||||
@bindThis
|
@bindThis
|
||||||
public async fetch(key: string): Promise<T> {
|
public async fetch(key: string): Promise<T> {
|
||||||
|
@ -77,14 +87,14 @@ export class RedisKVCache<T> {
|
||||||
|
|
||||||
// Cache MISS
|
// Cache MISS
|
||||||
const value = await this.fetcher(key);
|
const value = await this.fetcher(key);
|
||||||
this.set(key, value);
|
await this.set(key, value);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public async refresh(key: string) {
|
public async refresh(key: string) {
|
||||||
const value = await this.fetcher(key);
|
const value = await this.fetcher(key);
|
||||||
this.set(key, value);
|
await this.set(key, value);
|
||||||
|
|
||||||
// TODO: イベント発行して他プロセスのメモリキャッシュも更新できるようにする
|
// TODO: イベント発行して他プロセスのメモリキャッシュも更新できるようにする
|
||||||
}
|
}
|
||||||
|
@ -101,23 +111,23 @@ export class RedisKVCache<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class RedisSingleCache<T> {
|
export class RedisSingleCache<T> {
|
||||||
private redisClient: Redis.Redis;
|
private readonly lifetime: number;
|
||||||
private name: string;
|
private readonly memoryCache: MemorySingleCache<T>;
|
||||||
private lifetime: number;
|
private readonly fetcher: () => Promise<T>;
|
||||||
private memoryCache: MemorySingleCache<T>;
|
private readonly toRedisConverter: (value: T) => string;
|
||||||
private fetcher: () => Promise<T>;
|
private readonly fromRedisConverter: (value: string) => T | undefined;
|
||||||
private toRedisConverter: (value: T) => string;
|
|
||||||
private fromRedisConverter: (value: string) => T | undefined;
|
|
||||||
|
|
||||||
constructor(redisClient: RedisSingleCache<T>['redisClient'], name: RedisSingleCache<T>['name'], opts: {
|
constructor(
|
||||||
lifetime: RedisSingleCache<T>['lifetime'];
|
private redisClient: Redis.Redis,
|
||||||
memoryCacheLifetime: number;
|
private name: string,
|
||||||
fetcher: RedisSingleCache<T>['fetcher'];
|
opts: {
|
||||||
toRedisConverter: RedisSingleCache<T>['toRedisConverter'];
|
lifetime: number;
|
||||||
fromRedisConverter: RedisSingleCache<T>['fromRedisConverter'];
|
memoryCacheLifetime: number;
|
||||||
}) {
|
fetcher: RedisSingleCache<T>['fetcher'];
|
||||||
this.redisClient = redisClient;
|
toRedisConverter: RedisSingleCache<T>['toRedisConverter'];
|
||||||
this.name = name;
|
fromRedisConverter: RedisSingleCache<T>['fromRedisConverter'];
|
||||||
|
},
|
||||||
|
) {
|
||||||
this.lifetime = opts.lifetime;
|
this.lifetime = opts.lifetime;
|
||||||
this.memoryCache = new MemorySingleCache(opts.memoryCacheLifetime);
|
this.memoryCache = new MemorySingleCache(opts.memoryCacheLifetime);
|
||||||
this.fetcher = opts.fetcher;
|
this.fetcher = opts.fetcher;
|
||||||
|
@ -149,7 +159,13 @@ export class RedisSingleCache<T> {
|
||||||
|
|
||||||
const cached = await this.redisClient.get(`singlecache:${this.name}`);
|
const cached = await this.redisClient.get(`singlecache:${this.name}`);
|
||||||
if (cached == null) return undefined;
|
if (cached == null) return undefined;
|
||||||
return this.fromRedisConverter(cached);
|
|
||||||
|
const value = this.fromRedisConverter(cached);
|
||||||
|
if (value !== undefined) {
|
||||||
|
this.memoryCache.set(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
|
@ -160,6 +176,10 @@ export class RedisSingleCache<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* キャッシュがあればそれを返し、無ければfetcherを呼び出して結果をキャッシュ&返します
|
* キャッシュがあればそれを返し、無ければfetcherを呼び出して結果をキャッシュ&返します
|
||||||
|
* This awaits the call to Redis to ensure that the write succeeded, which is important for a few reasons:
|
||||||
|
* * Other code uses this to synchronize changes between worker processes. A failed write can internally de-sync the cluster.
|
||||||
|
* * Without an `await`, consecutive calls could race. An unlucky race could result in the older write overwriting the newer value.
|
||||||
|
* * Not awaiting here makes the entire cache non-consistent. The prevents many possible uses.
|
||||||
*/
|
*/
|
||||||
@bindThis
|
@bindThis
|
||||||
public async fetch(): Promise<T> {
|
public async fetch(): Promise<T> {
|
||||||
|
@ -171,14 +191,14 @@ export class RedisSingleCache<T> {
|
||||||
|
|
||||||
// Cache MISS
|
// Cache MISS
|
||||||
const value = await this.fetcher();
|
const value = await this.fetcher();
|
||||||
this.set(value);
|
await this.set(value);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public async refresh() {
|
public async refresh() {
|
||||||
const value = await this.fetcher();
|
const value = await this.fetcher();
|
||||||
this.set(value);
|
await this.set(value);
|
||||||
|
|
||||||
// TODO: イベント発行して他プロセスのメモリキャッシュも更新できるようにする
|
// TODO: イベント発行して他プロセスのメモリキャッシュも更新できるようにする
|
||||||
}
|
}
|
||||||
|
@ -187,22 +207,12 @@ export class RedisSingleCache<T> {
|
||||||
// TODO: メモリ節約のためあまり参照されないキーを定期的に削除できるようにする?
|
// TODO: メモリ節約のためあまり参照されないキーを定期的に削除できるようにする?
|
||||||
|
|
||||||
export class MemoryKVCache<T> {
|
export class MemoryKVCache<T> {
|
||||||
/**
|
private readonly cache = new Map<string, { date: number; value: T; }>();
|
||||||
* データを持つマップ
|
private readonly gcIntervalHandle = setInterval(() => this.gc(), 1000 * 60 * 3); // 3m
|
||||||
* @deprecated これを直接操作するべきではない
|
|
||||||
*/
|
|
||||||
public cache: Map<string, { date: number; value: T; }>;
|
|
||||||
private lifetime: number;
|
|
||||||
private gcIntervalHandle: NodeJS.Timeout;
|
|
||||||
|
|
||||||
constructor(lifetime: MemoryKVCache<never>['lifetime']) {
|
constructor(
|
||||||
this.cache = new Map();
|
private readonly lifetime: number,
|
||||||
this.lifetime = lifetime;
|
) {}
|
||||||
|
|
||||||
this.gcIntervalHandle = setInterval(() => {
|
|
||||||
this.gc();
|
|
||||||
}, 1000 * 60 * 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
/**
|
/**
|
||||||
|
@ -287,10 +297,14 @@ export class MemoryKVCache<T> {
|
||||||
@bindThis
|
@bindThis
|
||||||
public gc(): void {
|
public gc(): void {
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
|
|
||||||
for (const [key, { date }] of this.cache.entries()) {
|
for (const [key, { date }] of this.cache.entries()) {
|
||||||
if ((now - date) > this.lifetime) {
|
// The map is ordered from oldest to youngest.
|
||||||
this.cache.delete(key);
|
// We can stop once we find an entry that's still active, because all following entries must *also* be active.
|
||||||
}
|
const age = now - date;
|
||||||
|
if (age < this.lifetime) break;
|
||||||
|
|
||||||
|
this.cache.delete(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,16 +312,19 @@ export class MemoryKVCache<T> {
|
||||||
public dispose(): void {
|
public dispose(): void {
|
||||||
clearInterval(this.gcIntervalHandle);
|
clearInterval(this.gcIntervalHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get entries() {
|
||||||
|
return this.cache.entries();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class MemorySingleCache<T> {
|
export class MemorySingleCache<T> {
|
||||||
private cachedAt: number | null = null;
|
private cachedAt: number | null = null;
|
||||||
private value: T | undefined;
|
private value: T | undefined;
|
||||||
private lifetime: number;
|
|
||||||
|
|
||||||
constructor(lifetime: MemorySingleCache<never>['lifetime']) {
|
constructor(
|
||||||
this.lifetime = lifetime;
|
private lifetime: number,
|
||||||
}
|
) {}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public set(value: T): void {
|
public set(value: T): void {
|
||||||
|
|
|
@ -144,7 +144,9 @@ export interface Schema extends OfSchema {
|
||||||
readonly type?: TypeStringef;
|
readonly type?: TypeStringef;
|
||||||
readonly nullable?: boolean;
|
readonly nullable?: boolean;
|
||||||
readonly optional?: boolean;
|
readonly optional?: boolean;
|
||||||
|
readonly prefixItems?: ReadonlyArray<Schema>;
|
||||||
readonly items?: Schema;
|
readonly items?: Schema;
|
||||||
|
readonly unevaluatedItems?: Schema | boolean;
|
||||||
readonly properties?: Obj;
|
readonly properties?: Obj;
|
||||||
readonly required?: ReadonlyArray<Extract<keyof NonNullable<this['properties']>, string>>;
|
readonly required?: ReadonlyArray<Extract<keyof NonNullable<this['properties']>, string>>;
|
||||||
readonly description?: string;
|
readonly description?: string;
|
||||||
|
@ -198,6 +200,7 @@ type UnionSchemaType<a extends readonly any[], X extends Schema = a[number]> = X
|
||||||
//type UnionObjectSchemaType<a extends readonly any[], X extends Schema = a[number]> = X extends any ? ObjectSchemaType<X> : never;
|
//type UnionObjectSchemaType<a extends readonly any[], X extends Schema = a[number]> = X extends any ? ObjectSchemaType<X> : never;
|
||||||
type UnionObjType<s extends Obj, a extends readonly any[], X extends ReadonlyArray<keyof s> = a[number]> = X extends any ? ObjType<s, X> : never;
|
type UnionObjType<s extends Obj, a extends readonly any[], X extends ReadonlyArray<keyof s> = a[number]> = X extends any ? ObjType<s, X> : never;
|
||||||
type ArrayUnion<T> = T extends any ? Array<T> : never;
|
type ArrayUnion<T> = T extends any ? Array<T> : never;
|
||||||
|
type ArrayToTuple<X extends ReadonlyArray<Schema>> = { [K in keyof X]: SchemaType<X[K]> };
|
||||||
|
|
||||||
type ObjectSchemaTypeDef<p extends Schema> =
|
type ObjectSchemaTypeDef<p extends Schema> =
|
||||||
p['ref'] extends keyof typeof refs ? Packed<p['ref']> :
|
p['ref'] extends keyof typeof refs ? Packed<p['ref']> :
|
||||||
|
@ -232,6 +235,12 @@ export type SchemaTypeDef<p extends Schema> =
|
||||||
p['items']['allOf'] extends ReadonlyArray<Schema> ? UnionToIntersection<UnionSchemaType<NonNullable<p['items']['allOf']>>>[] :
|
p['items']['allOf'] extends ReadonlyArray<Schema> ? UnionToIntersection<UnionSchemaType<NonNullable<p['items']['allOf']>>>[] :
|
||||||
never
|
never
|
||||||
) :
|
) :
|
||||||
|
p['prefixItems'] extends ReadonlyArray<Schema> ? (
|
||||||
|
p['items'] extends NonNullable<Schema> ? [...ArrayToTuple<p['prefixItems']>, ...SchemaType<p['items']>[]] :
|
||||||
|
p['items'] extends false ? ArrayToTuple<p['prefixItems']> :
|
||||||
|
p['unevaluatedItems'] extends false ? ArrayToTuple<p['prefixItems']> :
|
||||||
|
[...ArrayToTuple<p['prefixItems']>, ...unknown[]]
|
||||||
|
) :
|
||||||
p['items'] extends NonNullable<Schema> ? SchemaType<p['items']>[] :
|
p['items'] extends NonNullable<Schema> ? SchemaType<p['items']>[] :
|
||||||
any[]
|
any[]
|
||||||
) :
|
) :
|
||||||
|
|
|
@ -6,3 +6,7 @@
|
||||||
export type JsonValue = JsonArray | JsonObject | string | number | boolean | null;
|
export type JsonValue = JsonArray | JsonObject | string | number | boolean | null;
|
||||||
export type JsonObject = {[K in string]?: JsonValue};
|
export type JsonObject = {[K in string]?: JsonValue};
|
||||||
export type JsonArray = JsonValue[];
|
export type JsonArray = JsonValue[];
|
||||||
|
|
||||||
|
export function isJsonObject(value: JsonValue | undefined): value is JsonObject {
|
||||||
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
||||||
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ export type MiNotification = {
|
||||||
/**
|
/**
|
||||||
* アプリ通知のbody
|
* アプリ通知のbody
|
||||||
*/
|
*/
|
||||||
customBody: string | null;
|
customBody: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* アプリ通知のheader
|
* アプリ通知のheader
|
||||||
|
|
|
@ -44,6 +44,11 @@ export const packedFlashSchema = {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
|
visibility: {
|
||||||
|
type: 'string',
|
||||||
|
optional: false, nullable: false,
|
||||||
|
enum: ['private', 'public'],
|
||||||
|
},
|
||||||
likedCount: {
|
likedCount: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
optional: false, nullable: true,
|
optional: false, nullable: true,
|
||||||
|
|
|
@ -258,6 +258,10 @@ export const packedMetaLiteSchema = {
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
default: 'local',
|
default: 'local',
|
||||||
},
|
},
|
||||||
|
maxFileSize: {
|
||||||
|
type: 'number',
|
||||||
|
optional: false, nullable: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { ACHIEVEMENT_TYPES } from '@/core/AchievementService.js';
|
||||||
import { notificationTypes } from '@/types.js';
|
import { notificationTypes } from '@/types.js';
|
||||||
|
|
||||||
const baseSchema = {
|
const baseSchema = {
|
||||||
|
@ -294,6 +295,7 @@ export const packedNotificationSchema = {
|
||||||
achievement: {
|
achievement: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
|
enum: ACHIEVEMENT_TYPES,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
|
@ -311,11 +313,11 @@ export const packedNotificationSchema = {
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: true,
|
||||||
},
|
},
|
||||||
icon: {
|
icon: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
|
|
|
@ -45,7 +45,7 @@ export class DeliverProcessorService {
|
||||||
private queueLoggerService: QueueLoggerService,
|
private queueLoggerService: QueueLoggerService,
|
||||||
) {
|
) {
|
||||||
this.logger = this.queueLoggerService.logger.createSubLogger('deliver');
|
this.logger = this.queueLoggerService.logger.createSubLogger('deliver');
|
||||||
this.suspendedHostsCache = new MemorySingleCache<MiInstance[]>(1000 * 60 * 60);
|
this.suspendedHostsCache = new MemorySingleCache<MiInstance[]>(1000 * 60 * 60); // 1h
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
|
|
|
@ -134,7 +134,7 @@ export class NodeinfoServerService {
|
||||||
return document;
|
return document;
|
||||||
};
|
};
|
||||||
|
|
||||||
const cache = new MemorySingleCache<Awaited<ReturnType<typeof nodeinfo2>>>(1000 * 60 * 10);
|
const cache = new MemorySingleCache<Awaited<ReturnType<typeof nodeinfo2>>>(1000 * 60 * 10); // 10m
|
||||||
|
|
||||||
fastify.get(nodeinfo2_1path, async (request, reply) => {
|
fastify.get(nodeinfo2_1path, async (request, reply) => {
|
||||||
const base = await cache.fetch(() => nodeinfo2(21));
|
const base = await cache.fetch(() => nodeinfo2(21));
|
||||||
|
|
|
@ -199,9 +199,18 @@ export class ApiCallService implements OnApplicationShutdown {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const [path] = await createTemp();
|
const [path, cleanup] = await createTemp();
|
||||||
await stream.pipeline(multipartData.file, fs.createWriteStream(path));
|
await stream.pipeline(multipartData.file, fs.createWriteStream(path));
|
||||||
|
|
||||||
|
// ファイルサイズが制限を超えていた場合
|
||||||
|
// なお truncated はストリームを読み切ってからでないと機能しないため、stream.pipeline より後にある必要がある
|
||||||
|
if (multipartData.file.truncated) {
|
||||||
|
cleanup();
|
||||||
|
reply.code(413);
|
||||||
|
reply.send();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const fields = {} as Record<string, unknown>;
|
const fields = {} as Record<string, unknown>;
|
||||||
for (const [k, v] of Object.entries(multipartData.fields)) {
|
for (const [k, v] of Object.entries(multipartData.fields)) {
|
||||||
fields[k] = typeof v === 'object' && 'value' in v ? v.value : undefined;
|
fields[k] = typeof v === 'object' && 'value' in v ? v.value : undefined;
|
||||||
|
|
|
@ -49,7 +49,7 @@ export class ApiServerService {
|
||||||
|
|
||||||
fastify.register(multipart, {
|
fastify.register(multipart, {
|
||||||
limits: {
|
limits: {
|
||||||
fileSize: this.config.maxFileSize ?? 262144000,
|
fileSize: this.config.maxFileSize,
|
||||||
files: 1,
|
files: 1,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -37,7 +37,7 @@ export class AuthenticateService implements OnApplicationShutdown {
|
||||||
|
|
||||||
private cacheService: CacheService,
|
private cacheService: CacheService,
|
||||||
) {
|
) {
|
||||||
this.appCache = new MemoryKVCache<MiApp>(Infinity);
|
this.appCache = new MemoryKVCache<MiApp>(1000 * 60 * 60 * 24 * 7); // 1w
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
|
|
|
@ -7,9 +7,9 @@ import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||||
import type { UsersRepository } from '@/models/_.js';
|
import type { UsersRepository } from '@/models/_.js';
|
||||||
import { QueueService } from '@/core/QueueService.js';
|
import { QueueService } from '@/core/QueueService.js';
|
||||||
import { UserSuspendService } from '@/core/UserSuspendService.js';
|
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import { UserEntityService } from '@/core/entities/UserEntityService.js';
|
import { UserEntityService } from '@/core/entities/UserEntityService.js';
|
||||||
|
import { DeleteAccountService } from '@/core/DeleteAccountService.js';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
tags: ['admin'],
|
tags: ['admin'],
|
||||||
|
@ -33,9 +33,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
@Inject(DI.usersRepository)
|
@Inject(DI.usersRepository)
|
||||||
private usersRepository: UsersRepository,
|
private usersRepository: UsersRepository,
|
||||||
|
|
||||||
private userEntityService: UserEntityService,
|
private deleteAccoountService: DeleteAccountService,
|
||||||
private queueService: QueueService,
|
|
||||||
private userSuspendService: UserSuspendService,
|
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const user = await this.usersRepository.findOneBy({ id: ps.userId });
|
const user = await this.usersRepository.findOneBy({ id: ps.userId });
|
||||||
|
@ -48,22 +46,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
throw new Error('cannot delete a root account');
|
throw new Error('cannot delete a root account');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.userEntityService.isLocalUser(user)) {
|
await this.deleteAccoountService.deleteAccount(user);
|
||||||
// 物理削除する前にDelete activityを送信する
|
|
||||||
await this.userSuspendService.doPostSuspend(user).catch(err => {});
|
|
||||||
|
|
||||||
this.queueService.createDeleteAccountJob(user, {
|
|
||||||
soft: false,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.queueService.createDeleteAccountJob(user, {
|
|
||||||
soft: true, // リモートユーザーの削除は、完全にDBから物理削除してしまうと再度連合してきてアカウントが復活する可能性があるため、soft指定する
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
await this.usersRepository.update(user.id, {
|
|
||||||
isDeleted: true,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,16 +21,15 @@ export const meta = {
|
||||||
items: {
|
items: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
items: {
|
prefixItems: [
|
||||||
anyOf: [
|
{
|
||||||
{
|
type: 'string',
|
||||||
type: 'string',
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'number',
|
||||||
type: 'number',
|
},
|
||||||
},
|
],
|
||||||
],
|
unevaluatedItems: false,
|
||||||
},
|
|
||||||
},
|
},
|
||||||
example: [[
|
example: [[
|
||||||
'example.com',
|
'example.com',
|
||||||
|
|
|
@ -21,16 +21,15 @@ export const meta = {
|
||||||
items: {
|
items: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
items: {
|
prefixItems: [
|
||||||
anyOf: [
|
{
|
||||||
{
|
type: 'string',
|
||||||
type: 'string',
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'number',
|
||||||
type: 'number',
|
},
|
||||||
},
|
],
|
||||||
],
|
unevaluatedItems: false,
|
||||||
},
|
|
||||||
},
|
},
|
||||||
example: [[
|
example: [[
|
||||||
'example.com',
|
'example.com',
|
||||||
|
|
|
@ -7,6 +7,7 @@ import { Injectable } from '@nestjs/common';
|
||||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||||
import { GlobalEventService } from '@/core/GlobalEventService.js';
|
import { GlobalEventService } from '@/core/GlobalEventService.js';
|
||||||
import { MetaService } from '@/core/MetaService.js';
|
import { MetaService } from '@/core/MetaService.js';
|
||||||
|
import { ModerationLogService } from '@/core/ModerationLogService.js';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
tags: ['admin', 'role'],
|
tags: ['admin', 'role'],
|
||||||
|
@ -33,12 +34,22 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
constructor(
|
constructor(
|
||||||
private metaService: MetaService,
|
private metaService: MetaService,
|
||||||
private globalEventService: GlobalEventService,
|
private globalEventService: GlobalEventService,
|
||||||
|
private moderationLogService: ModerationLogService,
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
|
const before = await this.metaService.fetch(true);
|
||||||
|
|
||||||
await this.metaService.update({
|
await this.metaService.update({
|
||||||
policies: ps.policies,
|
policies: ps.policies,
|
||||||
});
|
});
|
||||||
this.globalEventService.publishInternalEvent('policiesUpdated', ps.policies);
|
|
||||||
|
const after = await this.metaService.fetch(true);
|
||||||
|
|
||||||
|
this.globalEventService.publishInternalEvent('policiesUpdated', after.policies);
|
||||||
|
this.moderationLogService.log(me, 'updateServerSettings', {
|
||||||
|
before: before.policies,
|
||||||
|
after: after.policies,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,18 +3,12 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { IsNull, Not } from 'typeorm';
|
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||||
import type { UsersRepository, FollowingsRepository } from '@/models/_.js';
|
import type { UsersRepository } from '@/models/_.js';
|
||||||
import type { MiUser } from '@/models/User.js';
|
|
||||||
import type { RelationshipJobData } from '@/queue/types.js';
|
|
||||||
import { ModerationLogService } from '@/core/ModerationLogService.js';
|
|
||||||
import { UserSuspendService } from '@/core/UserSuspendService.js';
|
import { UserSuspendService } from '@/core/UserSuspendService.js';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
|
||||||
import { RoleService } from '@/core/RoleService.js';
|
import { RoleService } from '@/core/RoleService.js';
|
||||||
import { QueueService } from '@/core/QueueService.js';
|
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
tags: ['admin'],
|
tags: ['admin'],
|
||||||
|
@ -38,13 +32,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
@Inject(DI.usersRepository)
|
@Inject(DI.usersRepository)
|
||||||
private usersRepository: UsersRepository,
|
private usersRepository: UsersRepository,
|
||||||
|
|
||||||
@Inject(DI.followingsRepository)
|
|
||||||
private followingsRepository: FollowingsRepository,
|
|
||||||
|
|
||||||
private userSuspendService: UserSuspendService,
|
private userSuspendService: UserSuspendService,
|
||||||
private roleService: RoleService,
|
private roleService: RoleService,
|
||||||
private moderationLogService: ModerationLogService,
|
|
||||||
private queueService: QueueService,
|
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const user = await this.usersRepository.findOneBy({ id: ps.userId });
|
const user = await this.usersRepository.findOneBy({ id: ps.userId });
|
||||||
|
@ -57,42 +46,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
throw new Error('cannot suspend moderator account');
|
throw new Error('cannot suspend moderator account');
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.usersRepository.update(user.id, {
|
await this.userSuspendService.suspend(user, me);
|
||||||
isSuspended: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
this.moderationLogService.log(me, 'suspend', {
|
|
||||||
userId: user.id,
|
|
||||||
userUsername: user.username,
|
|
||||||
userHost: user.host,
|
|
||||||
});
|
|
||||||
|
|
||||||
(async () => {
|
|
||||||
await this.userSuspendService.doPostSuspend(user).catch(e => {});
|
|
||||||
await this.unFollowAll(user).catch(e => {});
|
|
||||||
})();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
|
||||||
private async unFollowAll(follower: MiUser) {
|
|
||||||
const followings = await this.followingsRepository.find({
|
|
||||||
where: {
|
|
||||||
followerId: follower.id,
|
|
||||||
followeeId: Not(IsNull()),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const jobs: RelationshipJobData[] = [];
|
|
||||||
for (const following of followings) {
|
|
||||||
if (following.followeeId && following.followerId) {
|
|
||||||
jobs.push({
|
|
||||||
from: { id: following.followerId },
|
|
||||||
to: { id: following.followeeId },
|
|
||||||
silent: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.queueService.createUnfollowJob(jobs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||||
import type { UsersRepository } from '@/models/_.js';
|
import type { UsersRepository } from '@/models/_.js';
|
||||||
import { ModerationLogService } from '@/core/ModerationLogService.js';
|
|
||||||
import { UserSuspendService } from '@/core/UserSuspendService.js';
|
import { UserSuspendService } from '@/core/UserSuspendService.js';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
|
|
||||||
|
@ -33,7 +32,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
private usersRepository: UsersRepository,
|
private usersRepository: UsersRepository,
|
||||||
|
|
||||||
private userSuspendService: UserSuspendService,
|
private userSuspendService: UserSuspendService,
|
||||||
private moderationLogService: ModerationLogService,
|
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const user = await this.usersRepository.findOneBy({ id: ps.userId });
|
const user = await this.usersRepository.findOneBy({ id: ps.userId });
|
||||||
|
@ -42,17 +40,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
throw new Error('user not found');
|
throw new Error('user not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.usersRepository.update(user.id, {
|
await this.userSuspendService.unsuspend(user, me);
|
||||||
isSuspended: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
this.moderationLogService.log(me, 'unsuspend', {
|
|
||||||
userId: user.id,
|
|
||||||
userUsername: user.username,
|
|
||||||
userHost: user.host,
|
|
||||||
});
|
|
||||||
|
|
||||||
this.userSuspendService.doPostUnsuspend(user);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,12 @@ export const meta = {
|
||||||
code: 'TOO_MANY_ANTENNAS',
|
code: 'TOO_MANY_ANTENNAS',
|
||||||
id: 'faf47050-e8b5-438c-913c-db2b1576fde4',
|
id: 'faf47050-e8b5-438c-913c-db2b1576fde4',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
emptyKeyword: {
|
||||||
|
message: 'Either keywords or excludeKeywords is required.',
|
||||||
|
code: 'EMPTY_KEYWORD',
|
||||||
|
id: '53ee222e-1ddd-4f9a-92e5-9fb82ddb463a',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
res: {
|
res: {
|
||||||
|
@ -87,7 +93,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
if (ps.keywords.flat().every(x => x === '') && ps.excludeKeywords.flat().every(x => x === '')) {
|
if (ps.keywords.flat().every(x => x === '') && ps.excludeKeywords.flat().every(x => x === '')) {
|
||||||
throw new Error('either keywords or excludeKeywords is required.');
|
throw new ApiError(meta.errors.emptyKeyword);
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentAntennasCount = await this.antennasRepository.countBy({
|
const currentAntennasCount = await this.antennasRepository.countBy({
|
||||||
|
|
|
@ -32,6 +32,12 @@ export const meta = {
|
||||||
code: 'NO_SUCH_USER_LIST',
|
code: 'NO_SUCH_USER_LIST',
|
||||||
id: '1c6b35c9-943e-48c2-81e4-2844989407f7',
|
id: '1c6b35c9-943e-48c2-81e4-2844989407f7',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
emptyKeyword: {
|
||||||
|
message: 'Either keywords or excludeKeywords is required.',
|
||||||
|
code: 'EMPTY_KEYWORD',
|
||||||
|
id: '721aaff6-4e1b-4d88-8de6-877fae9f68c4',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
res: {
|
res: {
|
||||||
|
@ -85,7 +91,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
if (ps.keywords && ps.excludeKeywords) {
|
if (ps.keywords && ps.excludeKeywords) {
|
||||||
if (ps.keywords.flat().every(x => x === '') && ps.excludeKeywords.flat().every(x => x === '')) {
|
if (ps.keywords.flat().every(x => x === '') && ps.excludeKeywords.flat().every(x => x === '')) {
|
||||||
throw new Error('either keywords or excludeKeywords is required.');
|
throw new ApiError(meta.errors.emptyKeyword);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Fetch the antenna
|
// Fetch the antenna
|
||||||
|
|
|
@ -170,7 +170,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
|
|
||||||
const instances = await query.limit(ps.limit).offset(ps.offset).getMany();
|
const instances = await query.limit(ps.limit).offset(ps.offset).getMany();
|
||||||
|
|
||||||
return await this.instanceEntityService.packMany(instances);
|
return await this.instanceEntityService.packMany(instances, me);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,9 +107,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
const gotPubCount = topPubInstances.map(x => x.followingCount).reduce((a, b) => a + b, 0);
|
const gotPubCount = topPubInstances.map(x => x.followingCount).reduce((a, b) => a + b, 0);
|
||||||
|
|
||||||
return await awaitAll({
|
return await awaitAll({
|
||||||
topSubInstances: this.instanceEntityService.packMany(topSubInstances),
|
topSubInstances: this.instanceEntityService.packMany(topSubInstances, me),
|
||||||
otherFollowersCount: Math.max(0, allSubCount - gotSubCount),
|
otherFollowersCount: Math.max(0, allSubCount - gotSubCount),
|
||||||
topPubInstances: this.instanceEntityService.packMany(topPubInstances),
|
topPubInstances: this.instanceEntityService.packMany(topPubInstances, me),
|
||||||
otherFollowingCount: Math.max(0, allPubCount - gotPubCount),
|
otherFollowingCount: Math.max(0, allPubCount - gotPubCount),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,9 +4,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import type { FlashsRepository } from '@/models/_.js';
|
import type { FlashsRepository, UsersRepository } from '@/models/_.js';
|
||||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
|
import { ModerationLogService } from '@/core/ModerationLogService.js';
|
||||||
|
import { RoleService } from '@/core/RoleService.js';
|
||||||
import { ApiError } from '../../error.js';
|
import { ApiError } from '../../error.js';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
|
@ -44,17 +46,35 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(DI.flashsRepository)
|
@Inject(DI.flashsRepository)
|
||||||
private flashsRepository: FlashsRepository,
|
private flashsRepository: FlashsRepository,
|
||||||
|
|
||||||
|
@Inject(DI.usersRepository)
|
||||||
|
private usersRepository: UsersRepository,
|
||||||
|
|
||||||
|
private moderationLogService: ModerationLogService,
|
||||||
|
private roleService: RoleService,
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const flash = await this.flashsRepository.findOneBy({ id: ps.flashId });
|
const flash = await this.flashsRepository.findOneBy({ id: ps.flashId });
|
||||||
|
|
||||||
if (flash == null) {
|
if (flash == null) {
|
||||||
throw new ApiError(meta.errors.noSuchFlash);
|
throw new ApiError(meta.errors.noSuchFlash);
|
||||||
}
|
}
|
||||||
if (flash.userId !== me.id) {
|
|
||||||
|
if (!await this.roleService.isModerator(me) && flash.userId !== me.id) {
|
||||||
throw new ApiError(meta.errors.accessDenied);
|
throw new ApiError(meta.errors.accessDenied);
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.flashsRepository.delete(flash.id);
|
await this.flashsRepository.delete(flash.id);
|
||||||
|
|
||||||
|
if (flash.userId !== me.id) {
|
||||||
|
const user = await this.usersRepository.findOneByOrFail({ id: flash.userId });
|
||||||
|
this.moderationLogService.log(me, 'deleteFlash', {
|
||||||
|
flashId: flash.id,
|
||||||
|
flashUserId: flash.userId,
|
||||||
|
flashUserUsername: user.username,
|
||||||
|
flash,
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,10 @@
|
||||||
|
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||||
import type { GalleryPostsRepository } from '@/models/_.js';
|
import type { GalleryPostsRepository, UsersRepository } from '@/models/_.js';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
|
import { ModerationLogService } from '@/core/ModerationLogService.js';
|
||||||
|
import { RoleService } from '@/core/RoleService.js';
|
||||||
import { ApiError } from '../../../error.js';
|
import { ApiError } from '../../../error.js';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
|
@ -22,6 +24,12 @@ export const meta = {
|
||||||
code: 'NO_SUCH_POST',
|
code: 'NO_SUCH_POST',
|
||||||
id: 'ae52f367-4bd7-4ecd-afc6-5672fff427f5',
|
id: 'ae52f367-4bd7-4ecd-afc6-5672fff427f5',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
accessDenied: {
|
||||||
|
message: 'Access denied.',
|
||||||
|
code: 'ACCESS_DENIED',
|
||||||
|
id: 'c86e09de-1c48-43ac-a435-1c7e42ed4496',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
@ -38,18 +46,35 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(DI.galleryPostsRepository)
|
@Inject(DI.galleryPostsRepository)
|
||||||
private galleryPostsRepository: GalleryPostsRepository,
|
private galleryPostsRepository: GalleryPostsRepository,
|
||||||
|
|
||||||
|
@Inject(DI.usersRepository)
|
||||||
|
private usersRepository: UsersRepository,
|
||||||
|
|
||||||
|
private moderationLogService: ModerationLogService,
|
||||||
|
private roleService: RoleService,
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const post = await this.galleryPostsRepository.findOneBy({
|
const post = await this.galleryPostsRepository.findOneBy({ id: ps.postId });
|
||||||
id: ps.postId,
|
|
||||||
userId: me.id,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (post == null) {
|
if (post == null) {
|
||||||
throw new ApiError(meta.errors.noSuchPost);
|
throw new ApiError(meta.errors.noSuchPost);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!await this.roleService.isModerator(me) && post.userId !== me.id) {
|
||||||
|
throw new ApiError(meta.errors.accessDenied);
|
||||||
|
}
|
||||||
|
|
||||||
await this.galleryPostsRepository.delete(post.id);
|
await this.galleryPostsRepository.delete(post.id);
|
||||||
|
|
||||||
|
if (post.userId !== me.id) {
|
||||||
|
const user = await this.usersRepository.findOneByOrFail({ id: post.userId });
|
||||||
|
this.moderationLogService.log(me, 'deleteGalleryPost', {
|
||||||
|
postId: post.id,
|
||||||
|
postUserId: post.userId,
|
||||||
|
postUserUsername: user.username,
|
||||||
|
post,
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import type { PagesRepository } from '@/models/_.js';
|
import type { PagesRepository, UsersRepository } from '@/models/_.js';
|
||||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
|
import { ModerationLogService } from '@/core/ModerationLogService.js';
|
||||||
|
import { RoleService } from '@/core/RoleService.js';
|
||||||
import { ApiError } from '../../error.js';
|
import { ApiError } from '../../error.js';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
|
@ -44,17 +46,35 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(DI.pagesRepository)
|
@Inject(DI.pagesRepository)
|
||||||
private pagesRepository: PagesRepository,
|
private pagesRepository: PagesRepository,
|
||||||
|
|
||||||
|
@Inject(DI.usersRepository)
|
||||||
|
private usersRepository: UsersRepository,
|
||||||
|
|
||||||
|
private moderationLogService: ModerationLogService,
|
||||||
|
private roleService: RoleService,
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const page = await this.pagesRepository.findOneBy({ id: ps.pageId });
|
const page = await this.pagesRepository.findOneBy({ id: ps.pageId });
|
||||||
|
|
||||||
if (page == null) {
|
if (page == null) {
|
||||||
throw new ApiError(meta.errors.noSuchPage);
|
throw new ApiError(meta.errors.noSuchPage);
|
||||||
}
|
}
|
||||||
if (page.userId !== me.id) {
|
|
||||||
|
if (!await this.roleService.isModerator(me) && page.userId !== me.id) {
|
||||||
throw new ApiError(meta.errors.accessDenied);
|
throw new ApiError(meta.errors.accessDenied);
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.pagesRepository.delete(page.id);
|
await this.pagesRepository.delete(page.id);
|
||||||
|
|
||||||
|
if (page.userId !== me.id) {
|
||||||
|
const user = await this.usersRepository.findOneByOrFail({ id: page.userId });
|
||||||
|
this.moderationLogService.log(me, 'deletePage', {
|
||||||
|
pageId: page.id,
|
||||||
|
pageUserId: page.userId,
|
||||||
|
pageUserUsername: user.username,
|
||||||
|
page,
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
}
|
}
|
||||||
const chartUsers: { userId: string; count: number; }[] = [];
|
const chartUsers: { userId: string; count: number; }[] = [];
|
||||||
if (ps.sort?.endsWith('pv')) {
|
if (ps.sort?.endsWith('pv')) {
|
||||||
await this.perUserPvChart.getChartUsers('day', 0, null, ps.limit, ps.offset).then(users => {
|
await this.perUserPvChart.getChartUsers('day', ps.sort === '+pv' ? 'DESC' : 'ASC', 0, null, ps.limit, ps.offset).then(users => {
|
||||||
chartUsers.push(...users);
|
chartUsers.push(...users);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { QueryService } from '@/core/QueryService.js';
|
||||||
import { FollowingEntityService } from '@/core/entities/FollowingEntityService.js';
|
import { FollowingEntityService } from '@/core/entities/FollowingEntityService.js';
|
||||||
import { UtilityService } from '@/core/UtilityService.js';
|
import { UtilityService } from '@/core/UtilityService.js';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
|
import { RoleService } from '@/core/RoleService.js';
|
||||||
import { ApiError } from '../../error.js';
|
import { ApiError } from '../../error.js';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
|
@ -81,6 +82,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
private utilityService: UtilityService,
|
private utilityService: UtilityService,
|
||||||
private followingEntityService: FollowingEntityService,
|
private followingEntityService: FollowingEntityService,
|
||||||
private queryService: QueryService,
|
private queryService: QueryService,
|
||||||
|
private roleService: RoleService,
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const user = await this.usersRepository.findOneBy(ps.userId != null
|
const user = await this.usersRepository.findOneBy(ps.userId != null
|
||||||
|
@ -93,23 +95,25 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
|
|
||||||
const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id });
|
const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id });
|
||||||
|
|
||||||
if (profile.followersVisibility === 'private') {
|
if (profile.followersVisibility !== 'public' && !await this.roleService.isModerator(me)) {
|
||||||
if (me == null || (me.id !== user.id)) {
|
if (profile.followersVisibility === 'private') {
|
||||||
throw new ApiError(meta.errors.forbidden);
|
if (me == null || (me.id !== user.id)) {
|
||||||
}
|
|
||||||
} else if (profile.followersVisibility === 'followers') {
|
|
||||||
if (me == null) {
|
|
||||||
throw new ApiError(meta.errors.forbidden);
|
|
||||||
} else if (me.id !== user.id) {
|
|
||||||
const isFollowing = await this.followingsRepository.exists({
|
|
||||||
where: {
|
|
||||||
followeeId: user.id,
|
|
||||||
followerId: me.id,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
if (!isFollowing) {
|
|
||||||
throw new ApiError(meta.errors.forbidden);
|
throw new ApiError(meta.errors.forbidden);
|
||||||
}
|
}
|
||||||
|
} else if (profile.followersVisibility === 'followers') {
|
||||||
|
if (me == null) {
|
||||||
|
throw new ApiError(meta.errors.forbidden);
|
||||||
|
} else if (me.id !== user.id) {
|
||||||
|
const isFollowing = await this.followingsRepository.exists({
|
||||||
|
where: {
|
||||||
|
followeeId: user.id,
|
||||||
|
followerId: me.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (!isFollowing) {
|
||||||
|
throw new ApiError(meta.errors.forbidden);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ import { QueryService } from '@/core/QueryService.js';
|
||||||
import { FollowingEntityService } from '@/core/entities/FollowingEntityService.js';
|
import { FollowingEntityService } from '@/core/entities/FollowingEntityService.js';
|
||||||
import { UtilityService } from '@/core/UtilityService.js';
|
import { UtilityService } from '@/core/UtilityService.js';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
|
import { RoleService } from '@/core/RoleService.js';
|
||||||
import { ApiError } from '../../error.js';
|
import { ApiError } from '../../error.js';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
|
@ -90,6 +91,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
private utilityService: UtilityService,
|
private utilityService: UtilityService,
|
||||||
private followingEntityService: FollowingEntityService,
|
private followingEntityService: FollowingEntityService,
|
||||||
private queryService: QueryService,
|
private queryService: QueryService,
|
||||||
|
private roleService: RoleService,
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const user = await this.usersRepository.findOneBy(ps.userId != null
|
const user = await this.usersRepository.findOneBy(ps.userId != null
|
||||||
|
@ -102,23 +104,25 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
|
|
||||||
const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id });
|
const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id });
|
||||||
|
|
||||||
if (profile.followingVisibility === 'private') {
|
if (profile.followingVisibility !== 'public' && !await this.roleService.isModerator(me)) {
|
||||||
if (me == null || (me.id !== user.id)) {
|
if (profile.followingVisibility === 'private') {
|
||||||
throw new ApiError(meta.errors.forbidden);
|
if (me == null || (me.id !== user.id)) {
|
||||||
}
|
|
||||||
} else if (profile.followingVisibility === 'followers') {
|
|
||||||
if (me == null) {
|
|
||||||
throw new ApiError(meta.errors.forbidden);
|
|
||||||
} else if (me.id !== user.id) {
|
|
||||||
const isFollowing = await this.followingsRepository.exists({
|
|
||||||
where: {
|
|
||||||
followeeId: user.id,
|
|
||||||
followerId: me.id,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
if (!isFollowing) {
|
|
||||||
throw new ApiError(meta.errors.forbidden);
|
throw new ApiError(meta.errors.forbidden);
|
||||||
}
|
}
|
||||||
|
} else if (profile.followingVisibility === 'followers') {
|
||||||
|
if (me == null) {
|
||||||
|
throw new ApiError(meta.errors.forbidden);
|
||||||
|
} else if (me.id !== user.id) {
|
||||||
|
const isFollowing = await this.followingsRepository.exists({
|
||||||
|
where: {
|
||||||
|
followeeId: user.id,
|
||||||
|
followerId: me.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (!isFollowing) {
|
||||||
|
throw new ApiError(meta.errors.forbidden);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,11 +14,14 @@ import { CacheService } from '@/core/CacheService.js';
|
||||||
import { MiFollowing, MiUserProfile } from '@/models/_.js';
|
import { MiFollowing, MiUserProfile } from '@/models/_.js';
|
||||||
import type { StreamEventEmitter, GlobalEvents } from '@/core/GlobalEventService.js';
|
import type { StreamEventEmitter, GlobalEvents } from '@/core/GlobalEventService.js';
|
||||||
import { ChannelFollowingService } from '@/core/ChannelFollowingService.js';
|
import { ChannelFollowingService } from '@/core/ChannelFollowingService.js';
|
||||||
import type { JsonObject } from '@/misc/json-value.js';
|
import { isJsonObject } from '@/misc/json-value.js';
|
||||||
|
import type { JsonObject, JsonValue } from '@/misc/json-value.js';
|
||||||
import type { ChannelsService } from './ChannelsService.js';
|
import type { ChannelsService } from './ChannelsService.js';
|
||||||
import type { EventEmitter } from 'events';
|
import type { EventEmitter } from 'events';
|
||||||
import type Channel from './channel.js';
|
import type Channel from './channel.js';
|
||||||
|
|
||||||
|
const MAX_CHANNELS_PER_CONNECTION = 32;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main stream connection
|
* Main stream connection
|
||||||
*/
|
*/
|
||||||
|
@ -112,8 +115,6 @@ export default class Connection {
|
||||||
|
|
||||||
const { type, body } = obj;
|
const { type, body } = obj;
|
||||||
|
|
||||||
if (typeof body !== 'object' || body === null || Array.isArray(body)) return;
|
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'readNotification': this.onReadNotification(body); break;
|
case 'readNotification': this.onReadNotification(body); break;
|
||||||
case 'subNote': this.onSubscribeNote(body); break;
|
case 'subNote': this.onSubscribeNote(body); break;
|
||||||
|
@ -154,7 +155,8 @@ export default class Connection {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
private readNote(body: JsonObject) {
|
private readNote(body: JsonValue | undefined) {
|
||||||
|
if (!isJsonObject(body)) return;
|
||||||
const id = body.id;
|
const id = body.id;
|
||||||
|
|
||||||
const note = this.cachedNotes.find(n => n.id === id);
|
const note = this.cachedNotes.find(n => n.id === id);
|
||||||
|
@ -166,7 +168,7 @@ export default class Connection {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
private onReadNotification(payload: JsonObject) {
|
private onReadNotification(payload: JsonValue | undefined) {
|
||||||
this.notificationService.readAllNotification(this.user!.id);
|
this.notificationService.readAllNotification(this.user!.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,7 +176,8 @@ export default class Connection {
|
||||||
* 投稿購読要求時
|
* 投稿購読要求時
|
||||||
*/
|
*/
|
||||||
@bindThis
|
@bindThis
|
||||||
private onSubscribeNote(payload: JsonObject) {
|
private onSubscribeNote(payload: JsonValue | undefined) {
|
||||||
|
if (!isJsonObject(payload)) return;
|
||||||
if (!payload.id || typeof payload.id !== 'string') return;
|
if (!payload.id || typeof payload.id !== 'string') return;
|
||||||
|
|
||||||
const current = this.subscribingNotes[payload.id] ?? 0;
|
const current = this.subscribingNotes[payload.id] ?? 0;
|
||||||
|
@ -190,7 +193,8 @@ export default class Connection {
|
||||||
* 投稿購読解除要求時
|
* 投稿購読解除要求時
|
||||||
*/
|
*/
|
||||||
@bindThis
|
@bindThis
|
||||||
private onUnsubscribeNote(payload: JsonObject) {
|
private onUnsubscribeNote(payload: JsonValue | undefined) {
|
||||||
|
if (!isJsonObject(payload)) return;
|
||||||
if (!payload.id || typeof payload.id !== 'string') return;
|
if (!payload.id || typeof payload.id !== 'string') return;
|
||||||
|
|
||||||
const current = this.subscribingNotes[payload.id];
|
const current = this.subscribingNotes[payload.id];
|
||||||
|
@ -216,12 +220,13 @@ export default class Connection {
|
||||||
* チャンネル接続要求時
|
* チャンネル接続要求時
|
||||||
*/
|
*/
|
||||||
@bindThis
|
@bindThis
|
||||||
private onChannelConnectRequested(payload: JsonObject) {
|
private onChannelConnectRequested(payload: JsonValue | undefined) {
|
||||||
|
if (!isJsonObject(payload)) return;
|
||||||
const { channel, id, params, pong } = payload;
|
const { channel, id, params, pong } = payload;
|
||||||
if (typeof id !== 'string') return;
|
if (typeof id !== 'string') return;
|
||||||
if (typeof channel !== 'string') return;
|
if (typeof channel !== 'string') return;
|
||||||
if (typeof pong !== 'boolean' && typeof pong !== 'undefined' && pong !== null) return;
|
if (typeof pong !== 'boolean' && typeof pong !== 'undefined' && pong !== null) return;
|
||||||
if (typeof params !== 'undefined' && (typeof params !== 'object' || params === null || Array.isArray(params))) return;
|
if (typeof params !== 'undefined' && !isJsonObject(params)) return;
|
||||||
this.connectChannel(id, params, channel, pong ?? undefined);
|
this.connectChannel(id, params, channel, pong ?? undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,7 +234,8 @@ export default class Connection {
|
||||||
* チャンネル切断要求時
|
* チャンネル切断要求時
|
||||||
*/
|
*/
|
||||||
@bindThis
|
@bindThis
|
||||||
private onChannelDisconnectRequested(payload: JsonObject) {
|
private onChannelDisconnectRequested(payload: JsonValue | undefined) {
|
||||||
|
if (!isJsonObject(payload)) return;
|
||||||
const { id } = payload;
|
const { id } = payload;
|
||||||
if (typeof id !== 'string') return;
|
if (typeof id !== 'string') return;
|
||||||
this.disconnectChannel(id);
|
this.disconnectChannel(id);
|
||||||
|
@ -251,6 +257,10 @@ export default class Connection {
|
||||||
*/
|
*/
|
||||||
@bindThis
|
@bindThis
|
||||||
public connectChannel(id: string, params: JsonObject | undefined, channel: string, pong = false) {
|
public connectChannel(id: string, params: JsonObject | undefined, channel: string, pong = false) {
|
||||||
|
if (this.channels.length >= MAX_CHANNELS_PER_CONNECTION) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const channelService = this.channelsService.getChannelService(channel);
|
const channelService = this.channelsService.getChannelService(channel);
|
||||||
|
|
||||||
if (channelService.requireCredential && this.user == null) {
|
if (channelService.requireCredential && this.user == null) {
|
||||||
|
@ -297,7 +307,8 @@ export default class Connection {
|
||||||
* @param data メッセージ
|
* @param data メッセージ
|
||||||
*/
|
*/
|
||||||
@bindThis
|
@bindThis
|
||||||
private onChannelMessageRequested(data: JsonObject) {
|
private onChannelMessageRequested(data: JsonValue | undefined) {
|
||||||
|
if (!isJsonObject(data)) return;
|
||||||
if (typeof data.id !== 'string') return;
|
if (typeof data.id !== 'string') return;
|
||||||
if (typeof data.type !== 'string') return;
|
if (typeof data.type !== 'string') return;
|
||||||
if (typeof data.body === 'undefined') return;
|
if (typeof data.body === 'undefined') return;
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
import Xev from 'xev';
|
import Xev from 'xev';
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
|
import { isJsonObject } from '@/misc/json-value.js';
|
||||||
import type { JsonObject, JsonValue } from '@/misc/json-value.js';
|
import type { JsonObject, JsonValue } from '@/misc/json-value.js';
|
||||||
import Channel, { type MiChannelService } from '../channel.js';
|
import Channel, { type MiChannelService } from '../channel.js';
|
||||||
|
|
||||||
|
@ -36,7 +37,7 @@ class QueueStatsChannel extends Channel {
|
||||||
public onMessage(type: string, body: JsonValue) {
|
public onMessage(type: string, body: JsonValue) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'requestLog':
|
case 'requestLog':
|
||||||
if (typeof body !== 'object' || body === null || Array.isArray(body)) return;
|
if (!isJsonObject(body)) return;
|
||||||
if (typeof body.id !== 'string') return;
|
if (typeof body.id !== 'string') return;
|
||||||
if (typeof body.length !== 'number') return;
|
if (typeof body.length !== 'number') return;
|
||||||
ev.once(`queueStatsLog:${body.id}`, statsLog => {
|
ev.once(`queueStatsLog:${body.id}`, statsLog => {
|
||||||
|
|
|
@ -9,8 +9,10 @@ import { DI } from '@/di-symbols.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
import { ReversiService } from '@/core/ReversiService.js';
|
import { ReversiService } from '@/core/ReversiService.js';
|
||||||
import { ReversiGameEntityService } from '@/core/entities/ReversiGameEntityService.js';
|
import { ReversiGameEntityService } from '@/core/entities/ReversiGameEntityService.js';
|
||||||
|
import { isJsonObject } from '@/misc/json-value.js';
|
||||||
import type { JsonObject, JsonValue } from '@/misc/json-value.js';
|
import type { JsonObject, JsonValue } from '@/misc/json-value.js';
|
||||||
import Channel, { type MiChannelService } from '../channel.js';
|
import Channel, { type MiChannelService } from '../channel.js';
|
||||||
|
import { reversiUpdateKeys } from 'misskey-js';
|
||||||
|
|
||||||
class ReversiGameChannel extends Channel {
|
class ReversiGameChannel extends Channel {
|
||||||
public readonly chName = 'reversiGame';
|
public readonly chName = 'reversiGame';
|
||||||
|
@ -44,16 +46,17 @@ class ReversiGameChannel extends Channel {
|
||||||
this.ready(body);
|
this.ready(body);
|
||||||
break;
|
break;
|
||||||
case 'updateSettings':
|
case 'updateSettings':
|
||||||
if (typeof body !== 'object' || body === null || Array.isArray(body)) return;
|
if (!isJsonObject(body)) return;
|
||||||
if (typeof body.key !== 'string') return;
|
if (!this.reversiService.isValidReversiUpdateKey(body.key)) return;
|
||||||
if (typeof body.value !== 'object' || body.value === null || Array.isArray(body.value)) return;
|
if (!this.reversiService.isValidReversiUpdateValue(body.key, body.value)) return;
|
||||||
|
|
||||||
this.updateSettings(body.key, body.value);
|
this.updateSettings(body.key, body.value);
|
||||||
break;
|
break;
|
||||||
case 'cancel':
|
case 'cancel':
|
||||||
this.cancelGame();
|
this.cancelGame();
|
||||||
break;
|
break;
|
||||||
case 'putStone':
|
case 'putStone':
|
||||||
if (typeof body !== 'object' || body === null || Array.isArray(body)) return;
|
if (!isJsonObject(body)) return;
|
||||||
if (typeof body.pos !== 'number') return;
|
if (typeof body.pos !== 'number') return;
|
||||||
if (typeof body.id !== 'string') return;
|
if (typeof body.id !== 'string') return;
|
||||||
this.putStone(body.pos, body.id);
|
this.putStone(body.pos, body.id);
|
||||||
|
@ -63,7 +66,7 @@ class ReversiGameChannel extends Channel {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
private async updateSettings(key: string, value: JsonObject) {
|
private async updateSettings<K extends typeof reversiUpdateKeys[number]>(key: K, value: MiReversiGame[K]) {
|
||||||
if (this.user == null) return;
|
if (this.user == null) return;
|
||||||
|
|
||||||
this.reversiService.updateSettings(this.gameId!, this.user, key, value);
|
this.reversiService.updateSettings(this.gameId!, this.user, key, value);
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
import Xev from 'xev';
|
import Xev from 'xev';
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
|
import { isJsonObject } from '@/misc/json-value.js';
|
||||||
import type { JsonObject, JsonValue } from '@/misc/json-value.js';
|
import type { JsonObject, JsonValue } from '@/misc/json-value.js';
|
||||||
import Channel, { type MiChannelService } from '../channel.js';
|
import Channel, { type MiChannelService } from '../channel.js';
|
||||||
|
|
||||||
|
@ -36,7 +37,7 @@ class ServerStatsChannel extends Channel {
|
||||||
public onMessage(type: string, body: JsonValue) {
|
public onMessage(type: string, body: JsonValue) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'requestLog':
|
case 'requestLog':
|
||||||
if (typeof body !== 'object' || body === null || Array.isArray(body)) return;
|
if (!isJsonObject(body)) return;
|
||||||
ev.once(`serverStatsLog:${body.id}`, statsLog => {
|
ev.once(`serverStatsLog:${body.id}`, statsLog => {
|
||||||
this.send('statsLog', statsLog);
|
this.send('statsLog', statsLog);
|
||||||
});
|
});
|
||||||
|
|
|
@ -61,7 +61,8 @@ const staticAssets = `${_dirname}/../../../assets/`;
|
||||||
const clientAssets = `${_dirname}/../../../../frontend/assets/`;
|
const clientAssets = `${_dirname}/../../../../frontend/assets/`;
|
||||||
const assets = `${_dirname}/../../../../../built/_frontend_dist_/`;
|
const assets = `${_dirname}/../../../../../built/_frontend_dist_/`;
|
||||||
const swAssets = `${_dirname}/../../../../../built/_sw_dist_/`;
|
const swAssets = `${_dirname}/../../../../../built/_sw_dist_/`;
|
||||||
const viteOut = `${_dirname}/../../../../../built/_vite_/`;
|
const frontendViteOut = `${_dirname}/../../../../../built/_frontend_vite_/`;
|
||||||
|
const frontendEmbedViteOut = `${_dirname}/../../../../../built/_frontend_embed_vite_/`;
|
||||||
const tarball = `${_dirname}/../../../../../built/tarball/`;
|
const tarball = `${_dirname}/../../../../../built/tarball/`;
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@ -277,15 +278,22 @@ export class ClientServerService {
|
||||||
});
|
});
|
||||||
|
|
||||||
//#region vite assets
|
//#region vite assets
|
||||||
if (this.config.clientManifestExists) {
|
if (this.config.frontendEmbedManifestExists) {
|
||||||
fastify.register((fastify, options, done) => {
|
fastify.register((fastify, options, done) => {
|
||||||
fastify.register(fastifyStatic, {
|
fastify.register(fastifyStatic, {
|
||||||
root: viteOut,
|
root: frontendViteOut,
|
||||||
prefix: '/vite/',
|
prefix: '/vite/',
|
||||||
maxAge: ms('30 days'),
|
maxAge: ms('30 days'),
|
||||||
immutable: true,
|
immutable: true,
|
||||||
decorateReply: false,
|
decorateReply: false,
|
||||||
});
|
});
|
||||||
|
fastify.register(fastifyStatic, {
|
||||||
|
root: frontendEmbedViteOut,
|
||||||
|
prefix: '/embed_vite/',
|
||||||
|
maxAge: ms('30 days'),
|
||||||
|
immutable: true,
|
||||||
|
decorateReply: false,
|
||||||
|
});
|
||||||
fastify.addHook('onRequest', handleRequestRedirectToOmitSearch);
|
fastify.addHook('onRequest', handleRequestRedirectToOmitSearch);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
@ -296,6 +304,13 @@ export class ClientServerService {
|
||||||
prefix: '/vite',
|
prefix: '/vite',
|
||||||
rewritePrefix: '/vite',
|
rewritePrefix: '/vite',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const embedPort = (process.env.EMBED_VITE_PORT ?? '5174');
|
||||||
|
fastify.register(fastifyProxy, {
|
||||||
|
upstream: 'http://localhost:' + embedPort,
|
||||||
|
prefix: '/embed_vite',
|
||||||
|
rewritePrefix: '/embed_vite',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
|
@ -425,6 +440,13 @@ export class ClientServerService {
|
||||||
// Manifest
|
// Manifest
|
||||||
fastify.get('/manifest.json', async (request, reply) => await this.manifestHandler(reply));
|
fastify.get('/manifest.json', async (request, reply) => await this.manifestHandler(reply));
|
||||||
|
|
||||||
|
// Embed Javascript
|
||||||
|
fastify.get('/embed.js', async (request, reply) => {
|
||||||
|
return await reply.sendFile('/embed.js', staticAssets, {
|
||||||
|
maxAge: ms('1 day'),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
fastify.get('/robots.txt', async (request, reply) => {
|
fastify.get('/robots.txt', async (request, reply) => {
|
||||||
return await reply.sendFile('/robots.txt', staticAssets);
|
return await reply.sendFile('/robots.txt', staticAssets);
|
||||||
});
|
});
|
||||||
|
@ -762,7 +784,7 @@ export class ClientServerService {
|
||||||
});
|
});
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
//region noindex pages
|
//#region noindex pages
|
||||||
// Tags
|
// Tags
|
||||||
fastify.get<{ Params: { clip: string; } }>('/tags/:tag', async (request, reply) => {
|
fastify.get<{ Params: { clip: string; } }>('/tags/:tag', async (request, reply) => {
|
||||||
return await renderBase(reply, { noindex: true });
|
return await renderBase(reply, { noindex: true });
|
||||||
|
@ -772,7 +794,20 @@ export class ClientServerService {
|
||||||
fastify.get<{ Params: { clip: string; } }>('/user-tags/:tag', async (request, reply) => {
|
fastify.get<{ Params: { clip: string; } }>('/user-tags/:tag', async (request, reply) => {
|
||||||
return await renderBase(reply, { noindex: true });
|
return await renderBase(reply, { noindex: true });
|
||||||
});
|
});
|
||||||
//endregion
|
//#endregion
|
||||||
|
|
||||||
|
//#region embed pages
|
||||||
|
fastify.get('/embed/*', async (request, reply) => {
|
||||||
|
const meta = await this.metaService.fetch();
|
||||||
|
|
||||||
|
reply.removeHeader('X-Frame-Options');
|
||||||
|
|
||||||
|
reply.header('Cache-Control', 'public, max-age=3600');
|
||||||
|
return await reply.view('base-embed', {
|
||||||
|
title: meta.name ?? 'Misskey',
|
||||||
|
...await this.generateCommonPugData(meta),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
fastify.get('/_info_card_', async (request, reply) => {
|
fastify.get('/_info_card_', async (request, reply) => {
|
||||||
const meta = await this.metaService.fetch(true);
|
const meta = await this.metaService.fetch(true);
|
||||||
|
@ -787,6 +822,7 @@ export class ClientServerService {
|
||||||
originalNotesCount: await this.notesRepository.countBy({ userHost: IsNull() }),
|
originalNotesCount: await this.notesRepository.countBy({ userHost: IsNull() }),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
//#endregion
|
||||||
|
|
||||||
fastify.get('/bios', async (request, reply) => {
|
fastify.get('/bios', async (request, reply) => {
|
||||||
return await reply.view('bios', {
|
return await reply.view('bios', {
|
||||||
|
|
|
@ -0,0 +1,219 @@
|
||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// ブロックの中に入れないと、定義した変数がブラウザのグローバルスコープに登録されてしまい邪魔なので
|
||||||
|
(async () => {
|
||||||
|
window.onerror = (e) => {
|
||||||
|
console.error(e);
|
||||||
|
renderError('SOMETHING_HAPPENED');
|
||||||
|
};
|
||||||
|
window.onunhandledrejection = (e) => {
|
||||||
|
console.error(e);
|
||||||
|
renderError('SOMETHING_HAPPENED_IN_PROMISE');
|
||||||
|
};
|
||||||
|
|
||||||
|
let forceError = localStorage.getItem('forceError');
|
||||||
|
if (forceError != null) {
|
||||||
|
renderError('FORCED_ERROR', 'This error is forced by having forceError in local storage.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// パラメータに応じてsplashのスタイルを変更
|
||||||
|
const params = new URLSearchParams(location.search);
|
||||||
|
if (params.has('rounded') && params.get('rounded') === 'false') {
|
||||||
|
document.documentElement.classList.add('norounded');
|
||||||
|
}
|
||||||
|
if (params.has('border') && params.get('border') === 'false') {
|
||||||
|
document.documentElement.classList.add('noborder');
|
||||||
|
}
|
||||||
|
|
||||||
|
//#region Detect language & fetch translations
|
||||||
|
if (!localStorage.hasOwnProperty('locale')) {
|
||||||
|
const supportedLangs = LANGS;
|
||||||
|
let lang = localStorage.getItem('lang');
|
||||||
|
if (lang == null || !supportedLangs.includes(lang)) {
|
||||||
|
if (supportedLangs.includes(navigator.language)) {
|
||||||
|
lang = navigator.language;
|
||||||
|
} else {
|
||||||
|
lang = supportedLangs.find(x => x.split('-')[0] === navigator.language);
|
||||||
|
|
||||||
|
// Fallback
|
||||||
|
if (lang == null) lang = 'en-US';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const metaRes = await window.fetch('/api/meta', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify({}),
|
||||||
|
credentials: 'omit',
|
||||||
|
cache: 'no-cache',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (metaRes.status !== 200) {
|
||||||
|
renderError('META_FETCH');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const meta = await metaRes.json();
|
||||||
|
const v = meta.version;
|
||||||
|
if (v == null) {
|
||||||
|
renderError('META_FETCH_V');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// for https://github.com/misskey-dev/misskey/issues/10202
|
||||||
|
if (lang == null || lang.toString == null || lang.toString() === 'null') {
|
||||||
|
console.error('invalid lang value detected!!!', typeof lang, lang);
|
||||||
|
lang = 'en-US';
|
||||||
|
}
|
||||||
|
|
||||||
|
const localRes = await window.fetch(`/assets/locales/${lang}.${v}.json`);
|
||||||
|
if (localRes.status === 200) {
|
||||||
|
localStorage.setItem('lang', lang);
|
||||||
|
localStorage.setItem('locale', await localRes.text());
|
||||||
|
localStorage.setItem('localeVersion', v);
|
||||||
|
} else {
|
||||||
|
renderError('LOCALE_FETCH');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
//#region Script
|
||||||
|
async function importAppScript() {
|
||||||
|
await import(`/embed_vite/${CLIENT_ENTRY}`)
|
||||||
|
.catch(async e => {
|
||||||
|
console.error(e);
|
||||||
|
renderError('APP_IMPORT');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// タイミングによっては、この時点でDOMの構築が済んでいる場合とそうでない場合とがある
|
||||||
|
if (document.readyState !== 'loading') {
|
||||||
|
importAppScript();
|
||||||
|
} else {
|
||||||
|
window.addEventListener('DOMContentLoaded', () => {
|
||||||
|
importAppScript();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
async function addStyle(styleText) {
|
||||||
|
let css = document.createElement('style');
|
||||||
|
css.appendChild(document.createTextNode(styleText));
|
||||||
|
document.head.appendChild(css);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function renderError(code) {
|
||||||
|
// Cannot set property 'innerHTML' of null を回避
|
||||||
|
if (document.readyState === 'loading') {
|
||||||
|
await new Promise(resolve => window.addEventListener('DOMContentLoaded', resolve));
|
||||||
|
}
|
||||||
|
document.body.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" /><path d="M12 9v4" /><path d="M12 16v.01" /></svg>
|
||||||
|
<div class="message">読み込みに失敗しました</div>
|
||||||
|
<div class="submessage">Failed to initialize Misskey</div>
|
||||||
|
<div class="submessage">Error Code: ${code}</div>
|
||||||
|
<button onclick="location.reload(!0)">
|
||||||
|
<div>リロード</div>
|
||||||
|
<div><small>Reload</small></div>
|
||||||
|
</button>`;
|
||||||
|
addStyle(`
|
||||||
|
#misskey_app,
|
||||||
|
#splash {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
html,
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
position: relative;
|
||||||
|
color: #dee7e4;
|
||||||
|
font-family: Hiragino Maru Gothic Pro, BIZ UDGothic, Roboto, HelveticaNeue, Arial, sans-serif;
|
||||||
|
line-height: 1.35;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
min-height: 100vh;
|
||||||
|
margin: 0;
|
||||||
|
padding: 24px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
border-radius: var(--radius, 12px);
|
||||||
|
border: 1px solid rgba(231, 255, 251, 0.14);
|
||||||
|
}
|
||||||
|
|
||||||
|
body::before {
|
||||||
|
content: '';
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: #192320;
|
||||||
|
border-radius: var(--radius, 12px);
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
html.embed.norounded body,
|
||||||
|
html.embed.norounded body::before {
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
html.embed.noborder body {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
max-width: 60px;
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
color: #dec340;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 700;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submessage {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 90%;
|
||||||
|
margin-bottom: 7.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submessage:last-of-type {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
padding: 7px 14px;
|
||||||
|
min-width: 100px;
|
||||||
|
font-weight: 700;
|
||||||
|
font-family: Hiragino Maru Gothic Pro, BIZ UDGothic, Roboto, HelveticaNeue, Arial, sans-serif;
|
||||||
|
line-height: 1.35;
|
||||||
|
border-radius: 99rem;
|
||||||
|
background-color: #b4e900;
|
||||||
|
color: #192320;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
-webkit-tap-highlight-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover {
|
||||||
|
background-color: #c6ff03;
|
||||||
|
}`);
|
||||||
|
}
|
||||||
|
})();
|
|
@ -3,17 +3,6 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* BOOT LOADER
|
|
||||||
* サーバーからレスポンスされるHTMLに埋め込まれるスクリプトで、以下の役割を持ちます。
|
|
||||||
* - 翻訳ファイルをフェッチする。
|
|
||||||
* - バージョンに基づいて適切なメインスクリプトを読み込む。
|
|
||||||
* - キャッシュされたコンパイル済みテーマを適用する。
|
|
||||||
* - クライアントの設定値に基づいて対応するHTMLクラス等を設定する。
|
|
||||||
* テーマをこの段階で設定するのは、メインスクリプトが読み込まれる間もテーマを適用したいためです。
|
|
||||||
* 注: webpackは介さないため、このファイルではrequireやimportは使えません。
|
|
||||||
*/
|
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// ブロックの中に入れないと、定義した変数がブラウザのグローバルスコープに登録されてしまい邪魔なので
|
// ブロックの中に入れないと、定義した変数がブラウザのグローバルスコープに登録されてしまい邪魔なので
|
||||||
|
@ -166,7 +155,7 @@
|
||||||
|
|
||||||
if (!errorsElement) {
|
if (!errorsElement) {
|
||||||
document.body.innerHTML = `
|
document.body.innerHTML = `
|
||||||
<svg class="icon-warning" xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-alert-triangle" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
<svg class="icon-warning" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
||||||
<path d="M12 9v2m0 4v.01"></path>
|
<path d="M12 9v2m0 4v.01"></path>
|
||||||
<path d="M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75"></path>
|
<path d="M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75"></path>
|
||||||
|
@ -176,10 +165,10 @@
|
||||||
<span class="button-label-big">Reload / リロード</span>
|
<span class="button-label-big">Reload / リロード</span>
|
||||||
</button>
|
</button>
|
||||||
<p><b>The following actions may solve the problem. / 以下を行うと解決する可能性があります。</b></p>
|
<p><b>The following actions may solve the problem. / 以下を行うと解決する可能性があります。</b></p>
|
||||||
<p>Clear the browser cache / ブラウザのキャッシュをクリアする</p>
|
|
||||||
<p>Update your os and browser / ブラウザおよびOSを最新バージョンに更新する</p>
|
<p>Update your os and browser / ブラウザおよびOSを最新バージョンに更新する</p>
|
||||||
<p>Disable an adblocker / アドブロッカーを無効にする</p>
|
<p>Disable an adblocker / アドブロッカーを無効にする</p>
|
||||||
<p>(Tor Browser) Set dom.webaudio.enabled to true / dom.webaudio.enabledをtrueに設定する</p>
|
<p>Clear the browser cache / ブラウザのキャッシュをクリアする</p>
|
||||||
|
<p>(Tor Browser) Set dom.webaudio.enabled to true / dom.webaudio.enabledをtrueに設定する</p>
|
||||||
<details style="color: #86b300;">
|
<details style="color: #86b300;">
|
||||||
<summary>Other options / その他のオプション</summary>
|
<summary>Other options / その他のオプション</summary>
|
||||||
<a href="/flush">
|
<a href="/flush">
|
||||||
|
@ -212,7 +201,7 @@
|
||||||
<summary>
|
<summary>
|
||||||
<code>ERROR CODE: ${code}</code>
|
<code>ERROR CODE: ${code}</code>
|
||||||
</summary>
|
</summary>
|
||||||
<code>${JSON.stringify(details)}</code>`;
|
<code>${details.toString()} ${JSON.stringify(details)}</code>`;
|
||||||
errorsElement.appendChild(detailsElement);
|
errorsElement.appendChild(detailsElement);
|
||||||
addStyle(`
|
addStyle(`
|
||||||
* {
|
* {
|
||||||
|
@ -320,6 +309,6 @@
|
||||||
#errorInfo {
|
#errorInfo {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
}
|
}
|
||||||
}`)
|
}`);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -47,6 +47,7 @@ html {
|
||||||
transform: translateY(70px);
|
transform: translateY(70px);
|
||||||
color: var(--accent);
|
color: var(--accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
#splashSpinner > .spinner {
|
#splashSpinner > .spinner {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
|
@ -0,0 +1,99 @@
|
||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
|
html {
|
||||||
|
background-color: var(--bg);
|
||||||
|
color: var(--fg);
|
||||||
|
}
|
||||||
|
|
||||||
|
html.embed {
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-color: transparent;
|
||||||
|
color-scheme: light dark;
|
||||||
|
max-width: 500px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#splash {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 10000;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
cursor: wait;
|
||||||
|
background-color: var(--bg);
|
||||||
|
opacity: 1;
|
||||||
|
transition: opacity 0.5s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
html.embed #splash {
|
||||||
|
box-sizing: border-box;
|
||||||
|
min-height: 300px;
|
||||||
|
border-radius: var(--radius, 12px);
|
||||||
|
border: 1px solid var(--divider, #e8e8e8);
|
||||||
|
}
|
||||||
|
|
||||||
|
html.embed.norounded #splash {
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
html.embed.noborder #splash {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#splashIcon {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
margin: auto;
|
||||||
|
width: 64px;
|
||||||
|
height: 64px;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#splashSpinner {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
margin: auto;
|
||||||
|
display: inline-block;
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
transform: translateY(70px);
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
#splashSpinner > .spinner {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
fill-rule: evenodd;
|
||||||
|
clip-rule: evenodd;
|
||||||
|
stroke-linecap: round;
|
||||||
|
stroke-linejoin: round;
|
||||||
|
stroke-miterlimit: 1.5;
|
||||||
|
}
|
||||||
|
#splashSpinner > .spinner.bg {
|
||||||
|
opacity: 0.275;
|
||||||
|
}
|
||||||
|
#splashSpinner > .spinner.fg {
|
||||||
|
animation: splashSpinner 0.5s linear infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes splashSpinner {
|
||||||
|
0% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,67 @@
|
||||||
|
block vars
|
||||||
|
|
||||||
|
block loadClientEntry
|
||||||
|
- const entry = config.frontendEmbedEntry;
|
||||||
|
|
||||||
|
doctype html
|
||||||
|
|
||||||
|
html(class='embed')
|
||||||
|
|
||||||
|
head
|
||||||
|
meta(charset='utf-8')
|
||||||
|
meta(name='application-name' content='Misskey')
|
||||||
|
meta(name='referrer' content='origin')
|
||||||
|
meta(name='theme-color' content= themeColor || '#86b300')
|
||||||
|
meta(name='theme-color-orig' content= themeColor || '#86b300')
|
||||||
|
meta(name='viewport' content='width=device-width, initial-scale=1')
|
||||||
|
meta(name='format-detection' content='telephone=no,date=no,address=no,email=no,url=no')
|
||||||
|
link(rel='icon' href= icon || '/favicon.ico')
|
||||||
|
link(rel='apple-touch-icon' href= appleTouchIcon || '/apple-touch-icon.png')
|
||||||
|
link(rel='modulepreload' href=`/embed_vite/${entry.file}`)
|
||||||
|
|
||||||
|
if !config.frontendEmbedManifestExists
|
||||||
|
script(type="module" src="/embed_vite/@vite/client")
|
||||||
|
|
||||||
|
if Array.isArray(entry.css)
|
||||||
|
each href in entry.css
|
||||||
|
link(rel='stylesheet' href=`/embed_vite/${href}`)
|
||||||
|
|
||||||
|
title
|
||||||
|
block title
|
||||||
|
= title || 'Misskey'
|
||||||
|
|
||||||
|
block meta
|
||||||
|
meta(name='robots' content='noindex')
|
||||||
|
|
||||||
|
style
|
||||||
|
include ../style.embed.css
|
||||||
|
|
||||||
|
script.
|
||||||
|
var VERSION = "#{version}";
|
||||||
|
var CLIENT_ENTRY = "#{entry.file}";
|
||||||
|
|
||||||
|
script(type='application/json' id='misskey_meta' data-generated-at=now)
|
||||||
|
!= metaJson
|
||||||
|
|
||||||
|
script
|
||||||
|
include ../boot.embed.js
|
||||||
|
|
||||||
|
body
|
||||||
|
noscript: p
|
||||||
|
| JavaScriptを有効にしてください
|
||||||
|
br
|
||||||
|
| Please turn on your JavaScript
|
||||||
|
div#splash
|
||||||
|
img#splashIcon(src= icon || '/static-assets/splash.png')
|
||||||
|
div#splashSpinner
|
||||||
|
<svg class="spinner bg" viewBox="0 0 152 152" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g transform="matrix(1,0,0,1,12,12)">
|
||||||
|
<circle cx="64" cy="64" r="64" style="fill:none;stroke:currentColor;stroke-width:24px;"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
<svg class="spinner fg" viewBox="0 0 152 152" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g transform="matrix(1,0,0,1,12,12)">
|
||||||
|
<path d="M128,64C128,28.654 99.346,0 64,0C99.346,0 128,28.654 128,64Z" style="fill:none;stroke:currentColor;stroke-width:24px;"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
block content
|
|
@ -1,7 +1,7 @@
|
||||||
block vars
|
block vars
|
||||||
|
|
||||||
block loadClientEntry
|
block loadClientEntry
|
||||||
- const clientEntry = config.clientEntry;
|
- const entry = config.frontendEntry;
|
||||||
|
|
||||||
doctype html
|
doctype html
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ html
|
||||||
meta(property='og:site_name' content= instanceName || 'Misskey')
|
meta(property='og:site_name' content= instanceName || 'Misskey')
|
||||||
meta(property='instance_url' content= instanceUrl)
|
meta(property='instance_url' content= instanceUrl)
|
||||||
meta(name='viewport' content='width=device-width, initial-scale=1')
|
meta(name='viewport' content='width=device-width, initial-scale=1')
|
||||||
|
meta(name='format-detection' content='telephone=no,date=no,address=no,email=no,url=no')
|
||||||
link(rel='icon' href= icon || '/favicon.ico')
|
link(rel='icon' href= icon || '/favicon.ico')
|
||||||
link(rel='apple-touch-icon' href= appleTouchIcon || '/apple-touch-icon.png')
|
link(rel='apple-touch-icon' href= appleTouchIcon || '/apple-touch-icon.png')
|
||||||
link(rel='manifest' href='/manifest.json')
|
link(rel='manifest' href='/manifest.json')
|
||||||
|
@ -35,15 +36,13 @@ html
|
||||||
link(rel='prefetch' href=serverErrorImageUrl)
|
link(rel='prefetch' href=serverErrorImageUrl)
|
||||||
link(rel='prefetch' href=infoImageUrl)
|
link(rel='prefetch' href=infoImageUrl)
|
||||||
link(rel='prefetch' href=notFoundImageUrl)
|
link(rel='prefetch' href=notFoundImageUrl)
|
||||||
//- https://github.com/misskey-dev/misskey/issues/9842
|
link(rel='modulepreload' href=`/vite/${entry.file}`)
|
||||||
link(rel='stylesheet' href='/assets/tabler-icons/tabler-icons.min.css?v3.3.0')
|
|
||||||
link(rel='modulepreload' href=`/vite/${clientEntry.file}`)
|
|
||||||
|
|
||||||
if !config.clientManifestExists
|
if !config.frontendManifestExists
|
||||||
script(type="module" src="/vite/@vite/client")
|
script(type="module" src="/vite/@vite/client")
|
||||||
|
|
||||||
if Array.isArray(clientEntry.css)
|
if Array.isArray(entry.css)
|
||||||
each href in clientEntry.css
|
each href in entry.css
|
||||||
link(rel='stylesheet' href=`/vite/${href}`)
|
link(rel='stylesheet' href=`/vite/${href}`)
|
||||||
|
|
||||||
title
|
title
|
||||||
|
@ -69,7 +68,7 @@ html
|
||||||
|
|
||||||
script.
|
script.
|
||||||
var VERSION = "#{version}";
|
var VERSION = "#{version}";
|
||||||
var CLIENT_ENTRY = "#{clientEntry.file}";
|
var CLIENT_ENTRY = "#{entry.file}";
|
||||||
|
|
||||||
script(type='application/json' id='misskey_meta' data-generated-at=now)
|
script(type='application/json' id='misskey_meta' data-generated-at=now)
|
||||||
!= metaJson
|
!= metaJson
|
||||||
|
|
|
@ -96,6 +96,10 @@ export const moderationLogTypes = [
|
||||||
'createAbuseReportNotificationRecipient',
|
'createAbuseReportNotificationRecipient',
|
||||||
'updateAbuseReportNotificationRecipient',
|
'updateAbuseReportNotificationRecipient',
|
||||||
'deleteAbuseReportNotificationRecipient',
|
'deleteAbuseReportNotificationRecipient',
|
||||||
|
'deleteAccount',
|
||||||
|
'deletePage',
|
||||||
|
'deleteFlash',
|
||||||
|
'deleteGalleryPost',
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export type ModerationLogPayloads = {
|
export type ModerationLogPayloads = {
|
||||||
|
@ -314,6 +318,29 @@ export type ModerationLogPayloads = {
|
||||||
recipientId: string;
|
recipientId: string;
|
||||||
recipient: any;
|
recipient: any;
|
||||||
};
|
};
|
||||||
|
deleteAccount: {
|
||||||
|
userId: string;
|
||||||
|
userUsername: string;
|
||||||
|
userHost: string | null;
|
||||||
|
};
|
||||||
|
deletePage: {
|
||||||
|
pageId: string;
|
||||||
|
pageUserId: string;
|
||||||
|
pageUserUsername: string;
|
||||||
|
page: any;
|
||||||
|
};
|
||||||
|
deleteFlash: {
|
||||||
|
flashId: string;
|
||||||
|
flashUserId: string;
|
||||||
|
flashUserUsername: string;
|
||||||
|
flash: any;
|
||||||
|
};
|
||||||
|
deleteGalleryPost: {
|
||||||
|
postId: string;
|
||||||
|
postUserId: string;
|
||||||
|
postUserUsername: string;
|
||||||
|
post: any;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Serialized<T> = {
|
export type Serialized<T> = {
|
||||||
|
|
|
@ -228,6 +228,17 @@ describe('アンテナ', () => {
|
||||||
assert.deepStrictEqual(response, expected);
|
assert.deepStrictEqual(response, expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('を作成する時キーワードが指定されていないとエラーになる', async () => {
|
||||||
|
await failedApiCall({
|
||||||
|
endpoint: 'antennas/create',
|
||||||
|
parameters: { ...defaultParam, keywords: [[]], excludeKeywords: [[]] },
|
||||||
|
user: alice
|
||||||
|
}, {
|
||||||
|
status: 400,
|
||||||
|
code: 'EMPTY_KEYWORD',
|
||||||
|
id: '53ee222e-1ddd-4f9a-92e5-9fb82ddb463a'
|
||||||
|
})
|
||||||
|
});
|
||||||
//#endregion
|
//#endregion
|
||||||
//#region 更新(antennas/update)
|
//#region 更新(antennas/update)
|
||||||
|
|
||||||
|
@ -255,6 +266,18 @@ describe('アンテナ', () => {
|
||||||
id: '1c6b35c9-943e-48c2-81e4-2844989407f7',
|
id: '1c6b35c9-943e-48c2-81e4-2844989407f7',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
test('を変更する時キーワードが指定されていないとエラーになる', async () => {
|
||||||
|
const antenna = await successfulApiCall({ endpoint: 'antennas/create', parameters: defaultParam, user: alice });
|
||||||
|
await failedApiCall({
|
||||||
|
endpoint: 'antennas/update',
|
||||||
|
parameters: { ...defaultParam, antennaId: antenna.id, keywords: [[]], excludeKeywords: [[]] },
|
||||||
|
user: alice
|
||||||
|
}, {
|
||||||
|
status: 400,
|
||||||
|
code: 'EMPTY_KEYWORD',
|
||||||
|
id: '721aaff6-4e1b-4d88-8de6-877fae9f68c4'
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
//#endregion
|
//#endregion
|
||||||
//#region 表示(antennas/show)
|
//#region 表示(antennas/show)
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue