mirror of
https://github.com/zadam/trilium.git
synced 2025-06-05 01:18:44 +02:00
if config file doesn't exist, create it from config sample
This commit is contained in:
parent
7dcd80bd81
commit
ef9a7040e8
@ -1,5 +1,5 @@
|
||||
[Network]
|
||||
port=80
|
||||
port=8080
|
||||
# true for TLS/SSL/HTTPS (secure), false for HTTP (unsecure).
|
||||
https=false
|
||||
# path to certificate (run "bash generate-cert.sh" to generate self-signed certificate). Relevant only if https=true
|
||||
|
@ -3,7 +3,18 @@
|
||||
const ini = require('ini');
|
||||
const fs = require('fs');
|
||||
const dataDir = require('./data_dir');
|
||||
const path = require('path');
|
||||
|
||||
const config = ini.parse(fs.readFileSync(dataDir.TRILIUM_DATA_DIR + '/config.ini', 'utf-8'));
|
||||
const configSampleFilePath = path.resolve(__dirname, "..", "config-sample.ini");
|
||||
|
||||
const configFilePath = dataDir.TRILIUM_DATA_DIR + '/config.ini';
|
||||
|
||||
if (!fs.existsSync(configFilePath)) {
|
||||
const configSample = fs.readFileSync(configSampleFilePath).toString('utf8');
|
||||
|
||||
fs.writeFileSync(configFilePath, configSample);
|
||||
}
|
||||
|
||||
const config = ini.parse(fs.readFileSync(configFilePath, 'utf-8'));
|
||||
|
||||
module.exports = config;
|
@ -3,7 +3,6 @@ const sql = require('./sql');
|
||||
const options = require('./options');
|
||||
const fs = require('fs-extra');
|
||||
const log = require('./log');
|
||||
const app_info = require('./app_info');
|
||||
const path = require('path');
|
||||
|
||||
const MIGRATIONS_DIR = path.resolve(__dirname, "..", "migrations");
|
||||
|
@ -11,6 +11,9 @@
|
||||
<div class="alert alert-warning" id="alert" style="display: none;">
|
||||
</div>
|
||||
|
||||
<p>You're almost done with the setup. That last thing is to choose username and password using which you'll login to the application.
|
||||
This password is also used for generating encryption key which encrypts protected notes.</p>
|
||||
|
||||
<form id="setup-form">
|
||||
<div class="form-group">
|
||||
<label for="username">Username</label>
|
||||
|
Loading…
x
Reference in New Issue
Block a user