Compare commits
22 Commits
Author | SHA1 | Date |
---|---|---|
Kekskurse | 94d1f90722 | |
Kekskurse | 383ce965a0 | |
Kekskurse | 3fde27f83b | |
Kekskurse | 28b5ccca8e | |
Kekskurse | 280a9559f6 | |
Kekskurse | a80fcb5d4c | |
Kekskurse | 40d601f5b4 | |
Kekskurse | 2ebe72790f | |
Kekskurse | 1d09eef545 | |
Kekskurse | 387ba50c26 | |
Kekskurse | 8a06fe56cf | |
Kekskurse | ab83e1ff5e | |
Kekskurse | 1d54f47988 | |
Kekskurse | eaaee5c3ef | |
Kekskurse | b65aff651c | |
Kekskurse | a49ed9a9a7 | |
Kekskurse | 4a54b35510 | |
Kekskurse | ee5075f47f | |
Kekskurse | 711a0714a4 | |
Kekskurse | 5b815e1932 | |
Kekskurse | 326b2e459e | |
Kekskurse | 4b41ef1c55 |
|
@ -0,0 +1,36 @@
|
||||||
|
run-name: ${{ github.actor }} is testing
|
||||||
|
on: ["push"]
|
||||||
|
jobs:
|
||||||
|
Release:
|
||||||
|
runs-on: docker
|
||||||
|
#container:
|
||||||
|
# image: goreleaser/goreleaser
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
#- run: goreleaser release --skip-publish --snapshot --rm-dist --debug
|
||||||
|
- name: Setup Go environment
|
||||||
|
uses: https://github.com/actions/setup-go@v2.1.3
|
||||||
|
with:
|
||||||
|
go-version: 1.20
|
||||||
|
- name: Run GoReleaser
|
||||||
|
uses: https://github.com/goreleaser/goreleaser-action@v4
|
||||||
|
with:
|
||||||
|
# either 'goreleaser' (default) or 'goreleaser-pro'
|
||||||
|
distribution: goreleaser
|
||||||
|
version: latest
|
||||||
|
args: release --skip-publish --snapshot --rm-dist --debug --clean
|
||||||
|
env:
|
||||||
|
GORELEASER_FORCE_TOKEN: "gitea"
|
||||||
|
- name: Copy deb to publish folder
|
||||||
|
run: mkdir publish; cp dist/*deb publish/last.deb
|
||||||
|
- name: Upload to s3
|
||||||
|
uses: https://github.com/shallwefootball/s3-upload-action@master
|
||||||
|
with:
|
||||||
|
aws_key_id: ${{ secrets.AWS_KEY_ID }}
|
||||||
|
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
|
||||||
|
aws_bucket: 'kekscloud-releases'
|
||||||
|
source_dir: 'publish/'
|
||||||
|
destination_dir: 'http-server-status/'
|
||||||
|
endpoint: 's3.eu-central-003.backblazeb2.com'
|
|
@ -0,0 +1,40 @@
|
||||||
|
run-name: ${{ github.actor }} is testing
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
jobs:
|
||||||
|
Release:
|
||||||
|
runs-on: docker
|
||||||
|
#container:
|
||||||
|
# image: goreleaser/goreleaser
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
#- run: goreleaser release --skip-publish --snapshot --rm-dist --debug
|
||||||
|
- name: Setup Go environment
|
||||||
|
uses: https://github.com/actions/setup-go@v2.1.3
|
||||||
|
with:
|
||||||
|
go-version: 1.20
|
||||||
|
- name: Run GoReleaser
|
||||||
|
uses: https://github.com/goreleaser/goreleaser-action@v4
|
||||||
|
with:
|
||||||
|
# either 'goreleaser' (default) or 'goreleaser-pro'
|
||||||
|
distribution: goreleaser
|
||||||
|
version: latest
|
||||||
|
args: release --clean
|
||||||
|
env:
|
||||||
|
GORELEASER_FORCE_TOKEN: "gitea"
|
||||||
|
GITEA_TOKEN: "${{ secrets.GITEA }}"
|
||||||
|
- name: Copy deb to publish folder
|
||||||
|
run: mkdir publish; cp dist/*deb publish/stable.deb; cp dist/*deb publish/
|
||||||
|
- name: Upload to s3
|
||||||
|
uses: https://github.com/shallwefootball/s3-upload-action@master
|
||||||
|
with:
|
||||||
|
aws_key_id: ${{ secrets.AWS_KEY_ID }}
|
||||||
|
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
|
||||||
|
aws_bucket: 'kekscloud-releases'
|
||||||
|
source_dir: 'publish/'
|
||||||
|
destination_dir: 'http-server-status/'
|
||||||
|
endpoint: 's3.eu-central-003.backblazeb2.com'
|
|
@ -17,11 +17,6 @@ builds:
|
||||||
- amd64
|
- amd64
|
||||||
ldflags:
|
ldflags:
|
||||||
- -X main.version={{ .Version }}
|
- -X main.version={{ .Version }}
|
||||||
archives:
|
|
||||||
- replacements:
|
|
||||||
darwin: Darwin
|
|
||||||
386: i386
|
|
||||||
amd64: x86_64
|
|
||||||
checksum:
|
checksum:
|
||||||
name_template: 'checksums.txt'
|
name_template: 'checksums.txt'
|
||||||
changelog:
|
changelog:
|
||||||
|
|
13
Readme.md
13
Readme.md
|
@ -4,13 +4,14 @@ Status Page with your Server informations (HDD usage, ram usage, load, systemd)
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
## Fast
|
## Dowanload URLs:
|
||||||
```
|
|
||||||
curl https://git.keks.cloud/kekskurse/http-server-status/raw/branch/main/install.sh | sh
|
|
||||||
```
|
|
||||||
|
|
||||||
## Manual
|
* Last Dev Build: `https://kekscloud-releases.s3.eu-central-003.backblazeb2.com/http-server-status/last.deb`
|
||||||
To Install the Server Montiroing download the last .deb File from the Release page and save it as http-server-status.deb on your server. Than install the package with dpkg
|
* Last Release Build: `https://kekscloud-releases.s3.eu-central-003.backblazeb2.com/http-server-status/stable.deb`
|
||||||
|
* Special Version: `https://kekscloud-releases.s3.eu-central-003.backblazeb2.com/http-server-status/http-server-status_1.0.7_linux_amd64.deb` (Bigger than 1.0.7)
|
||||||
|
|
||||||
|
|
||||||
|
To Install the Server Montiroing download the last .deb File from the Release page or the links above and save it as http-server-status.deb on your server. Than install the package with dpkg
|
||||||
|
|
||||||
```
|
```
|
||||||
dpkg -i http-server-status.deb
|
dpkg -i http-server-status.deb
|
||||||
|
|
|
@ -17,13 +17,11 @@ checks:
|
||||||
max_load_15: 5
|
max_load_15: 5
|
||||||
memory:
|
memory:
|
||||||
enabled: true
|
enabled: true
|
||||||
max: 100
|
max: 80
|
||||||
max_swap: 80
|
max_swap: 80
|
||||||
systemd:
|
systemd:
|
||||||
enabled: true
|
enabled: true
|
||||||
services:
|
services:
|
||||||
- sshd
|
- sshd
|
||||||
- test
|
|
||||||
- docker
|
|
||||||
version:
|
version:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Go Mail Admin
|
Description=HTTP Status Server
|
||||||
After=syslog.target
|
After=syslog.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=http-server-status
|
User=http-server-status
|
||||||
ExecStart=/usr/local/bin/http-server-status
|
ExecStart=/usr/bin/http-server-status
|
||||||
SyslogIdentifier=http-server-status
|
SyslogIdentifier=http-server-status
|
||||||
StandardOutput=syslog
|
StandardOutput=syslog
|
||||||
StandardError=syslog
|
StandardError=syslog
|
||||||
|
|
6
main.go
6
main.go
|
@ -3,9 +3,11 @@ package main
|
||||||
import (
|
import (
|
||||||
_ "embed"
|
_ "embed"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"github.com/rs/zerolog"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
checks "http-server-status/internal/pkg/checks"
|
checks "http-server-status/internal/pkg/checks"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
"text/template"
|
"text/template"
|
||||||
)
|
)
|
||||||
|
@ -21,7 +23,9 @@ var checkList []checks.Check
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
readConfig()
|
readConfig()
|
||||||
log.Debug().Int("max_percent", c.Checks.HDD.MaxPercent).Msg("HDD CHECK")
|
pp := log.Output(zerolog.ConsoleWriter{Out: os.Stdout})
|
||||||
|
multi := zerolog.MultiLevelWriter(pp)
|
||||||
|
log.Logger = zerolog.New(multi).With().Timestamp().Caller().Logger()
|
||||||
checkList = append(checkList, checks.HDD{c.Checks.HDD}, checks.Memory{Config: c.Checks.Memory}, checks.Load{Config: c.Checks.Load}, checks.Systemd{Config: c.Checks.Systemd}, checks.Version{Config: c.Checks.Version})
|
checkList = append(checkList, checks.HDD{c.Checks.HDD}, checks.Memory{Config: c.Checks.Memory}, checks.Load{Config: c.Checks.Load}, checks.Systemd{Config: c.Checks.Systemd}, checks.Version{Config: c.Checks.Version})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,12 @@
|
||||||
|
if [ -f "/etc/http-server-status/config.yml" ]; then
|
||||||
|
echo "Config exists"
|
||||||
|
else
|
||||||
|
cp /etc/http-server-status/config.yml.sample /etc/http-server-status/config.yml
|
||||||
|
fi
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl is-active --quiet http-server-status && systemctl restart http-server-status && echo "Restart Service"
|
STATUS="$(systemctl is-active tomcat.service)"
|
||||||
|
if [ "${STATUS}" = "active" ]; then
|
||||||
|
systemctl restart http-server-status
|
||||||
|
echo "Restart Service"
|
||||||
|
fi
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#/bin/sh
|
#/bin/sh
|
||||||
if ! id -u http-server-status > /dev/null 2>&1; then
|
if ! id -u http-server-status > /dev/null 2>&1; then
|
||||||
adduser --system http-server-status
|
adduser --system http-server-status
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue