Skip to content

Commit bbc7fb1

Browse files
committed
Move to ghcr
1 parent 08ea247 commit bbc7fb1

5 files changed

Lines changed: 76 additions & 97 deletions

File tree

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,47 @@
1-
name: lint-test-build-push
1+
name: build-push
22
on:
33
push:
4-
paths-ignore:
5-
- "**/*.md"
6-
- "renovate.json5"
7-
branches:
8-
- "**"
9-
tags:
10-
- "*"
11-
12-
concurrency:
13-
group: ${{ github.workflow }}-${{ github.ref }}
14-
cancel-in-progress: true
15-
16-
permissions:
17-
contents: read
4+
workflow_dispatch:
5+
186
jobs:
197
lint-test:
208
runs-on: ubuntu-24.04
219
steps:
22-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
10+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
2311

24-
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
12+
- name: Set up Go
13+
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
2514
with:
26-
go-version: ">=1.25.0"
15+
go-version-file: "go.mod"
2716

2817
- name: golangci-lint
29-
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8
18+
uses: golangci/golangci-lint-action@e7fa5ac41e1cf5b7d48e45e42232ce7ada589601 # v9
3019
with:
3120
version: latest
3221

33-
- name: Test with the Go CLI
34-
run: go test -v -race ./...
22+
- name: Install dependencies
23+
run: go get .
24+
25+
- run: go build
26+
27+
- name: unit test
28+
run: go test -race -v ./...
29+
30+
- name: coverage
31+
run: go test -v -coverprofile=coverage.out -covermode=atomic ./...
32+
33+
- name: upload coverage to codecov
34+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5
35+
with:
36+
files: ./coverage.out
37+
fail_ci_if_error: false
38+
env:
39+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3540

36-
build-push:
41+
run:
3742
needs: [lint-test]
38-
uses: libops/actions/.github/workflows/build-push.yml@main
43+
uses: libops/.github/.github/workflows/build-push-ghcr.yaml@main
3944
permissions:
4045
contents: read
4146
packages: write
42-
id-token: write
4347
secrets: inherit

Dockerfile

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
FROM golang:1.25-alpine3.22 AS builder
1+
FROM ghcr.io/libops/go1.25:main@sha256:f43c9b34f888d2ac53e87c8e061554f826b8eb580863d7b21fd787b6f0378f8f AS builder
2+
3+
SHELL ["/bin/ash", "-o", "pipefail", "-ex", "-c"]
24

35
WORKDIR /app
4-
COPY go.* ./
5-
RUN go mod download
66

7-
COPY . .
8-
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o lightsout .
7+
COPY go.* ./
8+
RUN --mount=type=cache,target=/go/pkg/mod \
9+
go mod download
910

10-
FROM alpine:3.22
11-
RUN apk --no-cache add ca-certificates curl docker-cli
12-
WORKDIR /root/
11+
COPY *.go ./
1312

14-
COPY --from=builder /app/lightsout .
13+
RUN --mount=type=cache,target=/root/.cache/go-build \
14+
CGO_ENABLED=0 go build -ldflags="-s -w" -o /app/binary .
1515

16-
# Set default environment variables
17-
ENV PORT=8808
18-
ENV INACTIVITY_TIMEOUT=90
19-
ENV LOG_LEVEL=INFO
20-
ENV GOOGLE_PROJECT_ID=""
21-
ENV GCE_ZONE=""
22-
ENV GCE_INSTANCE=""
23-
ENV LIBOPS_KEEP_ONLINE=""
16+
FROM ghcr.io/libops/go1.25:main@sha256:f43c9b34f888d2ac53e87c8e061554f826b8eb580863d7b21fd787b6f0378f8f
2417

25-
EXPOSE 8808
18+
COPY --from=builder /app/binary /app/binary
2619

27-
CMD ["/app/lightsout"]
20+
ENV \
21+
PORT=8808 \
22+
INACTIVITY_TIMEOUT=90 \
23+
LOG_LEVEL=INFO \
24+
GCP_PROJECT= \
25+
GCP_ZONE= \
26+
GCP_INSTANCE_NAME= \
27+
LIBOPS_KEEP_ONLINE=

LICENSE

Lines changed: 25 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,44 @@
1-
DUAL LICENSE
1+
# DUAL LICENSE AGREEMENT
22

3-
This software is available under two licenses:
3+
This software is available under two distinct licenses. All use must comply strictly with the terms set forth below.
44

5-
================================================================================
6-
NON-PROFIT & EDUCATIONAL LICENSE (MIT-BASED)
7-
================================================================================
5+
---
86

9-
For non-profit organizations, educational institutions, and personal use:
7+
## NON-COMMERCIAL LICENSE (MIT-BASED)
8+
9+
### **Strictly Limited to Non-Commercial Use**
1010

1111
Copyright (c) 2025 LibOps, LLC.
1212

13-
Permission is hereby granted, free of charge, to any person obtaining a copy
14-
of this software and associated documentation files (the "Software"), to deal
15-
in the Software without restriction, including without limitation the rights
16-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17-
copies of the Software, and to permit persons to whom the Software is
18-
furnished to do so, subject to the following conditions:
13+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, **provided such use is strictly Non-Commercial** and subject to the following conditions:
1914

20-
The above copyright notice and this permission notice shall be included in all
21-
copies or substantial portions of the Software.
15+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
2216

23-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29-
SOFTWARE.
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3018

31-
This license applies ONLY to:
32-
✅ 501(c)(3) and other registered non-profit organizations
33-
✅ Educational institutions (schools, universities, libraries)
34-
✅ Personal/hobby use (non-commercial)
35-
✅ Open-source projects (also licensed under compatible terms)
19+
This license applies **ONLY** to the following categories of **Non-Commercial Users**:
3620

37-
================================================================================
38-
COMMERCIAL LICENSE REQUIRED
39-
================================================================================
21+
* ✅ 501(c)(3) and other registered non-profit organizations
22+
* ✅ Educational institutions (schools, universities, libraries)
23+
* ✅ Personal/hobby use (non-commercial, non-revenue generating)
4024

41-
For-profit companies, businesses, and commercial use require a separate
42-
commercial license.
25+
---
4326

44-
❌ This includes:
27+
## COMMERCIAL LICENSE
4528

46-
- For-profit corporations and LLCs
47-
- Consulting companies and contractors
48-
- SaaS providers and cloud services
49-
- Any commercial or revenue-generating use
29+
Any use of the Software by a for-profit entity or any revenue-generating application is **strictly prohibited** without a separate, valid Commercial License Agreement from LibOps, LLC.
5030

51-
💰 Commercial License Benefits:
31+
This prohibition includes (but is not limited to):
5232

53-
- Right to use without restrictions
54-
- Legal warranties and indemnification
55-
- Technical support and updates
56-
- Custom features and professional services
33+
* For-profit corporations, LLCs, and businesses of any size.
34+
* Use by consultants, contractors, or freelancers providing services for a fee.
35+
* SaaS providers, cloud services, and managed service offerings.
36+
* **Any internal or external use** that directly or indirectly supports a commercial or revenue-generating activity.
5737

58-
📞 Contact for Commercial License:
59-
Email: [info@libops.io]
60-
Website: [www.libops.io]
38+
---
6139

62-
================================================================================
63-
COPYRIGHT NOTICE
64-
================================================================================
40+
## © COPYRIGHT NOTICE
6541

66-
Copyright (C) 2025 LibOps, LLC.
67-
All rights reserved.
42+
Copyright (C) 2025 LibOps, LLC. All rights reserved.
6843

69-
Unauthorized use by for-profit entities is prohibited without a commercial license.
44+
Unauthorized **Commercial Use** of this Software is strictly prohibited.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/libops/lightsout
22

3-
go 1.25.0
3+
go 1.25.3

main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ func loadConfig() *Config {
6767
Port: getEnv("PORT", "8808"),
6868
InactivityTimeout: getDurationEnv("INACTIVITY_TIMEOUT", 90) * time.Second,
6969
LogLevel: getEnv("LOG_LEVEL", "INFO"),
70-
GoogleProjectID: getEnv("GOOGLE_PROJECT_ID", ""),
71-
GCEZone: getEnv("GCE_ZONE", ""),
72-
GCEInstance: getEnv("GCE_INSTANCE", ""),
70+
GoogleProjectID: getEnv("GCP_PROJECT", ""),
71+
GCEZone: getEnv("GCP_ZONE", ""),
72+
GCEInstance: getEnv("GCP_INSTANCE_NAME", ""),
7373
LibOpsKeepOnline: getEnv("LIBOPS_KEEP_ONLINE", ""),
7474
}
7575
}

0 commit comments

Comments
 (0)