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
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ tar -xzf device-admin_{version number}_{os}_{cpu architecture}.tar.gz device-adm

Then you may need to move the device-admin binary into a directory in your system path, or you can just run the device-admin binary in your current directory (in which case you should replace `device-admin` with `./device-admin` in the commands listed below).

Once you have device-admin, you can run it as the `root` user on a Raspberry Pi:
Once you have device-admin, you can run it as the `pi` user on a Raspberry Pi:
```
sudo ./device-admin
./device-admin
```

Then you can view the landing page at <http://localhost:3001> . Note that if you are running it on a
Expand Down Expand Up @@ -87,22 +87,34 @@ You can override the default webpage templates embedded in the device-admin bina
and then running the following command:
```
# If you downloaded a device-admin binary:
sudo TEMPLATES_PATH=custom-templates ./device-admin
TEMPLATES_PATH=custom-templates ./device-admin
# If you are developing the project:
sudo TEMPLATES_PATH=custom-templates make run
TEMPLATES_PATH=custom-templates make run
```

#### HTTP Server

You can override the default port (`3001`) or base path (`/`) of the HTTP server with the `HTTP_PORT` and `HTTP_BASEPATH` environment variables, respectively. For example, you could run the web server on port 3002 with base path `/admin/panel/` by running the following command:
```
# If you downloaded a device-admin binary:
sudo HTTP_PORT=3002 HTTP_BASEPATH="/admin/panel/" ./device-admin
HTTP_PORT=3002 HTTP_BASEPATH="/admin/panel/" ./device-admin
# If you are developing the project:
sudo HTTP_PORT=3002 HTTP_BASEPATH="/admin/panel/" make run
HTTP_PORT=3002 HTTP_BASEPATH="/admin/panel/" make run
```
Note that `HTTP_BASEPATH` should end with a trailing slash.

#### Action Cable

Action Cable is used to push live page updates to web browsers without the need for page refreshes. Action Cable subscriptions are signed with a hash key for security reasons; that hash key will need to be persisted in a keyfile in order for web browsers to maintain subscriptions across restarts of the device-admin server. You should override the default path of that keyfile (`/tmp/action-cable.key`) with the `ACTIONCABLE_HASH_KEYFILE` environment variable. For example, you could run the web server with a keyfile in the HOME directory by running the following command:
```
# If you downloaded a device-admin binary:
ACTIONCABLE_HASH_KEYFILE="~/.config/device-admin/action-cable-hash.key" ./device-admin
# If you are developing the project:
ACTIONCABLE_HASH_KEYFILE="~/.config/device-admin/action-cable-hash.key" make run
```

If the file doesn't exist, a new key will be randomly generated and saved to the file.

### Embedding

Webpages can be embedded in other websites as iframes. For this, you may want to add the following GET query params to the webpage URL for the iframe:
Expand Down
70 changes: 36 additions & 34 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@ module github.com/openUC2/device-admin
go 1.25.3

require (
filippo.io/csrf v0.2.1
github.com/Masterminds/sprig/v3 v3.3.0
github.com/benbjohnson/hashfs v0.2.2
github.com/dgraph-io/ristretto v0.2.0
github.com/godbus/dbus/v5 v5.2.0
github.com/google/uuid v1.6.0
github.com/labstack/echo/v4 v4.13.4
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674
github.com/labstack/echo/v4 v4.14.0
github.com/labstack/gommon v0.4.2
github.com/pkg/errors v0.9.1
github.com/sargassum-world/godest v0.6.2
github.com/sargassum-world/godest v0.7.2
github.com/unrolled/secure v1.17.0
golang.org/x/sync v0.18.0
golang.org/x/sync v0.19.0
tailscale.com v1.92.0
)

Expand Down Expand Up @@ -65,7 +67,7 @@ require (
github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect
github.com/BurntSushi/toml v1.5.0 // indirect
github.com/Djarvur/go-err113 v0.1.1 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.27.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.29.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.51.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.51.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
Expand Down Expand Up @@ -126,7 +128,7 @@ require (
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/blizzy78/varnamelen v0.8.0 // indirect
github.com/bluesky-social/indigo v0.0.0-20240813042137-4006c0eca043 // indirect
github.com/bmatcuk/doublestar/v4 v4.6.0 // indirect
github.com/bmatcuk/doublestar/v4 v4.9.1 // indirect
github.com/bombsimon/wsl/v4 v4.7.0 // indirect
github.com/bombsimon/wsl/v5 v5.2.0 // indirect
github.com/breml/bidichk v0.3.3 // indirect
Expand Down Expand Up @@ -211,7 +213,7 @@ require (
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.6.2 // indirect
github.com/go-git/go-git/v5 v5.16.1 // indirect
github.com/go-jose/go-jose/v4 v4.1.0 // indirect
github.com/go-jose/go-jose/v4 v4.1.2 // indirect
github.com/go-json-experiment/json v0.0.0-20250813024750-ebf49471dced // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
Expand Down Expand Up @@ -272,7 +274,6 @@ require (
github.com/goreleaser/fileglob v1.3.0 // indirect
github.com/goreleaser/goreleaser/v2 v2.12.2 // indirect
github.com/goreleaser/nfpm/v2 v2.43.1 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect
github.com/gostaticanalysis/comment v1.5.0 // indirect
github.com/gostaticanalysis/forcetypeassert v0.2.0 // indirect
Expand Down Expand Up @@ -317,7 +318,7 @@ require (
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/kisielk/errcheck v1.9.0 // indirect
github.com/kkHAIKE/contextcheck v1.1.6 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/compress v1.18.1 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/kulti/thelper v0.7.1 // indirect
Expand Down Expand Up @@ -387,10 +388,10 @@ require (
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/polydawn/refmt v0.89.1-0.20221221234430-40501e09de1f // indirect
github.com/polyfloyd/go-errorlint v1.8.0 // indirect
github.com/prometheus/client_golang v1.23.0 // indirect
github.com/prometheus/client_golang v1.23.2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.65.0 // indirect
github.com/prometheus/procfs v0.16.1 // indirect
github.com/prometheus/common v0.66.1 // indirect
github.com/prometheus/procfs v0.17.0 // indirect
github.com/quasilyte/go-ruleguard v0.4.4 // indirect
github.com/quasilyte/go-ruleguard/dsl v0.3.22 // indirect
github.com/quasilyte/gogrep v0.5.0 // indirect
Expand All @@ -402,7 +403,7 @@ require (
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/ryancurrah/gomodguard v1.4.1 // indirect
github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect
github.com/sagikazarmark/locafero v0.9.0 // indirect
github.com/sagikazarmark/locafero v0.11.0 // indirect
github.com/sanposhiho/wastedassign/v2 v2.1.0 // indirect
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
github.com/sashamelentyev/interfacebloat v1.1.0 // indirect
Expand All @@ -420,19 +421,19 @@ require (
github.com/sigstore/sigstore v1.9.5 // indirect
github.com/sigstore/sigstore-go v0.7.1 // indirect
github.com/sigstore/timestamp-authority v1.2.5 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/sirupsen/logrus v1.9.4-0.20230606125235-dd1b4c2e81af // indirect
github.com/sivchari/containedctx v1.0.3 // indirect
github.com/skeema/knownhosts v1.3.1 // indirect
github.com/slack-go/slack v0.17.3 // indirect
github.com/sonatard/noctx v0.4.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
github.com/sourcegraph/go-diff v0.7.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/afero v1.14.0 // indirect
github.com/spf13/cast v1.7.1 // indirect
github.com/spf13/afero v1.15.0 // indirect
github.com/spf13/cast v1.10.0 // indirect
github.com/spf13/cobra v1.10.1 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/spf13/viper v1.20.1 // indirect
github.com/spf13/viper v1.21.0 // indirect
github.com/spiffe/go-spiffe/v2 v2.5.0 // indirect
github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect
github.com/stbenjam/no-sprintf-host-port v0.2.0 // indirect
Expand All @@ -451,7 +452,7 @@ require (
github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect
github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 // indirect
github.com/transparency-dev/merkle v0.0.2 // indirect
github.com/twmb/murmur3 v1.1.6 // indirect
github.com/twmb/murmur3 v1.1.8 // indirect
github.com/ulikunitz/xz v0.5.15 // indirect
github.com/ultraware/funlen v0.2.0 // indirect
github.com/ultraware/whitespace v0.2.0 // indirect
Expand Down Expand Up @@ -487,39 +488,40 @@ require (
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.36.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 // indirect
go.opentelemetry.io/otel v1.37.0 // indirect
go.opentelemetry.io/otel/metric v1.37.0 // indirect
go.opentelemetry.io/otel/sdk v1.37.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.37.0 // indirect
go.opentelemetry.io/otel/trace v1.37.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect
go.opentelemetry.io/otel v1.38.0 // indirect
go.opentelemetry.io/otel/metric v1.38.0 // indirect
go.opentelemetry.io/otel/sdk v1.38.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect
go.opentelemetry.io/otel/trace v1.38.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/automaxprocs v1.6.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
go4.org/mem v0.0.0-20240501181205-ae6ca9944745 // indirect
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
gocloud.dev v0.42.0 // indirect
golang.org/x/crypto v0.45.0 // indirect
golang.org/x/crypto v0.46.0 // indirect
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
golang.org/x/exp/typeparams v0.0.0-20250911091902-df9299821621 // indirect
golang.org/x/mod v0.30.0 // indirect
golang.org/x/net v0.47.0 // indirect
golang.org/x/net v0.48.0 // indirect
golang.org/x/oauth2 v0.31.0 // indirect
golang.org/x/sys v0.38.0 // indirect
golang.org/x/term v0.37.0 // indirect
golang.org/x/text v0.31.0 // indirect
golang.org/x/time v0.12.0 // indirect
golang.org/x/sys v0.39.0 // indirect
golang.org/x/term v0.38.0 // indirect
golang.org/x/text v0.32.0 // indirect
golang.org/x/time v0.14.0 // indirect
golang.org/x/tools v0.39.0 // indirect
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
golang.zx2c4.com/wireguard/windows v0.5.3 // indirect
google.golang.org/api v0.246.0 // indirect
google.golang.org/genproto v0.0.0-20250603155806-513f23925822 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250721164621-a45f3dfb1074 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0 // indirect
google.golang.org/grpc v1.74.2 // indirect
google.golang.org/protobuf v1.36.9 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250825161204-c5933d9347a5 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250825161204-c5933d9347a5 // indirect
google.golang.org/grpc v1.76.0 // indirect
google.golang.org/protobuf v1.36.10 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/mail.v2 v2.3.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
Expand Down
Loading
Loading