v0.1.0-beta.1

This commit is contained in:
Alexander Zhirov 2023-06-09 12:11:35 +03:00
commit a5dd160f63
3 changed files with 114 additions and 0 deletions

54
APKBUILD Normal file
View File

@ -0,0 +1,54 @@
# Maintainer: Alexander Zhirov <alexander@zhirov.kz>
pkgname=daster
pkgver=0.1.0
pkgbeta=-beta.1
pkgrel=0
pkgdesc="Daster Asterisk"
url="https://git.zhirov.kz/alexander/daster"
arch="all"
license="GPL-2.0"
options="!check"
source="
${pkgname}-${pkgver}${pkgbeta}.tar.gz::https://git.zhirov.kz/alexander/${pkgname}/archive/v${pkgver}${pkgbeta}.tar.gz
settings.patch
"
depends="
libpq
libcrypto1.1
libssl1.1
zlib
ldc-runtime
tzdata
"
makedepends="
dub
ldc
libc-dev
libpq-dev
openssl-dev
zlib-dev
"
builddir="${srcdir}/${pkgname}"
build() {
export DC=/usr/bin/ldc2
dub build --arch=$(uname -m) -b release
}
package() {
install -Dm644 "${builddir}/settings.conf.sample" "${pkgdir}/etc/${pkgname}/settings.conf"
install -Dm755 "${builddir}/bin/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
install -dm755 "${pkgdir}/var/lib/${pkgname}/jq"
install -dm755 "${pkgdir}/var/lib/${pkgname}/js"
install -dm755 "${pkgdir}/var/lib/${pkgname}/public"
install -dm755 "${pkgdir}/var/lib/${pkgname}/images"
cp -r "${builddir}/jq"/* "${pkgdir}/var/lib/${pkgname}/jq/"
install -Dm644 "${builddir}/js"/* "${pkgdir}/var/lib/${pkgname}/js/"
install -Dm644 "${builddir}/public"/* "${pkgdir}/var/lib/${pkgname}/public/"
install -Dm644 "${builddir}/images"/* "${pkgdir}/var/lib/${pkgname}/images/"
}
sha512sums="
66b3263bcf6f067520ec2d9ed5f71a516cba6693c7cbc7c5fec1b37ca1ca31679f41c125792ee34324d04429b05173595388cbc49cd64a4263d4af7d40244fac ${pkgname}-${pkgver}${pkgbeta}.tar.gz
bcfebdbf496df25bff836883603e019509522109debb4747638c0a26d5f621715c2b64902573cdf71b39fd69479542dfc34f3612c4400f8acd36cab6860ff629 settings.patch
"

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# Daster Alpine
Сборка пакета [daster](https://git.zhirov.kz/alexander/daster) для Alpine

57
settings.patch Normal file
View File

@ -0,0 +1,57 @@
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);