私はUbuntuにRealm Object Server v2.0.4を導入し、LetsEncryptも実装しました。私は新しいRealm Studioを使用して接続することができます。HTTPS接続用にRealm Object Server v2.0.4を設定するにはどうすればよいですか?
ベースサーバーが設置されたので、HTTPSを使用してHTTPを無効にするように構成する必要があります。これが苦労しています。
私はros init bb
を使用して新しいレルムプロジェクト(BBは単に一時プロジェクト名です)と、フォルダ構造は次のようになります作成しました:私は、次を含むようにindex.ts
を更新しました
bb
└───src
│ │ index.ts
:
import { BasicServer } from 'realm-object-server'
import * as path from 'path'
const BasicServer = require('realm-object-server').BasicServer
const path = require('path')
const server = new BasicServer()
server.start({
console.log(`Does this get logged?`),
dataPath: path.join(__dirname, '../data'),
https-enable: true,
https-key: '/etc/letsencrypt/live/{my domain in here}/privkey.pem',
https-cert: '/etc/letsencrypt/live/{my domain in here}/cert.pem',
https-address: 0.0.0.0,
https-port: 9443
})
.then(() => {
console.log(`Your server is started `, server.address)
}) .then(() => {
console.log(`Your server is started `, server.address)
})
.catch(err => {
console.error(`There was an error starting your file`)
})
IはROSを開始(ros start
)コンソール出力:
info: Realm Object Server version 2.0.4 is starting
info: Realm sync server started ([realm-core-4.0.2], [realm-sync-2.0.2]) service=sync
info: Directory holding persistent state: /home/ros_admin/bb/data/sync/user_data service=sync
info: Operating mode: master_with_no_slave service=sync
info: Listening on 127.0.0.1:36580 (sync protocol version 22) service=sync
info: sync-client: Connection[1]: Connected to endpoint '127.0.0.1:36580' (from '127.0.0.1:55292')
info: sync-client: Connection[2]: Connected to endpoint '127.0.0.1:36580' (from '127.0.0.1:55294')
info: sync-client: Connection[3]: Connected to endpoint '127.0.0.1:36580' (from '127.0.0.1:55296')
info: Starting auth provider 'password'
info: sync-client: Connection[4]: Connected to endpoint '127.0.0.1:36580' (from '127.0.0.1:55298')
info: 127.0.0.1 - GET /realms/files/%2F__admin HTTP/1.1 200 41 - 6.342 ms
info: 127.0.0.1 - GET /realms/files/%2F__revocation HTTP/1.1 200 46 - 1.071 ms
info: 127.0.0.1 - GET /realms/files/%2F__wildcardpermissions HTTP/1.1 200 55 - 1.201 ms
info: 127.0.0.1 - GET /realms/files/%2F__password HTTP/1.1 200 44 - 0.629 ms
info: Realm Object Server has started and is listening on http://0.0.0.0:9080
info: sync-client: Connection[5]: Connected to endpoint '0.0.0.0:9080' (from '127.0.0.1:33262')
info: sync-client: Connection[6]: Connected to endpoint '0.0.0.0:9080' (from '127.0.0.1:33266')
コンソールログ出力が表示されないため、設定が呼び出されていないと仮定する必要があります。これは、私が間違ったファイルや場所に構成を置いたと思うようになるか、私が紛失している余分なステップがあることにつながります。
誰も助言できますか?あるいは誰でも共有できる設定例がありますか?
アップデート。コマンドラインスイッチを使用してROSを起動すると、HTTPSが正常に開始されます。/etc/letsencrypt/live/{ここの私のドメイン} /privkey.pem --https-cert/etc/letsencrypt/live/{ここの私のドメイン}/cert .pem'''ログ出力は、info:Realm Object Serverが開始し、http://.0.0.0.0:9080およびhttps://0.0.0.0:9443でリッスンしていることを示します。 –