sonic: use ::1 as default target

pull/92/head
masnn 4 years ago
parent b4ac4da1fd
commit 3171277252

@ -98,9 +98,9 @@ export async function setting(pending: string[], fail: string[], modelSetting: t
if (!fs.existsSync(p)) p = path.resolve(i, 'settings.yaml'); if (!fs.existsSync(p)) p = path.resolve(i, 'settings.yaml');
if (fs.existsSync(p) && !fail.includes(i)) { if (fs.existsSync(p) && !fail.includes(i)) {
try { try {
const cfg: any = yaml.load(fs.readFileSync(p).toString()); const cfg: any = yaml.load(fs.readFileSync(p, 'utf-8'));
for (const key in cfg) { for (const key in cfg) {
let val = cfg[key].default; let val = cfg[key].default || cfg[key].value;
if (typeof val === 'string') { if (typeof val === 'string') {
val = val val = val
.replace(/\$TEMP/g, os.tmpdir()) .replace(/\$TEMP/g, os.tmpdir())

@ -47,9 +47,9 @@ class SonicService implements BaseService {
async start() { async start() {
const [host, port, auth] = system.getMany(['sonic.host', 'sonic.port', 'sonic.auth']); const [host, port, auth] = system.getMany(['sonic.host', 'sonic.port', 'sonic.auth']);
const cfg = { const cfg = {
host: host || '127.0.0.1', host: host || '::1',
port: port || 1491, port: port || 1491,
auth: auth || 'sonic-passwd', auth: auth || '',
}; };
this.search = new Search(cfg); this.search = new Search(cfg);
this.ingest = new Ingest(cfg); this.ingest = new Ingest(cfg);

@ -1,5 +1,5 @@
host: host:
value: localhost value: ::1
port: port:
type: number type: number
value: 1491 value: 1491

Loading…
Cancel
Save