daster-alpine/settings.patch

58 lines
2.1 KiB
Diff

diff --git a/settings.conf.sample b/settings.conf.sample
index 538d199..3a080b1 100644
--- a/settings.conf.sample
+++ b/settings.conf.sample
@@ -2,17 +2,16 @@
title => "Управление диалпланом"
addresses => 127.0.0.1
http => 80
-https => 443
+;https => 443
cert => certs/test.local.crt
key => certs/test.local.key
-data => ./ ; Путь к каталогу, в котором расположены каталоги public, jq, js, images
loglevel => 0 ; 0 - debug, 1 - crit, 2 - err, 3 - warn, 4 - notice, 5 - info, 6 - alert
logoutput => 1, 4 ; 1 - syslog, 2 - stout, 4 - file => example: 1,2 or 1,2,4
logfile => /var/log/daster.log ; if log-output set with 4
[auth]
-login =>
-password =>
+login => daster
+password => daster
[daster-db]
host => 127.0.0.1
diff --git a/source/daster.d b/source/daster.d
index 0f4876c..84e9fd1 100644
--- a/source/daster.d
+++ b/source/daster.d
@@ -37,7 +37,8 @@ void page404(HTTPServerRequest req, HTTPServerResponse res, HTTPServerErrorInfo
int main(string[] args) {
log.level(log.INFORMATION)
.output(log.SYSLOG)
- .color(true);
+ .color(true)
+ .file("/var/log/daster.log");
bool flagVersion;
string flagSettings;
@@ -75,7 +76,7 @@ int main(string[] args) {
}
if (!flagSettings.length)
- flagSettings = "./settings.conf";
+ flagSettings = "/etc/daster/settings.conf";
if (!flagSettings.exists) {
log.c("Файл конфигурации не найден: " ~ flagSettings);
@@ -87,6 +88,8 @@ int main(string[] args) {
auto webHost = rcWebHost();
serverInfo = ServerInfo(webHost.title);
+ if (!webHost.data.length) webHost.data = "/var/lib/daster";
+
if (webHost.loglevel != -1) log.level(webHost.loglevel);
if (webHost.logoutput) log.output(webHost.logoutput);
if (webHost.logfile.length) log.file(webHost.logfile);