mirror of https://github.com/statping/statping
building
parent
087403a0d9
commit
aeed39bc3e
|
@ -40,7 +40,7 @@ deploy:
|
||||||
- "build/statup-linux-arm64"
|
- "build/statup-linux-arm64"
|
||||||
- "build/statup-linux-arm7"
|
- "build/statup-linux-arm7"
|
||||||
- "build/statup-windows-x64.exe"
|
- "build/statup-windows-x64.exe"
|
||||||
- "build/statup-alpine"
|
- "build/statup-linux-alpine"
|
||||||
skip_cleanup: true
|
skip_cleanup: true
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
|
|
|
@ -3,7 +3,7 @@ FROM alpine:latest
|
||||||
ENV VERSION=v0.22
|
ENV VERSION=v0.22
|
||||||
|
|
||||||
RUN apk --no-cache add ca-certificates
|
RUN apk --no-cache add ca-certificates
|
||||||
RUN wget https://github.com/hunterlong/statup/releases/download/$VERSION/statup-alpine && \
|
RUN wget https://github.com/hunterlong/statup/releases/download/$VERSION/statup-linux-alpine && \
|
||||||
chmod +x statup-alpine && \
|
chmod +x statup-alpine && \
|
||||||
mv statup-alpine /usr/local/bin/statup
|
mv statup-alpine /usr/local/bin/statup
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
26
README.md
26
README.md
|
@ -38,19 +38,25 @@ LETSENCRYPT_HOST=mydomain.com \
|
||||||
Once your instance has started, it will take a moment to get your SSL certificate. Make sure you have a A or CNAME record on your domain that points to the IP/DNS of your server running Statup.
|
Once your instance has started, it will take a moment to get your SSL certificate. Make sure you have a A or CNAME record on your domain that points to the IP/DNS of your server running Statup.
|
||||||
|
|
||||||
## Run on AWS EC2
|
## Run on AWS EC2
|
||||||
Running Statup on the smallest EC2 server is very quick using the AWS AMI Image: `ami-1f7c3567`.
|
Running Statup on the smallest EC2 server is very quick using the AWS AMI Image: `ami-84da93fc`.
|
||||||
```bash
|
```bash
|
||||||
aws ec2 run-instances \
|
ec2-run-instances --key KEYPAIR ami-84da93fc
|
||||||
--image-id ami-1f7c3567 \
|
|
||||||
--count 1 \
|
|
||||||
--instance type t2.micro \
|
|
||||||
--region us-west-2
|
|
||||||
--key-name <key name> \
|
|
||||||
--security-group-ids <your security group id here> \
|
|
||||||
--subnet-id <your subnet id here> \
|
|
||||||
--region <your region here>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# EC2 with SSL Certificate
|
||||||
|
```bash
|
||||||
|
wget https://raw.githubusercontent.com/hunterlong/statup/master/servers/ec2-ssl.sh
|
||||||
|
#
|
||||||
|
# Edit ec2-ssl.sh and add LETSENCRYPT_HOST and LETSENCRYPT_EMAIL
|
||||||
|
#
|
||||||
|
# nano ec2-ssl.sh
|
||||||
|
#
|
||||||
|
ec2-run-instances --key KEYPAIR \
|
||||||
|
--user-data-file ec2-ssl.sh \
|
||||||
|
ami-bf5eb9d6
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Email Nofitications
|
## Email Nofitications
|
||||||
Statup includes email notification via SMTP if your services go offline.
|
Statup includes email notification via SMTP if your services go offline.
|
||||||
|
|
||||||
|
|
2
build.sh
2
build.sh
|
@ -14,7 +14,7 @@ xgo -go 1.10.x --targets=windows-6.0/amd64 --dest=build -ldflags="-X main.VERSIO
|
||||||
xgo -go 1.10.x --targets=linux/arm-7 --dest=build -ldflags="-X main.VERSION=$VERSION" ./
|
xgo -go 1.10.x --targets=linux/arm-7 --dest=build -ldflags="-X main.VERSION=$VERSION" ./
|
||||||
xgo -go 1.10.x --targets=linux/arm64 --dest=build -ldflags="-X main.VERSION=$VERSION" ./
|
xgo -go 1.10.x --targets=linux/arm64 --dest=build -ldflags="-X main.VERSION=$VERSION" ./
|
||||||
|
|
||||||
CGO_ENABLED=0 GOOS=linux go build -ldflags="-X main.VERSION=$VERSION" -a -o build/statup-alpine .
|
CGO_ENABLED=0 GOOS=linux go build -ldflags="-X main.VERSION=$VERSION" -a -o build/statup-linux-alpine .
|
||||||
|
|
||||||
cd build
|
cd build
|
||||||
ls
|
ls
|
||||||
|
|
|
@ -46,8 +46,8 @@ func (u *Service) DeleteFailures() {
|
||||||
|
|
||||||
func (s *Service) LimitedFailures() []*Failure {
|
func (s *Service) LimitedFailures() []*Failure {
|
||||||
var fails []*Failure
|
var fails []*Failure
|
||||||
col := dbSession.Collection("failures").Find("service", s.Id)
|
col := dbSession.Collection("failures").Find("service", s.Id).OrderBy("-id").Limit(10)
|
||||||
col.OrderBy("create_at").All(&fails)
|
col.All(&fails)
|
||||||
return fails
|
return fails
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,9 +44,9 @@
|
||||||
|
|
||||||
{{ range .Services }}
|
{{ range .Services }}
|
||||||
|
|
||||||
{{ if .Failures }}
|
{{ if .LimitedFailures }}
|
||||||
<div class="list-group mt-5">
|
<div class="list-group mt-5">
|
||||||
{{ range .Failures }}
|
{{ range .LimitedFailures }}
|
||||||
<a href="#" class="list-group-item list-group-item-action flex-column align-items-start">
|
<a href="#" class="list-group-item list-group-item-action flex-column align-items-start">
|
||||||
<div class="d-flex w-100 justify-content-between">
|
<div class="d-flex w-100 justify-content-between">
|
||||||
<h5 class="mb-1">{{.ParseError}}</h5>
|
<h5 class="mb-1">{{.ParseError}}</h5>
|
||||||
|
|
|
@ -8,6 +8,8 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- 0.0.0.0:80:80
|
- 0.0.0.0:80:80
|
||||||
- 0.0.0.0:443:443
|
- 0.0.0.0:443:443
|
||||||
|
labels:
|
||||||
|
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy"
|
||||||
networks:
|
networks:
|
||||||
- internet
|
- internet
|
||||||
restart: always
|
restart: always
|
||||||
|
@ -18,7 +20,20 @@ services:
|
||||||
- ./statup/nginx/html:/usr/share/nginx/html:ro
|
- ./statup/nginx/html:/usr/share/nginx/html:ro
|
||||||
- ./statup/nginx/dhparam:/etc/nginx/dhparam
|
- ./statup/nginx/dhparam:/etc/nginx/dhparam
|
||||||
environment:
|
environment:
|
||||||
DEFAULT_HOST: localhost
|
DEFAULT_HOST: ${LETSENCRYPT_HOST}
|
||||||
|
|
||||||
|
letsencrypt:
|
||||||
|
container_name: letsencrypt
|
||||||
|
image: jrcs/letsencrypt-nginx-proxy-companion
|
||||||
|
networks:
|
||||||
|
- internet
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
|
- ./statup/nginx/certs:/etc/nginx/certs
|
||||||
|
- ./statup/nginx/vhost:/etc/nginx/vhost.d
|
||||||
|
- ./statup/nginx/html:/usr/share/nginx/html
|
||||||
|
- ./statup/nginx/dhparam:/etc/nginx/dhparam
|
||||||
|
|
||||||
statup:
|
statup:
|
||||||
container_name: statup
|
container_name: statup
|
||||||
|
@ -32,15 +47,17 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./statup/app:/app
|
- ./statup/app:/app
|
||||||
environment:
|
environment:
|
||||||
VIRTUAL_HOST: localhost
|
VIRTUAL_HOST: ${LETSENCRYPT_HOST}
|
||||||
VIRTUAL_PORT: 8080
|
VIRTUAL_PORT: 8080
|
||||||
|
LETSENCRYPT_HOST: ${LETSENCRYPT_HOST}
|
||||||
|
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
|
||||||
DB_CONN: postgres
|
DB_CONN: postgres
|
||||||
DB_HOST: postgres
|
DB_HOST: postgres
|
||||||
DB_USER: statup
|
DB_USER: statup
|
||||||
DB_PASS: password123
|
DB_PASS: password123
|
||||||
DB_DATABASE: statup
|
DB_DATABASE: statup
|
||||||
NAME: EC2 Example
|
NAME: Statup on EC2
|
||||||
DESCRIPTION: This is a Statup Docker Compose instance
|
DESCRIPTION: This Status Status Page should be running ${LETSENCRYPT_HOST} with SSL.
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
container_name: postgres
|
container_name: postgres
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
## Domain for new SSL certificate
|
||||||
|
LETSENCRYPT_HOST="status.balancebadge.io"
|
||||||
|
|
||||||
|
## An email address that can recover SSL certificate from Lets Encrypt
|
||||||
|
LETSENCRYPT_EMAIL="info@socialeck.com"
|
||||||
|
|
||||||
|
###################################################
|
||||||
|
############# Leave this part alone ###############
|
||||||
|
###################################################
|
||||||
|
|
||||||
|
printf "Statup will try to create an SSL for domain: $LETSENCRYPT_HOST\n"
|
||||||
|
printf "\nexport LETSENCRYPT_HOST=$LETSENCRYPT_HOST\n" >> /home/ubuntu/.profile
|
||||||
|
printf "export LETSENCRYPT_EMAIL=$LETSENCRYPT_EMAIL\n" >> /home/ubuntu/.profile
|
||||||
|
sudo printf "\nexport LETSENCRYPT_HOST=$LETSENCRYPT_HOST\n" >> /root/.profile
|
||||||
|
sudo printf "export LETSENCRYPT_EMAIL=$LETSENCRYPT_EMAIL\n" >> /root/.profile
|
||||||
|
source /home/ubuntu/.profile
|
||||||
|
sudo /bin/bash -c "source /root/.profile"
|
||||||
|
LETSENCRYPT_HOST=$LETSENCRYPT_HOST LETSENCRYPT_EMAIL=$LETSENCRYPT_EMAIL ./startup.sh
|
|
@ -2,4 +2,4 @@
|
||||||
cd /home/ubuntu
|
cd /home/ubuntu
|
||||||
curl -o /home/ubuntu/startup.sh -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/hunterlong/statup/master/servers/startup.sh
|
curl -o /home/ubuntu/startup.sh -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/hunterlong/statup/master/servers/startup.sh
|
||||||
chmod +x /home/ubuntu/startup.sh
|
chmod +x /home/ubuntu/startup.sh
|
||||||
./startup.sh
|
LETSENCRYPT_HOST=$LETSENCRYPT_HOST LETSENCRYPT_EMAIL=$LETSENCRYPT_EMAIL ./startup.sh
|
|
@ -1,9 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
LETSENCRYPT_HOST="status.balancebadge.io"
|
cd /home/ubuntu
|
||||||
LETSENCRYPT_EMAIL="info@socialeck.com"
|
|
||||||
|
|
||||||
rm -f docker-compose.yml
|
rm -f docker-compose.yml
|
||||||
curl -o docker-compose.yml -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/hunterlong/statu$
|
curl -o docker-compose.yml -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/hunterlong/statup/master/servers/docker-compose-ssl.yml
|
||||||
sudo service docker start
|
sudo service docker start
|
||||||
sudo docker system prune -af
|
sudo docker system prune -af
|
||||||
sudo LETSENCRYPT_HOST=$LETSENCRYPT_HOST LETSENCRYPT_EMAIL=$LETSENCRYPT_EMAIL docker-compose pull
|
sudo LETSENCRYPT_HOST=$LETSENCRYPT_HOST LETSENCRYPT_EMAIL=$LETSENCRYPT_EMAIL docker-compose pull
|
||||||
|
|
|
@ -4,5 +4,5 @@ rm -f docker-compose.yml
|
||||||
curl -o docker-compose.yml -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/hunterlong/statup/master/servers/docker-compose.yml
|
curl -o docker-compose.yml -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/hunterlong/statup/master/servers/docker-compose.yml
|
||||||
sudo service docker start
|
sudo service docker start
|
||||||
sudo docker system prune -af
|
sudo docker system prune -af
|
||||||
sudo docker-compose pull
|
sudo LETSENCRYPT_HOST=$LETSENCRYPT_HOST LETSENCRYPT_EMAIL=$LETSENCRYPT_EMAIL docker-compose pull
|
||||||
sudo docker-compose up -d
|
sudo LETSENCRYPT_HOST=$LETSENCRYPT_HOST LETSENCRYPT_EMAIL=$LETSENCRYPT_EMAIL docker-compose up -d
|
Loading…
Reference in New Issue