WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
e671826
feat(backend): first MVP in Go
ralgozino Apr 6, 2023
82d8371
chore: changed folder structure
ralgozino Apr 6, 2023
68ae571
chore: addlicense
ralgozino Apr 6, 2023
14c888c
chore: linting
ralgozino Apr 6, 2023
498d8f3
chore: change extension for gotemplate file
ralgozino Apr 6, 2023
9d923e3
chore: remove rules for jinja2 html
ralgozino Apr 6, 2023
dd3874f
chore(ci): disable Go linting
ralgozino Apr 7, 2023
090bdff
chore(ci): run e2e for this branch
ralgozino Apr 7, 2023
b85ec99
chore(ci): typo
ralgozino Apr 7, 2023
f902d02
docs(readme): some updates to the readme
ralgozino Apr 7, 2023
fe353db
docs(readme): improve copy
ralgozino Apr 7, 2023
ef7d98d
chore(report): tweak css
ralgozino Apr 14, 2023
ec691fa
feat(backend): support for switching current context
ralgozino Apr 17, 2023
d440b83
feat(backend): add v1/events endpoint
ralgozino Apr 18, 2023
6c7cc0d
chore: move routes to functions
ralgozino Apr 18, 2023
ff8c4a8
chore(backend): avoid cors for dev
ralgozino Apr 18, 2023
7c3d115
chore(frontend): fix word order in constraint mode
ralgozino Apr 18, 2023
fc0fb53
fix(frontend): show error details
ralgozino Apr 18, 2023
8b63a7c
fix(backend):remove interface assertions
ralgozino Apr 19, 2023
fa7bd6a
fix(frontend): revert mode pill text change
ralgozino Apr 19, 2023
9ccc5e1
fix(frontend): reintroduce fix for mode badge
ralgozino Apr 19, 2023
26a4d69
chore: backport updated deps from main
ralgozino Apr 19, 2023
2c44f37
fix(backend): remove addtrailingslash middleware
ralgozino Apr 19, 2023
67655b0
fix(backend): set logLevel to info as default
ralgozino Apr 19, 2023
d36c8d6
chore(ci): update e2e constraints baseline image
ralgozino Apr 21, 2023
df7a62a
chore: update some comments
ralgozino Apr 21, 2023
8499ac2
feat(backend): get rid of the second kubeConfig
ralgozino Apr 21, 2023
439e2b2
chore(backend): make startingConfig global
ralgozino Apr 21, 2023
a4f8ab1
feat(backend): add API server address to report.
ralgozino Apr 21, 2023
3716295
feat(backend): add API server address to report.
ralgozino Apr 21, 2023
0dbf4f5
chore(backend): code cleanup
ralgozino Apr 21, 2023
96ea246
chore: update dockerignore
ralgozino Apr 21, 2023
20751b1
chore: remove unwanted Dockerfile
ralgozino Apr 21, 2023
8929f8b
chore: clean up static assets
ralgozino Apr 21, 2023
3bc3897
feat: violations events table view
ralgozino Apr 28, 2023
7b96841
feat: mutations view
ralgozino Apr 28, 2023
04ee200
chore(manifests): update RBAC for events and mutations
ralgozino Apr 28, 2023
bdac43b
feat(frontemd): mutations view
ralgozino Apr 28, 2023
f3da070
chore(ci): bump go version for addlicense
ralgozino May 3, 2023
d790f44
chore(ci): fix addlicense install
ralgozino May 3, 2023
5e8f6c5
chore(frontend): linting
ralgozino May 3, 2023
36fb943
chore(frontend): linting
ralgozino May 3, 2023
0595ee9
chore(e2e): update baseline and add new views
ralgozino May 3, 2023
c09921a
chore(ci): echo e2e images results
ralgozino May 3, 2023
de5fd4f
chore(ci): multiarch build
ralgozino May 3, 2023
7da720f
chore(frontend): use badge instead of text for mutation kind
ralgozino May 3, 2023
a3af08f
chore(e2e): update baseline
ralgozino May 3, 2023
29e499f
chore(ci): multiarch build
ralgozino May 3, 2023
60d0f98
chore(ci): multiarch build
ralgozino May 3, 2023
7ae32a3
chore(ci): multiarch build
ralgozino May 3, 2023
57672a5
chore(ci): push multiarch
ralgozino May 3, 2023
29d3e91
chore(ci)
ralgozino May 3, 2023
f3d2591
chore(ci)
ralgozino May 3, 2023
400b3cd
chore(ci)
ralgozino May 3, 2023
f5d1a82
chore(ci)
ralgozino May 3, 2023
e193430
chore(ci)
ralgozino May 3, 2023
c773287
chore(ci)
ralgozino May 3, 2023
2619fc0
chore(ci)
ralgozino May 3, 2023
a435b4e
chore(ci)
ralgozino May 3, 2023
becb58a
chore(ci)
ralgozino May 3, 2023
54ea7a4
chore(ci)
ralgozino May 3, 2023
5f627d1
fix(backend): move var to local scope
ralgozino May 4, 2023
53ebc04
chore(deps): sync javascript dependencies from main
ralgozino May 5, 2023
ae3c148
fix(frontend): add titlte tooltip to context dropdown
ralgozino May 5, 2023
e025363
chore(deps): update javascript deps
ralgozino May 8, 2023
d053b99
docs: update readme and screenshots
ralgozino May 10, 2023
f7a6a6e
chore: switch to structured logging
ralgozino May 15, 2023
b0eabb7
feat: add configurable listen address
ralgozino May 15, 2023
77281ea
fix(backend): set log level and code cleanup
ralgozino May 15, 2023
3392436
feat(frontend): show operations for mutations
ralgozino May 18, 2023
cdb9955
fix(frontend): improve status field
ralgozino May 19, 2023
de47673
chore(e2e): revert change to playright config
ralgozino May 19, 2023
24ad068
chore(ci): print expected images
ralgozino May 19, 2023
716c45b
chore(ci): print actual images
ralgozino May 19, 2023
9db11dd
chore(ci): debug ui e2e
ralgozino May 19, 2023
b6d451d
chore(e2e): update baseline
ralgozino May 19, 2023
6544791
chore(chart): backport updates from main
ralgozino Aug 10, 2023
2439124
chore(deps): backport javascript updates
ralgozino Aug 10, 2023
2b30a99
chore(ui): backport #797 from main
ralgozino Aug 10, 2023
151566c
chore: backport #729 from main
ralgozino Aug 10, 2023
cd48aff
chore: bump version to 2.0.0-alpha1
ralgozino Aug 28, 2023
bbbadb2
chore: improve logging
ralgozino Aug 28, 2023
c2bbba5
chore: update yarn lock
ralgozino Aug 28, 2023
5b2b9ff
chore(deps): backport javascript deps from main
ralgozino Aug 28, 2023
48579ae
chore(docker): tag go backend
ralgozino Aug 28, 2023
ea2c96c
chore(desp): backport javascript deps
ralgozino Aug 31, 2023
b61af7a
fix(backend): context switch
ralgozino Aug 31, 2023
c85603f
chore(deps): bump go deps
ralgozino Aug 31, 2023
99edba9
chore(deps): align javascript with main
ralgozino Sep 19, 2023
c9cae97
chore: fix linting
ralgozino Sep 19, 2023
6abdc7e
chore(deps): sync with main
ralgozino Oct 18, 2023
909967f
chore(deps): bump go deps
ralgozino Oct 18, 2023
cef2505
docs: fix version badge in readme
ralgozino Oct 19, 2023
988c953
chore(js): fix yarn run
ralgozino Oct 20, 2023
03d9c2f
chore: bump go version
ralgozino Oct 24, 2023
6196ea4
chore: add license to ts-checker config
ralgozino Oct 24, 2023
aa95522
chore(deps): port js deps from main
ralgozino Oct 24, 2023
1fa3de0
chore: linting
ralgozino Oct 24, 2023
88bd9a0
feat: use viper for config
ralgozino Nov 10, 2023
41ec625
chore: go mod tidy
ralgozino Nov 10, 2023
e2c72b8
chore: update deps
ralgozino Jul 4, 2025
ee925fb
chore: fixes after bumping dependencies
ralgozino Jul 4, 2025
f1f50ec
chroe: branding
ralgozino Jul 4, 2025
69693da
chore(backend): backport rego v1 support
ralgozino Jul 4, 2025
99b7ab6
fix(backend): don't panic when templates has no constrains
ralgozino Jul 4, 2025
e2f4bc0
chore: backport UX improvements from main
ralgozino Jul 8, 2025
9bde8a5
chore(deps): aligne react-dom to react
ralgozino Jul 8, 2025
f7da313
chore(ux): backport context dropdown UX from main
ralgozino Jul 8, 2025
788560a
feat: use constrainttemplates v1 instead of v1beta1
ralgozino Jul 8, 2025
eae3ce5
feat(mutations): sticky sidebar
ralgozino Jul 8, 2025
82b98e8
chore: move logo out of app assets to docs
ralgozino Jul 8, 2025
6bc5641
feat: backport autolinking from main
ralgozino Jul 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[bumpversion]
commit = True
tag = True
current_version = 1.0.3
current_version = 2.0.0-alpha1
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-rc(?P<rc>\d+))?
serialize =
{major}.{minor}.{patch}-rc{rc}
Expand All @@ -11,7 +11,7 @@ serialize =

[bumpversion:file:kustomization.yaml]

[bumpversion:file:app/web-client/src/components/Footer/Component.tsx]
[bumpversion:file:web-client/src/components/Footer/Component.tsx]

[bumpversion:file:chart/Chart.yaml]

Expand Down
11 changes: 8 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
app/__pycache__
.git
.github
.vscode
env
screenshots
chart
docs
manifests
screenshots
static-content
tests
web-client/build
web-client/node_modules
55 changes: 31 additions & 24 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022 SIGHUP s.r.l All rights reserved.
# Copyright (c) 2017-present SIGHUP s.r.l All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

Expand All @@ -8,10 +8,10 @@ type: docker

steps:
- name: check
image: docker.io/library/golang:1.17.3
image: docker.io/library/golang:1.20
pull: always
commands:
- go get -u github.com/google/addlicense
- go install github.com/google/addlicense@v1.1.1
- addlicense -c "SIGHUP s.r.l" -v -l bsd -check -ignore 'chart/**' .
trigger:
ref:
Expand All @@ -31,12 +31,15 @@ steps:
image: quay.io/sighup/policeman
pull: always
environment:
FILTER_REGEX_EXCLUDE: (app/static-content/semantic.min.css|chart/|tests/e2e/)
FILTER_REGEX_EXCLUDE: (chart/|tests/e2e/)
# Identifies false positives like missing 'selector'.
# Doing this is valid for Kustomize patches
VALIDATE_KUBERNETES_KUBEVAL: "false"
# Some duplicated code is intended.
VALIDATE_JSCPD: "false"
# The included version of golang-ci at the time os this writing has issues
# with Go +1.18
VALIDATE_GO: "false"
TYPESCRIPT_DEFAULT_STYLE: "prettier"
depends_on:
- clone
Expand All @@ -48,6 +51,7 @@ steps:
- clone
commands:
- kustomize build . > gpm.yml
- helm template --set config.secretKey=e2e chart > rendered_chart.yaml

- name: check-deprecated-apis
image: us-docker.pkg.dev/fairwinds-ops/oss/pluto:v5
Expand All @@ -56,7 +60,8 @@ steps:
- render
commands:
# we use --ignore-deprecations because we don't want the CI to fail when the API has not been removed yet.
- /pluto detect gpm.yml --ignore-deprecations --target-versions=k8s=v1.25.0
- /pluto detect gpm.yaml --ignore-deprecations --target-versions=k8s=v1.33.0
- /pluto detect rendered_chart.yaml --ignore-deprecations --target-versions=k8s=v1.33.0

trigger:
ref:
Expand Down Expand Up @@ -94,12 +99,10 @@ steps:
- name: dockersock
path: /var/run/docker.sock
commands:
- docker build
--pull=true
--rm=true
-f $${DOCKERFILE}
-t $${CONTAINER_IMAGE_NAME}:$${CONTAINER_IMAGE_TAG}
$${BUILD_CONTEXT}
- "apk add git"
- "docker buildx create --name sighup-builder --use"
- "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --pull -f $${DOCKERFILE} -t $${CONTAINER_IMAGE_NAME}:$${CONTAINER_IMAGE_TAG} $${BUILD_CONTEXT}"
- "docker buildx build --load --platform linux/amd64 -t $${CONTAINER_IMAGE_NAME}:$${CONTAINER_IMAGE_TAG} $${BUILD_CONTEXT}"

volumes:
- name: dockerconfig
Expand All @@ -124,6 +127,7 @@ trigger:
- refs/heads/main
- refs/heads/snyk-**
- refs/heads/dependabot/**
- refs/heads/feature/go-backend
exclude:
- refs/tags/gatekeeper-policy-manager-*

Expand Down Expand Up @@ -182,6 +186,8 @@ steps:
image: mcr.microsoft.com/playwright:v1.30.0-focal
commands:
- for f in tests/e2e/test-results/*/*diff.png; do echo $f; base64 -w 0 $f; echo; done;
# - for f in tests/e2e/test-results/*/*expected.png; do echo $f; base64 -w 0 $f; echo; done;
# - for f in tests/e2e/test-results/*/*actual.png; do echo $f; base64 -w 0 $f; echo; done;
- "echo 'Use base64 to decode the images and see the diff'"
when:
status:
Expand Down Expand Up @@ -235,6 +241,7 @@ trigger:
- refs/heads/dependabot/**
- refs/heads/snyk-**
- refs/tags/gatekeeper-policy-manager-*
- refs/heads/featuer/go-backend

steps:
- name: prepare-tar-gz
Expand All @@ -259,7 +266,7 @@ steps:
include:
- refs/tags/**
exclude:
- refs/tags/gatekeeper-policy-manager-* # Exclude helm chart releases
- refs/tags/gatekeeper-policy-manager-* # Exclude helm chart releases

- name: registry-sha
image: docker:dind
Expand All @@ -274,16 +281,16 @@ steps:
repo: quay.io/sighup/gatekeeper-policy-manager
container_image_name: gatekeeper-policy-manager
container_image_tag: test-${DRONE_BUILD_NUMBER}
DOCKERFILE: Dockerfile
BUILD_CONTEXT: "."
volumes:
- name: dockersock
path: /var/run/docker.sock
commands:
- docker login $${registry} -u $${username} -p $${password}
- docker tag $${container_image_name}:$${container_image_tag} $${repo}:unstable
- "docker tag $${container_image_name}:$${container_image_tag} $${repo}:${DRONE_COMMIT_SHA}"
- docker push $${repo}:unstable
- "docker push $${repo}:${DRONE_COMMIT_SHA}"
- docker rmi $${container_image_name}:$${container_image_tag}
- "apk add git"
- "docker login $${registry} -u $${username} -p $${password}"
- "docker buildx create --name sighup-builder --use"
- "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --pull --push -f $${DOCKERFILE} -t $${repo}:unstable -t $${repo}:go -t $${repo}:${DRONE_COMMIT_SHA} $${BUILD_CONTEXT}"
when:
event:
- push
Expand All @@ -301,16 +308,16 @@ steps:
repo: quay.io/sighup/gatekeeper-policy-manager
container_image_name: gatekeeper-policy-manager
container_image_tag: test-${DRONE_BUILD_NUMBER}
DOCKERFILE: Dockerfile
BUILD_CONTEXT: "."
volumes:
- name: dockersock
path: /var/run/docker.sock
commands:
- docker login $${registry} -u $${username} -p $${password}
- docker tag $${container_image_name}:$${container_image_tag} $${repo}:latest
- "docker tag $${container_image_name}:$${container_image_tag} $${repo}:${DRONE_TAG}"
- docker push $${repo}:latest
- "docker push $${repo}:${DRONE_TAG}"
- docker rmi $${container_image_name}:$${container_image_tag}
- "apk add git"
- "docker login $${registry} -u $${username} -p $${password}"
- "docker buildx create --name sighup-builder --use"
- "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --pull --push -f $${DOCKERFILE} -t $${repo}:latest -t $${repo}:${DRONE_TAG} $${BUILD_CONTEXT}"
when:
event:
- tag
Expand Down
10 changes: 5 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Copyright (c) 2022 SIGHUP s.r.l All rights reserved.
# Copyright (c) 2023 SIGHUP s.r.l All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/app" # Location of package manifests
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "npm" # See documentation for possible values
directory: "/app/web-client" # Location of package manifests
schedule:
interval: "daily"
interval: "weekly"
12 changes: 5 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
env
.vscode
__pycache__
launch.json
app/static-content/*
!app/static-content/logo.svg
!app/static-content/semantic.min.css
tests/e2e/test-results
static-content/*
tests/e2e/test-results
node_modules
web-client/build
**/mise.local.toml
28 changes: 0 additions & 28 deletions .rules/.htmlhintrc

This file was deleted.

43 changes: 33 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,45 @@
# Copyright (c) 2022 SIGHUP s.r.l All rights reserved.
# Copyright (c) 2023 SIGHUP s.r.l All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
FROM node:lts-alpine AS node
COPY app/web-client /web-client


FROM --platform=$BUILDPLATFORM node:lts-alpine AS frontend
ARG TARGETOS
ARG TARGETARCH
COPY ./web-client /web-client
WORKDIR /web-client
ENV npm_config_target_arch=${TARGETARCH} npm_config_target_platform=${TARGETOS}
RUN yarn install && yarn cache clean && yarn build


FROM python:3.11-slim
FROM --platform=$BUILDPLATFORM golang:1.24 AS backend
ARG TARGETOS
ARG TARGETARCH
WORKDIR /app
COPY *.go ./
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=bind,source=go.mod,target=go.mod \
--mount=type=bind,source=go.sum,target=go.sum \
go mod download -x
# hadolint ignore=DL3059
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=bind,source=go.mod,target=go.mod \
--mount=type=bind,source=go.sum,target=go.sum \
go vet -v
# hadolint ignore=DL3059
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=bind,target=. \
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /bin/gpm


FROM gcr.io/distroless/static-debian11:nonroot AS target
LABEL org.opencontainers.vendor="SIGHUP.io"
LABEL org.opencontainers.image.authors="SIGHUP https://sighup.io"
LABEL org.opencontainers.image.source="https://github.com/sighupio/gatekeeper-policy-manager"

RUN groupadd -r gpm && useradd --no-log-init -r -g gpm gpm
WORKDIR /app
COPY --chown=gpm ./app /app
COPY --from=node --chown=gpm /web-client/build/ /app/static-content/
RUN pip install --no-cache-dir -r /app/requirements.txt
USER 999
COPY templates ./templates
COPY --from=backend ./bin/gpm ./gpm
COPY --from=frontend /web-client/build/ ./static-content/
EXPOSE 8080
CMD ["gunicorn", "--bind=:8080", "--workers=2", "--threads=4", "--worker-class=gthread", "app:app"]
CMD ["/app/gpm"]
Loading