Skip to content

Commit

Permalink
✨ Add sample script for demo server
Browse files Browse the repository at this point in the history
  • Loading branch information
tosone committed Oct 11, 2023
1 parent dd2db1b commit 6f7e9c9
Show file tree
Hide file tree
Showing 45 changed files with 549 additions and 100 deletions.
9 changes: 6 additions & 3 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GOLANG_VERSION=1.21.2-alpine3.18
ARG GOLANG_VERSION=1.21.3-alpine3.18
ARG NODE_VERSION=18-alpine3.18
ARG ALPINE_VERSION=3.18

Expand All @@ -14,7 +14,7 @@ RUN set -eux && yarn install --frozen-lockfile && yarn build

FROM alpine:${ALPINE_VERSION} as syft

ARG SYFT_VERSION=0.88.0
ARG SYFT_VERSION=0.93.0
ARG TARGETARCH

RUN set -eux && \
Expand All @@ -26,7 +26,7 @@ RUN set -eux && \

FROM alpine:${ALPINE_VERSION} as trivy

ARG TRIVY_VERSION=0.44.1
ARG TRIVY_VERSION=0.45.1
ARG ORAS_VERSION=1.0.0
ARG TARGETARCH

Expand Down Expand Up @@ -72,4 +72,7 @@ COPY --from=trivy /opt/trivy/metadata.json /opt/trivy/db/metadata.json
COPY ./conf/config.yaml /etc/sigma/config.yaml
COPY --from=builder /go/src/github.com/go-sigma/sigma/bin/sigma /usr/local/bin/sigma

VOLUME /var/lib/sigma
VOLUME /etc/sigma

CMD ["sigma", "server"]
2 changes: 1 addition & 1 deletion build/Dockerfile.builder
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GOLANG_VERSION=1.21.2-alpine3.18
ARG GOLANG_VERSION=1.21.3-alpine3.18

FROM golang:${GOLANG_VERSION} as builder

Expand Down
9 changes: 6 additions & 3 deletions build/Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GOLANG_VERSION=1.21.2-bookworm
ARG GOLANG_VERSION=1.21.3-bookworm
ARG NODE_VERSION=18-alpine3.18
ARG ALPINE_VERSION=3.18
ARG DEBIAN_VERSION=bookworm-slim
Expand All @@ -15,7 +15,7 @@ RUN set -eux && yarn install --frozen-lockfile && yarn build

FROM alpine:${ALPINE_VERSION} as syft

ARG SYFT_VERSION=0.88.0
ARG SYFT_VERSION=0.93.0
ARG TARGETARCH

RUN set -eux && \
Expand All @@ -27,7 +27,7 @@ RUN set -eux && \

FROM alpine:${ALPINE_VERSION} as trivy

ARG TRIVY_VERSION=0.44.1
ARG TRIVY_VERSION=0.45.1
ARG ORAS_VERSION=1.0.0
ARG TARGETARCH

Expand Down Expand Up @@ -89,4 +89,7 @@ COPY --from=trivy /opt/trivy/metadata.json /opt/trivy/db/metadata.json
COPY ./conf/config.yaml /etc/sigma/config.yaml
COPY --from=builder /go/src/github.com/go-sigma/sigma/bin/sigma /usr/local/bin/sigma

VOLUME /var/lib/sigma
VOLUME /etc/sigma

CMD ["sigma", "server"]
7 changes: 5 additions & 2 deletions build/Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG ALPINE_VERSION=3.18

FROM alpine:${ALPINE_VERSION} as syft

ARG SYFT_VERSION=0.88.0
ARG SYFT_VERSION=0.93.0
ARG TARGETARCH

RUN set -eux && \
Expand All @@ -14,7 +14,7 @@ RUN set -eux && \

FROM alpine:${ALPINE_VERSION} as trivy

ARG TRIVY_VERSION=0.44.1
ARG TRIVY_VERSION=0.45.1
ARG ORAS_VERSION=1.0.0
ARG TARGETARCH

Expand Down Expand Up @@ -48,4 +48,7 @@ COPY --from=trivy /opt/trivy/metadata.json /opt/trivy/db/metadata.json
COPY ./conf/config.yaml /etc/sigma/config.yaml
COPY ./bin/sigma /usr/local/bin/sigma

VOLUME /var/lib/sigma
VOLUME /etc/sigma

CMD ["sigma", "server"]
4 changes: 2 additions & 2 deletions cmd/builder/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (b Builder) initCache() error {
if err != nil {
return fmt.Errorf("Rename cache_out to cache_in failed: %v", err)
}
log.Info().Str("size", humanize.BigBytes(big.NewInt(fileInfo.Size()))).Msg("Decompress cache success")
log.Info().Str("size", humanize.BigIBytes(big.NewInt(fileInfo.Size()))).Msg("Decompress cache success")
}
var dirs = []string{cacheOut, cacheIn}
for _, dir := range dirs {
Expand Down Expand Up @@ -177,6 +177,6 @@ func (b Builder) exportCache() error {
if err != nil {
return fmt.Errorf("Export cache to server failed: %v", err)
}
log.Info().Str("size", humanize.BigBytes(big.NewInt(fileInfo.Size()))).Msg("Export cache success")
log.Info().Str("size", humanize.BigIBytes(big.NewInt(fileInfo.Size()))).Msg("Export cache success")
return nil
}
1 change: 1 addition & 0 deletions cmd/imports/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package imports

import (
_ "github.com/go-sigma/sigma/pkg/daemon/afpushed"
_ "github.com/go-sigma/sigma/pkg/daemon/builder"
_ "github.com/go-sigma/sigma/pkg/daemon/coderepo"
_ "github.com/go-sigma/sigma/pkg/daemon/gc"
Expand Down
3 changes: 2 additions & 1 deletion conf/config-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ redis:
cache:
# the cache type available is: redis, inmemory, database
type: database
ttl: 72h
# please attention in multi
inmemory:
size: 10240
redis:
ttl: 72h
database:
size: 10240
threshold: 0.2
Expand Down Expand Up @@ -133,6 +133,7 @@ auth:
jwt:
ttl: 1h
refreshTtl: 24h
# generate the key with: openssl genrsa 4096 | base64
privateKey: "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlKS2dJQkFBS0NBZ0VBcHNISUFnRUpZSnFRcWRyZDNBWlhiVmROTFBQRklQcndKdEVoZ0JyVmV4MlY1UVRZCkVETnBHWkhwbUxrekpqbTJCOEd6blJEdDNaOGNlRnFFU3RxdU9CdUQ5VlYyYisvZS9ZSzcrVlF6aFpuQUhNZGgKbk5UUklxRFJqckF1UmhDN3U5MmR1b0w0S2s0a0JZNTRBa2JxQnRJZytZUXd1ODBnbDJrTjR0L3hqcWFveXl1VApDSG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MWhDa0tQCll6OVBtVExNM2kwTHBEVkFxazZSVG5TaFZGbGZBYjN5TWlVWS9wcXpwTlU4VlI4N2gzSW5Ma2hOck5DL01jbkIKdTE1aytvTFAyY0JNWGxBS0pwZUdlRFhTVjFrcG5PeEtvVmJiS1ZZc0JMYUdwQ3ZNekp6djNibkQ3ZVZKblJCdgoxT3BZa0E0bVJqYVI2R1VRYjA4UlJMckZzZDQxMTg5UzRXM21WVm9uU3JGb2tpSnB5elpFbTY5RnRqSmZKMkt0CmRpdXM0bUhXQnNvSFZjNkdBdUxVVlUvRis1SzZhTktLRFFLQ0FRRUF2VHRzZmNlVFE1cjRTTFlUMTlnMU5GMVgKckFPaUhzVHQ5TFNZUXNZUmpEcGZqR0t1b29jN091Q1ZGdGYwa1ArUkliODJIK05QRVNPMXlpclNzMTVaWnFobAorTXpmY1YrL1dHOVovZlAyUG5ZYVFCeWFOWkNMK3dSTW5nbXJycnF1RjZSRXk1UHQ5Z2pkaU1heXhSSzlVODVKCkY4WFVqcmhuVTJYMUxHTFAzaEoxV0lUbTh6V2RlcytyZU1JR2RNL3grajRBbW80R3FuMzd1U05WRkR4QVhuV2gKRzhPejBaa0dXb25Xai9CRVhnR2RiVk5uVldLQWpodUlRbkZwbHR4R3VpNzhyS09lSEhHVElEUDNZK1h5ZW9ZbAoxVTNtYWVrUGxEaURlUlBmemhjRFBJc0h2b3VoUVZCSlAxRTh2d1VpZkJ1bTEzSDZ5SjdKajcrR29Rb2diZz09Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg=="
oauth2:
github:
Expand Down
5 changes: 3 additions & 2 deletions conf/config-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ database:
# The database type to use. Supported types are: sqlite3, mysql, postgresql
type: sqlite3
sqlite3:
path: sigma.db
path: /var/lib/sigma/sigma.db
mysql:
host: localhost
port: 3306
Expand Down Expand Up @@ -37,8 +37,8 @@ cache:
type: redis
inmemory:
size: 10240
ttl: 72h
redis:
ttl: 72h
database:
size: 10240
threshold: 0.2
Expand Down Expand Up @@ -131,6 +131,7 @@ auth:
jwt:
ttl: 1h
refreshTtl: 24h
# generate the key with: openssl genrsa 4096 | base64
privateKey: "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlKS2dJQkFBS0NBZ0VBcHNISUFnRUpZSnFRcWRyZDNBWlhiVmROTFBQRklQcndKdEVoZ0JyVmV4MlY1UVRZCkVETnBHWkhwbUxrekpqbTJCOEd6blJEdDNaOGNlRnFFU3RxdU9CdUQ5VlYyYisvZS9ZSzcrVlF6aFpuQUhNZGgKbk5UUklxRFJqckF1UmhDN3U5MmR1b0w0S2s0a0JZNTRBa2JxQnRJZytZUXd1ODBnbDJrTjR0L3hqcWFveXl1VApDSGV3OXlwa3BONFFQTGZ1TU1OYjhYUktSdFV2cGlVekZkRmpGTkQ4eS9haVBkVlRYdVRNbGhUNjcvOXphbXlRCmtUU1V5c1l3aUtLSlRxb0N5SkFMTXRtekNrVHNTY0cxeURhcjh2cldWWDdtMnpVR0pRaW5QTllpV1JSS3IySWMKbUVTRXM3ZkROWm8zbnNka05sWEZNUWorZWVVa25Ebmk1VmtENFV1aVpBTmNXTHE4ckpBV0hTTEFtcUltK1BGUgpJVmZvcDZ0d3M5dXlUNWR2d0s2cldJcE9RRG5iZWhSM2FmU2ljY2YzQXVGNldLTFVJd05hanBhaThPdWZmYkFkClpSVTBBa2pFb2h5a1JxZnBqTEFGelBtaXdlYmo3OVdZaktlbXhIaVMxTlNEZFhnVHFRd2d0emFtQmlSbTkwYncKNk54VVRadU5hN1NQVnhvYWNZTHdSWnY4RUR0VFZyVEtMbEhZMEVCS0xPWGpLUEdUWXV0S2RDK3ZHWXhwTC9vVwoxVm5qWXpkYlhsR1VGQkRaczh5K2FsMEFRYVNDejVNUXVaYjdYVW9oTWRYRm1YT2FETnEyK3hsMU9DdFkrWlp1CnFnWEJKcE9BQlhOWjZKNlY4Ly9kaGViVUV3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CRVhnR2RiVk5uVldLQWpodUlRbkZwbHR4R3VpNzhyS09lSEhHVElEUDNZK1h5ZW9ZbAoxVTNtYWVrUGxEaURlUlBmemhjRFBJc0h2b3VoUVZCSlAxRTh2d1VpZkJ1bTEzSDZ5SjdKajcrR29Rb2diZz09Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg=="
oauth2:
github:
Expand Down
7 changes: 4 additions & 3 deletions conf/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ database:
# The database type to use. Supported types are: sqlite3, mysql, postgresql
type: sqlite3
sqlite3:
path: sigma.db
path: /var/lib/sigma/sigma.db
mysql:
host: localhost
port: 3306
Expand Down Expand Up @@ -37,11 +37,11 @@ redis:
cache:
# the cache type available is: redis, inmemory, database
type: database
ttl: 72h
# please attention in multi
inmemory:
size: 10240
redis:
ttl: 72h
database:
size: 10240
threshold: 0.2
Expand Down Expand Up @@ -88,7 +88,7 @@ storage:
rootdirectory: ./storage
type: filesystem
filesystem:
path: /var/lib/sigma/oci/
path: /var/lib/sigma/
s3:
ak: sigma
sk: sigma-sigma
Expand Down Expand Up @@ -139,6 +139,7 @@ auth:
jwt:
ttl: 1h
refreshTtl: 24h
# generate the key with: openssl genrsa 4096 | base64
privateKey: "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlKS2dJQkFBS0NBZ0VBcHNISUFnRUpZSnFRcWRyZDNBWlhiVmROTFBQRklQcndKdEVoZ0JyVmV4MlY1UVRZCkVETnBHWkhwbUxrekpqbTJCOEd6blJEdDNaOGNlRnFFU3RxdU9CdUQ5VlYyYisvZS9ZSzcrVlF6aFpuQUhNZGgKbk5UUklxRFJqckF1UmhDN3U5MmR1b0w0S2s0a0JZNTRBa2JxQnRJZytZUXd1ODBnbDJrTjR0L3hqcWFveXl1VApDSGV3OXlwa3BONFFQTGZ1TU1OYjhYUktSdFV2cGlVekZkRmpGTkQ4eS9haVBkVlRYdVRNbGh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I4N2gzSW5Ma2hOck5DL01jbkIKdTE1aytvTFAyY0JNWGxBS0pwZUdlRFhTVjFrcG5PeEtvVmJiS1ZZc0JMYUdwQ3ZNekp6djNibkQ3ZVZKblJCdgoxT3BZa0E0bVJqYVI2R1VRYjA4UlJMckZzZDQxMTg5UzRXM21WVm9uU3JGb2tpSnB5elpFbTY5RnRqSmZKMkt0CmRpdXM0bUhXQnNvSFZjNkdBdUxVVlUvRis1SzZhTktLRFFLQ0FRRUF2VHRzZmNlVFE1cjRTTFlUMTlnMU5GMVgKckFPaUhzVHQ5TFNZUXNZUmpEcGZqR0t1b29jN091Q1ZGdGYwa1ArUkliODJIK05QRVNPMXlpclNzMTVaWnFobAorTXpmY1YrL1dHOVovZlAyUG5ZYVFCeWFOWkNMK3dSTW5nbXJycnF1RjZSRXk1UHQ5Z2pkaU1heXhSSzlVODVKCkY4WFVqcmhuVTJYMUxHTFAzaEoxV0lUbTh6V2RlcytyZU1JR2RNL3grajRBbW80R3FuMzd1U05WRkR4QVhuV2gKRzhPejBaa0dXb25Xai9CRVhnR2RiVk5uVldLQWpodUlRbkZwbHR4R3VpNzhyS09lSEhHVElEUDNZK1h5ZW9ZbAoxVTNtYWVrUGxEaURlUlBmemhjRFBJc0h2b3VoUVZCSlAxRTh2d1VpZkJ1bTEzSDZ5SjdKajcrR29Rb2diZz09Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg=="
oauth2:
github:
Expand Down
1 change: 1 addition & 0 deletions docs/docs/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ auth:
jwt:
ttl: 1h
refreshTtl: 24h
# generate the key with: openssl genrsa 4096 | base64
privateKey: "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSB"
oauth2:
github:
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/push/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: Push image to sigma

### Push single image to sigma

``` sh
``` bash
docker pull redis:7
docker tag redis:7 127.0.0.1:3000/library/redis:7
docker push 127.0.0.1:3000/library/redis:7
Expand All @@ -24,7 +24,7 @@ Create 'buildkit.toml' with content:

Create buildx instance:

``` sh
``` bash
docker buildx create --use --config ./buildkit.toml
```

Expand All @@ -36,6 +36,6 @@ FROM alpine:3.18

Push multiarch image to sigma:

``` sh
``` bash
docker buildx build --platform linux/amd64,linux/arm64 --tag 10.3.201.221:3000/library/alpine:3.18.0 --file alpine.Dockerfile --push .
```
8 changes: 4 additions & 4 deletions docs/docs/push/helm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ description: Push helm chart to sigma

### Generate a sample helm chart

``` sh
``` bash
helm create demo
```

This command will create 'demo' directory, and a sample helm chart in it.

``` sh
``` bash
helm package demo
```

Expand All @@ -26,14 +26,14 @@ You can see the v3.13.0 [release note](https://github.com/helm/helm/releases/tag

Before helm version v3.13.0:

``` sh
``` bash
helm registry login --insecure -u sigma -p sigma 127.0.0.1:3000
helm push demo-0.1.0.tgz oci://127.0.0.1:3000/library/demo --insecure-skip-tls-verify
```

After helm version v3.13.0:

``` sh
``` bash
helm registry login -u sigma -p sigma 127.0.0.1:3000
helm push demo-0.1.0.tgz oci://127.0.0.1:3000/library/demo --plain-http
```
Loading

0 comments on commit 6f7e9c9

Please sign in to comment.