diff options
author | Caleb Maclennan | 2021-05-06 17:42:23 +0300 |
---|---|---|
committer | Caleb Maclennan | 2021-05-06 17:42:23 +0300 |
commit | cd2e18a4c1b63cf97f30255cde7079737021a714 (patch) | |
tree | 9a63b6c79a5e9e3cd75bcdd4ee68bf744012dc3e | |
parent | c7760019a8b4379e62930eaa53a1bb34e8bd5353 (diff) | |
download | aur-cd2e18a4c1b63cf97f30255cde7079737021a714.tar.gz |
upgpkg: listmonk-git 0.9.0.r78.g68b80d0-1
Normalize configs with other packages
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 16 | ||||
-rw-r--r-- | listmonk.install | 30 |
3 files changed, 31 insertions, 17 deletions
@@ -1,6 +1,6 @@ pkgbase = listmonk-git pkgdesc = Self-hosted newsletter and mailing list manager with a modern dashboard - pkgver = 0.9.0.beta.r78.g68b80d0 + pkgver = 0.9.0.r78.g68b80d0 pkgrel = 1 url = https://listmonk.app install = listmonk.install @@ -2,7 +2,7 @@ pkgname=listmonk-git _pkgname=${pkgname%-git} -pkgver=0.9.0.beta.r78.g68b80d0 +pkgver=0.9.0.r78.g68b80d0 pkgrel=1 pkgdesc='Self-hosted newsletter and mailing list manager with a modern dashboard' arch=(x86_64) @@ -24,11 +24,15 @@ sha256sums=('SKIP' pkgver() { cd "$pkgname" git describe --long --abbrev=7 --tags --match="v*" | - sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' + sed 's/-beta//;s/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' } prepare() { - cd "$pkgname/frontend" + cd "$pkgname" + sed -i -e 's/^[[:space:]]\+//;s/"db"/"localhost"/;s/0.0.0.0/localhost/' \ + -e '/password/s/"listmonk"/"<your_password>"/' \ + config.toml.sample + pushd frontend export YARN_CACHE_FOLDER="$srcdir/node_modules" yarn install --frozen-lockfile } @@ -40,11 +44,11 @@ build() { -buildmode=pie \ -mod=readonly \ -modcacherw \ - -ldflags "-extldflags '$LDFLAGS' -X 'main.buildString=Arch Linux AUR v$pkgver $pkgrel' -X 'main.versionString=v$pkgver-beta'" \ + -ldflags "-extldflags '$LDFLAGS' -X 'main.buildString=Arch Linux AUR v$pkgver-$pkgrel' -X 'main.versionString=v$pkgver'" \ -o $_pkgname \ cmd/*.go export YARN_CACHE_FOLDER="$srcdir/node_modules" - export VUE_APP_VERSION="v$pkgver-beta" + export VUE_APP_VERSION="v$pkgver" pushd frontend yarn build } @@ -57,7 +61,7 @@ check() { package() { cd "$pkgname" install -Dm755 -t "$pkgdir/usr/bin" $_pkgname - install -Dm644 "config.toml.sample" "$pkgdir/etc/$pkgname/config.toml" + install -Dm644 config.toml.sample "$pkgdir/etc/$pkgname/config.toml" install -Dm644 -t "$pkgdir/usr/lib/systemd/system/" "../$_pkgname.service" install -Dm644 -t "$pkgdir/usr/lib/sysusers.d/" "../$_pkgname.conf" install -Dm644 -t "$pkgdir/usr/share/$_pkgname/" \ diff --git a/listmonk.install b/listmonk.install index 48743d4388a1..be3a05e2b306 100644 --- a/listmonk.install +++ b/listmonk.install @@ -1,29 +1,39 @@ post_install() { cat <<- EOF - Installed with default password. To generate a new random one: + WARNING: Installed with default password! - \$ cd /tmp - \$ listmonk --new-config - \$ sudo mv config.toml /etc/listmonk/ + To setup: - Setup credentials and a database (substiting your own password!): + Setup PostgreSQL with credentials and a database: \$ sudo -u postgres psql - postgres=# CREATE USER listmonk WITH PASSWORD 'password'; + postgres=# CREATE USER listmonk WITH PASSWORD '<your_password>'; postgres=# CREATE DATABASE listmonk; postgres=# GRANT ALL PRIVILEGES ON DATABASE listmonk TO listmonk; + postgres=# \\q - Edit with PostgreSQL database credentials, then to setup database, run: + Then edit /etc/listmonk/config.toml with your new database credentials. + Also be sure to change the admin password from the defalut. - \$ sudo -u listmonk listmonk --config /etc/listmonk/config.toml --static-dir /usr/share/listmonk --install + Run manually once to setup the database tables: + + \$ sudo -u listmonk listmonk --config /etc/listmonk/config.toml --install + + Lastly you can enable the system service: + + \$ sudo systemctl enable --now listmonk EOF } post_upgrade() { cat <<- EOF - To update database, run + To update the Listmonk database format, first backup your data, then run: + + \$ sudo -u listmonk listmonk --config /etc/listmonk/config.toml --upgrade + + Then restart the service: - \$ sudo -u listmonk listmonk --config /etc/listmonk/config.toml --static-dir /usr/share/listmonk --upgrade + \$ sudo systemctl restart listmonk EOF } |