Skip to content

Commit 8da55f4

Browse files
committed
update
1 parent 9d9f18e commit 8da55f4

File tree

9 files changed

+1782
-32
lines changed

9 files changed

+1782
-32
lines changed

client/esbuild.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const runTailwindBuild = (watch) => {
3535
const options = {
3636
entryPoints: [
3737
"./src/index.tsx",
38+
"./src/vanilla.example.js",
3839
],
3940
outdir: "public/build/",
4041
format: "esm",

client/src/vanilla.example.js

Lines changed: 1766 additions & 0 deletions
Large diffs are not rendered by default.

pkg/chals/chals.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ func (s *Handler) Handle() (string, http.Handler) {
163163
view = caesarCipher(c, int(t.Caesar.Shift))
164164
case *chalgen.Challenge_Xor:
165165
view = string(xorEncryptDecrypt([]byte(t.Xor.Plaintext), []byte(t.Xor.Key)))
166+
case *chalgen.Challenge_Passshare:
167+
view = base64.StdEncoding.EncodeToString([]byte(chalURL))
166168
}
167169
}
168170
if view != "" {

pkg/chals/tmpl/chat.templ

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ templ Chat(state ChatState, slack *chalgen.Slack) {
9191
</ul>
9292
</div>
9393
</div>
94-
<div class="flex">
94+
<div class="flex bg-gray-900">
9595
<div class="w-32 bg-gray-800 text-white flex flex-col">
9696
<div class="px-4 py-6">
9797
<h2 class="text-xl font-semibold">Channels</h2>

pkg/chals/tmpl/chat_templ.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/chals/tmpl/passshare.templ

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ script lock(baseUrl string) {
4040
templ PassShare(s PassShareState, ps *chalgen.PassShare) {
4141
<div>
4242
<script src="/build/vanilla.example.js"></script>
43-
<h1>PassShare</h1>
44-
<p>Share your password with a friend!</p>
45-
<input id="id" type="number" name="id" placeholder="id" />
46-
<canvas id="lock"></canvas>
47-
<p>{ps.Message}</p>
48-
@lock(s.BaseURL)
43+
<div class="space-y-2 p-4">
44+
<h1>PassShare</h1>
45+
<p>Share your password with a friend!</p>
46+
<input id="id" type="number" name="id" placeholder="id" />
47+
<canvas id="lock"></canvas>
48+
<p>{ps.Message}</p>
49+
@lock(s.BaseURL)
50+
</div>
4951
</div>
5052
}

pkg/chals/tmpl/passshare_templ.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/db/Home.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

pkg/db/service.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package db
33
import (
44
"context"
55
"database/sql"
6-
"embed"
76
"fmt"
87
"github.com/benbjohnson/litestream"
98
lsgcs "github.com/benbjohnson/litestream/gcs"
@@ -24,9 +23,6 @@ import (
2423
"github.com/glebarez/sqlite"
2524
)
2625

27-
//go:embed Home.md
28-
var Home embed.FS
29-
3026
var ProviderSet = wire.NewSet(
3127
NewConfig,
3228
New,
@@ -160,17 +156,6 @@ func (s *Service) Migrate() error {
160156
return err
161157
}
162158
}
163-
164-
content, err := Home.ReadFile("Home.md")
165-
if err != nil {
166-
panic(err)
167-
}
168-
homePage := models.HomePage{
169-
Id: "home",
170-
Content: string(content),
171-
}
172-
s.DB.Save(&homePage)
173-
slog.Debug("creating home page")
174159
return nil
175160
}
176161

0 commit comments

Comments
 (0)