更新 2016.7.7 15:15閲覧 2660

【共同編集】LMDE 2 に Etherpad をインストール【テキストエディタ】

テキストファイルを共有して、複数人でリアルタイムに編集できる SubEthaEdit のようなテキストエディタを求め Gobby に辿り着いたものの、操作性に馴染めなかった為、ブラウザから編集できるという Etherpad を導入すべく、インストールとカスタマイズに挑んだが、セキュリティには配慮していない故、真似るな危険の覚え書き。

準備

マニュアルを参考に、Synaptic パッケージマネージャを起動し、git と npm をクイック検索してインストール。 GitHub - ether/etherpad-lite: Etherpad: Really real-time collaborative document editing https://github.com/ether/etherpad-lite#gnulinux-and-other-unix-like-systems

インストール

端末を開いて以下を実行。 git clone git://github.com/ether/etherpad-lite.git

カスタマイズ

/home/MyUserName/etherpad-lite/var/dirty.db を tmp に移し、ウェルカム文を非表示にし、メニューを日本語化すべく、 /home/MyUserName/etherpad-lite/settings.json.template を Pluma で開き該当箇所を編集。 //the database specific settings "dbSettings" : { "filename" : "/tmp/dirty.db" }, //the default text of a pad /* "defaultPadText" : "Welcome to Etherpad!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nGet involved with Etherpad at http:\/\/etherpad.org\n", */ exports.padOptions = { "noColors": false, "showControls": true, "showChat": true, "showLineNumbers": true, "useMonospaceFont": false, "userName": false, "userColor": false, "rtl": false, "alwaysShowChat": false, "chatAndUsers": false, "lang": "ja" } /home/MyUserName/etherpad-lite/var に保存される minified_**** を tmp に移すべく、 /home/MyUserName/etherpad-lite/node_modules/ep_etherpad-lite/node/utils/caching_middleware.js を Pluma で開き該当箇所を編集。 var CACHE_DIR = '/tmp/'; DirtyDB の警告を非表示にすべく、 /home/MyUserName/etherpad-lite/node_modules/ep_etherpad-lite/node/utils/Settings.js を Pluma で開き該当箇所をコメントアウト。 /* if(exports.dbType === "dirty"){ var dirtyWarning = "DirtyDB is used. This is fine for testing but not recommended for production."; if(!exports.suppressErrorsInPadText){ exports.defaultPadText = exports.defaultPadText + "\nWarning: " + dirtyWarning + suppressDisableMsg; } console.warn(dirtyWarning); }*/ HTML で保存する際に、ヘッダとフッタを除き、改行を実体参照にして、紀永で読み込めるようにすべく、 /home/MyUserName/etherpad-lite/src/node/utils/ExportHtml.js を Pluma で開き該当箇所を置換&編集。任意。 検索する文字列(S): <br> 置換後の文字列(W): &#10; callback(null, html);

自動起動

自動起動するアプリを起動して、 を押し、以下を入力。 名前(N): Etherpad コマンド(M): etherpad-lite/bin/run.sh 説明(E): あなたのドキュメントを共有して、みんなで作品を完成させましょう!とかなんとか

ポート開放

Gufw がインストールされているものとして起動したら、+ を押して Firewall: Add Rule ウィンドウの詳細タブをクリックし、To: のところに 9001 と入力して を押す。

注意点

カスタマイズの際に、端末で etherpad-lite/bin/run.sh を実行し、動作確認してから、 Ctrl+z で終了させた場合、システムモニタを起動して、run.sh または node のプロセスを強制終了しないと、再度 etherpad-lite/bin/run.sh を実行しても起動できなかった。 また、/home/MyUserName/etherpad-lite/settings.json.template を編集した後は、同じフォルダにある settings.json を削除しないと、編集した内容が反映されなかった。

コメント

当フォームより収集される個人情報は、返信を要する際に使用されるものであり、法令に基づく行政機関等への提供を除き、ご本人の同意を得ずに第三者に提供することはありません。また、コメントが掲載される場合であってもメールアドレスが本サイト内に記載されることはありません。