mirror of
https://github.com/henrygd/beszel.git
synced 2026-03-23 22:16:18 +01:00
Compare commits
3 Commits
v0.0.1-alp
...
v0.0.1-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be4a583126 | ||
|
|
75f1cb619b | ||
|
|
09806e8688 |
8
.github/workflows/docker-images.yml
vendored
8
.github/workflows/docker-images.yml
vendored
@@ -13,9 +13,11 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- image: henrygd/beszel
|
- image: henrygd/beszel
|
||||||
context: hub
|
context: ./hub
|
||||||
|
dockerfile: ./hub/Dockerfile
|
||||||
- image: henrygd/beszel-agent
|
- image: henrygd/beszel-agent
|
||||||
context: agent
|
context: ./agent
|
||||||
|
dockerfile: ./agent/Dockerfile
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
@@ -62,7 +64,7 @@ jobs:
|
|||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: '{{defaultContext}}:${{ matrix.context }}'
|
context: '${{ matrix.context }}'
|
||||||
file: ${{ matrix.dockerfile }}
|
file: ${{ matrix.dockerfile }}
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: ${{ github.ref_type == 'tag' }}
|
push: ${{ github.ref_type == 'tag' }}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import (
|
|||||||
psutilNet "github.com/shirou/gopsutil/v4/net"
|
psutilNet "github.com/shirou/gopsutil/v4/net"
|
||||||
)
|
)
|
||||||
|
|
||||||
var Version = "0.0.1-alpha.2"
|
var Version = "0.0.1-alpha.3"
|
||||||
|
|
||||||
var containerCpuMap = make(map[string][2]uint64)
|
var containerCpuMap = make(map[string][2]uint64)
|
||||||
var containerCpuMutex = &sync.Mutex{}
|
var containerCpuMutex = &sync.Mutex{}
|
||||||
|
|||||||
@@ -16,7 +16,10 @@ func updateBeszel() {
|
|||||||
currentVersion := semver.MustParse(Version)
|
currentVersion := semver.MustParse(Version)
|
||||||
fmt.Println("beszel-agent", currentVersion)
|
fmt.Println("beszel-agent", currentVersion)
|
||||||
fmt.Println("Checking for updates...")
|
fmt.Println("Checking for updates...")
|
||||||
latest, found, err = selfupdate.DetectLatest("henrygd/beszel")
|
updater, _ := selfupdate.NewUpdater(selfupdate.Config{
|
||||||
|
Filters: []string{"beszel-agent"},
|
||||||
|
})
|
||||||
|
latest, found, err = updater.DetectLatest("henrygd/beszel")
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Error checking for updates:", err)
|
fmt.Println("Error checking for updates:", err)
|
||||||
@@ -28,7 +31,7 @@ func updateBeszel() {
|
|||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("Latest version", "v", latest.Version)
|
fmt.Println("Latest version:", latest.Version)
|
||||||
|
|
||||||
if latest.Version.LTE(currentVersion) {
|
if latest.Version.LTE(currentVersion) {
|
||||||
fmt.Println("You are up to date")
|
fmt.Println("You are up to date")
|
||||||
|
|||||||
@@ -6,26 +6,29 @@ WORKDIR /app
|
|||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
|
||||||
|
# Copy source files
|
||||||
COPY *.go ./
|
COPY *.go ./
|
||||||
COPY migrations ./migrations
|
COPY migrations ./migrations
|
||||||
|
COPY site/dist ./site/dist
|
||||||
|
COPY site/*.go ./site
|
||||||
|
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
unzip \
|
||||||
|
ca-certificates
|
||||||
|
|
||||||
|
RUN update-ca-certificates
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
ARG TARGETOS TARGETARCH
|
ARG TARGETOS TARGETARCH
|
||||||
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-w -s" -o /beszel .
|
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-w -s" -o /beszel .
|
||||||
|
|
||||||
# ? -------------------------
|
# ? -------------------------
|
||||||
FROM alpine:latest
|
FROM scratch
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
|
||||||
unzip \
|
|
||||||
ca-certificates
|
|
||||||
|
|
||||||
COPY --from=builder /beszel /
|
COPY --from=builder /beszel /
|
||||||
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||||
|
|
||||||
COPY ./site/dist /site/dist
|
EXPOSE 8090
|
||||||
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
ENTRYPOINT [ "/beszel" ]
|
ENTRYPOINT [ "/beszel" ]
|
||||||
|
CMD ["serve", "--http=0.0.0.0:8090"]
|
||||||
CMD ["serve", "--http=0.0.0.0:8080"]
|
|
||||||
@@ -31,7 +31,7 @@ import (
|
|||||||
"golang.org/x/crypto/ssh"
|
"golang.org/x/crypto/ssh"
|
||||||
)
|
)
|
||||||
|
|
||||||
var Version = "0.0.1-alpha.2"
|
var Version = "0.0.1-alpha.3"
|
||||||
|
|
||||||
var app *pocketbase.PocketBase
|
var app *pocketbase.PocketBase
|
||||||
var serverConnections = make(map[string]Server)
|
var serverConnections = make(map[string]Server)
|
||||||
|
|||||||
@@ -17,7 +17,10 @@ func updateBeszel(cmd *cobra.Command, args []string) {
|
|||||||
currentVersion := semver.MustParse(Version)
|
currentVersion := semver.MustParse(Version)
|
||||||
fmt.Println("beszel", currentVersion)
|
fmt.Println("beszel", currentVersion)
|
||||||
fmt.Println("Checking for updates...")
|
fmt.Println("Checking for updates...")
|
||||||
latest, found, err = selfupdate.DetectLatest("henrygd/beszel")
|
updater, _ := selfupdate.NewUpdater(selfupdate.Config{
|
||||||
|
Filters: []string{"beszel_"},
|
||||||
|
})
|
||||||
|
latest, found, err = updater.DetectLatest("henrygd/beszel")
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Error checking for updates:", err)
|
fmt.Println("Error checking for updates:", err)
|
||||||
@@ -29,7 +32,7 @@ func updateBeszel(cmd *cobra.Command, args []string) {
|
|||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("Latest version", "v", latest.Version)
|
fmt.Println("Latest version:", latest.Version)
|
||||||
|
|
||||||
if latest.Version.LTE(currentVersion) {
|
if latest.Version.LTE(currentVersion) {
|
||||||
fmt.Println("You are up to date")
|
fmt.Println("You are up to date")
|
||||||
|
|||||||
Reference in New Issue
Block a user