PHPackages                             wolnosciowiec/wolnosciowiec-image-repository - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. wolnosciowiec/wolnosciowiec-image-repository

ArchivedProject[File &amp; Storage](/categories/file-storage)

wolnosciowiec/wolnosciowiec-image-repository
============================================

File storage service, built for ultra-low budget shared hostings with no footprint on performance

v2.0.6(7y ago)25314[25 issues](https://github.com/Wolnosciowiec/image-repository/issues)[11 PRs](https://github.com/Wolnosciowiec/image-repository/pulls)MITGoPHP &gt;=7.2

Since Feb 11Pushed 2y ago6 watchersCompare

[ Source](https://github.com/Wolnosciowiec/image-repository)[ Packagist](https://packagist.org/packages/wolnosciowiec/wolnosciowiec-image-repository)[ RSS](/packages/wolnosciowiec-wolnosciowiec-image-repository/feed)WikiDiscussions main Synced 2mo ago

READMEChangelog (10)Dependencies (26)Versions (6)Used By (0)

Backup Repository
=================

[](#backup-repository)

> NOTICE: Sadly, we no longer have power to maintain Backup Repository ecosystem as it grew up pretty big and we are not a full-time employeed development team. Feel free to maintain a fork.

[![Coverage Status](https://camo.githubusercontent.com/037ab4b4941e925cb971db282de1baa4b81a9f47d1194cc45bcaa19974ef455f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f72696f746b69742d6f72672f6261636b75702d7265706f7369746f72792f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/riotkit-org/backup-repository?branch=main)[![Test](https://github.com/riotkit-org/backup-repository/actions/workflows/test.yaml/badge.svg)](https://github.com/riotkit-org/backup-repository/actions/workflows/test.yaml)[![Artifact Hub](https://camo.githubusercontent.com/02f5d3b55ac3a3dcb2d12f95415fd01696bd51eb3fb6e5114f0b85378e551221/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f75726c3d68747470733a2f2f61727469666163746875622e696f2f62616467652f7265706f7369746f72792f72696f746b69742d6f7267)](https://artifacthub.io/packages/search?repo=riotkit-org)

Cloud-native, zero-knowledge, multi-tenant, compliance-strict, security-first backup storage with minimal footprint.

*TLDR; Primitive backup storage for E2E GPG-encrypted files, with multi-user, quotas, versioning, using a object storage (S3/Min.io/GCS etc.) and deployed on Kubernetes or standalone. No fancy stuff included, lightweight and stable as much as possible is the project target.*

**Natively supports:**

- Kubernetes (but does not require)
- GPG E2E encryption
- Configuration via GitOps (Configuration as a Code)
- Multi-tenancy with configurable Quotas
- Multiple cloud providers as a backend storage (all supported by [GO Cloud](https://gocloud.dev/howto/blob/#services))
- (Security) JWT tokens with restricted scope (login endpoint can apply additional restrictions to user session)
- (Security) Extra pairs of username &amp; passwords with different restrictions applied - for single user

**Notice:**

- Project is more focusing on security than on performance
- Due to E2E nature there is no incremental backups support. Incremental backups would need to be implemented client-side with some encrypted metadata stored on server. In the future it may be implemented, but is not our priority. Feel free to send a Pull Request

**Technology stack:**

- Kubernetes Client ([client-go](https://github.com/kubernetes/client-go))
- [GORM for database support](https://gorm.io/index.html)
- [GO Cloud for storage support](https://gocloud.dev/howto/blob)
- [GIN](https://github.com/gin-gonic/gin) + [GIN JWT](https://github.com/appleboy/gin-jwt) for web framework

**Requirements:**

- Kubernetes (if wanting to use Kubernetes)
- PostgreSQL
- About 128Mb ram for small scale usage (**Note**: *We use Argon2di and performing file uploads + calculations on buffers*)
- Storage provider (S3, GCS, Min.io, local filesystem, or others supported by )

**Support:**

- Any Kubernetes 1.20+
- [K3s](https://github.com/k3s-io/k3s)
- OpenShift (with support for Routes, non-privileged, non-root containers)
- PostgreSQL 11+
- [SealedSecrets](https://github.com/bitnami-labs/sealed-secrets)
- [Min.io](https://github.com/minio/minio)

Difference between other backups systems
----------------------------------------

[](#difference-between-other-backups-systems)

Selecting a best tool depends on specific use case. Most common way on Kubernetes is to perform cloud-native volume snapshotting, there [Velero project](https://velero.io/docs/v1.8/how-velero-works/) is the most recognized solution that integrates with cloud provides like AWS, Google Cloud or Azure and uses API calls to ask cloud provider for a snapshot.

**Backup Repository** approach uses **application-native** and more traditional method of performing backups - using tar, pg\_dump, mysqldump and other application-native tools for Backup and Restore. This selected approach have pros and cons as following:

**Pros:**

- Possibility to back up selected part of data e.g. "database X inside PostgreSQL instance"
- Control over data in terms of security: Everything GPG encrypted, storage does not know what is stored. Do you trust your cloud provider at 100%?
- No dependency on public cloud
- Volume driver agnostic, runs even on k3s with local storage provisioner

**Cons:**

- Responsibility for the process to be successful (not just an API call to provider)
- No possibility to do a consistent block device snapshot
- Slower and ineffective at very large scale
- Maintenance and monitoring of scripts that perform backups

Maturity
--------

[](#maturity)

**Notice:** *This software is currently in a pre-prod stage. We do not plan breaking changes to the functionality, but the API interface may still change. We recommend our official **Backup Maker** client that will be always up-to-date with API changes.*

Star a repo, subscribe for releases to get informed.

Security/Compliance demo
------------------------

[](#securitycompliance-demo)

### Are my backups created in specific time?

[](#are-my-backups-created-in-specific-time)

Every **Backup Collection** has HTTP health check endpoint you can monitor and trigger alerts in case when expected backup was not submitted or is invalid.

### Attacker got my Kubernetes cluster and wants to overwrite remote backups

[](#attacker-got-my-kubernetes-cluster-and-wants-to-overwrite-remote-backups)

- Good practice is to **limit how often versions can be submitted**. Attacker would need to be very patient to overwrite your past backups with malicious ones.

### Attacker got my Backup Repository credentials from target environment

[](#attacker-got-my-backup-repository-credentials-from-target-environment)

- **Access Keys** feature allows to generate additional pair of username &amp; password for same user, but with fewer privileges
- Use *Backup Maker Operator* which injects JWT credentials on-the-fly just before the backup is made. Those credentials are restricted to upload to single collection at a time
- You may specify ranges of IP addresses from which backup could be submitted (if the server is reachable from the internet)

### Attacker wants to upload a terabyte file to generate cloud costs or exhaust disk space

[](#attacker-wants-to-upload-a-terabyte-file-to-generate-cloud-costs-or-exhaust-disk-space)

Backup Repository operates on disk quotas. Every incoming byte stream is calculated on the fly and cancelled, when the limit is exhausted.

### Storage of my Backup Repository server leaked!

[](#storage-of-my-backup-repository-server-leaked)

End-To-End backup encryption makes your backup unreadable for people not having your GPG private key.

Running
-------

[](#running)

Application is written in GO and distributed as a single-binary file. Recommended way is to run it within a docker image on a Kubernetes cluster.

#### Running standalone

[](#running-standalone)

```
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export AWS_SECRET_ACCESS_KEY=wJaFuCKtnFEMI/CApItaliSM/bPxRfiCYEXAMPLEKEY

backup-repository \
    --db-password=postgres \
    --db-user=postgres \
    --db-password=postgres \
    --db-name=postgres \
    --jwt-secret-key="secret key" \
    --storage-url="s3://mybucket?endpoint=localhost:9000&disableSSL=true&s3ForcePathStyle=true&region=eu-central-1"
```

#### Installing via Helm

[](#installing-via-helm)

```
helm repo add riotkit-org https://riotkit-org.github.io/helm-of-revolution/
helm install backups riotkit-org/backup-repository-server -n backup-repository # --values ...
```

Documentation
-------------

[](#documentation)

### [For documentation please look into `./docs` directory](./docs/README.md)

[](#for-documentation-please-look-into-docs-directory)

**NOTICE:** You are probably reading documentation at `main` branch, please consider selecting a versioned tag from branch/tag selector.

Ecosystem
---------

[](#ecosystem)

- [Backup Maker](https://github.com/riotkit-org/br-backup-maker): Uploading &amp; Downloading backups with automated GPG encryption support. CLI client + BMG (Backup Maker procedures Generator) for generating customizable Backup &amp; Restore procedures.
- [RKC](https://github.com/riotkit-org/rkc): Part of `Space Harbor` project, contains CLI integration of `Space Harbor` K8s cluster with Backup Repository
- [PGBR](https://github.com/riotkit-org/br-pgbr): PostgreSQL helpers to be used with `BackupMaker` for reliable backups using native mechanism of dump &amp; restore

Find more projects in the [Github Community](https://github.com/topics/backup-repository).

Security
--------

[](#security)

- For authentication JSON Web Token was used
- Tokens are long-term due to usage nature
- Support for scoped JSON Web Tokens (a single requested token can have restricted permissions to perform less than defined in User profile)
- User can have multiple username &amp; passwords pairs, each one with additional restrictions (e.g. username `mycluster$collection1` -&gt; only uploads to collection1, username `mycluster$collection2` -&gt; only uploads to collection2)
- All JWT's can be revoked anytime. There is a list of generated tokens stored in configuration (only sha256 shortcuts)
- Passwords are encoded with `argon2di` (winner of the 2015 Password Hashing Competition, recommended by OWASP)
- All objects are managed by RBAC (Role Based Access Control) and ACL (Access Control Lists)
- Server works on `uid=65532`, [non-root container](https://kubesec.io/basics/containers-securitycontext-runasnonroot-true/)
- There is a separate [ServiceAccount](https://kubesec.io/basics/service-accounts/) using namespace-scoped roles
- We use [distroless](https://github.com/GoogleContainerTools/distroless) images
- By default, we set [requests and limits](https://kubesec.io/basics/containers-resources-limits-memory/) for `kind: Pod` in Kubernetes
- Built-in simple Request Rate limiter to protect against DoS attacks on application side (Note: The limit is PER application instance. [For more advanced limiting please configure your reverse-proxy properly](http://nginx.org/en/docs/http/ngx_http_limit_req_module.html))
- Each `BackupUser` can be optionally restricted to connect only from allowed IP addresses

```
Argon2Config{
    time:    1,
    memory:  64 * 1024,
    threads: 4,
    keyLen:  32,
}
```

### RBAC

[](#rbac)

Objects of type `kind: BackupUser` (users that can login to Backup Repository server) have a list of global roles. Global roles are granting access to all objects of given type in the system.

If somebody has a `collectionManager` in its profile, then in all collections that person is a manager which means browsing, deleting, editing, creating.

```
---
apiVersion: backups.riotkit.org/v1alpha1
kind: BackupUser
# ...
spec:
    # ...
    roles:
        - collectionManager
```

#### Scoped RBAC

[](#scoped-rbac)

Most of the object types implements `accessControl` to specify permissions for given users in scope of this object.

```
---
apiVersion: backups.riotkit.org/v1alpha1
kind: BackupCollection
# ...
spec:
    # ...
    accessControl:
        - name: admin
          roles:
              - collectionManager
```

#### RBAC in code

[](#rbac-in-code)

Domain objects should implement a logic that checks given `Actor` if it can act specifically in context of this object.

```
func (u User) CanViewMyProfile(actor User) bool {
	// rbac
	if actor.GetRoles().HasRole(security.RoleUserManager) {
		return true
	}

	// user can view self info
	return u.Spec.Email == actor.Spec.Email
}
```

#### ACL in code

[](#acl-in-code)

```
func (c Collection) CanUploadToMe(user *users.User) bool {
	if user.GetRoles().HasRole(security.RoleBackupUploader) {
		return true
	}

	for _, permitted := range c.Spec.AccessControl {
		if permitted.UserName == user.Metadata.Name && permitted.Roles.HasRole(security.RoleBackupUploader) {
			return true
		}
	}

	return false
}
```

#### Backup Windows

[](#backup-windows)

Good practice is to **limit how often versions can be submitted**. Attacker would need to be very patient to overwrite your past backups with malicious ones.

In emergency cases `System Administrator` or person with `uploadsAnytime` role can upload backups between backup windows. Be careful! Do not set up automated backups with administrator account or with account that has `uploadsAnytime` role.

```
---
apiVersion: backups.riotkit.org/v1alpha1
kind: BackupCollection
# ...
spec:
    # ...
    window:
        # allow to send backups only everyday starting from 00:30 to 01:30
        - from: "00 30 * * *"
          duration: 1h
```

Quota
-----

[](#quota)

`System administrator` can create a collection with specified storage limits on single file, whole collection, select a rotation strategy.

Concept is simple - there can be stored X versions of Y size in given collection.

Additionally, there is such thing as `extra space` which allows to upload a file that exceeds the limit to not break the backup pipeline. Such situation is immediately reported in a collection health check as a warning.

```
---
apiVersion: backups.riotkit.org/v1alpha1
kind: BackupCollection
# ...
spec:
    # ...
    maxBackupsCount: 5
    maxOneVersionSize: 1M
    maxCollectionSize: 5M
```

### Extra space

[](#extra-space)

The following example allows uploading files of 1 MB size normally, but optionally allows uploading larger files that could in summary take additional 5MB. For example one of uploaded versions can be a 5MB file, or there could be two versions of 2,5MB file each - both exceeding the soft limit of `maxOneVersionSize`. The `maxCollectionSize` is a hard limit.

```
maxBackupsCount = 5
maxOneVersionSize = 1MB
maxCollectionSize = 10MB

estimatedCollectionSize = maxBackupsCount * maxOneVersionSize = 5 * 1MB = 5MB
extraSpace = maxCollectionSize - estimatedCollectionSize = 10MB - 5MB
```

```
---
apiVersion: backups.riotkit.org/v1alpha1
kind: BackupCollection
# ...
spec:
    # ...
    maxBackupsCount: 5
    maxOneVersionSize: 1M
    maxCollectionSize: 10M
```

### Rotation

[](#rotation)

Rotation Strategies gives control over backup versioning.

#### `fifo`

[](#fifo)

First in first out. When adding a new version deletes oldest.

```
---
apiVersion: backups.riotkit.org/v1alpha1
kind: BackupCollection
# ...
spec:
    # ...
    strategyName: fifo
```

[Contributing](./CONTRIBUTING.md)
---------------------------------

[](#contributing)

This software is developed with [GoLand](https://www.jetbrains.com/go/) licensed for open source development. Special thanks for the support.

[Security policy](./SECURITY.md)
--------------------------------

[](#security-policy)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 97.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~200 days

Recently: every ~53 days

Total

6

Last Release

2377d ago

Major Versions

v1.1 → v2.0.32019-04-12

PHP version history (2 changes)v1.1PHP &gt;=7.0

v2.0.3PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/9bcf126fe030a49d883299ee4d99f7b9c67ffa348baf329117df9bb850ceccdc?d=identicon)[blackandred](/maintainers/blackandred)

---

Top Contributors

[![blackandred](https://avatars.githubusercontent.com/u/22807686?v=4)](https://github.com/blackandred "blackandred (1546 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (23 commits)")[![Gounlaf](https://avatars.githubusercontent.com/u/236413?v=4)](https://github.com/Gounlaf "Gounlaf (17 commits)")

---

Tags

amazon-s3anarchistbackupbackup-repositorygolangimagek3skuberneteslightweightmicroserviceminioopenshiftrepositoryriotkits3servicestoragestorage-api

### Embed Badge

![Health badge](/badges/wolnosciowiec-wolnosciowiec-image-repository/health.svg)

```
[![Health](https://phpackages.com/badges/wolnosciowiec-wolnosciowiec-image-repository/health.svg)](https://phpackages.com/packages/wolnosciowiec-wolnosciowiec-image-repository)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[ibexa/oss

A meta package for installing Ibexa Open Source

19772.4k11](/packages/ibexa-oss)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
