42 Commits

Author SHA1 Message Date
4bed79c68b chore(ci): add golangci-lint
Some checks failed
Golang Tests / unittest (stable, ubuntu-latest-amd64) (push) Successful in 14s
Markdown linter / markdown-lint (push) Successful in 4s
Golang CI lint / golangci (stable, ubuntu-latest-amd64) (push) Failing after 8s
Golang Tests / unittest (stable, ubuntu-latest-arm64) (push) Successful in 1m24s
Golang CI lint / golangci (stable, ubuntu-latest-arm64) (push) Failing after 33s
2025-06-01 12:18:38 +02:00
58c51f05f2 chore(deps): update github.com/google/gopacket digest to b7d9dbd
All checks were successful
Golang Tests / unittest (push) Successful in 18s
Markdown linter / markdown-lint (push) Successful in 16s
2025-05-31 20:33:54 +00:00
c886afb535 chore(deps): update davidanson/markdownlint-cli2-action action to v20
All checks were successful
Golang Tests / unittest (pull_request) Successful in 16s
Markdown linter / markdown-lint (pull_request) Successful in 15s
Golang Tests / unittest (push) Successful in 1m25s
Markdown linter / markdown-lint (push) Successful in 16s
2025-05-31 20:15:41 +00:00
bd5f22a613 chore(ci): update workflow_dispatch for update docker hub description
All checks were successful
Golang Tests / unittest (push) Successful in 16s
Markdown linter / markdown-lint (push) Successful in 16s
2025-05-31 22:08:02 +02:00
74f2362d46 chore(deps): update git.cryptic.systems/volker.raschek/markdownlint docker tag to v0.45.0
All checks were successful
Markdown linter / markdown-lint (pull_request) Successful in 3s
Golang Tests / unittest (pull_request) Successful in 40s
Golang Tests / unittest (push) Successful in 6s
Markdown linter / markdown-lint (push) Successful in 8s
2025-05-28 13:06:48 +00:00
a23f2270b1 docs(README): indentation
All checks were successful
Markdown linter / markdown-lint (push) Successful in 4s
Update Docker Hub Description / update-description-on-hub-docker-io (push) Successful in 12s
Golang Tests / unittest (push) Successful in 1m13s
Release / release (push) Successful in 55s
Release / sync-to-hub-docker-io (push) Successful in 28s
2025-05-13 20:31:09 +02:00
756d668fc9 fix(ci): replace drone with gitea actions
All checks were successful
Markdown linter / markdown-lint (push) Successful in 11s
Golang Tests / unittest (push) Successful in 43s
2025-05-13 20:28:50 +02:00
a91d50bc29 chore(deps): update git.cryptic.systems/volker.raschek/markdownlint docker tag to v0.44.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-01 17:10:48 +00:00
b9a337dc58 chore(deps): update docker.io/plugins/docker docker tag to v20.18.8
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-03-26 20:17:37 +00:00
0a602048aa chore(renovate): remove obsolete matchBaseBranches
All checks were successful
continuous-integration/drone/push Build is passing
2025-03-22 15:06:43 +00:00
0feb12b5bd chore(deps): update quay.io/skopeo/stable docker tag to v1.18.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-02-28 17:17:22 +00:00
92da52e8d6 chore(deps): update docker.io/plugins/docker docker tag to v20.18.7
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-02-18 08:15:41 +00:00
0a0be0b48c chore(deps): update docker.io/plugins/docker docker tag to v20.18.6
Some checks reported errors
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build encountered an error
2024-12-25 05:14:33 +00:00
48c7f07eaa chore(deps): update docker.io/library/alpine docker tag to v3.21
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-05 23:14:09 +00:00
46ae2a0bc2 chore(deps): update git.cryptic.systems/volker.raschek/markdownlint docker tag to v0.43.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-03 14:19:06 +00:00
86e6c95f6c chore(deps): update docker.io/plugins/docker docker tag to v20.18.5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-29 11:15:50 +00:00
b0e2cba10d chore(deps): update git.cryptic.systems/volker.raschek/git docker tag to v1.4.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-25 23:17:37 +00:00
2f62514ce4 chore(deps): update quay.io/skopeo/stable docker tag to v1.17.0
Some checks reported errors
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build encountered an error
2024-11-21 17:16:00 +00:00
f7095f0e35 chore(deps): update git.cryptic.systems/volker.raschek/markdownlint docker tag to v0.42.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-14 19:18:28 +00:00
f1cf139ab7 chore(deps): update docker.io/plugins/docker docker tag to v20.18.4
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-09-03 19:12:23 +00:00
d9e0eed29a chore(deps): update quay.io/skopeo/stable docker tag to v1.16.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-09-03 16:11:39 +00:00
3a3924f0e6 chore(deps): update quay.io/skopeo/stable docker tag to v1.16.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-08-18 16:12:03 +00:00
c5351b3bb2 chore(deps): update docker.io/plugins/docker docker tag to v20.18.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-26 12:08:53 +00:00
b313be532e chore(deps): update docker.io/plugins/docker docker tag to v20.18.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-23 19:14:12 +00:00
47bf4a6ad7 chore(deps): update quay.io/skopeo/stable docker tag to v1.15.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-16 16:09:39 +00:00
b76a196da2 chore(deps): update docker.io/plugins/docker docker tag to v20.18.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-15 22:13:40 +00:00
db417ffb8a chore(deps): update quay.io/skopeo/stable docker tag to v1.15.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-13 19:13:53 +00:00
825b8412ca chore(deps): update docker.io/plugins/docker docker tag to v20.18.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-13 10:58:56 +00:00
372d609042 chore(deps): update git.cryptic.systems/volker.raschek/markdownlint docker tag to v0.41.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-27 13:21:45 +00:00
2042e25715 chore(deps): update docker.io/library/alpine docker tag to v3.20
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-22 19:08:57 +00:00
3a61ee071c chore(deps): update docker.io/plugins/docker docker tag to v20.17.5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-20 13:12:21 +00:00
ca74f4ef24 chore(deps): update docker.io/plugins/docker docker tag to v20.17.4
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-13 10:11:00 +00:00
a252fd2925 Merge pull request 'chore(deps): update github.com/google/gopacket digest to 32ee382' (#2) from renovate/github.com-google-gopacket-digest into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #2
2024-05-08 06:36:29 +00:00
6dcc076b07 chore(deps): update github.com/google/gopacket digest to 32ee382
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-08 02:21:52 +00:00
7266639325 chore(deps): update docker.io/library/golang docker tag to v1.22.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-08 00:46:50 +00:00
e63c96368c chore(deps): update git.cryptic.systems/volker.raschek/markdownlint docker tag to v0.40.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-07 22:25:54 +00:00
f05677e0d3 chore(deps): update quay.io/skopeo/stable docker tag to v1.15.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-04-08 22:11:45 +00:00
7ecdc659bc chore(deps): update git.cryptic.systems/volker.raschek/markdownlint docker tag to v0.39.0
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-08 19:23:20 +00:00
4c4b7eb524 chore(deps): update docker.io/library/golang docker tag to v1.22.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-04-08 19:11:58 +00:00
3af0527a14 chore(deps): update docker.io/plugins/docker docker tag to v20.17.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-04-08 16:13:00 +00:00
9a5987f711 fix: update module path and git version
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-08 16:53:51 +02:00
3c1d4465fa feat: update Makefile, renovate, gitlangci-lint, markdownlint, container-image 2024-04-08 16:51:24 +02:00
18 changed files with 579 additions and 102 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
getpsrc

View File

@ -1,15 +1,13 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
# Editor configuration, see http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = false
trim_trailing_whitespace = true
[Makefile]
[{Makefile,*.go}]
indent_style = tab

10
.gitattributes vendored Normal file
View File

@ -0,0 +1,10 @@
# checkout alls text files with end of line = line feed
* text eol=lf
# Binary files should be checked in and out as binary
*.png binary
*.jpg binary
*.eot binary
*.ttf binary
*.pkcs8 binary
*.pkcs12 binary

View File

@ -0,0 +1,24 @@
name: Golang Tests
on:
pull_request:
types: [ "opened", "reopened", "synchronize" ]
push:
branches: [ '**' ]
tags-ignore: [ '**' ]
jobs:
unittest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: [ stable ]
os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-go@v5.5.0
with:
go-version: ${{ matrix.go }}
- env:
GOPROXY: ${{ vars.GOPROXY }}
run: make test/unit

View File

@ -0,0 +1,27 @@
name: Golang CI lint
on:
pull_request:
types: [ "opened", "reopened", "synchronize" ]
push:
branches: [ '**' ]
tags-ignore: [ '**' ]
permissions:
contents: read
jobs:
golangci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: [ stable ]
os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-go@v5.5.0
with:
go-version: ${{ matrix.go }}
- uses: golangci/golangci-lint-action@v8.0.0
with:
version: v2.1

View File

@ -0,0 +1,19 @@
name: Markdown linter
on:
pull_request:
types: [ "opened", "reopened", "synchronize" ]
push:
branches: [ '**' ]
tags-ignore: [ '**' ]
workflow_dispatch: {}
jobs:
markdown-lint:
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- uses: DavidAnson/markdownlint-cli2-action@v20.0.0
with:
globs: '**/*.md'

View File

@ -0,0 +1,52 @@
name: Release
on:
push:
tags: [ '**' ]
permissions:
contents: write
jobs:
release:
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- uses: docker/setup-qemu-action@v3.6.0
- uses: actions/setup-go@v5.5.0
with:
go-version: stable
- uses: docker/login-action@v3.4.0
with:
registry: git.cryptic.systems
username: ${{ github.repository_owner }}
password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
- env:
GITEA_TOKEN: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
GONOSUMDB: ${{ vars.GONOSUMDB }}
GOPROXY: ${{ vars.GOPROXY }}
uses: goreleaser/goreleaser-action@v6.3.0
with:
version: "~> v2"
args: release --clean
sync-to-hub-docker-io:
needs:
- release
runs-on: ubuntu-latest
steps:
- name: Copy images to docker.io
run: |
TAG=$(echo ${{ github.ref_name }} | sed 's/v//gm')
apt-get update --yes
apt-get install --yes skopeo
skopeo copy \
--all \
--dest-password ${{ secrets.DOCKER_IO_PASSWORD }} \
--dest-username ${{ secrets.DOCKER_IO_USERNAME }} \
--src-password ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }} \
--src-username volker.raschek \
docker://git.cryptic.systems/volker.raschek/getpsrc:${TAG} \
docker://docker.io/volkerraschek/getpsrc:${TAG}

View File

@ -0,0 +1,20 @@
name: Update Docker Hub Description
on:
push:
branches: [ 'master' ]
paths: [ 'README.md' ]
workflow_dispatch: {}
jobs:
update-description-on-hub-docker-io:
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- uses: peter-evans/dockerhub-description@v4.0.2
with:
username: ${{ secrets.DOCKER_IO_USERNAME }}
password: ${{ secrets.DOCKER_IO_PASSWORD }}
repository: volkerraschek/getpsrc
readme-filepath: README.md

27
.gitignore vendored
View File

@ -1 +1,26 @@
getpsrc
**/*.iml
**/*.idea
**/target
**/.project
**/.settings
**/.classpath
**/npm-debug.log
**/node/*
**/nb-configuration.xml
**/*.war
**/*.class
**/*.DS_Store
**/.vscode
.repo
**/pom.xml.releaseBackup
**/release.properties
**/bindata.go
**/t1k.rpm
**/orbis-u-t1k.tar.gz
**/container.log
**/.env
**/coverage*
getpsrc*
dist

View File

@ -1,6 +1,4 @@
run:
skip-dirs:
- it
timeout: 10m
tests: true
@ -26,3 +24,4 @@ linters:
- rowserrcheck
- sqlclosecheck
- unparam
- whitespace

154
.goreleaser.yaml Normal file
View File

@ -0,0 +1,154 @@
project_name: getpsrc
archives:
- formats: [ "tar.xz" ]
files:
- README.md
- LICENSE
before:
hooks:
- go mod tidy
builds:
- main: main.go
binary: >-
{{ .ProjectName }}-
{{- .Version }}-
{{- .Os }}-
{{- if eq .Arch "amd64" }}amd64
{{- else if eq .Arch "amd64_v1" }}amd64
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}-{{ .Arm }}{{ end }}
env:
- CGO_ENABLED=0
- GONOSUMDB={{ .Env.GONOSUMDB }}
- GOPROXY={{ .Env.GOPROXY }}
goos:
- linux
goarch:
- amd64
- arm
- arm64
goarm:
- "6"
- "7"
flags:
- -trimpath
ldflags:
- -s -w -X 'main.version={{ trimprefix .Tag "v" }}'
changelog:
filters:
exclude:
- '^chore'
- '^docs'
- '^test'
- Merge pull request
- Merge branch
- go mod tidy
format: "{{.SHA}}: {{.Message}} (@{{.AuthorUsername}})"
groups:
- title: Features
regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$'
order: 0
- title: "Bug fixes"
regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
order: 1
- title: Others
order: 999
sort: asc
use: git
dockers:
- build_flag_templates:
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.documentation={{ .ProjectName }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.source={{ .GitURL }}
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://git.cryptic.systems/volker.raschek/{{ .ProjectName }}
- --label=org.opencontainers.image.version={{ trimprefix .Tag "v" }}
- --platform=linux/amd64
- --pull
dockerfile: Dockerfile
goarch: amd64
goos: linux
image_templates:
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-amd64'
skip_push: false
use: buildx
- build_flag_templates:
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.documentation={{ .ProjectName }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.source={{ .GitURL }}
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://git.cryptic.systems/volker.raschek/{{ .ProjectName }}
- --label=org.opencontainers.image.version={{ trimprefix .Tag "v" }}
- --platform=linux/arm/v6
- --pull
dockerfile: Dockerfile
goarch: arm
goarm: "6"
goos: linux
image_templates:
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-arm-v6'
skip_push: false
use: buildx
- build_flag_templates:
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.documentation={{ .ProjectName }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.source={{ .GitURL }}
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://git.cryptic.systems/volker.raschek/{{ .ProjectName }}
- --label=org.opencontainers.image.version={{ trimprefix .Tag "v" }}
- --platform=linux/arm/v7
- --pull
dockerfile: Dockerfile
goarch: arm
goarm: "7"
goos: linux
image_templates:
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-arm-v7'
skip_push: false
use: buildx
- build_flag_templates:
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.documentation={{ .ProjectName }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.source={{ .GitURL }}
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://git.cryptic.systems/volker.raschek/{{ .ProjectName }}
- --label=org.opencontainers.image.version={{ trimprefix .Tag "v" }}
- --platform=linux/arm64
- --pull
dockerfile: Dockerfile
goarch: arm64
goos: linux
image_templates:
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-arm64'
skip_push: false
use: buildx
docker_manifests:
- name_template: 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}'
image_templates:
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-amd64'
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-arm-v6'
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-arm-v7'
- 'git.cryptic.systems/volker.raschek/{{ .ProjectName }}:{{ trimprefix .Tag "v" }}-arm64'
gitea_urls:
api: https://git.cryptic.systems/api/v1
download: https://git.cryptic.systems
version: 2

144
.markdownlint.yaml Normal file
View File

@ -0,0 +1,144 @@
# markdownlint YAML configuration
# https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml
# Default state for all rules
default: true
# Path to configuration file to extend
extends: null
# MD003/heading-style/header-style - Heading style
MD003:
# Heading style
style: "atx"
# MD004/ul-style - Unordered list style
MD004:
style: "dash"
# MD007/ul-indent - Unordered list indentation
MD007:
# Spaces for indent
indent: 2
# Whether to indent the first level of the list
start_indented: false
# MD009/no-trailing-spaces - Trailing spaces
MD009:
# Spaces for line break
br_spaces: 2
# Allow spaces for empty lines in list items
list_item_empty_lines: false
# Include unnecessary breaks
strict: false
# MD010/no-hard-tabs - Hard tabs
MD010:
# Include code blocks
code_blocks: true
# MD012/no-multiple-blanks - Multiple consecutive blank lines
MD012:
# Consecutive blank lines
maximum: 1
# MD013/line-length - Line length
MD013:
# Number of characters
line_length: 120
# Number of characters for headings
heading_line_length: 120
# Number of characters for code blocks
code_block_line_length: 120
# Include code blocks
code_blocks: false
# Include tables
tables: false
# Include headings
headings: true
# Include headings
headers: true
# Strict length checking
strict: false
# Stern length checking
stern: false
# MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines
MD022:
# Blank lines above heading
lines_above: 1
# Blank lines below heading
lines_below: 1
# MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content
MD024:
# Only check sibling headings
allow_different_nesting: true
# MD025/single-title/single-h1 - Multiple top-level headings in the same document
MD025:
# Heading level
level: 1
# RegExp for matching title in front matter
front_matter_title: "^\\s*title\\s*[:=]"
# MD026/no-trailing-punctuation - Trailing punctuation in heading
MD026:
# Punctuation characters
punctuation: ".,;:!。,;:!"
# MD029/ol-prefix - Ordered list item prefix
MD029:
# List style
style: "one_or_ordered"
# MD030/list-marker-space - Spaces after list markers
MD030:
# Spaces for single-line unordered list items
ul_single: 1
# Spaces for single-line ordered list items
ol_single: 1
# Spaces for multi-line unordered list items
ul_multi: 1
# Spaces for multi-line ordered list items
ol_multi: 1
# MD033/no-inline-html - Inline HTML
MD033:
# Allowed elements
allowed_elements: []
# MD035/hr-style - Horizontal rule style
MD035:
# Horizontal rule style
style: "---"
# MD036/no-emphasis-as-heading/no-emphasis-as-header - Emphasis used instead of a heading
MD036:
# Punctuation characters
punctuation: ".,;:!?。,;:!?"
# MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading
MD041:
# Heading level
level: 1
# RegExp for matching title in front matter
front_matter_title: "^\\s*title\\s*[:=]"
# MD044/proper-names - Proper names should have the correct capitalization
MD044:
# List of proper names
names:
- oas-collector
# Include code blocks
code_blocks: false
# MD046/code-block-style - Code block style
MD046:
# Block style
style: "fenced"
# MD048/code-fence-style - Code fence style
MD048:
# Code fence syle
style: "backtick"

View File

@ -1,32 +1,5 @@
ARG BASE_IMAGE
ARG BUILD_IMAGE
FROM scratch AS build
# BUILD
# =====================================================================
FROM ${BUILD_IMAGE} AS build
ARG GONOPROXY
ARG GONOSUMDB
ARG GOPRIVATE
ARG GOPROXY
ARG GOSUMDB
ARG VERSION
COPY ./ /workspace
RUN cd /workspace && \
GONOPROXY=${GONOPROXY} \
GONOSUMDB=${GONOSUMDB} \
GOPRIVATE=${GOPRIVATE} \
GOPROXY=${GOPROXY} \
GOSUMDB=${GOSUMDB} \
VERSION=${VERSION} \
make all
# TARGET
# =====================================================================
FROM ${BASE_IMAGE}
COPY --from=build /workspace/getpsrc /usr/bin/getpsrc
COPY getpsrc-* /usr/bin/getpsrc
ENTRYPOINT [ "/usr/bin/getpsrc" ]

View File

@ -2,29 +2,13 @@
VERSION?=$(shell git describe --abbrev=0)+hash.$(shell git rev-parse --short HEAD)
# CONTAINER_RUNTIME
CONTAINER_RUNTIME?=$(shell which docker)
# BUILD_IMAGE
BUILD_IMAGE_REGISTRY_HOST?=docker.io
BUILD_IMAGE_NAMESPACE=library
BUILD_IMAGE_REPOSITORY=golang
BUILD_IMAGE_VERSION?=1.16
BUILD_IMAGE_FULLY_QUALIFIED:=${BUILD_IMAGE_REGISTRY_HOST}/${BUILD_IMAGE_NAMESPACE}/${BUILD_IMAGE_REPOSITORY}:${BUILD_IMAGE_VERSION}
# BASE_IMAGE
BASE_IMAGE_REGISTRY_HOST?=docker.io
BASE_IMAGE_NAMESPACE=library
BASE_IMAGE_REPOSITORY=busybox
BASE_IMAGE_VERSION?=latest
BASE_IMAGE_FULLY_QUALIFIED=${BASE_IMAGE_REGISTRY_HOST}/${BASE_IMAGE_NAMESPACE}/${BASE_IMAGE_REPOSITORY}:${BASE_IMAGE_VERSION}
CONTAINER_RUNTIME?=$(shell which podman)
# CONTAINER_IMAGE
CONTAINER_IMAGE_REGISTRY_HOST?=docker.io
CONTAINER_IMAGE_NAMESPACE=volkerraschek
CONTAINER_IMAGE_REPOSITORY=getpsrc
CONTAINER_IMAGE_REGISTRY_HOST?=git.cryptic.systems
CONTAINER_IMAGE_REPOSITORY=volker.raschek/getpsrc
CONTAINER_IMAGE_VERSION?=latest
CONTAINER_IMAGE_FULLY_QUALIFIED=${CONTAINER_IMAGE_REGISTRY_HOST}/${CONTAINER_IMAGE_NAMESPACE}/${CONTAINER_IMAGE_REPOSITORY}:${CONTAINER_IMAGE_VERSION}
CONTAINER_IMAGE_UNQUALIFIED=${CONTAINER_IMAGE_NAMESPACE}/${CONTAINER_IMAGE_REPOSITORY}:${CONTAINER_IMAGE_VERSION}
CONTAINER_IMAGE_FULLY_QUALIFIED=${CONTAINER_IMAGE_REGISTRY_HOST}/${CONTAINER_IMAGE_REPOSITORY}:${CONTAINER_IMAGE_VERSION}
# EXECUTABLES
# ==============================================================================
@ -34,18 +18,28 @@ PHONY=all
all: clean ${EXECUTABLE_TARGETS}
getpsrc:
GOPRIVATE=$(shell go env GOPRIVATE) \
GOPROXY=$(shell go env GOPROXY) \
GONOPROXY=$(shell go env GONOPROXY) \
GONOSUMDB=$(shell go env GONOSUMDB) \
GOSUMDB=$(shell go env GOSUMDB) \
go build -tags netgo -ldflags "-X main.version=${VERSION}" -o ${@} main.go
go build -tags netgo -ldflags "-X main.version=${VERSION}" -o ${@} main.go
# CLEAN
# ==============================================================================
PHONY+=clean
clean:
rm --force --recursive $(shell pwd)/getpsrc*
rm -f -r $(shell pwd)/getpsrc*
# TESTS
# ==============================================================================
PHONY+=test/unit
test/unit:
CGO_ENABLED=0 \
GOPROXY=$(shell go env GOPROXY) \
go test -v -p 1 -coverprofile=coverage.txt -covermode=count -timeout 1200s ./...
PHONY+=test/coverage
test/coverage: test/unit
CGO_ENABLED=0 \
GOPROXY=$(shell go env GOPROXY) \
go tool cover -html=coverage.txt
# GOLANGCI-LINT
# ==============================================================================
@ -64,17 +58,9 @@ gosec:
PHONY+=container-image/build
container-image/build:
${CONTAINER_RUNTIME} build \
--build-arg BASE_IMAGE=${BASE_IMAGE_FULLY_QUALIFIED} \
--build-arg BUILD_IMAGE=${BUILD_IMAGE_FULLY_QUALIFIED} \
--build-arg GOPRIVATE=$(shell go env GOPRIVATE) \
--build-arg GOPROXY=$(shell go env GOPROXY) \
--build-arg GONOPROXY=$(shell go env GONOPROXY) \
--build-arg GONOSUMDB=$(shell go env GONOSUMDB) \
--build-arg GOSUMDB=$(shell go env GOSUMDB) \
--build-arg VERSION=${VERSION} \
--file ./Dockerfile \
--no-cache \
--tag ${CONTAINER_IMAGE_UNQUALIFIED} \
--tag ${CONTAINER_IMAGE_FULLY_QUALIFIED} \
.
@ -104,18 +90,13 @@ PHONY+=container-run
container-run:
${CONTAINER_RUNTIME} run \
--env CONTAINER_IMAGE_VERSION=${CONTAINER_IMAGE_VERSION} \
--env GONOPROXY=$(shell go env GONOPROXY) \
--env GONOSUMDB=$(shell go env GONOSUMDB) \
--env GOPRIVATE=$(shell go env GOPRIVATE) \
--env GOPROXY=$(shell go env GOPROXY) \
--env GOSUMDB=$(shell go env GOSUMDB) \
--env VERSION=${VERSION} \
--net=host \
--rm \
--volume /tmp:/tmp \
--volume ${HOME}/go:/root/go \
--volume $(shell pwd):/workspace \
--workdir /workspace \
--volume "${HOME}/go:/root/go" \
--volume "$(shell pwd):$(shell pwd)" \
--workdir "$(shell pwd)" \
${BUILD_IMAGE_FULLY_QUALIFIED} \
make ${COMMAND}

View File

@ -1,7 +1,10 @@
# getpsrc
[![Docker Pulls](https://img.shields.io/docker/pulls/volkerraschek/getpsrc)](https://hub.docker.com/r/volkerraschek/getpsrc)
`getpsrc` is a small programme to determine the src routing ip for an external ip.
`getpsrc` serves as an alternative to `ip route get <ip> | awk ... ` because `ip
route get` can return different output depending on the environment and
therefore the construct is unsafe.
`getpsrc` serves as an alternative to `ip route get <ip> | awk ...` because `ip
route get` can return different output depending on the environment and therefore the construct is unsafe.
`getpsrc` is also as container image available: `docker.io/volkerraschek/getpsrc`.

6
go.mod
View File

@ -1,5 +1,5 @@
module github.com/volker-raschek/getpsrc
module git.cryptic.systems/volker.raschek/getpsrc
go 1.16
go 1.21
require github.com/google/gopacket v1.1.20-0.20210429153827-3eaba0894325
require github.com/google/gopacket v1.1.20-0.20250319234736-b7d9dbd15ae4

17
go.sum
View File

@ -1,21 +1,14 @@
github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8=
github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo=
github.com/google/gopacket v1.1.20-0.20210429153827-3eaba0894325 h1:YmIcZ5Var3BAQ64AW98Iiys5Ih4fiU0xK41+8isC5Ec=
github.com/google/gopacket v1.1.20-0.20210429153827-3eaba0894325/go.mod h1:riddUzxTSBpJXk3qBHtYr4qOhFhT6k/1c0E3qkQjQpA=
github.com/google/gopacket v1.1.20-0.20250319234736-b7d9dbd15ae4 h1:iRhvvcuUeT5yDyWSnZewU+tJvKapX5VjBxqG+gU89FM=
github.com/google/gopacket v1.1.20-0.20250319234736-b7d9dbd15ae4/go.mod h1:E8yiKNM3ZzChWoaXdHg08eM+bqgp6nkbaoKwsqVK5Y8=
github.com/vishvananda/netlink v1.1.0 h1:1iyaYNBLmP6L0220aDnYQpo1QEV4t4hJ+xEEhhJH8j0=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f h1:p4VB7kIXpOQvVn1ZaTIVp+3vuYAXFe3OJEvjbUYJLaA=
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200217220822-9197077df867 h1:JoRuNIf+rpHl+VhScRQQvzbHed86tKkqwPMV34T8myw=
golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

54
renovate.json Normal file
View File

@ -0,0 +1,54 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"assigneesFromCodeOwners": true,
"labels": [ "renovate" ],
"packageRules": [
{
"description": "Automatically update minor and patch versions of container images",
"addLabels": [ "renovate/container-images", "renovate/automerge" ],
"automerge": true,
"matchDatasources":[ "docker" ],
"matchUpdateTypes": [ "minor", "patch"]
},
{
"description": "Prepare MR for major update of container images",
"addLabels": [ "renovate/container-images", "renovate/automerge" ],
"automerge": false,
"matchDatasources":[ "docker" ],
"matchUpdateTypes": [ "major"]
},
{
"description": "Automatically update minor and patch versions of used drone-ci images",
"addLabels": [ "renovate/droneci", "renovate/automerge" ],
"automerge": true,
"matchManagers": "droneci",
"matchUpdateTypes": [ "minor", "patch"]
},
{
"description": "Prepare MR for major update of used drone-ci images",
"addLabels": [ "renovate/droneci", "renovate/automerge" ],
"automerge": false,
"matchManagers": "droneci",
"matchUpdateTypes": [ "major"]
},
{
"description": "Automatically update minor and patch versions of go modules",
"addLabels": [ "renovate/gomod", "renovate/automerge" ],
"automerge": true,
"matchManagers": [ "gomod" ],
"matchUpdateTypes": [ "minor", "patch" ]
},
{
"description": "Prepare MR for major update of go modules",
"addLabels": [ "renovate/gomod" ],
"automerge": false,
"matchManagers": [ "gomod" ],
"matchUpdateTypes": [ "major" ]
}
],
"postUpdateOptions": [
"gomodTidy"
],
"rebaseLabel": "renovate/rebase",
"rebaseWhen": "behind-base-branch"
}