Skip to content

Commit

Permalink
refactor: rename to pobj
Browse files Browse the repository at this point in the history
  • Loading branch information
neurosnap committed Feb 17, 2024
1 parent d098aff commit c7b03ae
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
with:
file: ./Dockerfile
push: true
tags: ghcr.io/picosh/objx/objx:latest
tags: ghcr.io/picosh/pobj/pobj:latest
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# objx
# pobj

`rsync`, `scp`, `sftp` for your object store. No extra front-end CLI tools
necessary, use what you already have installed.
Expand All @@ -7,11 +7,11 @@ necessary, use what you already have installed.

Currently support object stores:

- [filesystem](https://github.com/picosh/objx/blob/9e920bd907fca88ad90a300b02254464e3f598fb/storage/fs.go#L1)
- [minio](https://github.com/picosh/objx/blob/9e920bd907fca88ad90a300b02254464e3f598fb/storage/minio.go#L1)
- [filesystem](https://github.com/picosh/pobj/blob/9e920bd907fca88ad90a300b02254464e3f598fb/storage/fs.go#L1)
- [minio](https://github.com/picosh/pobj/blob/9e920bd907fca88ad90a300b02254464e3f598fb/storage/minio.go#L1)

We provide an
[interface](https://github.com/picosh/objx/blob/9e920bd907fca88ad90a300b02254464e3f598fb/storage/storage.go#L1)
[interface](https://github.com/picosh/pobj/blob/9e920bd907fca88ad90a300b02254464e3f598fb/storage/storage.go#L1)
to build your own.

We plan on slowly building more object storage interfaces but this is all we use
Expand Down Expand Up @@ -46,9 +46,9 @@ scp -P 2222 -r ./files mybucket@localhost:/
# docker

```
ghcr.io/picosh/objx/objx:latest
ghcr.io/picosh/pobj/pobj:latest
```

We also have a
[docker compose file](https://github.com/picosh/objx/blob/305f252057d73d69a15b03cdf364596040f3735d/docker-compose.yml#L1)
[docker compose file](https://github.com/picosh/pobj/blob/305f252057d73d69a15b03cdf364596040f3735d/docker-compose.yml#L1)
which uses `minio`
2 changes: 1 addition & 1 deletion asset.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package objx
package pobj

import "github.com/picosh/send/send/utils"

Expand Down
16 changes: 8 additions & 8 deletions cmd/authorized_keys/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,33 @@ import (
"time"

"github.com/charmbracelet/wish"
"github.com/picosh/objx"
"github.com/picosh/pobj"
)

func main() {
logger := slog.Default()
host := objx.GetEnv("SSH_HOST", "0.0.0.0")
port := objx.GetEnv("SSH_PORT", "2222")
keyPath := objx.GetEnv("SSH_AUTHORIZED_KEYS", "ssh_data/authorized_keys")
host := pobj.GetEnv("SSH_HOST", "0.0.0.0")
port := pobj.GetEnv("SSH_PORT", "2222")
keyPath := pobj.GetEnv("SSH_AUTHORIZED_KEYS", "ssh_data/authorized_keys")

st, err := objx.EnvDriverDetector(logger)
st, err := pobj.EnvDriverDetector(logger)
if err != nil {
logger.Error(err.Error())
return
}

cfg := &objx.Config{
cfg := &pobj.Config{
Logger: logger,
Storage: st,
}

handler := objx.NewUploadAssetHandler(cfg)
handler := pobj.NewUploadAssetHandler(cfg)

s, err := wish.NewServer(
wish.WithAddress(fmt.Sprintf("%s:%s", host, port)),
wish.WithHostKeyPath("ssh_data/term_info_ed25519"),
wish.WithAuthorizedKeys(keyPath),
objx.WithProxy(handler),
pobj.WithProxy(handler),
)
if err != nil {
logger.Error(err.Error())
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/picosh/objx
module github.com/picosh/pobj

go 1.22.0

Expand Down
4 changes: 2 additions & 2 deletions handler.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package objx
package pobj

import (
"bytes"
Expand All @@ -11,7 +11,7 @@ import (
"time"

"github.com/charmbracelet/ssh"
"github.com/picosh/objx/storage"
"github.com/picosh/pobj/storage"
"github.com/picosh/send/send/utils"
)

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package objx
package pobj

import (
"github.com/charmbracelet/ssh"
Expand Down
2 changes: 1 addition & 1 deletion reader.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package objx
package pobj

import (
"errors"
Expand Down
4 changes: 2 additions & 2 deletions util.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package objx
package pobj

import (
"log/slog"
"os"

"github.com/picosh/objx/storage"
"github.com/picosh/pobj/storage"
)

func GetEnv(key string, defaultVal string) string {
Expand Down

0 comments on commit c7b03ae

Please sign in to comment.