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
67 changes: 0 additions & 67 deletions assets/config/openlore.yml

This file was deleted.

6 changes: 4 additions & 2 deletions assets/skills/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,10 @@ architecture:

1. Clone OpenLore into a separate temporary directory and check out the
selected release.
2. Remove that clone's embedded `assets/config/openlore.yml` before building,
because a binary cannot load embedded and external configuration together.
2. Run `rm -f assets/config/openlore.yml` in that clone before building to
remove any production fallback config shipped by older releases. Current
releases use built-in defaults; an external config file replaces any
custom embedded config.
3. Build the web UI first so the local server includes the dashboard like the
published image: in the clone, run `npm --prefix dashboard ci` and
`npm --prefix dashboard run build`. Without this step Go builds a binary
Expand Down
28 changes: 28 additions & 0 deletions cmd/openlore/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,46 @@ package main

import (
"bytes"
"context"
"crypto/ed25519"
"encoding/json"
"os"
"path/filepath"
"strings"
"testing"

"github.com/aakarim/go-openlore/assets"
"github.com/aakarim/go-openlore/internal/config"
openlore "github.com/aakarim/go-openlore/pkg/openlore"
gossh "golang.org/x/crypto/ssh"
)

func TestFreshInstallServer(t *testing.T) {
t.Chdir(t.TempDir())
if err := os.Mkdir("docs", 0755); err != nil {
t.Fatal(err)
}
embedded, _ := assets.EmbeddedConfig()
srv, err := openlore.NewServer("docs",
openlore.WithConfigFile("./openlore.yml"),
openlore.WithEmbeddedConfig(embedded, assets.DefaultMOTD()),
)
if err != nil {
t.Fatalf("fresh-install server: %v", err)
}
t.Cleanup(func() { _ = srv.Shutdown(context.Background()) })
cfg := srv.Config()
if cfg.Port != 2222 || cfg.HTTPPort != 8080 || !cfg.MCPEnabled || cfg.MCPPath != "/mcp" {
t.Fatalf("unexpected listener defaults: SSH=%d HTTP=%d MCP=%t %q", cfg.Port, cfg.HTTPPort, cfg.MCPEnabled, cfg.MCPPath)
}
if cfg.AuthFile != "" || !cfg.AllowKeyless || (cfg.MCPRequireAuth != nil && *cfg.MCPRequireAuth) {
t.Fatalf("fresh install must allow anonymous reads without an auth file")
}
if !cfg.Readonly || cfg.WritableDir != "" || cfg.Tokens != nil || cfg.Passkeys.RPID == "openlore.sh" {
t.Fatal("fresh install inherited production write or authentication settings")
}
}

func policyFile(t *testing.T, auth config.AuthConfig) string {
t.Helper()
p := filepath.Join(t.TempDir(), "lore.json")
Expand Down
4 changes: 2 additions & 2 deletions railpack-plan.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@
],
"commands": [
{
"cmd": "sh -c 'rm assets/config/openlore.yml'",
"customName": "rm assets/config/openlore.yml"
"cmd": "sh -c 'rm -f assets/config/openlore.yml'",
"customName": "rm -f assets/config/openlore.yml"
},
{
"cmd": "sh -c 'go build -o out ./cmd/openlore'",
Expand Down
2 changes: 1 addition & 1 deletion railpack.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}
],
"commands": [
"rm assets/config/openlore.yml",
"rm -f assets/config/openlore.yml",
"go build -o out ./cmd/openlore"
]
}
Expand Down
Loading