Skip to content
Open
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
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"program": "${workspaceFolder}/main.go",
"console": "integratedTerminal",
"args": [
"ls"
"run",
"cli"
],
"env": {
"SMALLWEB_DIR": "${workspaceFolder}/example",
Expand Down
19 changes: 12 additions & 7 deletions example/.smallweb/config.jsonc
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"$schema": "../../schemas/config.schema.json",
"domain": "smallweb.traefik.me",
"oidc": {
"issuer": "https://lastlogin.net"
},
"authorizedEmails": [
"achille.lacoin@gmail.com"
]
"domain": "smallweb.live",
"apps": {
"example-cron": {
"crons": [
{
"schedule": "* * * * *",
// ceci est un test
"args": []
}
]
}
}
}
8 changes: 0 additions & 8 deletions example/cron/smallweb.json

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions example/ls/data
13 changes: 8 additions & 5 deletions example/ls/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Smallweb } from "jsr:@smallweb/sdk"

async function handleRequest() {
const { SMALLWEB_DOMAIN, SMALLWEB_DIR } = Deno.env.toObject()
const entries = await Array.fromAsync(Deno.readDir(SMALLWEB_DIR))
const smallweb = new Smallweb("./data")
const apps = await smallweb.apps.list()

const html = /* html */`
<style>
body {
Expand Down Expand Up @@ -31,10 +34,10 @@ async function handleRequest() {
</tr>
</thead>
<tbody>
${entries.filter(entry => !entry.name.startsWith(".")).map(entry => `
${apps.map(app => `
<tr>
<td>${entry.name}</td>
<td><a href="https://${entry.name}.${SMALLWEB_DOMAIN}">https://${entry.name}.${SMALLWEB_DOMAIN}</a></td>
<td>${app.name}</td>
<td><a href="${app.url}">${app.url}</a></td>
</tr>
`).join('')}
</tbody>
Expand Down
4 changes: 0 additions & 4 deletions example/ls/smallweb.json

This file was deleted.

28 changes: 11 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/pomdtr/smallweb

go 1.24
go 1.24.0

require (
github.com/Masterminds/semver v1.5.0
Expand All @@ -13,33 +13,28 @@ require (
github.com/knadh/koanf/v2 v2.2.2
github.com/mattn/go-isatty v0.0.20
github.com/spf13/cobra v1.9.1
github.com/tailscale/hujson v0.0.0-20250226034555-ec1d1c113d33
golang.org/x/net v0.41.0 // indirect
golang.org/x/term v0.33.0
golang.org/x/net v0.47.0 // indirect
golang.org/x/term v0.37.0
)

require (
github.com/abiosoft/ishell/v2 v2.0.2
github.com/abiosoft/readline v0.0.0-20180607040430-155bce2042db
github.com/bmatcuk/doublestar/v4 v4.9.0
github.com/caddyserver/certmagic v0.23.0
github.com/charmbracelet/ssh v0.0.0-20250213143314-8712ec3ff3ef
github.com/charmbracelet/wish v1.4.7
github.com/coreos/go-oidc/v3 v3.14.1
github.com/creack/pty v1.1.24
github.com/fsnotify/fsnotify v1.9.0
github.com/getsops/sops/v3 v3.10.2
github.com/knadh/koanf/providers/confmap v1.0.0
github.com/knadh/koanf/providers/posflag v1.0.1
github.com/leaanthony/gosod v1.0.4
github.com/lmittmann/tint v1.1.2
github.com/matthewmueller/jsonc v0.1.0
github.com/mhale/smtpd v0.8.3
github.com/pkg/sftp v1.13.9
github.com/robfig/cron/v3 v3.0.1
github.com/samber/slog-http v1.7.0
go.uber.org/zap v1.27.0
golang.org/x/crypto v0.40.0
golang.org/x/oauth2 v0.30.0
golang.org/x/crypto v0.45.0
gopkg.in/natefinch/lumberjack.v2 v2.2.1
)

Expand All @@ -66,7 +61,6 @@ require (
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/ProtonMail/go-crypto v1.2.0 // indirect
github.com/abiosoft/ishell v2.0.0+incompatible // indirect
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
github.com/aws/aws-sdk-go-v2 v1.36.3 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.10 // indirect
Expand Down Expand Up @@ -113,7 +107,6 @@ require (
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect
github.com/getsops/gopgagent v0.0.0-20241224165529-7044f28e491e // indirect
github.com/go-jose/go-jose/v4 v4.0.5 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
Expand Down Expand Up @@ -185,12 +178,13 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap/exp v0.3.0 // indirect
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect
golang.org/x/mod v0.25.0 // indirect
golang.org/x/sync v0.16.0 // indirect
golang.org/x/sys v0.34.0 // indirect
golang.org/x/text v0.27.0 // indirect
golang.org/x/mod v0.29.0 // indirect
golang.org/x/oauth2 v0.30.0 // indirect
golang.org/x/sync v0.18.0 // indirect
golang.org/x/sys v0.38.0 // indirect
golang.org/x/text v0.31.0 // indirect
golang.org/x/time v0.11.0 // indirect
golang.org/x/tools v0.34.0 // indirect
golang.org/x/tools v0.38.0 // indirect
google.golang.org/api v0.228.0 // indirect
google.golang.org/genproto v0.0.0-20250324211829-b45e905df463 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 // indirect
Expand Down
Loading