This commit is contained in:
syuilo 2021-12-07 11:48:48 +09:00
parent 0837b63a60
commit 5749fc63b9
3 changed files with 8 additions and 9 deletions

View File

@ -21,7 +21,7 @@ Misskey用の日本語Botです。
"serverMonitoring": "サーバー監視の機能を有効にする場合は true を入れる (無効にする場合は false)", "serverMonitoring": "サーバー監視の機能を有効にする場合は true を入れる (無効にする場合は false)",
"mecab": "MeCab のインストールパス (ソースからインストールした場合、大体は /usr/local/bin/mecab)", "mecab": "MeCab のインストールパス (ソースからインストールした場合、大体は /usr/local/bin/mecab)",
"mecabDic": "MeCab の辞書ファイルパス (オプション)", "mecabDic": "MeCab の辞書ファイルパス (オプション)",
"memoryPath": "memory.jsonの保存先オプション、デフォルトは'.'(レポジトリのルートです))" "memoryDir": "memory.jsonの保存先オプション、デフォルトは'.'(レポジトリのルートです))"
} }
``` ```
`npm install` して `npm run build` して `npm start` すれば起動できます `npm install` して `npm run build` して `npm start` すれば起動できます
@ -29,7 +29,7 @@ Misskey用の日本語Botです。
## Dockerで動かす ## Dockerで動かす
まず適当なディレクトリに `git clone` します。 まず適当なディレクトリに `git clone` します。
次にそのディレクトリに `config.json` を作成します。中身は次のようにします: 次にそのディレクトリに `config.json` を作成します。中身は次のようにします:
MeCabの設定、memoryPathについては触らないでください) MeCabの設定、memoryDirについては触らないでください)
``` json ``` json
{ {
"host": "https:// + あなたのインスタンスのURL (末尾の / は除く)", "host": "https:// + あなたのインスタンスのURL (末尾の / は除く)",
@ -42,7 +42,7 @@ Misskey用の日本語Botです。
"serverMonitoring": "サーバー監視の機能を有効にする場合は true を入れる (無効にする場合は false)", "serverMonitoring": "サーバー監視の機能を有効にする場合は true を入れる (無効にする場合は false)",
"mecab": "/usr/bin/mecab", "mecab": "/usr/bin/mecab",
"mecabDic": "/usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/", "mecabDic": "/usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/",
"memoryPath": "data" "memoryDir": "data"
} }
``` ```
`docker-compose build` して `docker-compose up` すれば起動できます。 `docker-compose build` して `docker-compose up` すれば起動できます。

View File

@ -81,12 +81,11 @@ export default class 藍 {
this.account = account; this.account = account;
this.modules = modules; this.modules = modules;
let memoryPath = './'; let memoryDir = '.';
if (config.memoryPath) if (config.memoryDir) {
{ memoryDir = config.memoryDir;
memoryPath = config.memoryPath;
} }
const file = process.env.NODE_ENV === 'test' ? `${memoryPath}/test.memory.json` : `${memoryPath}/memory.json`; const file = process.env.NODE_ENV === 'test' ? `${memoryDir}/test.memory.json` : `${memoryDir}/memory.json`;
this.log(`Lodaing the memory from ${file}...`); this.log(`Lodaing the memory from ${file}...`);

View File

@ -11,7 +11,7 @@ type Config = {
serverMonitoring: boolean; serverMonitoring: boolean;
mecab?: string; mecab?: string;
mecabDic?: string; mecabDic?: string;
memoryPath?: string; memoryDir?: string;
}; };
const config = require('../config.json'); const config = require('../config.json');