11 Commits
v2.0.2 ... main

Author SHA1 Message Date
db368bbfd4 Update actions/checkout action to v6
All checks were successful
Main workflow / Run unit tests (push) Successful in 2m27s
Main workflow / build (push) Successful in 47s
2025-12-01 00:02:03 +00:00
79c0529823 Update actions/setup-go action to v6
All checks were successful
Main workflow / Run unit tests (push) Successful in 32s
Main workflow / build (push) Successful in 41s
2025-11-29 12:31:49 +00:00
e1b2d99b23 Update all non-major dependencies
All checks were successful
Main workflow / Run unit tests (push) Successful in 2m6s
Main workflow / build (push) Successful in 1m16s
2025-11-05 20:01:38 +00:00
6175a9857c Update all non-major dependencies
All checks were successful
Main workflow / Run unit tests (push) Successful in 3m23s
Main workflow / build (push) Successful in 42s
2025-08-24 17:01:17 +00:00
7441ce0a83 Update all non-major dependencies
All checks were successful
Main workflow / Run unit tests (push) Successful in 43s
Main workflow / build (push) Successful in 42s
2025-05-01 00:01:57 +00:00
1dc5a2b56b Update dependency ubuntu to v24
All checks were successful
Main workflow / Run unit tests (push) Successful in 3m26s
Main workflow / build (push) Successful in 42s
2025-04-01 00:01:08 +00:00
2eaa0ada05 Update all non-major dependencies
All checks were successful
Main workflow / Run unit tests (push) Successful in 41s
Main workflow / build (push) Successful in 50s
2025-03-31 14:18:47 +00:00
1e67af6bba Use metadata-action
All checks were successful
Main workflow / Run unit tests (push) Successful in 30s
Main workflow / build (push) Successful in 31s
2025-03-31 16:17:05 +02:00
db8529e560 Update renovate config
All checks were successful
Main workflow / Run unit tests (push) Successful in 3m5s
Main workflow / build (push) Successful in 25s
2025-03-31 15:18:28 +02:00
114edffa0a Improve CI
All checks were successful
Main workflow / Run unit tests (push) Successful in 26s
Main workflow / build (push) Successful in 24s
2025-03-31 15:14:34 +02:00
5732fb7aa0 Update renovate settings
All checks were successful
Main workflow / Run unit tests (push) Successful in 1m55s
Main workflow / Build docker image (push) Successful in 2m6s
2024-12-19 15:47:49 +01:00
11 changed files with 153 additions and 147 deletions

View File

@@ -1,11 +1,2 @@
.git/
.gitignore
.dockerignore
Dockerfile
LICENSE
Makefile
*.md
*.jpg
docker-compose.yaml
prosody-filer-s3
!cmd/prosody-filer-s3
*
!bin/

60
.github/workflows/build.yaml vendored Normal file
View File

@@ -0,0 +1,60 @@
---
name: Build image
on:
workflow_call:
inputs:
push:
description: Whether to push the image
type: boolean
required: true
jobs:
build:
name: Build docker image
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Login to registry
if: ${{ inputs.push }}
uses: docker/login-action@v3
with:
registry: git.mug.lv
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Setup buildx
uses: docker/setup-buildx-action@v3
- name: Setup go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Build binary
run: make build
env:
CGO_ENABLED: 0
- name: Tag image
uses: docker/metadata-action@v5
id: meta
with:
images: |
git.mug.lv/${{ github.repository }}
flavor: |
latest=false
tags: |
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
- name: Build image
uses: docker/build-push-action@v6
with:
context: .
push: ${{ inputs.push }}
tags: ${{ steps.meta.outputs.tags }}

View File

@@ -4,72 +4,43 @@ name: Main workflow
on:
push:
branches:
- '**'
- '**'
tags-ignore:
- '**'
- '**'
jobs:
test:
name: Run unit tests
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Setup go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Start minio
run: |
wget https://dl.min.io/server/minio/release/linux-amd64/minio
chmod +x minio
./minio server /data &
while ! curl -s -f http://localhost:9000/minio/health/live; do
sleep 1
done
- name: Run minio
run: |
wget -q https://dl.min.io/server/minio/release/linux-amd64/minio
chmod +x minio
./minio server /data &
while ! curl -s -f http://localhost:9000/minio/health/live; do
sleep 1
done
- name: Run unit tests
run: go test -v ./...
- name: Run unit tests
run: go test -v ./...
- name: Stop minio
if: always()
run: pkill -f minio
build:
name: Build docker image
needs: test
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install docker
uses: actions/docker-install@v1
- name: Login to registry
uses: actions/docker-login@v2
with:
registry: git.mug.lv
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Setup buildx
uses: actions/docker-setup-buildx@v2
- name: Get version
id: metadata
run: |
if [ "$REF_NAME" = 'main' ]; then
version='latest'
else
version="${REF_NAME//\//-}"
fi
echo "version=$version" | tee -a "$GITHUB_OUTPUT"
env:
REF_NAME: ${{ github.ref_name }}
- name: Build image
uses: actions/docker-build-push@v4
with:
push: ${{ github.ref_name == 'main' }}
tags: git.mug.lv/${{ github.repository }}:${{ steps.metadata.outputs.version }}
uses: ./.github/workflows/build.yaml
with:
push: ${{ github.ref_name == 'main' }}
secrets: inherit

View File

@@ -4,34 +4,13 @@ name: Main workflow
on:
push:
branches-ignore:
- '**'
- '**'
tags:
- '**'
- '**'
jobs:
build:
name: Build docker image
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install docker
uses: actions/docker-install@v1
- name: Login to registry
uses: actions/docker-login@v2
with:
registry: git.mug.lv
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Setup buildx
uses: actions/docker-setup-buildx@v2
- name: Build image
uses: actions/docker-build-push@v4
with:
push: true
tags: git.mug.lv/${{ github.repository }}:${{ github.ref_name }}
uses: ./.github/workflows/build.yaml
with:
push: true
secrets: inherit

3
.gitignore vendored
View File

@@ -1,2 +1 @@
prosody-filer-s3
!cmd/prosody-filer-s3
bin/

View File

@@ -1,4 +1,11 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"dependencyDashboard": true,
"extends": [
"group:allNonMajor",
"schedule:monthly",
],
"enabledManagers": ["github-actions", "gomod"],
"osvVulnerabilityAlerts": true,
"postUpdateOptions": ["gomodTidy"]
}

View File

@@ -1,18 +1,10 @@
FROM golang:1.22-alpine AS build
WORKDIR /build
COPY . /build
RUN go build ./...
FROM alpine:3.20
FROM alpine:3.21
RUN apk add -U --no-cache ca-certificates tini && \
addgroup -g 1000 prosody-filer-s3 && \
adduser -h /var/lib/empty -G prosody-filer-s3 -s /sbin/nologin -D -H -u 1000 prosody-filer-s3
COPY --from=build /build/prosody-filer-s3 /usr/local/bin/prosody-filer-s3
COPY bin/prosody-filer-s3 /usr/local/bin/prosody-filer-s3
USER 1000

View File

@@ -1,6 +1,6 @@
.PHONY: build
build:
go build ./...
go build -o bin/ ./cmd/prosody-filer-s3
.PHONY: clean
clean:

View File

@@ -4,7 +4,7 @@ services:
minio:
image: minio/minio:latest
command:
- server
- /data
- server
- /data
ports:
- "9000:9000"
- "9000:9000"

29
go.mod
View File

@@ -1,32 +1,35 @@
module git.mug.lv/galen/prosody-filer-s3
go 1.22
go 1.23.0
toolchain go1.22.8
toolchain go1.25.4
require (
github.com/BurntSushi/toml v1.4.0
github.com/minio/minio-go/v7 v7.0.78
github.com/rs/zerolog v1.33.0
github.com/stretchr/testify v1.9.0
github.com/BurntSushi/toml v1.5.0
github.com/minio/minio-go/v7 v7.0.97
github.com/rs/zerolog v1.34.0
github.com/stretchr/testify v1.11.1
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/go-ini/ini v1.67.0 // indirect
github.com/goccy/go-json v0.10.3 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.11 // indirect
github.com/klauspost/crc32 v1.3.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/minio/crc64nvme v1.1.0 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/philhofer/fwd v1.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rs/xid v1.6.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/text v0.19.0 // indirect
github.com/tinylib/msgp v1.3.0 // indirect
golang.org/x/crypto v0.39.0 // indirect
golang.org/x/net v0.41.0 // indirect
golang.org/x/sys v0.34.0 // indirect
golang.org/x/text v0.26.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

52
go.sum
View File

@@ -1,5 +1,5 @@
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -7,48 +7,52 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A=
github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA=
github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM=
github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/klauspost/cpuid/v2 v2.2.11 h1:0OwqZRYI2rFrjS4kvkDnqJkKHdHaRnCm68/DY4OxRzU=
github.com/klauspost/cpuid/v2 v2.2.11/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
github.com/klauspost/crc32 v1.3.0 h1:sSmTt3gUt81RP655XGZPElI0PelVTZ6YwCRnPSupoFM=
github.com/klauspost/crc32 v1.3.0/go.mod h1:D7kQaZhnkX/Y0tstFGf8VUzv2UofNGqCjnC3zdHB0Hw=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/minio/crc64nvme v1.1.0 h1:e/tAguZ+4cw32D+IO/8GSf5UVr9y+3eJcxZI2WOO/7Q=
github.com/minio/crc64nvme v1.1.0/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg=
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
github.com/minio/minio-go/v7 v7.0.78 h1:LqW2zy52fxnI4gg8C2oZviTaKHcBV36scS+RzJnxUFs=
github.com/minio/minio-go/v7 v7.0.78/go.mod h1:84gmIilaX4zcvAWWzJ5Z1WI5axN+hAbM5w25xf8xvC0=
github.com/minio/minio-go/v7 v7.0.97 h1:lqhREPyfgHTB/ciX8k2r8k0D93WaFqxbJX36UZq5occ=
github.com/minio/minio-go/v7 v7.0.97/go.mod h1:re5VXuo0pwEtoNLsNuSr0RrLfT/MBtohwdaSmPPSRSk=
github.com/philhofer/fwd v1.2.0 h1:e6DnBTl7vGY+Gz322/ASL4Gyp1FspeMvx1RNDoToZuM=
github.com/philhofer/fwd v1.2.0/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU=
github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8=
github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4=
golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY=
github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/tinylib/msgp v1.3.0 h1:ULuf7GPooDaIlbyvgAxBV/FI7ynli6LZ1/nVUNu+0ww=
github.com/tinylib/msgp v1.3.0/go.mod h1:ykjzy2wzgrlvpDCRc4LA8UXy6D8bzMSuAF3WD57Gok0=
golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw=
golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=