summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Maclennan2021-05-05 13:39:22 +0300
committerCaleb Maclennan2021-05-05 13:42:09 +0300
commitc5e4fedd924a39479fb3b938dd37e2747d775b9a (patch)
treecbc8b4507ac5741aaefa534fde88b9d6da95bc6b
parent03e79d4612e8982dba85bdf2fbd54dc77ea77cbe (diff)
downloadaur-c5e4fedd924a39479fb3b938dd37e2747d775b9a.tar.gz
Use static example config, add SQL setup instructions
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD17
-rw-r--r--listmonk.install13
-rw-r--r--listmonk.toml22
4 files changed, 41 insertions, 15 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ebcec1ca9947..b255dc073b7a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = listmonk-bin
pkgdesc = Self-hosted newsletter and mailing list manager with a modern dashboard
pkgver = 0.9.0
- pkgrel = 4
+ pkgrel = 5
url = https://listmonk.app
install = listmonk.install
arch = x86_64
@@ -13,9 +13,11 @@ pkgbase = listmonk-bin
source = https://github.com/knadh/listmonk/releases/download/v0.9.0-beta/listmonk_0.9.0-beta_linux_amd64.tar.gz
source = listmonk.conf
source = listmonk.service
+ source = listmonk.toml
sha256sums = 1137f572fd93b25034865cb638d169acb1bd9b87d6848c274405bc6108dad62c
sha256sums = 5cfc186438df2408ed88a5bec3a9a4b5f2afb0d3aec41c4cc63b2f5eb810b3cb
sha256sums = 4852f206b7763ba047ba123d663cadb806f437967154ebe837845198b3266533
+ sha256sums = 6c72c0adbcd80dabcb5bcde6ddf01e3da9e2f2503eef52362497b0c0e76f8209
pkgname = listmonk-bin
diff --git a/PKGBUILD b/PKGBUILD
index 3b09e13f600b..f9fe87d802ba 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=listmonk-bin
pkgver=0.9.0
-pkgrel=4
+pkgrel=5
pkgdesc='Self-hosted newsletter and mailing list manager with a modern dashboard'
arch=(x86_64)
url=https://listmonk.app
@@ -14,21 +14,16 @@ backup=(etc/listmonk/config.toml)
install=${pkgname%-bin}.install
source=("https://github.com/knadh/${pkgname%-bin}/releases/download/v$pkgver-beta/${pkgname%-bin}_$pkgver-beta_linux_amd64.tar.gz"
"${pkgname%-bin}.conf"
- "${pkgname%-bin}.service")
+ "${pkgname%-bin}.service"
+ "${pkgname%-bin}.toml")
sha256sums=('1137f572fd93b25034865cb638d169acb1bd9b87d6848c274405bc6108dad62c'
'5cfc186438df2408ed88a5bec3a9a4b5f2afb0d3aec41c4cc63b2f5eb810b3cb'
- '4852f206b7763ba047ba123d663cadb806f437967154ebe837845198b3266533')
-_sample_pw=TKByjizucIoex3mA
-
-build() {
- rm -f config.toml
- ./${pkgname%-bin} --new-config
- sed -i -e "/admin_password/s,\".*\",\"$_sample_pw\"," config.toml
-}
+ '4852f206b7763ba047ba123d663cadb806f437967154ebe837845198b3266533'
+ '6c72c0adbcd80dabcb5bcde6ddf01e3da9e2f2503eef52362497b0c0e76f8209')
package() {
install -Dm755 -t "$pkgdir/usr/bin" ${pkgname%-bin}
- install -Dm600 -t "$pkgdir/etc/${pkgname%-bin}" config.toml
+ install -Dm644 "${pkgname%-bin}.toml" "$pkgdir/etc/${pkgname%-bin}/config.toml"
install -Dm644 -t "$pkgdir/usr/lib/systemd/system/" "${pkgname%-bin}.service"
install -Dm644 -t "$pkgdir/usr/lib/sysusers.d/" "${pkgname%-bin}.conf"
}
diff --git a/listmonk.install b/listmonk.install
index c3c6e89ad28c..38210b548899 100644
--- a/listmonk.install
+++ b/listmonk.install
@@ -6,9 +6,16 @@ post_install() {
\$ listmonk --new-config
\$ sudo mv config.toml /etc/listmonk/
- To setup database, run
+ Setup credentials and a database (substiting your own password!):
- \$ listmonk --config /etc/listmonk/config.toml --install
+ \$ sudo -u postgres psql
+ postgres=# CREATE USER listmonk WITH PASSWORD 'TKByjizucIoex3mA';
+ postgres=# CREATE DATABASE listmonk;
+ postgres=# GRANT ALL PRIVILEGES ON DATABASE listmonk TO listmonk;
+
+ Edit with PostgreSQL database credentials, then to setup database, run:
+
+ \$ sudo -u listmonk listmonk --config /etc/listmonk/config.toml --install
EOF
}
@@ -16,7 +23,7 @@ post_upgrade() {
cat <<- EOF
To update database, run
- \$ listmonk --config /etc/listmonk/config.toml --upgrade
+ \$ sudo -u listmonk listmonk --config /etc/listmonk/config.toml --upgrade
EOF
}
diff --git a/listmonk.toml b/listmonk.toml
new file mode 100644
index 000000000000..44ea3a2acef1
--- /dev/null
+++ b/listmonk.toml
@@ -0,0 +1,22 @@
+[app]
+ # Interface and port where the app will run its webserver.
+ address = "0.0.0.0:9000"
+
+ # BasicAuth authentication for the admin dashboard. This will eventually
+ # be replaced with a better multi-user, role-based authentication system.
+ # IMPORTANT: Leave both values empty to disable authentication on admin
+ # only where an external authentication is already setup.
+ admin_username = "listmonk"
+ admin_password = "TKByjizucIoex3mA"
+
+# Database.
+[db]
+ host = "localhost"
+ port = 5432
+ user = "listmonk"
+ password = "TKByjizucIoex3mA"
+ database = "listmonk"
+ ssl_mode = "disable"
+ max_open = 25
+ max_idle = 25
+ max_lifetime = "300s"