-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cb03d05
Showing
9 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
web: ./start-listmonk.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# listmonk Heroku installer | ||
|
||
This repository is a Heroku Buildpack + button installer for [listmonk](https://github.com/knadh/listmonk). It downloads and installs the latest binary release from the listmonk releases page. | ||
|
||
[](https://heroku.com/deploy?template=https://github.com/knadh/listmonk-heroku) | ||
|
||
Licensed under the MIT license. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "listmonk", | ||
"description": "Self-hosted newsletter + mailing list manager", | ||
"repository": "https://github.com/knadh/listmonk-heroku", | ||
"logo": "https://listmonk.app/static/images/listmonk.svg", | ||
"website": "https://listmonk.app", | ||
"keywords": ["emails", "newsletter", "mailing-list"], | ||
|
||
"buildpacks": [ | ||
{ | ||
"url": "https://github.com/knadh/listmonk-heroku" | ||
} | ||
], | ||
"addons": ["heroku-postgresql"], | ||
|
||
"env": { | ||
"LISTMONK_APP__ADMIN_USERNAME": { | ||
"description": "Admin username", | ||
"value": "" | ||
}, | ||
"LISTMONK_APP__ADMIN_PASSWORD": { | ||
"description": "Admin password", | ||
"value": "" | ||
} | ||
}, | ||
|
||
"scripts": { | ||
"postdeploy": "./install-db.sh" | ||
}, | ||
|
||
"success_url": "/settings" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
# bin/compile <build-dir> <cache-dir> | ||
|
||
echo "Downloading listmonk" | ||
|
||
BUILD_DIR=$1 | ||
|
||
# Get the URL of the latest Linux release. | ||
URL=$(curl -L -s https://api.github.com/repos/knadh/listmonk/releases/latest | grep -o -E "https://(.*)listmonk_(.*)_linux_amd64.tar.gz") | ||
|
||
# Download and extract the release to the build dir. | ||
curl -L -s $URL | tar xvz -C $BUILD_DIR | ||
|
||
# Generate the config file. | ||
cd $BUILD_DIR && ./listmonk --new-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
# bin/detect <build-dir> | ||
|
||
echo "Null" | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "config_vars: {}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
# DATABSE_URL and PORT come from Heroku. | ||
# DATABASE_URL="postgres://listmonk:listmonk@localhost:9432/listmonk" | ||
# PORT="9005" | ||
|
||
export LISTMONK_APP__ADDRESS="0.0.0.0:$PORT" | ||
|
||
# `cut` is used to cut out the separators (:, @, /) that come matched with the groups. | ||
export LISTMONK_DB__HOST=$(echo $DATABASE_URL | grep -oP "postgres://.*@\K(.+?):" | cut -d: -f1) | ||
export LISTMONK_DB__PORT=$(echo $DATABASE_URL | grep -oP "postgres://.*@.*:\K(\d+)/" | cut -d/ -f1) | ||
export LISTMONK_DB__USER=$(echo $DATABASE_URL | grep -oP "postgres://\K(.+?):" | cut -d: -f1) | ||
export LISTMONK_DB__PASSWORD=$(echo $DATABASE_URL | grep -oP "postgres://.*:\K(.+?)@" | cut -d@ -f1) | ||
export LISTMONK_DB__DATABASE=$(echo $DATABASE_URL | grep -oP "postgres://.*@.*:.*/\K(.+?)$") | ||
export LISTMONK_DB__SSL_MODE="require" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Source the DB variables from the env. | ||
source ./env.sh | ||
|
||
# Setup the listmonk DB. | ||
./listmonk --install --yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Source the DB variables from the env. | ||
source ./env.sh | ||
|
||
./listmonk --upgrade --yes | ||
./listmonk |