Use static example config, add SQL setup instructions
authorCaleb Maclennan <caleb@alerque.com>
Wed, 5 May 2021 10:39:22 +0000 (13:39 +0300)
committerCaleb Maclennan <caleb@alerque.com>
Wed, 5 May 2021 10:42:09 +0000 (13:42 +0300)
.SRCINFO
PKGBUILD
listmonk.install
listmonk.toml [new file with mode: 0644]
index ebcec1ca99478bcf6628d770e2c5bf8b9b082fe8..b255dc073b7ac16b2987e05b4af168ccacb9e9ed 100644 (file)
--- 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
 
index 3b09e13f600bbefa34deefeae99c2a0bba85e868..f9fe87d802baef9bab6ad371e974930a1207c226 100644 (file)
--- 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"
 }
index c3c6e89ad28c70a4da93eca62024f698ec2fe3a5..38210b54889905db987d6372f2065b32c02704c1 100644 (file)
@@ -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 (file)
index 0000000..44ea3a2
--- /dev/null
@@ -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"