mirror of
https://git.numenor-labs.us/dsfx.git
synced 2025-04-29 08:10:34 +00:00
feat(project): switch go modules
This commit is contained in:
parent
159ec353ff
commit
eb2b596f77
@ -4,15 +4,15 @@
|
|||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
- [dsfx standard docs](https://koti.casa/numenor-labs/dsfx/src/branch/main/docs/README.md)
|
- [dsfx standard docs](./docs/README.md)
|
||||||
|
|
||||||
## Start
|
## Start
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Run a server
|
# Run a server
|
||||||
go run koti.casa/numenor-labs/dsfx/cmd/dsfx@main
|
go run numenor-labs.us/dsfx/cmd/dsfx@main
|
||||||
# serving: dsfx://0.0.0.0:8000#<ed25519_public_key>
|
# serving: dsfx://0.0.0.0:8000#<ed25519_public_key>
|
||||||
|
|
||||||
# Get the client
|
# Get the client
|
||||||
go run koti.casa/numenor-labs/dsfx/cmd/dsfxctl@main test dsfx://0.0.0.0:8000#<ed25519_public_key>
|
go run numenor-labs.us/dsfx/cmd/dsfxctl@main test dsfx://0.0.0.0:8000#<ed25519_public_key>
|
||||||
```
|
```
|
||||||
|
@ -3,9 +3,9 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/disk"
|
"numenor-labs.us/dsfx/internal/lib/disk"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/system"
|
"numenor-labs.us/dsfx/internal/lib/system"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/peer"
|
"numenor-labs.us/dsfx/internal/peer"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -3,9 +3,9 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/internal/client"
|
"numenor-labs.us/dsfx/internal/client"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/disk"
|
"numenor-labs.us/dsfx/internal/lib/disk"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/system"
|
"numenor-labs.us/dsfx/internal/lib/system"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# DSFX Internals
|
# DSFX Internals
|
||||||
|
|
||||||
Welcome, friend! You are viewing the DSFX internal documentation. If you want to _use_
|
Welcome, friend! You are viewing the DSFX internal documentation. If you want to _use_
|
||||||
DSFX, you don't need to read this and could head straight to our user-level docs [here](https://koti.casa/numenor-labs/dsfx/src/branch/main/docs/README.md).
|
DSFX, you don't need to read this and could head straight to our user-level docs [here](../README.md).
|
||||||
|
|
||||||
If you want to learn how DSFX works inside, here's what we got:
|
If you want to learn how DSFX works inside, here's what we got:
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ server on your deployment machine.
|
|||||||
If you opted to _not_ install dsfx locally, then you can run it directly with the go toolchain.
|
If you opted to _not_ install dsfx locally, then you can run it directly with the go toolchain.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go run koti.casa/numenor-labs/dsfx/cmd/dsfx@main
|
go run numenor-labs.us/dsfx/cmd/dsfx@main
|
||||||
```
|
```
|
||||||
|
|
||||||
Otherwise, you can run the server with the `dsfx` command. For those who built
|
Otherwise, you can run the server with the `dsfx` command. For those who built
|
||||||
|
@ -38,42 +38,13 @@ are a few commands for various operating systems (not comprehensive):
|
|||||||
If the above commands don't work for you, please refer to the official
|
If the above commands don't work for you, please refer to the official
|
||||||
documentation for your operating system.
|
documentation for your operating system.
|
||||||
|
|
||||||
### Git Setup
|
|
||||||
|
|
||||||
Currently we are hosted on **gitea cloud**, which hides everything from the
|
|
||||||
public internet by default. This means that the machine you are deploying to
|
|
||||||
will need to be able to access the gitea cloud instance. One way to do this is
|
|
||||||
to use the `.netrc` file in conjunction with a personal access token. Once you
|
|
||||||
have a personal access token, you can create a `.netrc` file in your home
|
|
||||||
directory with the following contents:
|
|
||||||
|
|
||||||
```plaintext
|
|
||||||
machine koti.casa login <your username> password <gitea personal access token>
|
|
||||||
```
|
|
||||||
|
|
||||||
Finally, you'll need to set the `GOPRIVATE` environment variable to allow go to fetch
|
|
||||||
private repositories. You can do this by running the following command:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
export GOPRIVATE=koti.casa
|
|
||||||
```
|
|
||||||
|
|
||||||
If you want to persist this setting across sessions, you can add the above line to your
|
|
||||||
`~/.bashrc` or `~/.bash_profile`.
|
|
||||||
|
|
||||||
### Stopping Point
|
|
||||||
|
|
||||||
At this point, you should have the go toolchain installed and configured. If you
|
|
||||||
only want to run the server, and you don't care to actually install it, you can
|
|
||||||
you can skip directly the [deploying docs](./deploying.md).
|
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
|
||||||
Now that you have the go toolchain set up with access to our repository, you can simply install the
|
Now that you have the go toolchain set up with access to our repository, you can simply install the
|
||||||
project by using the `go install` command.
|
project by using the `go install` command.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go install koti.casa/numenorlabs/dsfx/cmd/dsfx@main
|
go install numenor-labs.us/dsfx/cmd/dsfx@main
|
||||||
```
|
```
|
||||||
|
|
||||||
Assuming that you have the `GOPATH` environment variable set up correctly, you will now be able to
|
Assuming that you have the `GOPATH` environment variable set up correctly, you will now be able to
|
||||||
|
2
go.mod
2
go.mod
@ -1,3 +1,3 @@
|
|||||||
module koti.casa/numenor-labs/dsfx
|
module numenor-labs.us/dsfx
|
||||||
|
|
||||||
go 1.24.1
|
go 1.24.1
|
||||||
|
@ -13,12 +13,12 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/crypto/identity"
|
"numenor-labs.us/dsfx/internal/lib/crypto/identity"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/disk"
|
"numenor-labs.us/dsfx/internal/lib/disk"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/logging"
|
"numenor-labs.us/dsfx/internal/lib/logging"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/network"
|
"numenor-labs.us/dsfx/internal/lib/network"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/storage/scoped"
|
"numenor-labs.us/dsfx/internal/lib/storage/scoped"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/system"
|
"numenor-labs.us/dsfx/internal/lib/system"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/crypto/encryption"
|
"numenor-labs.us/dsfx/internal/lib/crypto/encryption"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestEncryptDecrypt(t *testing.T) {
|
func TestEncryptDecrypt(t *testing.T) {
|
||||||
|
@ -3,7 +3,7 @@ package disk_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/disk"
|
"numenor-labs.us/dsfx/internal/lib/disk"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDefaultDisk(t *testing.T) {
|
func TestDefaultDisk(t *testing.T) {
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/frame"
|
"numenor-labs.us/dsfx/internal/lib/frame"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestLenPrefixedWriteTo(t *testing.T) {
|
func TestLenPrefixedWriteTo(t *testing.T) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
goos: linux
|
goos: linux
|
||||||
goarch: amd64
|
goarch: amd64
|
||||||
pkg: koti.casa/numenor-labs/dsfx/internal/lib/handshake
|
pkg: numenor-labs.us/dsfx/internal/lib/handshake
|
||||||
cpu: Intel(R) Core(TM) Ultra 9 185H
|
cpu: Intel(R) Core(TM) Ultra 9 185H
|
||||||
BenchmarkHandshake 4508 285270 ns/op 12976 B/op 131 allocs/op
|
BenchmarkHandshake 4508 285270 ns/op 12976 B/op 131 allocs/op
|
||||||
PASS
|
PASS
|
||||||
ok koti.casa/numenor-labs/dsfx/internal/lib/handshake 1.291s
|
ok numenor-labs.us/dsfx/internal/lib/handshake 1.291s
|
||||||
|
@ -10,12 +10,12 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/assert"
|
"numenor-labs.us/dsfx/internal/lib/assert"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/buffer"
|
"numenor-labs.us/dsfx/internal/lib/buffer"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/crypto/encryption"
|
"numenor-labs.us/dsfx/internal/lib/crypto/encryption"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/crypto/identity"
|
"numenor-labs.us/dsfx/internal/lib/crypto/identity"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/crypto/keyexchange"
|
"numenor-labs.us/dsfx/internal/lib/crypto/keyexchange"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/logging"
|
"numenor-labs.us/dsfx/internal/lib/logging"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -10,8 +10,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/crypto/identity"
|
"numenor-labs.us/dsfx/internal/lib/crypto/identity"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/handshake"
|
"numenor-labs.us/dsfx/internal/lib/handshake"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestHandshake(t *testing.T) {
|
func TestHandshake(t *testing.T) {
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/crypto/identity"
|
"numenor-labs.us/dsfx/internal/lib/crypto/identity"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -5,8 +5,8 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/crypto/encryption"
|
"numenor-labs.us/dsfx/internal/lib/crypto/encryption"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/frame"
|
"numenor-labs.us/dsfx/internal/lib/frame"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Conn is a wrapper around net.TCPConn that encrypts and decrypts data as it is
|
// Conn is a wrapper around net.TCPConn that encrypts and decrypts data as it is
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"log/slog"
|
"log/slog"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/crypto/identity"
|
"numenor-labs.us/dsfx/internal/lib/crypto/identity"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/handshake"
|
"numenor-labs.us/dsfx/internal/lib/handshake"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Listener ...
|
// Listener ...
|
||||||
|
@ -5,8 +5,8 @@ import (
|
|||||||
"crypto/ed25519"
|
"crypto/ed25519"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/handshake"
|
"numenor-labs.us/dsfx/internal/lib/handshake"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/logging"
|
"numenor-labs.us/dsfx/internal/lib/logging"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Dial ...
|
// Dial ...
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"io/fs"
|
"io/fs"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/disk"
|
"numenor-labs.us/dsfx/internal/lib/disk"
|
||||||
)
|
)
|
||||||
|
|
||||||
// StorageScope is an interface that extends the disk.Disk interface by ensuring
|
// StorageScope is an interface that extends the disk.Disk interface by ensuring
|
||||||
|
@ -4,8 +4,8 @@ import (
|
|||||||
"io/fs"
|
"io/fs"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/disk"
|
"numenor-labs.us/dsfx/internal/lib/disk"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/storage/scoped"
|
"numenor-labs.us/dsfx/internal/lib/storage/scoped"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestScopedStorage_Scope(t *testing.T) {
|
func TestScopedStorage_Scope(t *testing.T) {
|
||||||
|
@ -3,7 +3,7 @@ package system
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/disk"
|
"numenor-labs.us/dsfx/internal/lib/disk"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Default returns a default implementation of the System interface.
|
// Default returns a default implementation of the System interface.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package system
|
package system
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/disk"
|
"numenor-labs.us/dsfx/internal/lib/disk"
|
||||||
)
|
)
|
||||||
|
|
||||||
type System interface {
|
type System interface {
|
||||||
|
@ -13,12 +13,12 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/crypto/identity"
|
"numenor-labs.us/dsfx/internal/lib/crypto/identity"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/disk"
|
"numenor-labs.us/dsfx/internal/lib/disk"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/logging"
|
"numenor-labs.us/dsfx/internal/lib/logging"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/network"
|
"numenor-labs.us/dsfx/internal/lib/network"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/storage/scoped"
|
"numenor-labs.us/dsfx/internal/lib/storage/scoped"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/system"
|
"numenor-labs.us/dsfx/internal/lib/system"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/disk"
|
"numenor-labs.us/dsfx/internal/lib/disk"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Tolerance defines simulation tolerance parameters.
|
// Tolerance defines simulation tolerance parameters.
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/disk"
|
"numenor-labs.us/dsfx/internal/lib/disk"
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/system"
|
"numenor-labs.us/dsfx/internal/lib/system"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SimSystem is a simulated implementation of system.System.
|
// SimSystem is a simulated implementation of system.System.
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"koti.casa/numenor-labs/dsfx/internal/lib/crypto/identity"
|
"numenor-labs.us/dsfx/internal/lib/crypto/identity"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user