Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions build/ctl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -e

CURRENT_DIR="$(pwd)"
SRC_DIR="$CURRENT_DIR/src"

cd "$SRC_DIR"

SOURCE="cmd/ctl/main.go"
OUTPUT="linuxusctl"

go build -o "$CURRENT_DIR/$OUTPUT" "$SOURCE"

cd "$CURRENT_DIR"
File renamed without changes.
3 changes: 0 additions & 3 deletions cfg/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
user_service:
source_dir: src/service
container:
name_prefix: linuxus_user_
network_name_prefix: linuxus_user_net_
Expand Down Expand Up @@ -35,7 +34,6 @@ user_service:
# session_timeout: 3600

auth_service:
source_dir: src/auth
container:
name: linuxus_auth
external_port: 8080
Expand All @@ -56,7 +54,6 @@ auth_service:
allow_signup: true

manager_service:
source_dir: src/manager
container:
name: linuxus_manager
network: linuxus_manager_net
Expand Down
15 changes: 0 additions & 15 deletions ctl/build.sh

This file was deleted.

43 changes: 0 additions & 43 deletions ctl/go.mod

This file was deleted.

2 changes: 1 addition & 1 deletion doc/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin d
Build the control CLI:

```bash
./ctl/build.sh
./build/ctl.sh
```

Generated executable:
Expand Down
5 changes: 0 additions & 5 deletions src/auth/go.mod

This file was deleted.

4 changes: 0 additions & 4 deletions src/auth/go.sum

This file was deleted.

4 changes: 2 additions & 2 deletions src/auth/cmd/main.go → src/cmd/auth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"strings"
"time"

"github.com/elecbug/linuxus/src/auth/internal/handler"
"github.com/elecbug/linuxus/src/auth/internal/user"
"github.com/elecbug/linuxus/src/internal/auth/handler"
"github.com/elecbug/linuxus/src/internal/auth/user"
)

// main loads configuration, registers routes, and starts the auth server.
Expand Down
8 changes: 4 additions & 4 deletions ctl/cmd/main.go → src/cmd/ctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"os"
"path/filepath"

"github.com/elecbug/linuxus/ctl/internal/app"
"github.com/elecbug/linuxus/ctl/internal/cli"
"github.com/elecbug/linuxus/ctl/internal/config"
"github.com/elecbug/linuxus/ctl/internal/format"
"github.com/elecbug/linuxus/src/internal/ctl/app"
"github.com/elecbug/linuxus/src/internal/ctl/cli"
"github.com/elecbug/linuxus/src/internal/ctl/config"
"github.com/elecbug/linuxus/src/internal/ctl/format"
)

// main executes the CLI entrypoint and prints user-friendly errors.
Expand Down
4 changes: 2 additions & 2 deletions src/manager/cmd/main.go → src/cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"strconv"
"time"

"github.com/elecbug/linuxus/src/manager/internal/config"
"github.com/elecbug/linuxus/src/manager/internal/handler"
"github.com/elecbug/linuxus/src/internal/manager/config"
"github.com/elecbug/linuxus/src/internal/manager/handler"
)

// main loads environment configuration and starts the manager server.
Expand Down
2 changes: 1 addition & 1 deletion src/auth/Dockerfile → src/docker/auth.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN go mod download

COPY cmd ./cmd
COPY internal ./internal
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o auth-server cmd/main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o auth-server cmd/auth/main.go

FROM debian:bookworm-slim

Expand Down
2 changes: 1 addition & 1 deletion src/manager/Dockerfile → src/docker/manager.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN go mod download
COPY cmd ./cmd
COPY internal ./internal

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o linuxus-manager cmd/main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o linuxus-manager cmd/manager/main.go

FROM ubuntu:22.04

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/service/Dockerfile → src/docker/user.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Create a fixed runtime user at build time
RUN groupadd -g 1000 $CONTAINER_RUNTIME_USER && useradd -m -u 1000 -g 1000 -s /bin/bash $CONTAINER_RUNTIME_USER

COPY start.sh /start.sh
COPY docker/start.sh /start.sh
RUN chmod +x /start.sh

CMD ["/start.sh"]
7 changes: 5 additions & 2 deletions src/manager/go.mod → src/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
module github.com/elecbug/linuxus/src/manager
module github.com/elecbug/linuxus/src

go 1.26.1

require (
github.com/containerd/errdefs v1.0.0
github.com/docker/docker v28.5.2+incompatible
github.com/docker/go-connections v0.7.0
golang.org/x/crypto v0.50.0
golang.org/x/term v0.42.0
gopkg.in/yaml.v3 v3.0.1
)

require (
Expand All @@ -13,7 +17,6 @@ require (
github.com/containerd/errdefs/pkg v0.3.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/go-connections v0.7.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.3 // indirect
Expand Down
3 changes: 0 additions & 3 deletions ctl/go.sum → src/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151X
github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk=
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
Expand Down Expand Up @@ -89,7 +87,6 @@ golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI=
golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q=
golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0=
golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI=
golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/term v0.42.0 h1:UiKe+zDFmJobeJ5ggPwOshJIVt6/Ft0rcfrXZDLWAWY=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"sync"
"time"

"github.com/elecbug/linuxus/src/auth/internal/page"
"github.com/elecbug/linuxus/src/internal/auth/page"
)

// App holds auth server state, templates, and manager integration clients.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"
"time"

"github.com/elecbug/linuxus/src/auth/internal/user"
"github.com/elecbug/linuxus/src/internal/auth/user"
"golang.org/x/crypto/bcrypt"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"net/http"
"strings"

"github.com/elecbug/linuxus/src/auth/internal/page"
"github.com/elecbug/linuxus/src/auth/internal/user"
"github.com/elecbug/linuxus/src/internal/auth/page"
"github.com/elecbug/linuxus/src/internal/auth/user"
)

// handleSignup processes GET and POST requests to the signup endpoint for user registration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"time"

"github.com/elecbug/linuxus/src/auth/internal/packet"
"github.com/elecbug/linuxus/src/internal/auth/packet"
)

// ensureUserContainerReady asks the manager service to ensure a user runtime is ready.
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package page
import (
"fmt"

html "github.com/elecbug/linuxus/src/auth/internal/html"
html "github.com/elecbug/linuxus/src/internal/auth/html"
)

// getLoginCSS builds style rules for the login page.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package page

import (
"github.com/elecbug/linuxus/src/auth/internal/html"
"github.com/elecbug/linuxus/src/internal/auth/html"
)

// GetLoginPage renders the login HTML template.
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions ctl/internal/app/app.go → src/internal/ctl/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"

"github.com/docker/docker/client"
"github.com/elecbug/linuxus/ctl/internal/config"
"github.com/elecbug/linuxus/ctl/internal/system_api"
"github.com/elecbug/linuxus/src/internal/ctl/config"
"github.com/elecbug/linuxus/src/internal/ctl/system_api"
)

// App stores runtime state, config, and Docker dependencies for linuxusctl.
Expand Down
4 changes: 0 additions & 4 deletions ctl/internal/app/config.go → src/internal/ctl/app/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ func (a *App) LoadConfig() error {

// normalizeConfigPaths resolves source-relative paths to absolute paths.
func (a *App) normalizeConfigPaths() {
a.Config.UserService.SourceDir = a.absFromSource(a.Config.UserService.SourceDir)
a.Config.AuthService.SourceDir = a.absFromSource(a.Config.AuthService.SourceDir)
a.Config.ManagerService.SourceDir = a.absFromSource(a.Config.ManagerService.SourceDir)

a.Config.AuthService.Mounts.HostAuthListPath = a.absFromSource(a.Config.AuthService.Mounts.HostAuthListPath)

a.Config.Volumes.Host.Homes = a.absFromSource(a.Config.Volumes.Host.Homes)
Expand Down
2 changes: 1 addition & 1 deletion ctl/internal/app/disk.go → src/internal/ctl/app/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"sort"
"strings"

"github.com/elecbug/linuxus/ctl/internal/format"
"github.com/elecbug/linuxus/src/internal/ctl/format"
)

// cleanVolumesAll unmounts and removes all user and shared disks after confirming with the user.
Expand Down
Loading