Compare commits
4 commits
54e3813b71
...
310ddbc84b
Author | SHA1 | Date | |
---|---|---|---|
310ddbc84b | |||
24007cab58 | |||
a72240e4f2 | |||
802b93bdaf |
13 changed files with 245 additions and 133 deletions
|
@ -7,10 +7,6 @@ steps:
|
||||||
- go fmt $(go list ./... | grep -v /vendor/)
|
- go fmt $(go list ./... | grep -v /vendor/)
|
||||||
- go vet $(go list ./... | grep -v /vendor/)
|
- go vet $(go list ./... | grep -v /vendor/)
|
||||||
- go test -race $(go list ./... | grep -v /vendor/)
|
- go test -race $(go list ./... | grep -v /vendor/)
|
||||||
when:
|
|
||||||
- event: [push, cron]
|
|
||||||
branch: [main, develop]
|
|
||||||
- event: pull_request
|
|
||||||
|
|
||||||
- name: check-sec
|
- name: check-sec
|
||||||
image: golang
|
image: golang
|
||||||
|
@ -18,7 +14,12 @@ steps:
|
||||||
- go install github.com/securego/gosec/v2/cmd/gosec@latest
|
- go install github.com/securego/gosec/v2/cmd/gosec@latest
|
||||||
- go get -v -d .
|
- go get -v -d .
|
||||||
- gosec ./...
|
- gosec ./...
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
when:
|
when:
|
||||||
- event: [push, cron]
|
- event: [push, cron]
|
||||||
branch: [main, develop]
|
branch: [main, develop]
|
||||||
- event: pull_request
|
- event: pull_request
|
||||||
|
- event: tag
|
||||||
|
branch: main
|
48
.woodpecker/1-build-check.yml
Normal file
48
.woodpecker/1-build-check.yml
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
steps:
|
||||||
|
- name: test/build-binary/linux-amd64
|
||||||
|
image: golang:1.24.2
|
||||||
|
environment:
|
||||||
|
GOOS: "linux"
|
||||||
|
GOARCH: "amd64"
|
||||||
|
I_PACKAGE: "git.hackmi.ch/Phil/goshorly/utils"
|
||||||
|
CGO_ENABLED: 0
|
||||||
|
commands:
|
||||||
|
- go build -a -installsuffix cgo -ldflags=" -X $I_PACKAGE.CI_COMMIT_SHA=$CI_COMMIT_SHA -X $I_PACKAGE.CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH -X $I_PACKAGE.CI_COMMIT_TAG=$CI_COMMIT_TAG" -o app-amd64 .
|
||||||
|
|
||||||
|
- name: test/build-binary/linux-arm64
|
||||||
|
image: golang:1.24.2
|
||||||
|
environment:
|
||||||
|
GOOS: "linux"
|
||||||
|
GOARCH: "arm64"
|
||||||
|
I_PACKAGE: "git.hackmi.ch/Phil/goshorly/utils"
|
||||||
|
CGO_ENABLED: 0
|
||||||
|
commands:
|
||||||
|
- go build -a -installsuffix cgo -ldflags=" -X $I_PACKAGE.CI_COMMIT_SHA=$CI_COMMIT_SHA -X $I_PACKAGE.CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH -X $I_PACKAGE.CI_COMMIT_TAG=$CI_COMMIT_TAG" -o app-arm64 .
|
||||||
|
|
||||||
|
- name: test/build-docker/linux-amd64
|
||||||
|
image: woodpeckerci/plugin-docker-buildx:5.2.2
|
||||||
|
settings:
|
||||||
|
platforms: linux/amd64
|
||||||
|
dry-run: true
|
||||||
|
repo: git.hackmi.ch/phil/goshorly
|
||||||
|
registry: git.hackmi.ch
|
||||||
|
depends_on:
|
||||||
|
- test/build-binary/linux-amd64
|
||||||
|
|
||||||
|
- name: test/build-docker/linux-arm64
|
||||||
|
image: woodpeckerci/plugin-docker-buildx:5.2.2
|
||||||
|
settings:
|
||||||
|
platforms: linux/arm64
|
||||||
|
dry-run: true
|
||||||
|
repo: git.hackmi.ch/phil/goshorly
|
||||||
|
registry: git.hackmi.ch
|
||||||
|
depends_on:
|
||||||
|
- test/build-binary/linux-arm64
|
||||||
|
|
||||||
|
when:
|
||||||
|
- event: [push, cron]
|
||||||
|
branch: [main, develop]
|
||||||
|
- event: pull_request
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- 0-pre
|
42
.woodpecker/10-build-dev.yml
Normal file
42
.woodpecker/10-build-dev.yml
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
steps:
|
||||||
|
- name: dev/build-binary/linux-amd64
|
||||||
|
image: golang:1.24.2
|
||||||
|
environment:
|
||||||
|
GOOS: "linux"
|
||||||
|
GOARCH: "amd64"
|
||||||
|
I_PACKAGE: "git.hackmi.ch/Phil/goshorly/utils"
|
||||||
|
CGO_ENABLED: 0
|
||||||
|
commands:
|
||||||
|
- go build -a -installsuffix cgo -ldflags=" -X $I_PACKAGE.CI_COMMIT_SHA=$CI_COMMIT_SHA -X $I_PACKAGE.CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH -X $I_PACKAGE.CI_COMMIT_TAG=$CI_COMMIT_TAG" -o app-linux-amd64 .
|
||||||
|
|
||||||
|
- name: dev/build-binary/linux-arm64
|
||||||
|
image: golang:1.24.2
|
||||||
|
environment:
|
||||||
|
GOOS: "linux"
|
||||||
|
GOARCH: "arm64"
|
||||||
|
I_PACKAGE: "git.hackmi.ch/Phil/goshorly/utils"
|
||||||
|
CGO_ENABLED: 0
|
||||||
|
commands:
|
||||||
|
- go build -a -installsuffix cgo -ldflags=" -X $I_PACKAGE.CI_COMMIT_SHA=$CI_COMMIT_SHA -X $I_PACKAGE.CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH -X $I_PACKAGE.CI_COMMIT_TAG=$CI_COMMIT_TAG" -o app-linux-arm64 .
|
||||||
|
|
||||||
|
- name: dev/build-docker/linux-multiarch
|
||||||
|
image: woodpeckerci/plugin-docker-buildx:5.2.2
|
||||||
|
settings:
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
repo: git.hackmi.ch/phil/goshorly
|
||||||
|
registry: git.hackmi.ch
|
||||||
|
tags: dev
|
||||||
|
username:
|
||||||
|
from_secret: reg-user
|
||||||
|
password:
|
||||||
|
from_secret: reg-pass
|
||||||
|
depends_on:
|
||||||
|
- dev/build-binary/linux-amd64
|
||||||
|
- dev/build-binary/linux-arm64
|
||||||
|
|
||||||
|
when:
|
||||||
|
- event: [push, cron]
|
||||||
|
branch: main
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- 0-pre
|
|
@ -1,41 +0,0 @@
|
||||||
steps:
|
|
||||||
- name: build-binary
|
|
||||||
image: golang:1.24.2
|
|
||||||
commands:
|
|
||||||
- export CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHA:0:10}
|
|
||||||
- go build -ldflags="-X main.CommitSHA=${CI_COMMIT_SHORT_SHA}" -o linux-amd64 .
|
|
||||||
when:
|
|
||||||
- event: [push, cron]
|
|
||||||
branch: main
|
|
||||||
|
|
||||||
- name: build-and-push-docker-dev
|
|
||||||
image: woodpeckerci/plugin-docker-buildx:5.2.2
|
|
||||||
settings:
|
|
||||||
platforms: linux/amd64,linux/arm/v6,linux/arm64/v8
|
|
||||||
repo: git.hackmi.ch/phil/goshorly
|
|
||||||
registry: git.hackmi.ch
|
|
||||||
tags: dev
|
|
||||||
username:
|
|
||||||
from_secret: reg-user
|
|
||||||
password:
|
|
||||||
from_secret: reg-pass
|
|
||||||
build_args:
|
|
||||||
- CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH}
|
|
||||||
- CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHA:0:10}
|
|
||||||
depends_on:
|
|
||||||
- build-binary
|
|
||||||
when:
|
|
||||||
- event: [push, cron]
|
|
||||||
branch: main
|
|
||||||
|
|
||||||
services:
|
|
||||||
docker-daemon:
|
|
||||||
image: docker:28.0-dind-rootless
|
|
||||||
commands:
|
|
||||||
- dockerd --tls=false --host=tcp://0.0.0.0:2376
|
|
||||||
privileged: true
|
|
||||||
when:
|
|
||||||
- event: [push, cron]
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- 0-pre
|
|
41
.woodpecker/20-build-tag.yml
Normal file
41
.woodpecker/20-build-tag.yml
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
steps:
|
||||||
|
- name: prod/build-binary/linux-amd64
|
||||||
|
image: golang:1.24.2
|
||||||
|
environment:
|
||||||
|
GOOS: "linux"
|
||||||
|
GOARCH: "amd64"
|
||||||
|
I_PACKAGE: "git.hackmi.ch/Phil/goshorly/utils"
|
||||||
|
CGO_ENABLED: 0
|
||||||
|
commands:
|
||||||
|
- go build -a -installsuffix cgo -ldflags=" -X $I_PACKAGE.CI_COMMIT_SHA=$CI_COMMIT_SHA -X $I_PACKAGE.CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH -X $I_PACKAGE.CI_COMMIT_TAG=$CI_COMMIT_TAG" -o app-linux-amd64 .
|
||||||
|
|
||||||
|
- name: prod/build-binary/linux-arm64
|
||||||
|
image: golang:1.24.2
|
||||||
|
environment:
|
||||||
|
GOOS: "linux"
|
||||||
|
GOARCH: "arm64"
|
||||||
|
I_PACKAGE: "git.hackmi.ch/Phil/goshorly/utils"
|
||||||
|
CGO_ENABLED: 0
|
||||||
|
commands:
|
||||||
|
- go build -a -installsuffix cgo -ldflags=" -X $I_PACKAGE.CI_COMMIT_SHA=$CI_COMMIT_SHA -X $I_PACKAGE.CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH -X $I_PACKAGE.CI_COMMIT_TAG=$CI_COMMIT_TAG" -o app-linux-arm64 .
|
||||||
|
|
||||||
|
- name: prod/build-docker/linux-multiarch
|
||||||
|
image: woodpeckerci/plugin-docker-buildx:5.2.2
|
||||||
|
settings:
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
repo: git.hackmi.ch/phil/goshorly
|
||||||
|
registry: git.hackmi.ch
|
||||||
|
auto_tag: true
|
||||||
|
username:
|
||||||
|
from_secret: reg-user
|
||||||
|
password:
|
||||||
|
from_secret: reg-pass
|
||||||
|
depends_on:
|
||||||
|
- prod/build-binary/linux-amd64
|
||||||
|
- prod/build-binary/linux-arm64
|
||||||
|
|
||||||
|
when:
|
||||||
|
- event: tag
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- 0-pre
|
18
Dockerfile
18
Dockerfile
|
@ -1,26 +1,18 @@
|
||||||
FROM golang:alpine as builder
|
FROM golang:1.24.2-alpine AS builder
|
||||||
|
|
||||||
RUN apk add --no-cache git make build-base
|
|
||||||
|
|
||||||
ARG CI_COMMIT_BRANCH
|
|
||||||
ARG CI_COMMIT_SHORT_SHA
|
|
||||||
ARG CI_COMMIT_TAG
|
|
||||||
|
|
||||||
ENV CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH
|
|
||||||
ENV CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA
|
|
||||||
ENV CI_COMMIT_TAG=$CI_COMMIT_TAG
|
|
||||||
|
|
||||||
ENV I_PACKAGE="git.hackmi.ch/Phil/goshorly/utils"
|
ENV I_PACKAGE="git.hackmi.ch/Phil/goshorly/utils"
|
||||||
ENV CGO_ENABLED=0
|
ENV CGO_ENABLED=0
|
||||||
|
|
||||||
|
RUN apk add --no-cache git make build-base
|
||||||
|
|
||||||
WORKDIR /go/src/git.hackmi.ch/goshorly
|
WORKDIR /go/src/git.hackmi.ch/goshorly
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN go get -d -v ./...
|
RUN go get -d -v ./...
|
||||||
|
|
||||||
RUN go build -a -installsuffix cgo -ldflags=" -X $I_PACKAGE.CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA -X $I_PACKAGE.CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH -X $I_PACKAGE.CI_COMMIT_TAG=$CI_COMMIT_TAG" -o app .
|
RUN go build -a -installsuffix cgo -ldflags=" -X $I_PACKAGE.CI_COMMIT_SHA=$CI_COMMIT_SHA -X $I_PACKAGE.CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH -X $I_PACKAGE.CI_COMMIT_TAG=$CI_COMMIT_TAG" -o app .
|
||||||
|
|
||||||
FROM scratch as production
|
FROM scratch AS production
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
COPY --from=builder /go/src/git.hackmi.ch/goshorly/app /app
|
COPY --from=builder /go/src/git.hackmi.ch/goshorly/app /app
|
||||||
ENTRYPOINT [ "/app" ]
|
ENTRYPOINT [ "/app" ]
|
53
README.md
53
README.md
|
@ -1,24 +1,53 @@
|
||||||
[](https://ci.hackmi.ch/repos/11)
|
[](https://ci.hackmi.ch/repos/11)
|
||||||
# goshorly
|
|
||||||
An easy self-hosted Link shortener in Golang with Redis <3
|
# Goshorly
|
||||||
|
**Easy-to-use, self-hosted link shortener built with Golang and Redis.**
|
||||||
|
|
||||||
|
Lightweight, fast, and Docker-compatible for seamless deployment. ❤️
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Docker Supported:
|
### Features
|
||||||
- linux/amd64
|
|
||||||
- linux/arm/v6
|
|
||||||
- linux/arm64/v8
|
|
||||||
|
|
||||||
See docker-compose.yml as example
|
- Self-hosted: Take control of your link shortening service.
|
||||||
|
- Built with Golang: High performance and reliability.
|
||||||
|
- Redis Integration: Efficient data storage.
|
||||||
|
- Easy Deployment: Docker, Binary, Build it yourself
|
||||||
|
- Docker Support: ( linux/amd64, linux/arm64 )
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Live-Demo:
|
### Installation
|
||||||
- https://2slk.com Hosted by nitmali in Chinese
|
#### Using Docker
|
||||||
|
(please refer to the example files!)
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
git clone https://github.com/yourusername/goshorly.git
|
||||||
|
cd goshorly
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
To simplify your deployment, we offer the following Docker tags:
|
||||||
|
|
||||||
|
- dev: Latest code from the main branch (experimental).
|
||||||
|
- latest: Latest stable release (may include breaking changes).
|
||||||
|
- Versioned Tags (vX, vX.X, vX.X.X): Specific release versions.
|
||||||
|
|
||||||
|
#### Using Binary
|
||||||
|
1. Download the latest binary from the releases.
|
||||||
|
2. Create an .env file (or use the .env.example)
|
||||||
|
and change the values for your environment.
|
||||||
|
3. Run the binary the terminal.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**WARNING:**
|
### Contributing
|
||||||
- goshorly is in an early stage, it is not an Final Version! (Pre-Release Status v0.1.X)
|
|
||||||
|
|
||||||
If you have an feature request, please do not hesitate to open an issue or merge request.
|
We welcome contributions!
|
||||||
|
If you have feature requests, bug reports, or improvements, feel free to:
|
||||||
|
|
||||||
|
- Open an issue.
|
||||||
|
- Fork the repository.
|
||||||
|
- Create a new branch (feature/awesome-feature).
|
||||||
|
- Submit a pull request with detailed explanations.
|
||||||
|
- Submit a review.
|
|
@ -8,7 +8,7 @@ import (
|
||||||
|
|
||||||
func Gethome(c *fiber.Ctx) error {
|
func Gethome(c *fiber.Ctx) error {
|
||||||
return c.Render("views/home", fiber.Map{
|
return c.Render("views/home", fiber.Map{
|
||||||
"CI_COMMIT_SHORT_SHA": utils.CI_COMMIT_SHORT_SHA,
|
"CI_COMMIT_SHA": utils.CI_COMMIT_SHA,
|
||||||
"CI_COMMIT_BRANCH": utils.CI_COMMIT_BRANCH,
|
"CI_COMMIT_BRANCH": utils.CI_COMMIT_BRANCH,
|
||||||
"CI_COMMIT_TAG": utils.CI_COMMIT_TAG,
|
"CI_COMMIT_TAG": utils.CI_COMMIT_TAG,
|
||||||
"CI_TAGGED": utils.CI_TAGGED,
|
"CI_TAGGED": utils.CI_TAGGED,
|
||||||
|
|
|
@ -29,7 +29,7 @@ func Posthome(c *fiber.Ctx) error {
|
||||||
|
|
||||||
return c.Status(500).Render("views/home", fiber.Map{
|
return c.Status(500).Render("views/home", fiber.Map{
|
||||||
"ERR": "Parsing Error",
|
"ERR": "Parsing Error",
|
||||||
"CI_COMMIT_SHORT_SHA": utils.CI_COMMIT_SHORT_SHA,
|
"CI_COMMIT_SHA": utils.CI_COMMIT_SHA,
|
||||||
"CI_COMMIT_BRANCH": utils.CI_COMMIT_BRANCH,
|
"CI_COMMIT_BRANCH": utils.CI_COMMIT_BRANCH,
|
||||||
"CI_COMMIT_TAG": utils.CI_COMMIT_TAG,
|
"CI_COMMIT_TAG": utils.CI_COMMIT_TAG,
|
||||||
"CI_TAGGED": utils.CI_TAGGED,
|
"CI_TAGGED": utils.CI_TAGGED,
|
||||||
|
@ -50,7 +50,7 @@ func Posthome(c *fiber.Ctx) error {
|
||||||
|
|
||||||
return c.Status(424).Render("views/home", fiber.Map{
|
return c.Status(424).Render("views/home", fiber.Map{
|
||||||
"ERR": "Invalid URL, please check and try again.",
|
"ERR": "Invalid URL, please check and try again.",
|
||||||
"CI_COMMIT_SHORT_SHA": utils.CI_COMMIT_SHORT_SHA,
|
"CI_COMMIT_SHA": utils.CI_COMMIT_SHA,
|
||||||
"CI_COMMIT_BRANCH": utils.CI_COMMIT_BRANCH,
|
"CI_COMMIT_BRANCH": utils.CI_COMMIT_BRANCH,
|
||||||
"CI_COMMIT_TAG": utils.CI_COMMIT_TAG,
|
"CI_COMMIT_TAG": utils.CI_COMMIT_TAG,
|
||||||
"CI_TAGGED": utils.CI_TAGGED,
|
"CI_TAGGED": utils.CI_TAGGED,
|
||||||
|
@ -73,7 +73,7 @@ func Posthome(c *fiber.Ctx) error {
|
||||||
|
|
||||||
return c.Status(500).Render("views/home", fiber.Map{
|
return c.Status(500).Render("views/home", fiber.Map{
|
||||||
"ERR": err.Error(),
|
"ERR": err.Error(),
|
||||||
"CI_COMMIT_SHORT_SHA": utils.CI_COMMIT_SHORT_SHA,
|
"CI_COMMIT_SHA": utils.CI_COMMIT_SHA,
|
||||||
"CI_COMMIT_BRANCH": utils.CI_COMMIT_BRANCH,
|
"CI_COMMIT_BRANCH": utils.CI_COMMIT_BRANCH,
|
||||||
"CI_COMMIT_TAG": utils.CI_COMMIT_TAG,
|
"CI_COMMIT_TAG": utils.CI_COMMIT_TAG,
|
||||||
"CI_TAGGED": utils.CI_TAGGED,
|
"CI_TAGGED": utils.CI_TAGGED,
|
||||||
|
@ -95,7 +95,7 @@ func Posthome(c *fiber.Ctx) error {
|
||||||
|
|
||||||
return c.Status(500).Render("views/home", fiber.Map{
|
return c.Status(500).Render("views/home", fiber.Map{
|
||||||
"ERR": err.Error(),
|
"ERR": err.Error(),
|
||||||
"CI_COMMIT_SHORT_SHA": utils.CI_COMMIT_SHORT_SHA,
|
"CI_COMMIT_SHA": utils.CI_COMMIT_SHA,
|
||||||
"CI_COMMIT_BRANCH": utils.CI_COMMIT_BRANCH,
|
"CI_COMMIT_BRANCH": utils.CI_COMMIT_BRANCH,
|
||||||
"CI_COMMIT_TAG": utils.CI_COMMIT_TAG,
|
"CI_COMMIT_TAG": utils.CI_COMMIT_TAG,
|
||||||
"CI_TAGGED": utils.CI_TAGGED,
|
"CI_TAGGED": utils.CI_TAGGED,
|
||||||
|
@ -123,7 +123,7 @@ func Posthome(c *fiber.Ctx) error {
|
||||||
|
|
||||||
return c.Status(201).Render("views/home", fiber.Map{
|
return c.Status(201).Render("views/home", fiber.Map{
|
||||||
"URL": fURL,
|
"URL": fURL,
|
||||||
"CI_COMMIT_SHORT_SHA": utils.CI_COMMIT_SHORT_SHA,
|
"CI_COMMIT_SHA": utils.CI_COMMIT_SHA,
|
||||||
"CI_COMMIT_BRANCH": utils.CI_COMMIT_BRANCH,
|
"CI_COMMIT_BRANCH": utils.CI_COMMIT_BRANCH,
|
||||||
"CI_COMMIT_TAG": utils.CI_COMMIT_TAG,
|
"CI_COMMIT_TAG": utils.CI_COMMIT_TAG,
|
||||||
"CI_TAGGED": utils.CI_TAGGED,
|
"CI_TAGGED": utils.CI_TAGGED,
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
CI_COMMIT_SHORT_SHA string
|
CI_COMMIT_SHA string
|
||||||
CI_COMMIT_BRANCH string
|
CI_COMMIT_BRANCH string
|
||||||
CI_COMMIT_TAG string
|
CI_COMMIT_TAG string
|
||||||
CI_TAGGED bool
|
CI_TAGGED bool
|
||||||
|
@ -14,7 +14,7 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
func Init_build_vars() {
|
func Init_build_vars() {
|
||||||
CI_BUILD = CI_COMMIT_SHORT_SHA != "" || CI_COMMIT_BRANCH != ""
|
CI_BUILD = CI_COMMIT_SHA != "" || CI_COMMIT_BRANCH != ""
|
||||||
CI_TAGGED = CI_COMMIT_TAG != ""
|
CI_TAGGED = CI_COMMIT_TAG != ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ func Print_Starting_Screen() {
|
||||||
if CI_TAGGED {
|
if CI_TAGGED {
|
||||||
version = CI_COMMIT_TAG
|
version = CI_COMMIT_TAG
|
||||||
} else if CI_BUILD {
|
} else if CI_BUILD {
|
||||||
version = CI_COMMIT_SHORT_SHA
|
version = CI_COMMIT_SHA
|
||||||
}
|
}
|
||||||
fmt.Println("---- Starting goshorly " + version + " ----")
|
fmt.Println("---- Starting goshorly " + version + " ----")
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(1 * time.Second)
|
||||||
|
|
|
@ -19,7 +19,7 @@ var ConfigLimiter limiter.Config = limiter.Config{
|
||||||
}
|
}
|
||||||
return c.Render("views/home", fiber.Map{
|
return c.Render("views/home", fiber.Map{
|
||||||
"ERR": "You have reached the limit of requests! Please check back later. (1 minute)",
|
"ERR": "You have reached the limit of requests! Please check back later. (1 minute)",
|
||||||
"CI_COMMIT_SHORT_SHA": CI_COMMIT_SHORT_SHA,
|
"CI_COMMIT_SHA": CI_COMMIT_SHA,
|
||||||
"CI_COMMIT_BRANCH": CI_COMMIT_BRANCH,
|
"CI_COMMIT_BRANCH": CI_COMMIT_BRANCH,
|
||||||
"CI_BUILD": CI_BUILD,
|
"CI_BUILD": CI_BUILD,
|
||||||
})
|
})
|
||||||
|
|
|
@ -82,7 +82,7 @@
|
||||||
{{ if .CI_COMMIT_TAG }}
|
{{ if .CI_COMMIT_TAG }}
|
||||||
| {{ .CI_COMMIT_TAG }}
|
| {{ .CI_COMMIT_TAG }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
| {{ .CI_COMMIT_SHORT_SHA }}/{{ .CI_COMMIT_BRANCH }}
|
| {{ .CI_COMMIT_SHA }}/{{ .CI_COMMIT_BRANCH }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</center>
|
</center>
|
||||||
|
|
Loading…
Add table
Reference in a new issue