tangled
alpha
login
or
join now
lewis.moe
/
tangled-core
1
fork
atom
Monorepo for Tangled
1
fork
atom
overview
issues
1
pulls
pipelines
all: rename module to tangled.sh/tangled.sh/core
Anirudh Oppiliappan
11 months ago
ccb31131
2f637381
+81
-81
32 changed files
expand all
collapse all
unified
split
appview
auth
auth.go
db
pulls.go
pages
pages.go
state
follow.go
jetstream.go
middleware.go
pull.go
repo.go
repo_util.go
router.go
settings.go
signer.go
star.go
state.go
cmd
appview
main.go
gen.go
jstest
main.go
knotserver
main.go
repoguard
main.go
go.mod
jetstream
jetstream.go
knotserver
db
pubkeys.go
file.go
git
diff.go
git.go
tree.go
git.go
handler.go
internal.go
jetstream.go
routes.go
lexicon-build-config.json
+1
-1
appview/auth/auth.go
···
10
10
"github.com/bluesky-social/indigo/atproto/identity"
11
11
"github.com/bluesky-social/indigo/xrpc"
12
12
"github.com/gorilla/sessions"
13
13
-
"github.com/sotangled/tangled/appview"
13
13
+
"tangled.sh/tangled.sh/core/appview"
14
14
)
15
15
16
16
type Auth struct {
+5
-5
appview/db/pulls.go
···
9
9
10
10
"github.com/bluekeyes/go-gitdiff/gitdiff"
11
11
"github.com/bluesky-social/indigo/atproto/syntax"
12
12
-
"github.com/sotangled/tangled/types"
12
12
+
"tangled.sh/tangled.sh/core/types"
13
13
)
14
14
15
15
type PullState int
···
289
289
rkey
290
290
from
291
291
pulls
292
292
-
where
292
292
+
where
293
293
repo_at = ? and pull_id = ?
294
294
`
295
295
row := e.QueryRow(query, repoAt, pullId)
···
321
321
submissionsQuery := `
322
322
select
323
323
id, pull_id, repo_at, round_number, patch, created
324
324
-
from
324
324
+
from
325
325
pull_submissions
326
326
where
327
327
repo_at = ? and pull_id = ?
···
370
370
}
371
371
inClause := strings.TrimSuffix(strings.Repeat("?, ", len(submissionsMap)), ", ")
372
372
commentsQuery := fmt.Sprintf(`
373
373
-
select
373
373
+
select
374
374
id,
375
375
pull_id,
376
376
submission_id,
···
383
383
pull_comments
384
384
where
385
385
submission_id IN (%s)
386
386
-
order by
386
386
+
order by
387
387
created asc
388
388
`, inClause)
389
389
commentsRows, err := e.Query(commentsQuery, args...)
+4
-4
appview/pages/pages.go
···
20
20
"github.com/alecthomas/chroma/v2/styles"
21
21
"github.com/bluesky-social/indigo/atproto/syntax"
22
22
"github.com/microcosm-cc/bluemonday"
23
23
-
"github.com/sotangled/tangled/appview/auth"
24
24
-
"github.com/sotangled/tangled/appview/db"
25
25
-
"github.com/sotangled/tangled/appview/state/userutil"
26
26
-
"github.com/sotangled/tangled/types"
23
23
+
"tangled.sh/tangled.sh/core/appview/auth"
24
24
+
"tangled.sh/tangled.sh/core/appview/db"
25
25
+
"tangled.sh/tangled.sh/core/appview/state/userutil"
26
26
+
"tangled.sh/tangled.sh/core/types"
27
27
)
28
28
29
29
//go:embed templates/* static
+3
-3
appview/state/follow.go
···
7
7
8
8
comatproto "github.com/bluesky-social/indigo/api/atproto"
9
9
lexutil "github.com/bluesky-social/indigo/lex/util"
10
10
-
tangled "github.com/sotangled/tangled/api/tangled"
11
11
-
"github.com/sotangled/tangled/appview/db"
12
12
-
"github.com/sotangled/tangled/appview/pages"
10
10
+
tangled "tangled.sh/tangled.sh/core/api/tangled"
11
11
+
"tangled.sh/tangled.sh/core/appview/db"
12
12
+
"tangled.sh/tangled.sh/core/appview/pages"
13
13
)
14
14
15
15
func (s *State) Follow(w http.ResponseWriter, r *http.Request) {
+2
-2
appview/state/jetstream.go
···
8
8
9
9
"github.com/bluesky-social/indigo/atproto/syntax"
10
10
"github.com/bluesky-social/jetstream/pkg/models"
11
11
-
tangled "github.com/sotangled/tangled/api/tangled"
12
12
-
"github.com/sotangled/tangled/appview/db"
11
11
+
tangled "tangled.sh/tangled.sh/core/api/tangled"
12
12
+
"tangled.sh/tangled.sh/core/appview/db"
13
13
)
14
14
15
15
type Ingester func(ctx context.Context, e *models.Event) error
+3
-3
appview/state/middleware.go
···
12
12
"github.com/bluesky-social/indigo/atproto/identity"
13
13
"github.com/bluesky-social/indigo/xrpc"
14
14
"github.com/go-chi/chi/v5"
15
15
-
"github.com/sotangled/tangled/appview"
16
16
-
"github.com/sotangled/tangled/appview/auth"
17
17
-
"github.com/sotangled/tangled/appview/db"
15
15
+
"tangled.sh/tangled.sh/core/appview"
16
16
+
"tangled.sh/tangled.sh/core/appview/auth"
17
17
+
"tangled.sh/tangled.sh/core/appview/db"
18
18
)
19
19
20
20
type Middleware func(http.Handler) http.Handler
+4
-4
appview/state/pull.go
···
11
11
"time"
12
12
13
13
"github.com/go-chi/chi/v5"
14
14
-
"github.com/sotangled/tangled/api/tangled"
15
15
-
"github.com/sotangled/tangled/appview/db"
16
16
-
"github.com/sotangled/tangled/appview/pages"
17
17
-
"github.com/sotangled/tangled/types"
14
14
+
"tangled.sh/tangled.sh/core/api/tangled"
15
15
+
"tangled.sh/tangled.sh/core/appview/db"
16
16
+
"tangled.sh/tangled.sh/core/appview/pages"
17
17
+
"tangled.sh/tangled.sh/core/types"
18
18
19
19
comatproto "github.com/bluesky-social/indigo/api/atproto"
20
20
lexutil "github.com/bluesky-social/indigo/lex/util"
+5
-5
appview/state/repo.go
···
18
18
"github.com/bluesky-social/indigo/atproto/syntax"
19
19
securejoin "github.com/cyphar/filepath-securejoin"
20
20
"github.com/go-chi/chi/v5"
21
21
-
"github.com/sotangled/tangled/api/tangled"
22
22
-
"github.com/sotangled/tangled/appview/auth"
23
23
-
"github.com/sotangled/tangled/appview/db"
24
24
-
"github.com/sotangled/tangled/appview/pages"
25
25
-
"github.com/sotangled/tangled/types"
21
21
+
"tangled.sh/tangled.sh/core/api/tangled"
22
22
+
"tangled.sh/tangled.sh/core/appview/auth"
23
23
+
"tangled.sh/tangled.sh/core/appview/db"
24
24
+
"tangled.sh/tangled.sh/core/appview/pages"
25
25
+
"tangled.sh/tangled.sh/core/types"
26
26
27
27
comatproto "github.com/bluesky-social/indigo/api/atproto"
28
28
lexutil "github.com/bluesky-social/indigo/lex/util"
+3
-3
appview/state/repo_util.go
···
10
10
"github.com/bluesky-social/indigo/atproto/syntax"
11
11
"github.com/go-chi/chi/v5"
12
12
"github.com/go-git/go-git/v5/plumbing/object"
13
13
-
"github.com/sotangled/tangled/appview/auth"
14
14
-
"github.com/sotangled/tangled/appview/db"
15
15
-
"github.com/sotangled/tangled/appview/pages"
13
13
+
"tangled.sh/tangled.sh/core/appview/auth"
14
14
+
"tangled.sh/tangled.sh/core/appview/db"
15
15
+
"tangled.sh/tangled.sh/core/appview/pages"
16
16
)
17
17
18
18
func fullyResolvedRepo(r *http.Request) (*FullyResolvedRepo, error) {
+1
-1
appview/state/router.go
···
5
5
"strings"
6
6
7
7
"github.com/go-chi/chi/v5"
8
8
-
"github.com/sotangled/tangled/appview/state/userutil"
8
8
+
"tangled.sh/tangled.sh/core/appview/state/userutil"
9
9
)
10
10
11
11
func (s *State) Router() http.Handler {
+4
-4
appview/state/settings.go
···
14
14
lexutil "github.com/bluesky-social/indigo/lex/util"
15
15
"github.com/gliderlabs/ssh"
16
16
"github.com/google/uuid"
17
17
-
"github.com/sotangled/tangled/api/tangled"
18
18
-
"github.com/sotangled/tangled/appview/db"
19
19
-
"github.com/sotangled/tangled/appview/email"
20
20
-
"github.com/sotangled/tangled/appview/pages"
17
17
+
"tangled.sh/tangled.sh/core/api/tangled"
18
18
+
"tangled.sh/tangled.sh/core/appview/db"
19
19
+
"tangled.sh/tangled.sh/core/appview/email"
20
20
+
"tangled.sh/tangled.sh/core/appview/pages"
21
21
)
22
22
23
23
func (s *State) Settings(w http.ResponseWriter, r *http.Request) {
+1
-1
appview/state/signer.go
···
11
11
"net/url"
12
12
"time"
13
13
14
14
-
"github.com/sotangled/tangled/types"
14
14
+
"tangled.sh/tangled.sh/core/types"
15
15
)
16
16
17
17
type SignerTransport struct {
+3
-3
appview/state/star.go
···
8
8
comatproto "github.com/bluesky-social/indigo/api/atproto"
9
9
"github.com/bluesky-social/indigo/atproto/syntax"
10
10
lexutil "github.com/bluesky-social/indigo/lex/util"
11
11
-
tangled "github.com/sotangled/tangled/api/tangled"
12
12
-
"github.com/sotangled/tangled/appview/db"
13
13
-
"github.com/sotangled/tangled/appview/pages"
11
11
+
tangled "tangled.sh/tangled.sh/core/api/tangled"
12
12
+
"tangled.sh/tangled.sh/core/appview/db"
13
13
+
"tangled.sh/tangled.sh/core/appview/pages"
14
14
)
15
15
16
16
func (s *State) Star(w http.ResponseWriter, r *http.Request) {
+7
-7
appview/state/state.go
···
17
17
lexutil "github.com/bluesky-social/indigo/lex/util"
18
18
securejoin "github.com/cyphar/filepath-securejoin"
19
19
"github.com/go-chi/chi/v5"
20
20
-
tangled "github.com/sotangled/tangled/api/tangled"
21
21
-
"github.com/sotangled/tangled/appview"
22
22
-
"github.com/sotangled/tangled/appview/auth"
23
23
-
"github.com/sotangled/tangled/appview/db"
24
24
-
"github.com/sotangled/tangled/appview/pages"
25
25
-
"github.com/sotangled/tangled/jetstream"
26
26
-
"github.com/sotangled/tangled/rbac"
20
20
+
tangled "tangled.sh/tangled.sh/core/api/tangled"
21
21
+
"tangled.sh/tangled.sh/core/appview"
22
22
+
"tangled.sh/tangled.sh/core/appview/auth"
23
23
+
"tangled.sh/tangled.sh/core/appview/db"
24
24
+
"tangled.sh/tangled.sh/core/appview/pages"
25
25
+
"tangled.sh/tangled.sh/core/jetstream"
26
26
+
"tangled.sh/tangled.sh/core/rbac"
27
27
)
28
28
29
29
type State struct {
+2
-2
cmd/appview/main.go
···
7
7
"net/http"
8
8
"os"
9
9
10
10
-
"github.com/sotangled/tangled/appview"
11
11
-
"github.com/sotangled/tangled/appview/state"
10
10
+
"tangled.sh/tangled.sh/core/appview"
11
11
+
"tangled.sh/tangled.sh/core/appview/state"
12
12
)
13
13
14
14
func main() {
+1
-1
cmd/gen.go
···
1
1
package main
2
2
3
3
import (
4
4
-
shtangled "github.com/sotangled/tangled/api/tangled"
5
4
cbg "github.com/whyrusleeping/cbor-gen"
5
5
+
shtangled "tangled.sh/tangled.sh/core/api/tangled"
6
6
)
7
7
8
8
func main() {
+1
-1
cmd/jstest/main.go
···
12
12
13
13
"github.com/bluesky-social/jetstream/pkg/client"
14
14
"github.com/bluesky-social/jetstream/pkg/models"
15
15
-
"github.com/sotangled/tangled/jetstream"
15
15
+
"tangled.sh/tangled.sh/core/jetstream"
16
16
)
17
17
18
18
// Simple in-memory implementation of DB interface
+7
-7
cmd/knotserver/main.go
···
4
4
"context"
5
5
"net/http"
6
6
7
7
-
"github.com/sotangled/tangled/api/tangled"
8
8
-
"github.com/sotangled/tangled/jetstream"
9
9
-
"github.com/sotangled/tangled/knotserver"
10
10
-
"github.com/sotangled/tangled/knotserver/config"
11
11
-
"github.com/sotangled/tangled/knotserver/db"
12
12
-
"github.com/sotangled/tangled/log"
13
13
-
"github.com/sotangled/tangled/rbac"
7
7
+
"tangled.sh/tangled.sh/core/api/tangled"
8
8
+
"tangled.sh/tangled.sh/core/jetstream"
9
9
+
"tangled.sh/tangled.sh/core/knotserver"
10
10
+
"tangled.sh/tangled.sh/core/knotserver/config"
11
11
+
"tangled.sh/tangled.sh/core/knotserver/db"
12
12
+
"tangled.sh/tangled.sh/core/log"
13
13
+
"tangled.sh/tangled.sh/core/rbac"
14
14
15
15
_ "net/http/pprof"
16
16
)
+1
-1
cmd/repoguard/main.go
···
13
13
"time"
14
14
15
15
securejoin "github.com/cyphar/filepath-securejoin"
16
16
-
"github.com/sotangled/tangled/appview"
16
16
+
"tangled.sh/tangled.sh/core/appview"
17
17
)
18
18
19
19
var (
+3
-3
go.mod
···
1
1
-
module github.com/sotangled/tangled
1
1
+
module tangled.sh/tangled.sh/core
2
2
3
3
go 1.23.0
4
4
···
17
17
github.com/gliderlabs/ssh v0.3.5
18
18
github.com/go-chi/chi/v5 v5.2.0
19
19
github.com/go-git/go-git/v5 v5.14.0
20
20
+
github.com/google/uuid v1.6.0
20
21
github.com/gorilla/sessions v1.4.0
21
22
github.com/ipfs/go-cid v0.4.1
22
23
github.com/mattn/go-sqlite3 v1.14.24
23
24
github.com/microcosm-cc/bluemonday v1.0.27
25
25
+
github.com/resend/resend-go/v2 v2.15.0
24
26
github.com/sethvargo/go-envconfig v1.1.0
25
27
github.com/whyrusleeping/cbor-gen v0.2.1-0.20241030202151-b7a6831be65e
26
28
github.com/yuin/goldmark v1.4.13
···
50
52
github.com/go-logr/stdr v1.2.2 // indirect
51
53
github.com/goccy/go-json v0.10.2 // indirect
52
54
github.com/gogo/protobuf v1.3.2 // indirect
53
53
-
github.com/google/uuid v1.6.0 // indirect
54
55
github.com/gorilla/css v1.0.1 // indirect
55
56
github.com/gorilla/securecookie v1.1.2 // indirect
56
57
github.com/gorilla/websocket v1.5.1 // indirect
···
92
93
github.com/prometheus/client_model v0.6.1 // indirect
93
94
github.com/prometheus/common v0.54.0 // indirect
94
95
github.com/prometheus/procfs v0.15.1 // indirect
95
95
-
github.com/resend/resend-go/v2 v2.15.0 // indirect
96
96
github.com/sergi/go-diff v1.3.1 // indirect
97
97
github.com/skeema/knownhosts v1.3.1 // indirect
98
98
github.com/spaolacci/murmur3 v1.1.0 // indirect
+1
-1
jetstream/jetstream.go
···
10
10
"github.com/bluesky-social/jetstream/pkg/client"
11
11
"github.com/bluesky-social/jetstream/pkg/client/schedulers/sequential"
12
12
"github.com/bluesky-social/jetstream/pkg/models"
13
13
-
"github.com/sotangled/tangled/log"
13
13
+
"tangled.sh/tangled.sh/core/log"
14
14
)
15
15
16
16
type DB interface {
+1
-1
knotserver/db/pubkeys.go
···
3
3
import (
4
4
"time"
5
5
6
6
-
"github.com/sotangled/tangled/api/tangled"
6
6
+
"tangled.sh/tangled.sh/core/api/tangled"
7
7
)
8
8
9
9
type PublicKey struct {
+1
-1
knotserver/file.go
···
7
7
"net/http"
8
8
"strings"
9
9
10
10
-
"github.com/sotangled/tangled/types"
10
10
+
"tangled.sh/tangled.sh/core/types"
11
11
)
12
12
13
13
func (h *Handle) listFiles(files []types.NiceTree, data map[string]any, w http.ResponseWriter) {
+1
-1
knotserver/git.go
···
8
8
9
9
securejoin "github.com/cyphar/filepath-securejoin"
10
10
"github.com/go-chi/chi/v5"
11
11
-
"github.com/sotangled/tangled/knotserver/git/service"
11
11
+
"tangled.sh/tangled.sh/core/knotserver/git/service"
12
12
)
13
13
14
14
func (d *Handle) InfoRefs(w http.ResponseWriter, r *http.Request) {
+1
-1
knotserver/git/diff.go
···
7
7
8
8
"github.com/bluekeyes/go-gitdiff/gitdiff"
9
9
"github.com/go-git/go-git/v5/plumbing/object"
10
10
-
"github.com/sotangled/tangled/types"
10
10
+
"tangled.sh/tangled.sh/core/types"
11
11
)
12
12
13
13
func (g *GitRepo) Diff() (*types.NiceDiff, error) {
+1
-1
knotserver/git/git.go
···
18
18
"github.com/go-git/go-git/v5"
19
19
"github.com/go-git/go-git/v5/plumbing"
20
20
"github.com/go-git/go-git/v5/plumbing/object"
21
21
-
"github.com/sotangled/tangled/types"
21
21
+
"tangled.sh/tangled.sh/core/types"
22
22
)
23
23
24
24
var (
+1
-1
knotserver/git/tree.go
···
4
4
"fmt"
5
5
6
6
"github.com/go-git/go-git/v5/plumbing/object"
7
7
-
"github.com/sotangled/tangled/types"
7
7
+
"tangled.sh/tangled.sh/core/types"
8
8
)
9
9
10
10
func (g *GitRepo) FileTree(path string) ([]types.NiceTree, error) {
+4
-4
knotserver/handler.go
···
7
7
"net/http"
8
8
9
9
"github.com/go-chi/chi/v5"
10
10
-
"github.com/sotangled/tangled/jetstream"
11
11
-
"github.com/sotangled/tangled/knotserver/config"
12
12
-
"github.com/sotangled/tangled/knotserver/db"
13
13
-
"github.com/sotangled/tangled/rbac"
10
10
+
"tangled.sh/tangled.sh/core/jetstream"
11
11
+
"tangled.sh/tangled.sh/core/knotserver/config"
12
12
+
"tangled.sh/tangled.sh/core/knotserver/db"
13
13
+
"tangled.sh/tangled.sh/core/rbac"
14
14
)
15
15
16
16
const (
+2
-2
knotserver/internal.go
···
6
6
7
7
"github.com/go-chi/chi/v5"
8
8
"github.com/go-chi/chi/v5/middleware"
9
9
-
"github.com/sotangled/tangled/knotserver/db"
10
10
-
"github.com/sotangled/tangled/rbac"
9
9
+
"tangled.sh/tangled.sh/core/knotserver/db"
10
10
+
"tangled.sh/tangled.sh/core/rbac"
11
11
)
12
12
13
13
type InternalHandle struct {
+3
-3
knotserver/jetstream.go
···
10
10
"strings"
11
11
12
12
"github.com/bluesky-social/jetstream/pkg/models"
13
13
-
"github.com/sotangled/tangled/api/tangled"
14
14
-
"github.com/sotangled/tangled/knotserver/db"
15
15
-
"github.com/sotangled/tangled/log"
13
13
+
"tangled.sh/tangled.sh/core/api/tangled"
14
14
+
"tangled.sh/tangled.sh/core/knotserver/db"
15
15
+
"tangled.sh/tangled.sh/core/log"
16
16
)
17
17
18
18
func (h *Handle) processPublicKey(ctx context.Context, did string, record tangled.PublicKey) error {
+3
-3
knotserver/routes.go
···
22
22
gogit "github.com/go-git/go-git/v5"
23
23
"github.com/go-git/go-git/v5/plumbing"
24
24
"github.com/go-git/go-git/v5/plumbing/object"
25
25
-
"github.com/sotangled/tangled/knotserver/db"
26
26
-
"github.com/sotangled/tangled/knotserver/git"
27
27
-
"github.com/sotangled/tangled/types"
25
25
+
"tangled.sh/tangled.sh/core/knotserver/db"
26
26
+
"tangled.sh/tangled.sh/core/knotserver/git"
27
27
+
"tangled.sh/tangled.sh/core/types"
28
28
)
29
29
30
30
func (h *Handle) Index(w http.ResponseWriter, r *http.Request) {
+1
-1
lexicon-build-config.json
···
3
3
"package": "tangled",
4
4
"prefix": "sh.tangled",
5
5
"outdir": "api/tangled",
6
6
-
"import": "github.com/sotangled/tangled/api/tangled",
6
6
+
"import": "tangled.sh/tangled.sh/core/api/tangled",
7
7
"gen-server": true
8
8
}
9
9
]