diff --git a/.config/example.yml b/.config/example.yml index 0f38e593b6f6114103201b33ec7b3e98ba8fb0d2..ea83f9cfb880b7df4ad13d70dd265cd069301466 100644 --- a/.config/example.yml +++ b/.config/example.yml @@ -60,11 +60,6 @@ mongodb: user: example-misskey-user pass: example-misskey-pass -redis: - host: localhost - port: 6379 - pass: example-pass - # Drive capacity of a local user (MB) localDriveCapacityMb: 256 @@ -122,47 +117,50 @@ drive: # Below settings are optional # +# Redis +#redis: +# host: localhost +# port: 6379 +# pass: example-pass + # Elasticsearch -# elasticsearch: -# host: localhost -# port: 9200 -# pass: null +#elasticsearch: +# host: localhost +# port: 9200 +# pass: null # reCAPTCHA -# recaptcha: -# site_key: example-site-key +#recaptcha: +# site_key: example-site-key # secret_key: example-secret-key # ServiceWorker -# sw: -# # Public key of VAPID -# public_key: example-sw-public-key - -# # Private key of VAPID -# private_key: example-sw-private-key - -# google_maps_api_key: example-google-maps-api-key +#sw: +# # Public key of VAPID +# public_key: example-sw-public-key +# +# # Private key of VAPID +# private_key: example-sw-private-key # Twitter integration # You need to set the oauth callback url as : https://<your-misskey-instance>/api/tw/cb -# twitter: -# consumer_key: example-twitter-consumer-key -# consumer_secret: example-twitter-consumer-secret-key +#twitter: +# consumer_key: example-twitter-consumer-key +# consumer_secret: example-twitter-consumer-secret-key # Ghost # Ghost account is an account used for the purpose of delegating # followers when putting users in the list. -# ghost: user-id-of-your-ghost-account +#ghost: user-id-of-your-ghost-account # Clustering -# clusterLimit: 1 +#clusterLimit: 1 # Summaly proxy -# summalyProxy: "http://example.com" +#summalyProxy: "http://example.com" # User recommendation -user_recommendation: - external: true - engine: http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-misskey-api.cgi?{{host}}+{{user}}+{{limit}}+{{offset}} - timeout: 300000 - +#user_recommendation: +# external: true +# engine: http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-misskey-api.cgi?{{host}}+{{user}}+{{limit}}+{{offset}} +# timeout: 300000 diff --git a/docs/setup.en.md b/docs/setup.en.md index 23bcdcca98922032205ec19465dca94ba87217b2..e30297962bd715fb907816087809fab81fd95a58 100644 --- a/docs/setup.en.md +++ b/docs/setup.en.md @@ -24,12 +24,12 @@ Please install and setup these softwares: #### Dependencies :package: * **[Node.js](https://nodejs.org/en/)** * **[MongoDB](https://www.mongodb.com/)** >= 3.6 -* **[Redis](https://redis.io/)** ##### Optional +* [Redis](https://redis.io/) + * Redis is optional, but we strongly recommended to install it * [Elasticsearch](https://www.elastic.co/) - used to provide searching feature instead of MongoDB - *3.* Setup MongoDB ---------------------------------------------------------------- In root : diff --git a/docs/setup.ja.md b/docs/setup.ja.md index e1ed63cab4f94fb2ce64fa51416cdd8fb1599a44..df98e6a8c08077d50e4368b4cdf37e432deefd40 100644 --- a/docs/setup.ja.md +++ b/docs/setup.ja.md @@ -24,9 +24,11 @@ adduser --disabled-password --disabled-login misskey #### ä¾å˜é–¢ä¿‚ :package: * **[Node.js](https://nodejs.org/en/)** * **[MongoDB](https://www.mongodb.com/)** (3.6以上) -* **[Redis](https://redis.io/)** ##### オプション +* [Redis](https://redis.io/) + * Redisã¯ã‚ªãƒ—ションã§ã™ãŒã€ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã™ã‚‹ã“ã¨ã‚’å¼·ã推奨ã—ã¾ã™ã€‚ + * インストールã—ãªãã¦ã„ã„ã®ã¯ã€ã‚ãªãŸã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ãŒè‡ªåˆ†å°‚用ã®ã¨ãã ã‘ã§ã™ * [Elasticsearch](https://www.elastic.co/) - 検索機能をå‘上ã•ã›ã‚‹ãŸã‚ã«ç”¨ã„ã¾ã™ã€‚ *3.* MongoDBã®è¨å®š diff --git a/src/config/types.ts b/src/config/types.ts index 5c7b8260dbcb1a90e12e433590942908f5cfee8e..5c2b5542859d5c2606f42dacdb1e6f1e8bf8f72f 100644 --- a/src/config/types.ts +++ b/src/config/types.ts @@ -93,11 +93,9 @@ export type Source = { private_key: string; }; - google_maps_api_key: string; - clusterLimit?: number; - user_recommendation: { + user_recommendation?: { external: boolean; engine: string; timeout: number; diff --git a/src/db/redis.ts b/src/db/redis.ts index f8d66ebda0717897f0f3beee3328db2469d04018..48e3f4e43e417214704457647b64a5fc65fe7bb2 100644 --- a/src/db/redis.ts +++ b/src/db/redis.ts @@ -1,10 +1,10 @@ import * as redis from 'redis'; import config from '../config'; -export default redis.createClient( +export default config.redis ? redis.createClient( config.redis.port, config.redis.host, { auth_pass: config.redis.pass } -); +) : null; diff --git a/src/server/api/limitter.ts b/src/server/api/limitter.ts index 20a18a7098543c3b19d0d183b030532947ef04c5..abf7627ab8bc905f73d2d4a014e706cbd79edaeb 100644 --- a/src/server/api/limitter.ts +++ b/src/server/api/limitter.ts @@ -8,6 +8,12 @@ import { IUser } from '../../models/user'; const log = debug('misskey:limitter'); export default (endpoint: IEndpoint, user: IUser) => new Promise((ok, reject) => { + // RedisãŒã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚Œã¦ãªã„å ´åˆã¯å¸¸ã«è¨±å¯ + if (limiterDB == null) { + ok(); + return; + } + const limitation = endpoint.meta.limit; const key = limitation.hasOwnProperty('key') diff --git a/src/server/api/service/twitter.ts b/src/server/api/service/twitter.ts index f71e588628502ee762e1ed3d141319dcf22651e1..6c3cdaa1389ca7efe6dbb455a3aadaf0878fed05 100644 --- a/src/server/api/service/twitter.ts +++ b/src/server/api/service/twitter.ts @@ -55,7 +55,7 @@ router.get('/disconnect/twitter', async ctx => { })); }); -if (config.twitter == null) { +if (config.twitter == null || redis == null) { router.get('/connect/twitter', ctx => { ctx.body = 'ç¾åœ¨Twitterã¸æŽ¥ç¶šã§ãã¾ã›ã‚“ (ã“ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã§ã¯Twitterã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“)'; });