Skip to content

Commit

Permalink
Migrate to Microbox names/namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
danhunsaker committed Apr 19, 2022
1 parent 8df58c2 commit 6563236
Show file tree
Hide file tree
Showing 17 changed files with 984 additions and 39 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI
on:
- push

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch:
- x86
- x86_64
- armhf
- armv7
- aarch64
- ppc64le
- s390x
steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Expose Latest QEMU
run: sudo add-apt-repository ppa:savoury1/virtualisation

- name: Setup Alpine chroot
run: |
wget https://raw.githubusercontent.com/alpinelinux/alpine-chroot-install/v0.13.3/alpine-chroot-install \
&& echo 'c3005e323029637db20ec9595243ac94bb9b2226 alpine-chroot-install' | sha1sum -c \
|| exit 1
chmod +x alpine-chroot-install
sudo ./alpine-chroot-install -a ${{ matrix.arch }} -i $(pwd)
/alpine/enter-chroot apk add abuild
/alpine/enter-chroot addgroup ${USER} abuild
echo "${{ secrets.ABUILD_ARCHIVE }}" | \
base64 -d | \
/alpine/enter-chroot -u ${USER} tar xzv -C ~/
- name: Build Package
run: /alpine/enter-chroot -u ${USER} abuild -r -c -P /tmp/

- name: Clean Up
run: |
mv /alpine/tmp/hoarder/${{ matrix.arch }}/hoarder-*.apk hoarder-${{ matrix.arch }}.apk
/alpine/destroy --remove
- name: Upload As Artifact
uses: actions/upload-artifact@v2
with:
name: hoarder-${{ matrix.arch }}.apk
path: hoarder-${{ matrix.arch }}.apk
retention-days: 5

- name: Upload To Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: hoarder-${{ matrix.arch }}.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ language: go
go:
- 1.6

go_import_path: github.com/nanopack/hoarder
go_import_path: github.com/mu-box/hoarder
install: go get -t -v .
script: go test -v ./...
33 changes: 33 additions & 0 deletions APKBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Contributor: Hennik Hunsaker <[email protected]>
# Maintainer: Hennik Hunsaker <[email protected]>
pkgname=hoarder
pkgver=0.2.3
pkgrel=0
pkgdesc="A simple, api-driven storage system for storing code builds and cached libraries for cloud-based deployment services."
url="https://github.com/mu-box/hoarder"
arch="all"
license="MIT"
depends=""
makedepends="go git bash"
checkdepends=""
install=""
subpackages=""
source=""
srcdir="/tmp/abuild/hoarder"
builddir=""

build() {
go get -t -v .
go install github.com/mitchellh/gox@latest
export PATH="$(go env | grep GOPATH | sed -E 's/GOPATH="(.*)"/\1/')/bin:${PATH}"
./scripts/build.sh
}

check() {
# Replace with proper check command(s)
:
}

package() {
install -m 0755 -D ./build/hoarder "$pkgdir"/sbin/hoarder
}
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Hoarder

[![Build Status](https://travis-ci.org/nanopack/hoarder.svg)](https://travis-ci.org/nanopack/hoarder)
[![GoDoc](https://godoc.org/github.com/nanopack/hoarder?status.svg)](https://godoc.org/github.com/nanopack/hoarder)
[![hoarder logo](http://assets.microbox.rocks/readme-headers/hoarder.png)](http://microbox.cloud/open-source#hoarder)
[![Build Status](https://travis-ci.org/mu-box/hoarder.svg)](https://travis-ci.org/mu-box/hoarder)
[![GoDoc](https://godoc.org/github.com/mu-box/hoarder?status.svg)](https://godoc.org/github.com/mu-box/hoarder)

Hoarder is a simple, api-driven, storage system for storing anything for cloud based deployment services.

Expand Down Expand Up @@ -137,12 +136,12 @@ $ curl -k https://localhost:7410/blobs/test -d "some string"
```

##### JSON
``` json
```
$ curl -k https://localhost:7410/blobs/test -d "{\"key\":\"value\"}"
```

When it retrieves data it might look like the following:
```
```json
{
"Name": "test",
"Size": 4,
Expand All @@ -154,6 +153,6 @@ When it retrieves data it might look like the following:

## Contributing

Contributions to hoarder are welcome and encouraged. Hoarder is a [Nanobox](https://nanobox.io) project and contributions should follow the [Nanobox Contribution Process & Guidelines](https://docs.nanobox.io/contributing/).
Contributions to hoarder are welcome and encouraged. Hoarder is a [Microbox](https://microbox.cloud) project and contributions should follow the [Microbox Contribution Process & Guidelines](https://docs.microbox.cloud/contributing/).

[![open source](http://nano-assets.gopagoda.io/open-src/nanobox-open-src.png)](http://nanobox.io/open-source)
[![open source](http://assets.microbox.rocks/open-src/microbox-open-src.png)](http://microbox.cloud/open-source)
8 changes: 4 additions & 4 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/gorilla/pat"
"github.com/jcelliott/lumber"
nanoauth "github.com/nanobox-io/golang-nanoauth"
microauth "github.com/mu-box/golang-microauth"
"github.com/spf13/viper"
)

Expand All @@ -21,17 +21,17 @@ func Start() error {
}

// blocking...
nanoauth.DefaultAuth.Header = "X-AUTH-TOKEN"
microauth.DefaultAuth.Header = "X-AUTH-TOKEN"

// listen http (with auth support)
if uri.Scheme == "http" {
lumber.Info("Starting hoarder server at 'http://%s'...", uri.Host)
return nanoauth.ListenAndServe(uri.Host, viper.GetString("token"), routes(), "/ping")
return microauth.ListenAndServe(uri.Host, viper.GetString("token"), routes(), "/ping")
}

// listen https
lumber.Info("Starting secure hoarder server at 'https://%s'...", uri.Host)
return nanoauth.ListenAndServeTLS(uri.Host, viper.GetString("token"), routes(), "/ping")
return microauth.ListenAndServeTLS(uri.Host, viper.GetString("token"), routes(), "/ping")
}

// routes registers all api routes with the router
Expand Down
4 changes: 2 additions & 2 deletions api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/jcelliott/lumber"
"github.com/spf13/viper"

"github.com/nanopack/hoarder/api"
"github.com/nanopack/hoarder/backends"
"github.com/mu-box/hoarder/api"
"github.com/mu-box/hoarder/backends"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion api/blobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/jcelliott/lumber"

"github.com/nanopack/hoarder/backends"
"github.com/mu-box/hoarder/backends"
)

// get returns the data corresponding to specified key
Expand Down
2 changes: 1 addition & 1 deletion backends/backends.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func Initialize() error {
// driver = &Postgres{Path: u.Path}
default:
return fmt.Errorf(`
Unrecognized scheme '%s'. You can visit https://github.com/nanopack/hoarder and
Unrecognized scheme '%s'. You can visit https://github.com/mu-box/hoarder and
submit a pull request adding the scheme or you can submit an issue requesting its
addition.
`, u.Scheme)
Expand Down
2 changes: 1 addition & 1 deletion backends/filesystem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/spf13/viper"

"github.com/nanopack/hoarder/backends"
"github.com/mu-box/hoarder/backends"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/jcelliott/lumber"
"github.com/spf13/viper"

"github.com/nanopack/hoarder/backends"
"github.com/mu-box/hoarder/backends"
)

// garbage collection will have this many seconds before consistancy
Expand Down
8 changes: 4 additions & 4 deletions commands/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![hoarder logo](http://nano-assets.gopagoda.io/readme-headers/hoarder.png)](http://nanobox.io/open-source#hoarder)
[![Build Status](https://travis-ci.org/nanopack/hoarder.svg)](https://travis-ci.org/nanopack/hoarder)
[![GoDoc](https://godoc.org/github.com/nanopack/hoarder?status.svg)](https://godoc.org/github.com/nanopack/hoarder)
[![hoarder logo](http://assets.microbox.rocks/readme-headers/hoarder.png)](http://microbox.cloud/open-source#hoarder)
[![Build Status](https://travis-ci.org/mu-box/hoarder.svg)](https://travis-ci.org/mu-box/hoarder)
[![GoDoc](https://godoc.org/github.com/mu-box/hoarder?status.svg)](https://godoc.org/github.com/mu-box/hoarder)

# Hoarder

Expand Down Expand Up @@ -123,4 +123,4 @@ $ hoarder update -k small-file -d 'eliftset'
# 'small-file' created!
```

[![opensource logo](http://nano-assets.gopagoda.io/open-src/nanobox-open-src.png)](http://nanobox.io/open-source)
[![opensource logo](http://assets.microbox.rocks/open-src/microbox-open-src.png)](http://microbox.cloud/open-source)
6 changes: 3 additions & 3 deletions commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/nanopack/hoarder/api"
"github.com/nanopack/hoarder/backends"
"github.com/nanopack/hoarder/collector"
"github.com/mu-box/hoarder/api"
"github.com/mu-box/hoarder/backends"
"github.com/mu-box/hoarder/collector"
)

var (
Expand Down
35 changes: 35 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module github.com/mu-box/hoarder

go 1.17

require (
github.com/gorilla/context v1.1.1 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/pat v1.0.1
github.com/jcelliott/lumber v0.0.0-20160324203708-dd349441af25
github.com/mu-box/golang-microauth v0.0.0-20220418115140-a7200e5d2be7
github.com/spf13/cobra v1.4.0
github.com/spf13/viper v1.11.0
)

require (
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/kr/pretty v0.2.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
Loading

0 comments on commit 6563236

Please sign in to comment.