diff --git a/.config/docker_example.yml b/.config/docker_example.yml index ba8b07538c..e9099101a3 100644 --- a/.config/docker_example.yml +++ b/.config/docker_example.yml @@ -120,19 +120,6 @@ redis: # index: '' # scope: local -# ┌───────────────────────────┐ -#───┘ OpenSearch configuration └───────────────────────────── - -# You can use OpenSearch when you enabled AdvancedSearch. - -#opensearch: -# host: opensearch -# port: 9200 -# user: 'admin' -# pass: 'opensearch-adminpassword' #強めのパスワードじゃないと怒られる -# ssl: false -# index: 'instancename' #なんでもいい - # ┌───────────────┐ #───┘ ID generation └─────────────────────────────────────────── diff --git a/.config/example.yml b/.config/example.yml index 5c3b80dd9f..a49fb30910 100644 --- a/.config/example.yml +++ b/.config/example.yml @@ -129,9 +129,6 @@ dbReplications: false # user: # pass: -# You can use PGroonga when enabled. -#pgroonga: false - # ┌─────────────────────┐ #───┘ Redis configuration └───────────────────────────────────── @@ -190,19 +187,6 @@ redis: # scope: local -# ┌───────────────────────────┐ -#───┘ OpenSearch configuration └───────────────────────────── - -# You can use OpenSearch when you enabled AdvancedSearch. - -#opensearch: -# host: localhost -# port: 9200 -# user: 'admin' -# pass: 'opensearch-adminpassword' #強めのパスワードじゃないと怒られる -# ssl: false -# index: 'instancename' #なんでもいい - # ┌───────────────┐ #───┘ ID generation └─────────────────────────────────────────── diff --git a/CHANGELOG_engawa.md b/CHANGELOG_engawa.md index deaee4d808..aafd0412b1 100644 --- a/CHANGELOG_engawa.md +++ b/CHANGELOG_engawa.md @@ -27,7 +27,7 @@ - fix: 設定画面でリロードすべきところでリロードしない問題 ### Server -- +- Breaking: OpenSearchを利用不可に ### Misc diff --git a/compose.local-db.yml b/compose.local-db.yml index 9d200ea36d..548ce60679 100644 --- a/compose.local-db.yml +++ b/compose.local-db.yml @@ -37,39 +37,3 @@ services: # - .config/meilisearch.env # volumes: # - ./meili_data:/meili_data - -# opensearchとopensearch-dashboardsのdockerfileは実装時の最新版の辞書なので適宜書き換えてください -# opensearch: -# build: ./opensearch -# environment: -# - "server.ssl.enabled:false" -# - "discovery.type=single-node" -# - "OPENSEARCH_INITIAL_ADMIN_PASSWORD=opensearch-adminpassword" #強めのパスワードじゃないと怒られる -# - "plugins.security.disabled=true" -# ulimits: -# memlock: -# soft: -1 # Set memlock to unlimited (no soft or hard limit) -# hard: -1 -# nofile: -# soft: 65536 # Maximum number of open files for the opensearch user - set to at least 65536 -# hard: 65536 -# volumes: -# - ./os-data:/usr/share/opensearch/data -# networks: -# - internal_network -# - external_network - -#OpenSearchのダッシュボードを見る場合に必要 -# opensearch-dashboards: -# build: ./opensearch-dashboards -# ports: -# - 5601:5601 -# links: -# - opensearch -# expose: -# - '5601' -# environment: -# OPENSEARCH_HOSTS: 'http://opensearch:9200' -# networks: -# - internal_network -# - external_network diff --git a/packages/backend/package.json b/packages/backend/package.json index 4453497cdb..1bac053aa5 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -91,7 +91,6 @@ "@nestjs/common": "10.3.10", "@nestjs/core": "10.3.10", "@nestjs/testing": "10.3.10", - "@opensearch-project/opensearch": "^2.7.0", "@peertube/http-signature": "1.7.0", "@sentry/node": "8.20.0", "@sentry/profiling-node": "8.20.0", diff --git a/packages/backend/src/GlobalModule.ts b/packages/backend/src/GlobalModule.ts index f4ebdd3527..416415e85b 100644 --- a/packages/backend/src/GlobalModule.ts +++ b/packages/backend/src/GlobalModule.ts @@ -8,7 +8,6 @@ import { Global, Inject, Module } from '@nestjs/common'; import * as Redis from 'ioredis'; import { DataSource } from 'typeorm'; import { MeiliSearch } from 'meilisearch'; -import { Client as OpenSearch } from '@opensearch-project/opensearch'; import { Logging } from '@google-cloud/logging'; import { DI } from './di-symbols.js'; import { Config, loadConfig } from './config.js'; @@ -46,29 +45,6 @@ const $meilisearch: Provider = { inject: [DI.config], }; -const $opensearch: Provider = { - provide: DI.opensearch, - useFactory: (config: Config) => { - if (config.opensearch) { - return new OpenSearch({ - nodes: { - url: new URL(`${config.opensearch.ssl ? 'https' : 'http'}://${config.opensearch.host}:${config.opensearch.port}`), - ssl: { - rejectUnauthorized: config.opensearch.rejectUnauthorized, - }, - }, - auth: { - username: config.opensearch.user, - password: config.opensearch.pass, - }, - }); - } else { - return null; - } - }, - inject: [DI.config], -}; - const $cloudLogging: Provider = { provide: DI.cloudLogging, useFactory: (config: Config) => { @@ -133,8 +109,8 @@ const $redisForJobQueue: Provider = { @Global() @Module({ imports: [RepositoryModule], - providers: [$config, $db, $meilisearch, $opensearch, $cloudLogging, $redis, $redisForPub, $redisForSub, $redisForTimelines, $redisForJobQueue], - exports: [$config, $db, $meilisearch, $opensearch, $cloudLogging, $redis, $redisForPub, $redisForSub, $redisForTimelines, $redisForJobQueue, RepositoryModule], + providers: [$config, $db, $meilisearch, $cloudLogging, $redis, $redisForPub, $redisForSub, $redisForTimelines, $redisForJobQueue], + exports: [$config, $db, $meilisearch, $cloudLogging, $redis, $redisForPub, $redisForSub, $redisForTimelines, $redisForJobQueue, RepositoryModule], }) export class GlobalModule implements OnApplicationShutdown { constructor( diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts index 8b2ac9c88c..37dc641942 100644 --- a/packages/backend/src/config.ts +++ b/packages/backend/src/config.ts @@ -45,7 +45,6 @@ type Source = { user: string; pass: string; }[]; - pgroonga?: boolean; redis: RedisOptionsSource; redisForPubsub?: RedisOptionsSource; redisForJobQueue?: RedisOptionsSource; @@ -58,15 +57,6 @@ type Source = { index: string; scope?: 'local' | 'global' | string[]; }; - opensearch?: { - host: string; - port: string; - user: string; - pass: string; - ssl?: boolean; - rejectUnauthorized?: boolean; - index: string; - } | undefined; sentryForBackend?: { options: Partial; enableNodeProfiling: boolean; }; sentryForFrontend?: { options: Partial }; @@ -140,7 +130,6 @@ export type Config = { user: string; pass: string; }[] | undefined; - pgroonga: boolean | undefined; meilisearch: { host: string; port: string; @@ -149,15 +138,6 @@ export type Config = { index: string; scope?: 'local' | 'global' | string[]; } | undefined; - opensearch: { - host: string; - port: string; - user: string; - pass: string; - ssl?: boolean; - rejectUnauthorized?: boolean; - index: string; - } | undefined; proxy: string | undefined; proxySmtp: string | undefined; proxyBypassHosts: string[] | undefined; @@ -284,9 +264,7 @@ export function loadConfig(): Config { db: { ...config.db, db: dbDb, user: dbUser, pass: dbPass }, dbReplications: config.dbReplications, dbSlaves: config.dbSlaves, - pgroonga: config.pgroonga, meilisearch: config.meilisearch, - opensearch: config.opensearch, redis, redisForPubsub: config.redisForPubsub ? convertRedisOptions(config.redisForPubsub, host) : redis, redisForJobQueue: config.redisForJobQueue ? convertRedisOptions(config.redisForJobQueue, host) : redis, diff --git a/packages/backend/src/core/SearchService.ts b/packages/backend/src/core/SearchService.ts index 39f2021b37..28f9395397 100644 --- a/packages/backend/src/core/SearchService.ts +++ b/packages/backend/src/core/SearchService.ts @@ -105,11 +105,6 @@ export class SearchService { } /** - * if (this.config.pgroonga) { - * query.andWhere('note.text &@~ :q', { q: `%${sqlLikeEscape(q)}%` }); - *} else { - * query.andWhere('note.text ILIKE :q', { q: `%${sqlLikeEscape(q)}%` }); - *} * TODO: PGroongaの統合 */ diff --git a/packages/backend/src/di-symbols.ts b/packages/backend/src/di-symbols.ts index a88c695958..1d2ee08cc5 100644 --- a/packages/backend/src/di-symbols.ts +++ b/packages/backend/src/di-symbols.ts @@ -7,7 +7,6 @@ export const DI = { config: Symbol('config'), db: Symbol('db'), meilisearch: Symbol('meilisearch'), - opensearch: Symbol('opensearch'), cloudLogging: Symbol('cloudLogging'), redis: Symbol('redis'), redisForPub: Symbol('redisForPub'), diff --git a/packages/backend/src/server/web/ClientServerService.ts b/packages/backend/src/server/web/ClientServerService.ts index 8eafaa1adc..90304f11f1 100644 --- a/packages/backend/src/server/web/ClientServerService.ts +++ b/packages/backend/src/server/web/ClientServerService.ts @@ -429,24 +429,6 @@ export class ClientServerService { return await reply.sendFile('/robots.txt', staticAssets); }); - // OpenSearch XML - fastify.get('/opensearch.xml', async (request, reply) => { - const meta = await this.metaService.fetch(); - - const name = meta.name ?? 'CherryPick'; - let content = ''; - content += ''; - content += `${name}`; - content += `${name} Search`; - content += 'UTF-8'; - content += `${this.config.url}/favicon.ico`; - content += ``; - content += ''; - - reply.header('Content-Type', 'application/opensearchdescription+xml'); - return await reply.send(content); - }); - //#endregion const renderBase = async (reply: FastifyReply, data: { [key: string]: any } = {}) => { diff --git a/packages/backend/src/server/web/views/base.pug b/packages/backend/src/server/web/views/base.pug index f355338df4..0e496432c6 100644 --- a/packages/backend/src/server/web/views/base.pug +++ b/packages/backend/src/server/web/views/base.pug @@ -31,7 +31,6 @@ html link(rel='icon' href= icon || '/favicon.ico') link(rel='apple-touch-icon' href= appleTouchIcon || '/apple-touch-icon.png') link(rel='manifest' href='/manifest.json') - link(rel='search' type='application/opensearchdescription+xml' title=(title || "CherryPick") href=`${url}/opensearch.xml`) link(rel='prefetch' href=serverErrorImageUrl) link(rel='prefetch' href=infoImageUrl) link(rel='prefetch' href=notFoundImageUrl) diff --git a/packages/backend/test/e2e/fetch-resource.ts b/packages/backend/test/e2e/fetch-resource.ts index 5c5a9c1f1a..b42d762cff 100644 --- a/packages/backend/test/e2e/fetch-resource.ts +++ b/packages/backend/test/e2e/fetch-resource.ts @@ -105,7 +105,6 @@ describe('Webリソース', () => { { path: '/flush', type: HTML }, { path: '/robots.txt', type: 'text/plain; charset=UTF-8' }, { path: '/favicon.ico', type: 'image/vnd.microsoft.icon' }, - { path: '/opensearch.xml', type: 'application/opensearchdescription+xml' }, { path: '/apple-touch-icon.png', type: 'image/png' }, { path: '/twemoji/2764.svg', type: 'image/svg+xml' }, { path: '/twemoji/2764-fe0f-200d-1f525.svg', type: 'image/svg+xml' }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8803c21994..26ad212072 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -152,9 +152,6 @@ importers: '@nestjs/testing': specifier: 10.3.10 version: 10.3.10(@nestjs/common@10.3.10(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10(@nestjs/common@10.3.10(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.3.10(@nestjs/common@10.3.10(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.3.10)) - '@opensearch-project/opensearch': - specifier: ^2.7.0 - version: 2.10.0 '@peertube/http-signature': specifier: 1.7.0 version: 1.7.0 @@ -3668,10 +3665,6 @@ packages: '@open-draft/until@2.1.0': resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} - '@opensearch-project/opensearch@2.10.0': - resolution: {integrity: sha512-I3Ko09HvA50zyDi92fgEZfFFaNHhpvXcYLImdKTSL6eEwKqQmszqkLF2g5NTgEyb4Jh9uD2RGX8EYr9PO9zenQ==} - engines: {node: '>=10', yarn: ^1.22.10} - '@opentelemetry/api-logs@0.52.1': resolution: {integrity: sha512-qnSqB2DQ9TPP96dl8cDubDvrUyWc0/sK81xHTK8eSUspzDM3bsewX903qclQFvVhgStjRWdC5bLb3kQqMkfV5A==} engines: {node: '>=14'} @@ -8773,10 +8766,6 @@ packages: resolution: {integrity: sha512-W9Lq347r8tA1DfMvAGn9QNcgYm4Wm7Yc+k8e6vezpMnRT+NHbtlxgNBXRVjXe9YM6eTn6+p/MKOlV/aABJcSnQ==} engines: {node: '>= 4'} - json11@1.1.2: - resolution: {integrity: sha512-5r1RHT1/Gr/jsI/XZZj/P6F11BKM8xvTaftRuiLkQI9Z2PFDukM82Ysxw8yDszb3NJP/NKnRlSGmhUdG99rlBw==} - hasBin: true - json5@1.0.2: resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} hasBin: true @@ -14386,7 +14375,7 @@ snapshots: '@eslint/config-array@0.17.1': dependencies: '@eslint/object-schema': 2.1.4 - debug: 4.3.5(supports-color@8.1.1) + debug: 4.3.7 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -14394,7 +14383,7 @@ snapshots: '@eslint/eslintrc@3.1.0': dependencies: ajv: 6.12.6 - debug: 4.3.5(supports-color@8.1.1) + debug: 4.3.7 espree: 10.1.0 globals: 14.0.0 ignore: 5.3.1 @@ -15245,17 +15234,6 @@ snapshots: '@open-draft/until@2.1.0': {} - '@opensearch-project/opensearch@2.10.0': - dependencies: - aws4: 1.13.0 - debug: 4.3.5(supports-color@8.1.1) - hpagent: 1.2.0 - json11: 1.1.2 - ms: 2.1.3 - secure-json-parse: 2.7.0 - transitivePeerDependencies: - - supports-color - '@opentelemetry/api-logs@0.52.1': dependencies: '@opentelemetry/api': 1.9.0 @@ -17626,7 +17604,7 @@ snapshots: '@typescript-eslint/types': 7.17.0 '@typescript-eslint/typescript-estree': 7.17.0(typescript@5.5.4) '@typescript-eslint/visitor-keys': 7.17.0 - debug: 4.3.5(supports-color@8.1.1) + debug: 4.3.5(supports-color@5.5.0) eslint: 9.8.0 optionalDependencies: typescript: 5.5.4 @@ -17681,7 +17659,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 7.17.0(typescript@5.5.4) '@typescript-eslint/utils': 7.17.0(eslint@9.8.0)(typescript@5.5.4) - debug: 4.3.5(supports-color@8.1.1) + debug: 4.3.5(supports-color@5.5.0) eslint: 9.8.0 ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: @@ -17744,7 +17722,7 @@ snapshots: dependencies: '@typescript-eslint/types': 7.17.0 '@typescript-eslint/visitor-keys': 7.17.0 - debug: 4.3.5(supports-color@8.1.1) + debug: 4.3.5(supports-color@5.5.0) globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.4 @@ -18417,7 +18395,7 @@ snapshots: axios@0.24.0: dependencies: - follow-redirects: 1.15.6(debug@4.3.5) + follow-redirects: 1.15.6 transitivePeerDependencies: - debug @@ -19360,6 +19338,10 @@ snapshots: dependencies: ms: 2.0.0 + debug@3.2.7: + dependencies: + ms: 2.1.3 + debug@3.2.7(supports-color@8.1.1): dependencies: ms: 2.1.3 @@ -19933,7 +19915,7 @@ snapshots: eslint-import-resolver-node@0.3.9: dependencies: - debug: 3.2.7(supports-color@8.1.1) + debug: 3.2.7 is-core-module: 2.14.0 resolve: 1.22.8 transitivePeerDependencies: @@ -19941,7 +19923,7 @@ snapshots: eslint-module-utils@2.8.1(@typescript-eslint/parser@7.17.0(eslint@9.8.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint@9.8.0): dependencies: - debug: 3.2.7(supports-color@8.1.1) + debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 7.17.0(eslint@9.8.0)(typescript@5.5.4) eslint: 9.8.0 @@ -19955,7 +19937,7 @@ snapshots: array.prototype.findlastindex: 1.2.5 array.prototype.flat: 1.3.2 array.prototype.flatmap: 1.3.2 - debug: 3.2.7(supports-color@8.1.1) + debug: 3.2.7 doctrine: 2.1.0 eslint: 9.8.0 eslint-import-resolver-node: 0.3.9 @@ -20035,7 +20017,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.5(supports-color@8.1.1) + debug: 4.3.7 escape-string-regexp: 4.0.0 eslint-scope: 8.0.2 eslint-visitor-keys: 4.0.0 @@ -20495,6 +20477,8 @@ snapshots: async: 0.2.10 which: 1.3.1 + follow-redirects@1.15.6: {} + follow-redirects@1.15.6(debug@4.3.5): optionalDependencies: debug: 4.3.5(supports-color@8.1.1) @@ -21094,7 +21078,7 @@ snapshots: https-proxy-agent@2.2.4: dependencies: agent-base: 4.3.0 - debug: 3.2.7(supports-color@8.1.1) + debug: 3.2.7 transitivePeerDependencies: - supports-color optional: true @@ -21212,7 +21196,7 @@ snapshots: dependencies: '@ioredis/commands': 1.2.0 cluster-key-slot: 1.1.2 - debug: 4.3.5(supports-color@8.1.1) + debug: 4.3.5(supports-color@5.5.0) denque: 2.1.0 lodash.defaults: 4.2.0 lodash.isarguments: 3.1.0 @@ -21986,8 +21970,6 @@ snapshots: code-error-fragment: 0.0.230 grapheme-splitter: 1.0.4 - json11@1.1.2: {} - json5@1.0.2: dependencies: minimist: 1.2.8 @@ -22898,7 +22880,7 @@ snapshots: needle@2.9.1: dependencies: - debug: 3.2.7(supports-color@8.1.1) + debug: 3.2.7 iconv-lite: 0.4.24 sax: 1.4.1 transitivePeerDependencies: @@ -24588,7 +24570,7 @@ snapshots: dependencies: '@hapi/hoek': 11.0.4 '@hapi/wreck': 18.1.0 - debug: 4.3.5(supports-color@8.1.1) + debug: 4.3.5(supports-color@5.5.0) joi: 17.13.3 transitivePeerDependencies: - supports-color @@ -25352,7 +25334,7 @@ snapshots: chalk: 4.1.2 cli-highlight: 2.1.11 dayjs: 1.11.11 - debug: 4.3.5(supports-color@8.1.1) + debug: 4.3.5(supports-color@5.5.0) dotenv: 16.4.5 glob: 10.4.2 mkdirp: 2.1.6