1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-20 02:57:05 +00:00

Add fauxmailer to gcloud, custom greeting

This commit is contained in:
James Hillyerd
2017-12-24 10:40:12 -08:00
parent 52de1b2bfe
commit 0e72b414c4
3 changed files with 38 additions and 4 deletions

View File

@@ -0,0 +1,8 @@
#!/bin/bash
# create-demo-instance.sh
set -x
gcloud compute instances create inbucket-1 --machine-type=f1-micro \
--image-project=debian-cloud --image-family=debian-9 \
--metadata-from-file=startup-script=debian-startup.sh,greeting=demo-greeting.html \
--tags=http-server --address=inbucket-demo

19
etc/gcloud/setup.sh → etc/gcloud/debian-startup.sh Normal file → Executable file
View File

@@ -2,8 +2,13 @@
# setup.sh
# description: Install Inbucket on Google Cloud debian9 instance
release="inbucket_1.2.0-rc2_linux_amd64"
url="https://dl.bintray.com/content/jhillyerd/golang/${release}.tar.gz?direct"
inbucket_rel="1.2.0-rc2"
inbucket_pkg="inbucket_${inbucket_rel}_linux_amd64"
inbucket_url="https://dl.bintray.com/content/jhillyerd/golang/${inbucket_pkg}.tar.gz?direct"
fauxmailer_rel="0.1"
fauxmailer_pkg="fauxmailer_${fauxmailer_rel}_linux_amd64"
fauxmailer_url="https://github.com/jhillyerd/fauxmailer/releases/download/0.1/${fauxmailer_pkg}.tar.gz"
set -eo pipefail
[ $TRACE ] && set -x
@@ -15,8 +20,8 @@ id inbucket &>/dev/null || useradd -r -m inbucket
# Extract
cd /opt
curl --location "$url" | tar xzvf -
ln -s "$release/" inbucket
curl --location "$inbucket_url" | tar xzvf -
ln -s "$inbucket_pkg/" inbucket
# Install
cd /opt/inbucket/etc/ubuntu
@@ -29,5 +34,11 @@ install -o root -g root -m 644 ../unix-sample.conf /etc/opt/inbucket.conf
# Setup
setcap 'cap_net_bind_service=+ep' /opt/inbucket/inbucket
curl -sL -o /opt/inbucket/themes/greeting.html "http://metadata.google.internal/computeMetadata/v1/instance/attributes/greeting" -H "Metadata-Flavor: Google"
systemctl enable inbucket.service
systemctl start inbucket
# Fauxmailer
cd /opt
curl --location "$fauxmailer_url" | tar xzvf -
ln -s "$fauxmailer_pkg/" fauxmailer

View File

@@ -0,0 +1,15 @@
<h2>Welcome to the Inbucket demonstration instance</h2>
<p><em>tl;dr</em> - click <code>Monitor</code> above to get started.</p>
<p>Inbucket is an email testing service; it will accept email for any email
address and make it available to view without a password.</p>
<p>This instance is running on Google Compute Engine, and utilizes
<a href="https://github.com/jhillyerd/fauxmailer">fauxmailer</a> to generate
a stream of fake email. Feel free to poke around, delete mails, or try out
the REST API.</p>
<p>To protect our visitors, this instance does not accept external mail. You
will need to install your own copy of Inbucket to use it in your
environment.</p>