Skip to content

Commit

Permalink
refactor: Update dependencies, modernize Hydrun build systems, CI/CD …
Browse files Browse the repository at this point in the history
…and README conventions

Signed-off-by: Felicitas Pojtinger <[email protected]>
  • Loading branch information
pojntfx committed Jul 30, 2024
1 parent f3fbd31 commit 3aff00b
Show file tree
Hide file tree
Showing 14 changed files with 522 additions and 553 deletions.
59 changes: 34 additions & 25 deletions .github/workflows/hydrun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,31 @@ on:
schedule:
- cron: "0 0 * * 0"

permissions:
contents: write

jobs:
build-linux:
runs-on: ubuntu-latest
runs-on: ${{ matrix.target.runner }}
permissions:
contents: read
strategy:
matrix:
target:
# Tests
- id: test
src: .
os: golang:bookworm
flags: ""
flags: -e '-v /tmp/ccache:/root/.cache/go-build'
cmd: GOFLAGS="-short" ./Hydrunfile test
dst: out/nonexistent
- id: go-stfs
runner: ubuntu-latest

# Binaries
- id: go.stfs
src: .
os: golang:bookworm
flags: ""
flags: -e '-v /tmp/ccache:/root/.cache/go-build'
cmd: ./Hydrunfile go stfs
dst: out/*
# Disabled until `gccgo` supports generics/Go 1.21: https://go.dev/doc/install/gccgo
# - id: gccgo-stfs
# src: .
# os: ghcr.io/pojntfx/bagccgop-base-sid
# flags: -e '--privileged'
# cmd: ./Hydrunfile gccgo stfs
# dst: out/*
runner: ubuntu-latest

steps:
- name: Maximize build space
Expand All @@ -42,11 +39,17 @@ jobs:
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Restore ccache
uses: actions/cache/restore@v4
with:
path: |
/tmp/ccache
key: cache-ccache-${{ matrix.target.id }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Set up hydrun
run: |
curl -L -o /tmp/hydrun "https://github.com/pojntfx/hydrun/releases/latest/download/hydrun.linux-$(uname -m)"
Expand All @@ -56,40 +59,46 @@ jobs:
run: hydrun -o ${{ matrix.target.os }} ${{ matrix.target.flags }} "${{ matrix.target.cmd }}"
- name: Fix permissions for output
run: sudo chown -R $USER .
- name: Save ccache
uses: actions/cache/save@v4
with:
path: |
/tmp/ccache
key: cache-ccache-${{ matrix.target.id }}
- name: Upload output
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target.id }}
path: ${{ matrix.target.dst }}

publish-linux:
runs-on: ubuntu-latest
permissions:
contents: write
needs: build-linux

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Download output
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
path: /tmp/out
- name: Extract branch name
id: extract_branch
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
- name: Publish pre-release to GitHub releases
if: ${{ github.ref == 'refs/heads/main' }}
uses: marvinpinto/action-automatic-releases@latest
uses: softprops/action-gh-release@v2
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: release-${{ steps.extract_branch.outputs.branch }}
tag_name: release-${{ steps.extract_branch.outputs.branch }}
prerelease: true
files: |
/tmp/out/*/*
- name: Publish release to GitHub releases
if: startsWith(github.ref, 'refs/tags/v')
uses: marvinpinto/action-automatic-releases@latest
uses: softprops/action-gh-release@v2
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
/tmp/out/*/*
19 changes: 0 additions & 19 deletions Hydrunfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,3 @@ if [ "$1" = "go" ]; then

exit 0
fi

# gccgo
if [ "$1" = "gccgo" ]; then
# Install native dependencies
apt update
apt install -y curl git

# Install bagccgop
curl -L -o /tmp/bagccgop "https://github.com/pojntfx/bagccgop/releases/latest/download/bagccgop.linux-$(uname -m)"
install /tmp/bagccgop /usr/local/bin

# Configure Git
git config --global --add safe.directory '*'

# Build
GOFLAGS='-gccgoflags=-static' bagccgop -x '(linux/alpha|linux/mipsle|linux/arm$|linux/arm64|linux/386|linux/amd64|linux/s390x)' -j1 -b "$2" -n -r 'make depend' -s 'build-essential,automake' -m 'libsqlite3-dev' -p 'make build/stfs DST=$DST' -d out

exit 0
fi
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@

Simple Tape File System (STFS), a file system for tapes and tar files.

⚠️ STFS has not yet been audited! While we try to make it as secure as possible, it has not yet undergone a formal security audit by a third party. Please keep this in mind if you use it for security-critical applications. ⚠️

[![hydrun CI](https://github.com/pojntfx/stfs/actions/workflows/hydrun.yaml/badge.svg)](https://github.com/pojntfx/stfs/actions/workflows/hydrun.yaml)
![Go Version](https://img.shields.io/badge/go%20version-%3E=1.17-61CFDD.svg)
![Go Version](https://img.shields.io/badge/go%20version-%3E=1.21-61CFDD.svg)
[![Go Reference](https://pkg.go.dev/badge/github.com/pojntfx/stfs.svg)](https://pkg.go.dev/github.com/pojntfx/stfs)
[![Matrix](https://img.shields.io/matrix/stfs:matrix.org)](https://matrix.to/#/#stfs:matrix.org?via=matrix.org)

## Overview

STFS is a filesystem that brings tapes and tar files into the 21st century.

It enables you too ...
It enables you to:

- **Use a tape or tar file like a regular disk**: STFS uses the robust `tar` format and tape technology to provide a fully features filesystem. This makes such storage solutions much for accessible and manageable, while also significantly increasing the performance of everyday operations such as listing and searching for files by using a SQLite-based on-disk index.
- **Archive data securely**: The integrated transparent, asymmetrical encryption and signature support makes it possible to use almost any tape as a regulations compliant storage medium, while still being able to take advantage of all the benefits of tapes like reduced cost and increased reliability.
Expand All @@ -39,9 +37,17 @@ $ curl -L -o /tmp/stfs "https://github.com/pojntfx/stfs/releases/latest/download
$ sudo install /tmp/stfs /usr/local/bin
```

On Windows, the following should work (using PowerShell as administrator):

```shell
PS> Invoke-WebRequest https://github.com/pojntfx/stfs/releases/latest/download/stfs.windows-x86_64.exe -OutFile \Windows\System32\stfs.exe
```

Note that only the Linux version supports reading from tape drives; macOS and Windows are limited to operating on tar files.

You can find binaries for more operating systems and architectures on [GitHub releases](https://github.com/pojntfx/stfs/releases).

## Usage
## Tutorial

> Please note that this is only a short overview and does not explain all configuration options. To get more info on available commands or options, use `--help`.
Expand Down Expand Up @@ -613,6 +619,6 @@ Have any questions or need help? Chat with us [on Matrix](https://matrix.to/#/#s
## License
STFS (c) 2023 Felicitas Pojtinger and contributors
STFS (c) 2024 Felicitas Pojtinger and contributors
SPDX-License-Identifier: AGPL-3.0
4 changes: 4 additions & 0 deletions examples/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ func (l Logger) Error(event string, keyvals ...interface{}) {
l.log("ERROR", event, keyvals)
}

func (l Logger) Panic(event string, keyvals ...interface{}) {
l.log("PANIC", event, keyvals)
}

func (l Logger) With(keyvals ...interface{}) golog.Logger {
return l
}
110 changes: 56 additions & 54 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,71 +1,73 @@
module github.com/pojntfx/stfs

go 1.17
go 1.21

toolchain go1.22.5

require (
aead.dev/minisign v0.2.0
filippo.io/age v1.0.0
github.com/ProtonMail/go-crypto v0.0.0-20211112122917-428f8eabeeb3
github.com/ProtonMail/gopenpgp/v2 v2.3.1
github.com/andybalholm/brotli v1.0.4
github.com/cosnicolaou/pbzip2 v1.0.1
aead.dev/minisign v0.3.0
filippo.io/age v1.2.0
github.com/ProtonMail/go-crypto v1.0.0
github.com/ProtonMail/gopenpgp/v2 v2.7.5
github.com/andybalholm/brotli v1.1.0
github.com/cosnicolaou/pbzip2 v1.0.3
github.com/dsnet/compress v0.0.1
github.com/fclairamb/ftpserverlib v0.16.0
github.com/fclairamb/go-log v0.1.0
github.com/fclairamb/ftpserverlib v0.24.1
github.com/fclairamb/go-log v0.5.0
github.com/friendsofgo/errors v0.9.2
github.com/klauspost/compress v1.13.6
github.com/klauspost/pgzip v1.2.5
github.com/klauspost/compress v1.17.9
github.com/klauspost/pgzip v1.2.6
github.com/mattetti/filebuffer v1.0.1
github.com/mattn/go-sqlite3 v1.14.9
github.com/pierrec/lz4/v4 v4.1.12
github.com/rubenv/sql-migrate v0.0.0-20211023115951-9f02b1e13857
github.com/spf13/afero v1.8.0
github.com/spf13/cobra v1.3.0
github.com/spf13/viper v1.10.1
github.com/mattn/go-sqlite3 v1.14.22
github.com/pierrec/lz4/v4 v4.1.21
github.com/rubenv/sql-migrate v1.7.0
github.com/spf13/afero v1.11.0
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
github.com/volatiletech/null/v8 v8.1.2
github.com/volatiletech/sqlboiler/v4 v4.8.3
github.com/volatiletech/strmangle v0.0.1
modernc.org/sqlite v1.14.3
github.com/volatiletech/sqlboiler/v4 v4.16.2
github.com/volatiletech/strmangle v0.0.6
modernc.org/sqlite v1.31.1
)

require (
github.com/ProtonMail/go-mime v0.0.0-20190923161245-9b5a4261663a // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/gofrs/uuid v3.2.0+incompatible // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f // indirect
github.com/cloudflare/circl v1.3.9 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-gorp/gorp/v3 v3.1.0 // indirect
github.com/gofrs/uuid v4.4.0+incompatible // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/sagikazarmark/locafero v0.6.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/volatiletech/inflect v0.0.1 // indirect
github.com/volatiletech/randomize v0.0.1 // indirect
github.com/ziutek/mymysql v1.5.4 // indirect
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa // indirect
golang.org/x/mod v0.5.0 // indirect
golang.org/x/sys v0.0.0-20211210111614-af8b64212486 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.5 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gopkg.in/gorp.v1 v1.7.2 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
lukechampine.com/uint128 v1.1.1 // indirect
modernc.org/cc/v3 v3.35.18 // indirect
modernc.org/ccgo/v3 v3.12.95 // indirect
modernc.org/libc v1.11.104 // indirect
modernc.org/mathutil v1.4.1 // indirect
modernc.org/memory v1.0.5 // indirect
modernc.org/opt v0.1.1 // indirect
modernc.org/strutil v1.1.1 // indirect
modernc.org/token v1.0.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
modernc.org/gc/v3 v3.0.0-20240722195230-4a140ff9c08e // indirect
modernc.org/libc v1.55.6 // indirect
modernc.org/mathutil v1.6.0 // indirect
modernc.org/memory v1.8.0 // indirect
modernc.org/strutil v1.2.0 // indirect
modernc.org/token v1.1.0 // indirect
)
Loading

0 comments on commit 3aff00b

Please sign in to comment.