Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Identify directories with an explicit ns#directory marker

Gabe Kangas51e558430d3f
diff --git a/config/constants.go b/config/constants.go
index 14b53594e9..c4cb15aefd 100644
--- a/config/constants.go
+++ b/config/constants.go
@@ -25,6 +25,12 @@ const (
APOwncastNamespaceLogoURL = "https://owncast.online/ns#logoUrl"
APOwncastNamespaceThumbnailURL = "https://owncast.online/ns#thumbnailUrl"
APOwncastNamespaceStreamTags = "https://owncast.online/ns#streamTags"
+ // APOwncastNamespaceDirectory marks a Follow as coming from a directory (or an
+ // Owncast server featuring another). Its presence is what makes the receiver
+ // hold the follow for operator approval and, once approved, send it stream
+ // pings. Unlike the stream-metadata fields above, a directory has no stream of
+ // its own, so this explicit marker is how it identifies itself.
+ APOwncastNamespaceDirectory = "https://owncast.online/ns#directory"
// APStreamStatusLive is the stream status value for a live stream.
APStreamStatusLive = "live"
diff --git a/db/models.go b/db/models.go
index 50dd66ed22..dad55ceec2 100644
--- a/db/models.go
+++ b/db/models.go
@@ -31,7 +31,7 @@ type ApFollower struct {
RequestObject []byte
LastValidatedAt sql.NullTime
FirstValidationFailureAt sql.NullTime
- OwncastServer sql.NullBool
+ Directory sql.NullBool
}
type ApOutbox struct {
diff --git a/db/query.sql b/db/query.sql
index d4a7649f26..21b3221b6f 100644
--- a/db/query.sql
+++ b/db/query.sql
@@ -6,7 +6,7 @@
-- Featured-streams follows (another Owncast server following us so it can show
-- our live status in its directory) are excluded: they are a directory
-- relationship, not a fan follow, so they must not inflate the follower count.
-SELECT count(*) FROM ap_followers WHERE approved_at is not null AND owncast_server IS NOT 1;
+SELECT count(*) FROM ap_followers WHERE approved_at is not null AND directory IS NOT 1;
-- name: GetLocalPostCount :one
SELECT count(*) FROM ap_outbox;
@@ -15,7 +15,7 @@ SELECT count(*) FROM ap_outbox;
-- Excludes featured-streams (Owncast-server) follows so they don't show up in
-- the public or admin followers list; they are tracked as a directory
-- relationship, not surfaced as followers.
-SELECT iri, inbox, shared_inbox, name, username, image, created_at FROM ap_followers WHERE approved_at is not null AND owncast_server IS NOT 1 ORDER BY created_at DESC LIMIT ? OFFSET ?;
+SELECT iri, inbox, shared_inbox, name, username, image, created_at FROM ap_followers WHERE approved_at is not null AND directory IS NOT 1 ORDER BY created_at DESC LIMIT ? OFFSET ?;
-- name: GetRejectedAndBlockedFollowers :many
SELECT iri, name, username, image, created_at, disabled_at FROM ap_followers WHERE disabled_at is not null;
@@ -25,12 +25,12 @@ SELECT iri, name, username, image, created_at, disabled_at FROM ap_followers WHE
-- server) requests are excluded here and surfaced separately via
-- GetPendingFeaturedFollowRequests so they can be approved from the featured
-- streams admin instead of the followers admin.
-SELECT iri, inbox, shared_inbox, name, username, image, created_at FROM ap_followers WHERE approved_at IS null AND disabled_at is null AND owncast_server IS NOT 1;
+SELECT iri, inbox, shared_inbox, name, username, image, created_at FROM ap_followers WHERE approved_at IS null AND disabled_at is null AND directory IS NOT 1;
-- name: GetPendingFeaturedFollowRequests :many
-- Pending requests from other Owncast servers asking to feature this server's
-- stream in their directory. These always require explicit approval.
-SELECT iri, inbox, shared_inbox, name, username, image, created_at FROM ap_followers WHERE approved_at IS null AND disabled_at is null AND owncast_server IS 1 ORDER BY created_at DESC;
+SELECT iri, inbox, shared_inbox, name, username, image, created_at FROM ap_followers WHERE approved_at IS null AND disabled_at is null AND directory IS 1 ORDER BY created_at DESC;
-- name: ApproveFederationFollower :exec
UPDATE ap_followers SET approved_at = ?, disabled_at = null WHERE iri = ?;
@@ -39,7 +39,7 @@ UPDATE ap_followers SET approved_at = ?, disabled_at = null WHERE iri = ?;
UPDATE ap_followers SET approved_at = null, disabled_at = ? WHERE iri = ?;
-- name: GetFollowerByIRI :one
-SELECT iri, inbox, shared_inbox, name, username, image, request, request_object, created_at, approved_at, disabled_at, owncast_server FROM ap_followers WHERE iri = ?;
+SELECT iri, inbox, shared_inbox, name, username, image, request, request_object, created_at, approved_at, disabled_at, directory FROM ap_followers WHERE iri = ?;
-- name: GetOutboxWithOffset :many
SELECT value FROM ap_outbox LIMIT ? OFFSET ?;
@@ -52,7 +52,7 @@ SELECT value, live_notification, created_at FROM ap_outbox WHERE iri = ?;
DELETE FROM ap_followers WHERE iri = ?;
-- name: AddFollower :exec
-INSERT INTO ap_followers(iri, inbox, shared_inbox, request, request_object, name, username, image, approved_at, owncast_server) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
+INSERT INTO ap_followers(iri, inbox, shared_inbox, request, request_object, name, username, image, approved_at, directory) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
-- name: AddToOutbox :exec
INSERT INTO ap_outbox(iri, value, type, live_notification) values(?, ?, ?, ?);
@@ -92,6 +92,16 @@ WHERE iri = @iri;
-- name: GetUniqueDeliveryInboxes :many
SELECT COALESCE(shared_inbox, inbox) as delivery_inbox FROM ap_followers WHERE approved_at is not null GROUP BY delivery_inbox;
+-- name: GetUniqueDirectoryDeliveryInboxes :many
+-- Approved directory followers only. The Offer/Leave stream pings are delivered
+-- here, not to fan followers, who only need the go-live Create/Note.
+SELECT COALESCE(shared_inbox, inbox) as delivery_inbox FROM ap_followers WHERE approved_at is not null AND directory IS 1 GROUP BY delivery_inbox;
+
+-- name: GetApprovedDirectoryFollowers :many
+-- Approved directories that are featuring/listing this server. Shown in the
+-- admin so the operator can review and remove them.
+SELECT iri, inbox, shared_inbox, name, username, image, created_at FROM ap_followers WHERE approved_at IS NOT NULL AND disabled_at IS NULL AND directory IS 1 ORDER BY created_at DESC;
+
-- name: BanIPAddress :exec
INSERT INTO ip_bans(ip_address, notes) values(?, ?);
diff --git a/db/query.sql.go b/db/query.sql.go
index 71ad825d07..7c736736b2 100644
--- a/db/query.sql.go
+++ b/db/query.sql.go
@@ -68,7 +68,7 @@ func (q *Queries) AddFederatedServer(ctx context.Context, arg AddFederatedServer
}
const addFollower = `-- name: AddFollower :exec
-INSERT INTO ap_followers(iri, inbox, shared_inbox, request, request_object, name, username, image, approved_at, owncast_server) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
+INSERT INTO ap_followers(iri, inbox, shared_inbox, request, request_object, name, username, image, approved_at, directory) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
`
type AddFollowerParams struct {
@@ -81,7 +81,7 @@ type AddFollowerParams struct {
Username string
Image sql.NullString
ApprovedAt sql.NullTime
- OwncastServer sql.NullBool
+ Directory sql.NullBool
}
func (q *Queries) AddFollower(ctx context.Context, arg AddFollowerParams) error {
@@ -95,7 +95,7 @@ func (q *Queries) AddFollower(ctx context.Context, arg AddFollowerParams) error
arg.Username,
arg.Image,
arg.ApprovedAt,
- arg.OwncastServer,
+ arg.Directory,
)
return err
}
@@ -236,6 +236,53 @@ func (q *Queries) DoesInboundActivityExist(ctx context.Context, arg DoesInboundA
return count, err
}
+const getApprovedDirectoryFollowers = `-- name: GetApprovedDirectoryFollowers :many
+SELECT iri, inbox, shared_inbox, name, username, image, created_at FROM ap_followers WHERE approved_at IS NOT NULL AND disabled_at IS NULL AND directory IS 1 ORDER BY created_at DESC
+`
+
+type GetApprovedDirectoryFollowersRow struct {
+ Iri string
+ Inbox string
+ SharedInbox sql.NullString
+ Name sql.NullString
+ Username string
+ Image sql.NullString
+ CreatedAt sql.NullTime
+}
+
+// Approved directories that are featuring/listing this server. Shown in the
+// admin so the operator can review and remove them.
+func (q *Queries) GetApprovedDirectoryFollowers(ctx context.Context) ([]GetApprovedDirectoryFollowersRow, error) {
+ rows, err := q.db.QueryContext(ctx, getApprovedDirectoryFollowers)
+ if err != nil {
+ return nil, err
+ }
+ defer rows.Close()
+ var items []GetApprovedDirectoryFollowersRow
+ for rows.Next() {
+ var i GetApprovedDirectoryFollowersRow
+ if err := rows.Scan(
+ &i.Iri,
+ &i.Inbox,
+ &i.SharedInbox,
+ &i.Name,
+ &i.Username,
+ &i.Image,
+ &i.CreatedAt,
+ ); err != nil {
+ return nil, err
+ }
+ items = append(items, i)
+ }
+ if err := rows.Close(); err != nil {
+ return nil, err
+ }
+ if err := rows.Err(); err != nil {
+ return nil, err
+ }
+ return items, nil
+}
+
const getFederatedServer = `-- name: GetFederatedServer :one
SELECT id, iri, name, logo_url, is_online, stream_title, stream_description, stream_tags, thumbnail_url, last_seen_online, last_status_update, added_at, followed_at, pending, username, display_name, summary, accepted_at, rejected_at, follow_status FROM federated_servers WHERE iri = ?
`
@@ -319,7 +366,7 @@ func (q *Queries) GetFederatedServers(ctx context.Context) ([]FederatedServer, e
}
const getFederationFollowerApprovalRequests = `-- name: GetFederationFollowerApprovalRequests :many
-SELECT iri, inbox, shared_inbox, name, username, image, created_at FROM ap_followers WHERE approved_at IS null AND disabled_at is null AND owncast_server IS NOT 1
+SELECT iri, inbox, shared_inbox, name, username, image, created_at FROM ap_followers WHERE approved_at IS null AND disabled_at is null AND directory IS NOT 1
`
type GetFederationFollowerApprovalRequestsRow struct {
@@ -368,7 +415,7 @@ func (q *Queries) GetFederationFollowerApprovalRequests(ctx context.Context) ([]
}
const getFederationFollowersWithOffset = `-- name: GetFederationFollowersWithOffset :many
-SELECT iri, inbox, shared_inbox, name, username, image, created_at FROM ap_followers WHERE approved_at is not null AND owncast_server IS NOT 1 ORDER BY created_at DESC LIMIT ? OFFSET ?
+SELECT iri, inbox, shared_inbox, name, username, image, created_at FROM ap_followers WHERE approved_at is not null AND directory IS NOT 1 ORDER BY created_at DESC LIMIT ? OFFSET ?
`
type GetFederationFollowersWithOffsetParams struct {
@@ -421,7 +468,7 @@ func (q *Queries) GetFederationFollowersWithOffset(ctx context.Context, arg GetF
}
const getFollowerByIRI = `-- name: GetFollowerByIRI :one
-SELECT iri, inbox, shared_inbox, name, username, image, request, request_object, created_at, approved_at, disabled_at, owncast_server FROM ap_followers WHERE iri = ?
+SELECT iri, inbox, shared_inbox, name, username, image, request, request_object, created_at, approved_at, disabled_at, directory FROM ap_followers WHERE iri = ?
`
type GetFollowerByIRIRow struct {
@@ -436,7 +483,7 @@ type GetFollowerByIRIRow struct {
CreatedAt sql.NullTime
ApprovedAt sql.NullTime
DisabledAt sql.NullTime
- OwncastServer sql.NullBool
+ Directory sql.NullBool
}
func (q *Queries) GetFollowerByIRI(ctx context.Context, iri string) (GetFollowerByIRIRow, error) {
@@ -454,7 +501,7 @@ func (q *Queries) GetFollowerByIRI(ctx context.Context, iri string) (GetFollower
&i.CreatedAt,
&i.ApprovedAt,
&i.DisabledAt,
- &i.OwncastServer,
+ &i.Directory,
)
return i, err
}
@@ -462,7 +509,7 @@ func (q *Queries) GetFollowerByIRI(ctx context.Context, iri string) (GetFollower
const getFollowerCount = `-- name: GetFollowerCount :one
-SELECT count(*) FROM ap_followers WHERE approved_at is not null AND owncast_server IS NOT 1
+SELECT count(*) FROM ap_followers WHERE approved_at is not null AND directory IS NOT 1
`
// Queries added to query.sql must be compiled into Go code with sqlc. Read README.md for details.
@@ -735,7 +782,7 @@ func (q *Queries) GetOutboxWithOffset(ctx context.Context, arg GetOutboxWithOffs
}
const getPendingFeaturedFollowRequests = `-- name: GetPendingFeaturedFollowRequests :many
-SELECT iri, inbox, shared_inbox, name, username, image, created_at FROM ap_followers WHERE approved_at IS null AND disabled_at is null AND owncast_server IS 1 ORDER BY created_at DESC
+SELECT iri, inbox, shared_inbox, name, username, image, created_at FROM ap_followers WHERE approved_at IS null AND disabled_at is null AND directory IS 1 ORDER BY created_at DESC
`
type GetPendingFeaturedFollowRequestsRow struct {
@@ -899,6 +946,35 @@ func (q *Queries) GetUniqueDeliveryInboxes(ctx context.Context) ([]string, error
return items, nil
}
+const getUniqueDirectoryDeliveryInboxes = `-- name: GetUniqueDirectoryDeliveryInboxes :many
+SELECT COALESCE(shared_inbox, inbox) as delivery_inbox FROM ap_followers WHERE approved_at is not null AND directory IS 1 GROUP BY delivery_inbox
+`
+
+// Approved directory followers only. The Offer/Leave stream pings are delivered
+// here, not to fan followers, who only need the go-live Create/Note.
+func (q *Queries) GetUniqueDirectoryDeliveryInboxes(ctx context.Context) ([]string, error) {
+ rows, err := q.db.QueryContext(ctx, getUniqueDirectoryDeliveryInboxes)
+ if err != nil {
+ return nil, err
+ }
+ defer rows.Close()
+ var items []string
+ for rows.Next() {
+ var delivery_inbox string
+ if err := rows.Scan(&delivery_inbox); err != nil {
+ return nil, err
+ }
+ items = append(items, delivery_inbox)
+ }
+ if err := rows.Close(); err != nil {
+ return nil, err
+ }
+ if err := rows.Err(); err != nil {
+ return nil, err
+ }
+ return items, nil
+}
+
const getUserByAccessToken = `-- name: GetUserByAccessToken :one
SELECT users.id, display_name, display_color, users.created_at, disabled_at, previous_names, namechanged_at, authenticated_at, scopes, users.type = 'API' AS is_bot FROM users, user_access_tokens WHERE token = ? AND users.id = user_id
`
diff --git a/openapi.yaml b/openapi.yaml
index 1c9dae16bb..7c0160c79b 100644
--- a/openapi.yaml
+++ b/openapi.yaml
@@ -945,6 +945,33 @@ paths:
responses:
'204':
$ref: '#/components/responses/204'
+ /admin/followers/directory:
+ get:
+ summary: Get directories that are featuring/listing this server
+ operationId: GetDirectoryFollowers
+ tags: ['Internal', 'Admin', 'Social']
+ security:
+ - BasicAuth: []
+ responses:
+ '200':
+ description: List of directories featuring this server
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Followers'
+ '400':
+ $ref: '#/components/responses/400'
+ '401':
+ $ref: '#/components/responses/401BasicAuth'
+ default:
+ $ref: '#/components/responses/Default'
+ options:
+ operationId: GetDirectoryFollowersOptions
+ x-internal: true
+ tags: ['Objects', 'Internal', 'Admin', 'Social']
+ responses:
+ '204':
+ $ref: '#/components/responses/204'
/admin/followers/approve:
post:
summary: Set the following state of a follower or follow request
diff --git a/persistence/migrations/00003_directory_follower.sql b/persistence/migrations/00003_directory_follower.sql
new file mode 100644
index 0000000000..5b54aac738
--- /dev/null
+++ b/persistence/migrations/00003_directory_follower.sql
@@ -0,0 +1,15 @@
+-- +goose Up
+-- +goose StatementBegin
+-- Rename the follower flag from owncast_server to directory.
+--
+-- The flag marks followers that asked to list this server's stream in their
+-- directory (set when their Follow carries the ns#directory marker). The old
+-- name conflated "is an Owncast peer" with "is a directory"; the flag has only
+-- ever meant the latter, so name it for what it is.
+ALTER TABLE ap_followers RENAME COLUMN owncast_server TO directory;
+-- +goose StatementEnd
+
+-- +goose Down
+-- +goose StatementBegin
+ALTER TABLE ap_followers RENAME COLUMN directory TO owncast_server;
+-- +goose StatementEnd
diff --git a/persistence/migrations/migrations_test.go b/persistence/migrations/migrations_test.go
index 3e7c723a51..4550406e2d 100644
--- a/persistence/migrations/migrations_test.go
+++ b/persistence/migrations/migrations_test.go
@@ -68,8 +68,8 @@ func TestRun_FreshDatabase(t *testing.T) {
t.Error("fresh install should not have legacy config table")
}
- if v := gooseVersion(t, db); v != 2 {
- t.Errorf("goose version = %d, want 2", v)
+ if v := gooseVersion(t, db); v != 3 {
+ t.Errorf("goose version = %d, want 3", v)
}
// Calling Run a second time should be a no-op (idempotent).
@@ -93,8 +93,8 @@ func TestRun_LegacyDatabaseAtV9(t *testing.T) {
}
// Goose should record the latest migration.
- if v := gooseVersion(t, db); v != 2 {
- t.Errorf("goose version = %d, want 2", v)
+ if v := gooseVersion(t, db); v != 3 {
+ t.Errorf("goose version = %d, want 3", v)
}
// Config version should still be 9, the legacy bridge was not invoked.
@@ -141,8 +141,8 @@ func TestRun_LegacyDatabasePreV9(t *testing.T) {
}
// Goose should have recorded the latest migration.
- if v := gooseVersion(t, db); v != 2 {
- t.Errorf("goose version = %d, want 2", v)
+ if v := gooseVersion(t, db); v != 3 {
+ t.Errorf("goose version = %d, want 3", v)
}
}
diff --git a/services/activitypub/apmodels/actor.go b/services/activitypub/apmodels/actor.go
index e52a9deb66..9788b7ba38 100644
--- a/services/activitypub/apmodels/actor.go
+++ b/services/activitypub/apmodels/actor.go
@@ -37,8 +37,10 @@ type ActivityPubActor struct {
Username string
// FullUsername is the [email protected] representation of the user.
FullUsername string
- // IsOwncastServer indicates if this actor is an Owncast server.
- IsOwncastServer bool
+ // IsDirectory indicates this follower identified itself as a directory (it
+ // sent the ns#directory marker on its Follow), so it is held for operator
+ // approval and receives stream pings once approved.
+ IsDirectory bool
}
// ErrActorMissingRequiredField is returned when an actor is missing a required field.
diff --git a/services/activitypub/apmodels/owncast_metadata.go b/services/activitypub/apmodels/owncast_metadata.go
index 7febda0c0d..0083b00731 100644
--- a/services/activitypub/apmodels/owncast_metadata.go
+++ b/services/activitypub/apmodels/owncast_metadata.go
@@ -16,7 +16,10 @@ type OwncastMetadata struct {
LogoURL string
ThumbnailURL string
Tags []string
- IsOwncastServer bool
+ // IsDirectory is true when the activity carries the ns#directory marker,
+ // meaning the sender is a directory (or an Owncast server featuring another)
+ // asking to receive stream pings. It is set only by the explicit marker.
+ IsDirectory bool
}
// ParseOwncastMetadata extracts Owncast custom properties from unknown properties map.
@@ -31,13 +34,11 @@ func ParseOwncastMetadata(unknownProps map[string]interface{}) *OwncastMetadata
metadata.ThumbnailURL = extractStringProp(unknownProps, config.APOwncastNamespaceThumbnailURL)
metadata.Tags = extractTagsProp(unknownProps)
- metadata.IsOwncastServer = metadata.StreamStatus != "" ||
- metadata.StreamTitle != "" ||
- metadata.StreamDescription != "" ||
- metadata.ServerName != "" ||
- metadata.LogoURL != "" ||
- metadata.ThumbnailURL != "" ||
- len(metadata.Tags) > 0
+ // A peer is a directory only when it explicitly says so with the ns#directory
+ // marker on its Follow. Presence of stream-metadata fields does not imply a
+ // directory: a normal go-live notification carries those too, and a directory
+ // has no stream of its own to describe.
+ metadata.IsDirectory = extractBoolProp(unknownProps, config.APOwncastNamespaceDirectory)
return metadata
}
@@ -52,6 +53,24 @@ func extractStringProp(unknownProps map[string]interface{}, key string) string {
return ""
}
+// extractBoolProp extracts a boolean value from the unknown properties map for a
+// given key. It accepts a real boolean or the strings "true"/"false", since a
+// JSON-LD value may arrive either way depending on the sender.
+func extractBoolProp(unknownProps map[string]interface{}, key string) bool {
+ val, exists := unknownProps[key]
+ if !exists {
+ return false
+ }
+ switch v := val.(type) {
+ case bool:
+ return v
+ case string:
+ return v == "true"
+ default:
+ return false
+ }
+}
+
// extractTagsProp extracts the tags list from the unknown properties map.
func extractTagsProp(unknownProps map[string]interface{}) []string {
tags, exists := unknownProps[config.APOwncastNamespaceStreamTags]
@@ -119,6 +138,12 @@ func SetBasicOwncastMetadata(unknownProps map[string]interface{}, repo configrep
unknownProps[config.APOwncastNamespaceServerName] = repo.GetServerName()
unknownProps[config.APOwncastNamespaceStreamDescription] = repo.GetServerSummary()
+ // This helper is used to build the Follow we send when featuring another
+ // server, so mark ourselves as a directory. That is what makes the remote
+ // server hold the follow for its operator to approve and, once approved,
+ // deliver its stream pings to us.
+ unknownProps[config.APOwncastNamespaceDirectory] = true
+
// Always include current stream status
if isStreamConnected {
unknownProps[config.APOwncastNamespaceStreamStatus] = config.APStreamStatusLive
diff --git a/services/activitypub/apmodels/owncast_metadata_test.go b/services/activitypub/apmodels/owncast_metadata_test.go
index 07c5663f02..50fb7699fb 100644
--- a/services/activitypub/apmodels/owncast_metadata_test.go
+++ b/services/activitypub/apmodels/owncast_metadata_test.go
@@ -222,13 +222,13 @@ func TestSetBasicOwncastMetadata(t *testing.T) {
func TestParseOwncastMetadata(t *testing.T) {
tests := []struct {
- name string
- unknownProps map[string]interface{}
- expected *OwncastMetadata
- expectOwncast bool
+ name string
+ unknownProps map[string]interface{}
+ expected *OwncastMetadata
+ expectDirectory bool
}{
{
- name: "parse full metadata",
+ name: "parse full stream metadata without directory marker",
unknownProps: map[string]interface{}{
config.APOwncastNamespaceStreamStatus: "live",
config.APOwncastNamespaceStreamTitle: "Test Stream",
@@ -246,9 +246,42 @@ func TestParseOwncastMetadata(t *testing.T) {
LogoURL: "https://example.com/logo.png",
ThumbnailURL: "https://example.com/thumb.png",
Tags: []string{"gaming", "tech"},
- IsOwncastServer: true,
+ IsDirectory: false,
},
- expectOwncast: true,
+ // Stream fields alone no longer flag a peer as a directory.
+ expectDirectory: false,
+ },
+ {
+ name: "parse directory marker",
+ unknownProps: map[string]interface{}{
+ config.APOwncastNamespaceDirectory: true,
+ },
+ expected: &OwncastMetadata{
+ IsDirectory: true,
+ },
+ expectDirectory: true,
+ },
+ {
+ name: "parse directory marker with server metadata",
+ unknownProps: map[string]interface{}{
+ config.APOwncastNamespaceDirectory: true,
+ config.APOwncastNamespaceServerName: "Some Directory",
+ },
+ expected: &OwncastMetadata{
+ ServerName: "Some Directory",
+ IsDirectory: true,
+ },
+ expectDirectory: true,
+ },
+ {
+ name: "parse directory marker sent as string true",
+ unknownProps: map[string]interface{}{
+ config.APOwncastNamespaceDirectory: "true",
+ },
+ expected: &OwncastMetadata{
+ IsDirectory: true,
+ },
+ expectDirectory: true,
},
{
name: "parse partial metadata",
@@ -259,17 +292,17 @@ func TestParseOwncastMetadata(t *testing.T) {
expected: &OwncastMetadata{
ServerName: "Test Server",
StreamDescription: "Test Description",
- IsOwncastServer: true,
+ IsDirectory: false,
},
- expectOwncast: true,
+ expectDirectory: false,
},
{
name: "parse empty metadata",
unknownProps: map[string]interface{}{},
expected: &OwncastMetadata{
- IsOwncastServer: false,
+ IsDirectory: false,
},
- expectOwncast: false,
+ expectDirectory: false,
},
{
name: "parse metadata with wrong types",
@@ -278,10 +311,10 @@ func TestParseOwncastMetadata(t *testing.T) {
config.APOwncastNamespaceServerName: "Test Server",
},
expected: &OwncastMetadata{
- ServerName: "Test Server",
- IsOwncastServer: true,
+ ServerName: "Test Server",
+ IsDirectory: false,
},
- expectOwncast: true,
+ expectDirectory: false,
},
{
name: "parse metadata with invalid tags",
@@ -290,10 +323,10 @@ func TestParseOwncastMetadata(t *testing.T) {
config.APOwncastNamespaceStreamTags: "not an array", // Wrong type
},
expected: &OwncastMetadata{
- ServerName: "Test Server",
- IsOwncastServer: true,
+ ServerName: "Test Server",
+ IsDirectory: false,
},
- expectOwncast: true,
+ expectDirectory: false,
},
{
name: "parse metadata with mixed tag types",
@@ -302,11 +335,11 @@ func TestParseOwncastMetadata(t *testing.T) {
config.APOwncastNamespaceStreamTags: []interface{}{"gaming", 123, "tech"}, // Mixed types
},
expected: &OwncastMetadata{
- ServerName: "Test Server",
- Tags: []string{"gaming", "tech"}, // Only string values
- IsOwncastServer: true,
+ ServerName: "Test Server",
+ Tags: []string{"gaming", "tech"}, // Only string values
+ IsDirectory: false,
},
- expectOwncast: true,
+ expectDirectory: false,
},
}
@@ -314,8 +347,8 @@ func TestParseOwncastMetadata(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
metadata := ParseOwncastMetadata(tt.unknownProps)
- if metadata.IsOwncastServer != tt.expectOwncast {
- t.Errorf("Expected IsOwncastServer=%v, got %v", tt.expectOwncast, metadata.IsOwncastServer)
+ if metadata.IsDirectory != tt.expectDirectory {
+ t.Errorf("Expected IsDirectory=%v, got %v", tt.expectDirectory, metadata.IsDirectory)
}
if tt.expected.StreamStatus != "" && metadata.StreamStatus != tt.expected.StreamStatus {
@@ -401,8 +434,10 @@ func TestRoundTripMetadata(t *testing.T) {
t.Errorf("Round trip failed for Tags: expected %d tags, got %d", len(repo.serverMetadataTags), len(metadata.Tags))
}
- if !metadata.IsOwncastServer {
- t.Error("Round trip failed: IsOwncastServer should be true")
+ // Stream metadata alone does not make a peer a directory; only the explicit
+ // ns#directory marker does, and the round-trip helper does not set it.
+ if metadata.IsDirectory {
+ t.Error("Round trip of stream metadata should not be flagged as a directory")
}
}
diff --git a/services/activitypub/inbox/follow.go b/services/activitypub/inbox/follow.go
index 4b7be3a032..33445711be 100644
--- a/services/activitypub/inbox/follow.go
+++ b/services/activitypub/inbox/follow.go
@@ -29,13 +29,13 @@ func (s *Service) handleFollowInboxRequest(c context.Context, activity vocab.Act
followRequest := *follow
- // Featured-streams follows (another Owncast server following us so it can
- // list our stream in its directory) always require explicit approval,
- // regardless of whether this server otherwise accepts follows
- // automatically. Being featured by another server is a different
- // relationship from gaining a fan, so the operator opts in per server. The
- // Accept is sent later by the admin approval flow, not here.
- if followRequest.IsOwncastServer {
+ // A directory follow (a server that sent the ns#directory marker so it can
+ // list our stream) always requires explicit approval, regardless of whether
+ // this server otherwise accepts follows automatically. Being listed by a
+ // directory is a different relationship from gaining a fan, so the operator
+ // opts in per directory. The Accept is sent later by the admin approval
+ // flow, not here.
+ if followRequest.IsDirectory {
approved = false
}
@@ -67,16 +67,16 @@ func (s *Service) handleFollowInboxRequest(c context.Context, activity vocab.Act
return err
}
// Don't fire the follower webhook for featured-streams follows.
- if !followRequest.IsOwncastServer {
+ if !followRequest.IsDirectory {
go s.webhooks.SendFediverseEngagementFollowEvent(actorIRI)
}
}
- // A Follow from another Owncast server is a featured-streams directory
- // relationship, not a fan follow. It is kept and accepted above because we
- // need it to deliver stream-status pings to that server, but it must not
- // be surfaced as a new follower in chat or the activity feed.
- if followRequest.IsOwncastServer {
+ // A directory follow is a listing relationship, not a fan follow. It is kept
+ // and accepted above because we need it to deliver stream-status pings to
+ // that directory, but it must not be surfaced as a new follower in chat or
+ // the activity feed.
+ if followRequest.IsDirectory {
return nil
}
diff --git a/services/activitypub/inbox/leave_test.go b/services/activitypub/inbox/leave_test.go
index 04d66959f2..5070f78db7 100644
--- a/services/activitypub/inbox/leave_test.go
+++ b/services/activitypub/inbox/leave_test.go
@@ -65,8 +65,9 @@ func TestHandleLeaveActivityWithMetadata(t *testing.T) {
t.Errorf("Expected stream title 'Remote Stream', got '%s'", metadata.StreamTitle)
}
- if !metadata.IsOwncastServer {
- t.Error("Expected IsOwncastServer to be true")
+ // A Leave carries stream metadata but is not a directory marker.
+ if metadata.IsDirectory {
+ t.Error("Expected IsDirectory to be false for a stream Leave")
}
}
@@ -95,9 +96,9 @@ func TestHandleLeaveActivityWithoutMetadata(t *testing.T) {
unknownProps := activity.GetUnknownProperties()
metadata := apmodels.ParseOwncastMetadata(unknownProps)
- // Should not be recognized as Owncast server without metadata
- if metadata.IsOwncastServer {
- t.Error("Expected IsOwncastServer to be false when no Owncast metadata present")
+ // Should not be flagged as a directory without the directory marker.
+ if metadata.IsDirectory {
+ t.Error("Expected IsDirectory to be false when no directory marker present")
}
}
@@ -141,9 +142,9 @@ func TestHandleLeaveActivityWithPartialMetadata(t *testing.T) {
t.Errorf("Expected empty logo URL, got '%s'", metadata.LogoURL)
}
- // Should still be recognized as Owncast server with partial metadata
- if !metadata.IsOwncastServer {
- t.Error("Expected IsOwncastServer to be true with partial Owncast metadata")
+ // Partial stream metadata still does not make a Leave a directory marker.
+ if metadata.IsDirectory {
+ t.Error("Expected IsDirectory to be false for a stream Leave")
}
}
@@ -249,7 +250,7 @@ func TestUpdateFederatedServerStatusFunction(t *testing.T) {
StreamDescription: "Test Description",
LogoURL: "https://example.com/logo.png",
Tags: []string{"test", "stream"},
- IsOwncastServer: true,
+ IsDirectory: true,
},
wantErr: false,
},
@@ -257,8 +258,8 @@ func TestUpdateFederatedServerStatusFunction(t *testing.T) {
name: "update with minimal metadata",
actorIRI: "https://example.com/federation/user/test",
metadata: &apmodels.OwncastMetadata{
- StreamStatus: "offline",
- IsOwncastServer: true,
+ StreamStatus: "offline",
+ IsDirectory: true,
},
wantErr: false,
},
@@ -266,9 +267,9 @@ func TestUpdateFederatedServerStatusFunction(t *testing.T) {
name: "update with empty actor IRI",
actorIRI: "",
metadata: &apmodels.OwncastMetadata{
- StreamStatus: "offline",
- ServerName: "Test Server",
- IsOwncastServer: true,
+ StreamStatus: "offline",
+ ServerName: "Test Server",
+ IsDirectory: true,
},
wantErr: false, // We don't error on empty IRI in current implementation
},
@@ -358,7 +359,8 @@ func TestLeaveActivityMetadataRoundTrip(t *testing.T) {
}
}
- if !parsedMetadata.IsOwncastServer {
- t.Error("Round trip failed: IsOwncastServer should be true")
+ // Stream metadata round-trips without the directory marker.
+ if parsedMetadata.IsDirectory {
+ t.Error("Round trip of stream metadata should not be flagged as a directory")
}
}
diff --git a/services/activitypub/inbox/offer_test.go b/services/activitypub/inbox/offer_test.go
index 0c90329277..7b640ae9df 100644
--- a/services/activitypub/inbox/offer_test.go
+++ b/services/activitypub/inbox/offer_test.go
@@ -74,8 +74,10 @@ func TestHandleOfferActivityWithMetadata(t *testing.T) {
t.Errorf("Expected 3 tags, got %d", len(metadata.Tags))
}
- if !metadata.IsOwncastServer {
- t.Error("Expected IsOwncastServer to be true")
+ // An Offer carries stream metadata but is not a directory marker, so it must
+ // not be flagged as a directory.
+ if metadata.IsDirectory {
+ t.Error("Expected IsDirectory to be false for a stream Offer")
}
}
@@ -104,9 +106,9 @@ func TestHandleOfferActivityWithoutMetadata(t *testing.T) {
unknownProps := activity.GetUnknownProperties()
metadata := apmodels.ParseOwncastMetadata(unknownProps)
- // Should not be recognized as Owncast server without metadata
- if metadata.IsOwncastServer {
- t.Error("Expected IsOwncastServer to be false when no Owncast metadata present")
+ // Should not be flagged as a directory without the directory marker.
+ if metadata.IsDirectory {
+ t.Error("Expected IsDirectory to be false when no directory marker present")
}
}
@@ -136,9 +138,9 @@ func TestHandleOfferActivityWithOfflineStatus(t *testing.T) {
t.Errorf("Expected stream status 'offline', got '%s'", metadata.StreamStatus)
}
- // The handler should ignore offers with offline status since offers are for live streams
- if metadata.IsOwncastServer {
- t.Log("Metadata parsed correctly as Owncast server")
+ // Regardless of stream status, an Offer is not a directory marker.
+ if metadata.IsDirectory {
+ t.Error("Expected IsDirectory to be false for a stream Offer")
}
}
@@ -303,7 +305,9 @@ func TestOfferActivityMetadataRoundTrip(t *testing.T) {
}
}
- if !parsedMetadata.IsOwncastServer {
- t.Error("Round trip failed: IsOwncastServer should be true")
+ // Stream metadata round-trips without the directory marker, so the result is
+ // not a directory.
+ if parsedMetadata.IsDirectory {
+ t.Error("Round trip of stream metadata should not be flagged as a directory")
}
}
diff --git a/services/activitypub/outbox/outbox.go b/services/activitypub/outbox/outbox.go
index 7a61b4e2b8..c3f9106276 100644
--- a/services/activitypub/outbox/outbox.go
+++ b/services/activitypub/outbox/outbox.go
@@ -282,8 +282,6 @@ func getHashtagLinkHTMLFromTagString(baseHashtag string) string {
// SendToFollowers sends an arbitrary payload to all follower inboxes,
// preferring shared inboxes to reduce outbound request count.
func (s *Service) SendToFollowers(payload []byte) error {
- localActor := s.builder.MakeLocalIRIForAccount(s.configRepository.GetDefaultFederationUsername())
-
// Prefer shared inboxes over individual inboxes.
inboxes, err := s.followers.GetUniqueDeliveryInboxes()
if err != nil {
@@ -291,6 +289,28 @@ func (s *Service) SendToFollowers(payload []byte) error {
return errors.New("unable to fetch delivery inboxes to send payload to")
}
+ return s.sendToInboxes(payload, inboxes)
+}
+
+// SendToDirectoryFollowers sends a payload only to approved directory followers,
+// the servers that identified themselves with the ns#directory marker. The
+// Offer/Leave stream pings use this so fan followers are not sent directory
+// traffic they have no use for.
+func (s *Service) SendToDirectoryFollowers(payload []byte) error {
+ inboxes, err := s.followers.GetUniqueDirectoryDeliveryInboxes()
+ if err != nil {
+ log.Errorln("unable to fetch directory delivery inboxes", err)
+ return errors.New("unable to fetch directory delivery inboxes to send payload to")
+ }
+
+ return s.sendToInboxes(payload, inboxes)
+}
+
+// sendToInboxes signs and queues the payload for delivery to each of the given
+// inbox URLs, preferring shared inboxes and spreading the work into batches.
+func (s *Service) sendToInboxes(payload []byte, inboxes []string) error {
+ localActor := s.builder.MakeLocalIRIForAccount(s.configRepository.GetDefaultFederationUsername())
+
// Batch size and delay to prevent resource exhaustion during
// delivery; spreads CPU load from cryptographic signing over time.
const batchSize = 50
diff --git a/services/activitypub/outbox/outbox_test.go b/services/activitypub/outbox/outbox_test.go
index 0d17720c68..5c47f7fd2c 100644
--- a/services/activitypub/outbox/outbox_test.go
+++ b/services/activitypub/outbox/outbox_test.go
@@ -101,8 +101,9 @@ func TestLeaveActivityWithMetadata(t *testing.T) {
}
}
- if !metadata.IsOwncastServer {
- t.Error("Expected IsOwncastServer to be true")
+ // A Leave carries stream metadata but is not a directory marker.
+ if metadata.IsDirectory {
+ t.Error("Expected IsDirectory to be false for a stream Leave")
}
}
diff --git a/services/activitypub/outbox/ping.go b/services/activitypub/outbox/ping.go
index c35e330557..76f0853129 100644
--- a/services/activitypub/outbox/ping.go
+++ b/services/activitypub/outbox/ping.go
@@ -26,10 +26,12 @@ type streamStatusActivity interface {
}
// sendStreamStatusToFollowers stamps the given activity with this server's
-// identity, attaches its Owncast stream metadata (live or offline), addresses
-// it to all followers, and delivers it. logLabel is used only for log and
-// error messages. It is the shared implementation behind SendStreamPing
-// (Offer/live) and SendStreamGoingOffline (Leave/offline).
+// identity, attaches its Owncast stream metadata (live or offline), and
+// delivers it to directory followers only (the servers listing this stream).
+// Fan followers learn about going live from the Create/Note post instead, so
+// they are deliberately excluded here. logLabel is used only for log and error
+// messages. It is the shared implementation behind SendStreamPing (Offer/live)
+// and SendStreamGoingOffline (Leave/offline).
func (s *Service) sendStreamStatusToFollowers(activity streamStatusActivity, isLive bool, logLabel string) error {
id := shortid.MustGenerate()
activityID := s.builder.MakeLocalIRIForResource(id)
@@ -68,7 +70,7 @@ func (s *Service) sendStreamStatusToFollowers(activity streamStatusActivity, isL
return errors.Wrapf(err, "unable to serialize %s", logLabel)
}
- if err := s.SendToFollowers(b); err != nil {
+ if err := s.SendToDirectoryFollowers(b); err != nil {
return err
}
@@ -76,14 +78,14 @@ func (s *Service) sendStreamStatusToFollowers(activity streamStatusActivity, isL
return err
}
- log.Debugln("Sent " + logLabel + " to all followers")
+ log.Debugln("Sent " + logLabel + " to directory followers")
return nil
}
-// SendStreamPing sends an Offer activity to all followers indicating the
+// SendStreamPing sends an Offer activity to directory followers indicating the
// stream is live. Used by the featured-streams flow (at go-live and on a
-// timer) so remote Owncast servers can keep their mini-directory of live
-// streams fresh without polling.
+// timer) so directories can keep their list of live streams fresh without
+// polling.
func (s *Service) SendStreamPing() error {
if !s.configRepository.GetFederationEnabled() {
return nil
@@ -92,11 +94,11 @@ func (s *Service) SendStreamPing() error {
return s.sendStreamStatusToFollowers(streams.NewActivityStreamsOffer(), true, "stream ping Offer activity")
}
-// SendStreamGoingOffline sends a Leave activity to all followers indicating
-// the stream has ended. This is the offline counterpart to SendStreamPing:
-// it lets peer Owncast servers drop this server from the live section of
-// their featured-streams directory immediately, rather than waiting for the
-// staleness sweep to time the entry out.
+// SendStreamGoingOffline sends a Leave activity to directory followers
+// indicating the stream has ended. This is the offline counterpart to
+// SendStreamPing: it lets directories drop this server from the live section
+// of their list immediately, rather than waiting for the staleness sweep to
+// time the entry out.
func (s *Service) SendStreamGoingOffline() error {
if !s.configRepository.GetFederationEnabled() {
return nil
diff --git a/services/activitypub/persistence/followersrepository/followersrepository.go b/services/activitypub/persistence/followersrepository/followersrepository.go
index 03846b0858..b27a910d50 100644
--- a/services/activitypub/persistence/followersrepository/followersrepository.go
+++ b/services/activitypub/persistence/followersrepository/followersrepository.go
@@ -34,6 +34,12 @@ type FollowersRepository interface {
GetBlockedAndRejected() ([]models.Follower, error)
// GetUniqueDeliveryInboxes returns unique inbox URLs for delivery.
GetUniqueDeliveryInboxes() ([]string, error)
+ // GetUniqueDirectoryDeliveryInboxes returns unique inbox URLs for approved
+ // directory followers only, the recipients of Offer/Leave stream pings.
+ GetUniqueDirectoryDeliveryInboxes() ([]string, error)
+ // GetApprovedDirectoryFollowers returns approved directories that are
+ // featuring/listing this server.
+ GetApprovedDirectoryFollowers() ([]models.Follower, error)
// GetByIRI returns a single follower by IRI.
GetByIRI(iri string) (*apmodels.ActivityPubActor, error)
// Add saves a new follow to the datastore.
@@ -191,6 +197,36 @@ func (r *SqlFollowersRepository) GetUniqueDeliveryInboxes() ([]string, error) {
return r.datastore.GetQueries().GetUniqueDeliveryInboxes(ctx)
}
+// GetUniqueDirectoryDeliveryInboxes returns unique inbox URLs for approved
+// directory followers only. The Offer/Leave stream pings are delivered here.
+func (r *SqlFollowersRepository) GetUniqueDirectoryDeliveryInboxes() ([]string, error) {
+ ctx := context.Background()
+ return r.datastore.GetQueries().GetUniqueDirectoryDeliveryInboxes(ctx)
+}
+
+// GetApprovedDirectoryFollowers returns approved directories that are featuring
+// this server, for the admin to review and remove.
+func (r *SqlFollowersRepository) GetApprovedDirectoryFollowers() ([]models.Follower, error) {
+ result, err := r.datastore.GetQueries().GetApprovedDirectoryFollowers(context.Background())
+ if err != nil {
+ return nil, err
+ }
+
+ followers := make([]models.Follower, 0)
+ for _, row := range result {
+ followers = append(followers, models.Follower{
+ Name: row.Name.String,
+ Username: row.Username,
+ Image: row.Image.String,
+ ActorIRI: row.Iri,
+ Inbox: row.Inbox,
+ SharedInbox: row.SharedInbox.String,
+ Timestamp: utils.NullTime{Time: row.CreatedAt.Time, Valid: true},
+ })
+ }
+ return followers, nil
+}
+
// GetByIRI returns a single follower by IRI.
func (r *SqlFollowersRepository) GetByIRI(iri string) (*apmodels.ActivityPubActor, error) {
result, err := r.datastore.GetQueries().GetFollowerByIRI(context.Background(), iri)
@@ -259,7 +295,7 @@ func (r *SqlFollowersRepository) GetByIRI(iri string) (*apmodels.ActivityPubActo
FollowRequestIri: followIRI,
DisabledAt: disabledAt,
RequestObject: followRequestObject,
- IsOwncastServer: result.OwncastServer.Bool,
+ IsDirectory: result.Directory.Bool,
}
return &follower, nil
@@ -278,7 +314,7 @@ func (r *SqlFollowersRepository) Add(follow apmodels.ActivityPubActor, approved
return errors.Wrap(err, "error serializing follow request object")
}
- return r.createFollow(follow.ActorIriString(), follow.InboxString(), follow.SharedInboxString(), follow.FollowRequestIriString(), follow.Name, follow.Username, follow.ImageString(), followRequestObject, approved, follow.IsOwncastServer)
+ return r.createFollow(follow.ActorIriString(), follow.InboxString(), follow.SharedInboxString(), follow.FollowRequestIriString(), follow.Name, follow.Username, follow.ImageString(), followRequestObject, approved, follow.IsDirectory)
}
// Remove removes a follow from the datastore.
@@ -339,7 +375,7 @@ func (r *SqlFollowersRepository) Update(actorIRI string, inbox string, sharedInb
return tx.Commit()
}
-func (r *SqlFollowersRepository) createFollow(actor, inbox, sharedInbox, request, name, username, image string, requestObject []byte, approved, owncastServer bool) error {
+func (r *SqlFollowersRepository) createFollow(actor, inbox, sharedInbox, request, name, username, image string, requestObject []byte, approved, directory bool) error {
r.datastore.DbLock.Lock()
defer r.datastore.DbLock.Unlock()
@@ -369,7 +405,7 @@ func (r *SqlFollowersRepository) createFollow(actor, inbox, sharedInbox, request
ApprovedAt: approvedAt,
Request: request,
RequestObject: requestObject,
- OwncastServer: sql.NullBool{Bool: owncastServer, Valid: true},
+ Directory: sql.NullBool{Bool: directory, Valid: true},
}); err != nil {
return errors.Wrap(err, "error creating new federation follow")
}
diff --git a/services/activitypub/requests/rejectFollow.go b/services/activitypub/requests/rejectFollow.go
new file mode 100644
index 0000000000..f0b606bb48
--- /dev/null
+++ b/services/activitypub/requests/rejectFollow.go
@@ -0,0 +1,69 @@
+package requests
+
+import (
+ "encoding/json"
+ "net/url"
+
+ "github.com/go-fed/activity/streams"
+ "github.com/go-fed/activity/streams/vocab"
+ "github.com/pkg/errors"
+
+ "github.com/owncast/owncast/services/activitypub/apmodels"
+ "github.com/owncast/owncast/services/activitypub/crypto"
+ "github.com/owncast/owncast/services/activitypub/workerpool"
+ "github.com/owncast/owncast/utils"
+
+ "github.com/teris-io/shortid"
+)
+
+// SendFollowReject sends a Reject of a previously received Follow to that
+// follower's inbox, queuing delivery on the provided workerpool. Owncast uses
+// this to revoke a follower it had accepted: when the operator removes a
+// directory that is listing this server, the Reject tells the directory its
+// follow is no longer accepted so it drops the listing, rather than leaving the
+// server showing offline there forever. It is the same signal the wider
+// Fediverse sends when an account removes one of its followers.
+func SendFollowReject(wp *workerpool.Service, inbox *url.URL, originalFollowActivity vocab.ActivityStreamsFollow, fromLocalAccountName string, builder *apmodels.Builder, signer *crypto.Signer) error {
+ // SSRF protection: reject non-HTTPS schemes and internal/loopback hosts.
+ if inbox.Scheme != "https" {
+ return errors.Errorf("rejecting non-HTTPS inbox URL for SSRF protection: %s", inbox.String())
+ }
+ if utils.IsHostnameInternal(inbox.Hostname()) {
+ return errors.Errorf("rejecting internal/loopback inbox URL for SSRF protection: %s", inbox.String())
+ }
+
+ followReject := makeRejectFollow(originalFollowActivity, fromLocalAccountName, builder)
+ localAccountIRI := builder.MakeLocalIRIForAccount(fromLocalAccountName)
+
+ var jsonmap map[string]interface{}
+ jsonmap, _ = streams.Serialize(followReject)
+ b, _ := json.Marshal(jsonmap)
+ req, err := signer.CreateSignedRequest(b, inbox, localAccountIRI)
+ if err != nil {
+ return err
+ }
+
+ wp.AddToOutboundQueue(req)
+
+ return nil
+}
+
+func makeRejectFollow(originalFollowActivity vocab.ActivityStreamsFollow, fromAccountName string, builder *apmodels.Builder) vocab.ActivityStreamsReject {
+ rejectIDString := shortid.MustGenerate()
+ rejectID := builder.MakeLocalIRIForResource(rejectIDString)
+ actorID := builder.MakeLocalIRIForAccount(fromAccountName)
+
+ reject := streams.NewActivityStreamsReject()
+ idProperty := streams.NewJSONLDIdProperty()
+ idProperty.SetIRI(rejectID)
+ reject.SetJSONLDId(idProperty)
+
+ actor := apmodels.MakeActorPropertyWithID(actorID)
+ reject.SetActivityStreamsActor(actor)
+
+ object := streams.NewActivityStreamsObjectProperty()
+ object.AppendActivityStreamsFollow(originalFollowActivity)
+ reject.SetActivityStreamsObject(object)
+
+ return reject
+}
diff --git a/services/activitypub/resolvers/follow.go b/services/activitypub/resolvers/follow.go
index d516b75f0f..f3dc919ca2 100644
--- a/services/activitypub/resolvers/follow.go
+++ b/services/activitypub/resolvers/follow.go
@@ -26,7 +26,8 @@ func (r *Resolver) MakeFollowRequest(c context.Context, activity vocab.ActivityS
username := person.Username
fullUsername := fmt.Sprintf("%s@%s", username, hostname)
- // Check if this is an Owncast server by looking for custom properties in the follow request
+ // Check whether the follower identified itself as a directory by looking for
+ // the ns#directory marker on the follow request.
unknownProps := activity.GetUnknownProperties()
metadata := apmodels.ParseOwncastMetadata(unknownProps)
@@ -39,7 +40,7 @@ func (r *Resolver) MakeFollowRequest(c context.Context, activity vocab.ActivityS
Username: fullUsername,
Image: person.Image,
RequestObject: activity,
- IsOwncastServer: metadata.IsOwncastServer,
+ IsDirectory: metadata.IsDirectory,
}
return &followRequest, nil
diff --git a/web/components/admin/FederatedServers/DirectoryListings.tsx b/web/components/admin/FederatedServers/DirectoryListings.tsx
new file mode 100644
index 0000000000..5d33bcb226
--- /dev/null
+++ b/web/components/admin/FederatedServers/DirectoryListings.tsx
@@ -0,0 +1,133 @@
+import React, { FC, useState } from 'react';
+import { List, Button, Avatar, Typography, Popconfirm, message } from 'antd';
+import { useTranslation } from 'next-export-i18n';
+import { DeleteOutlined } from '@ant-design/icons';
+import { Translation } from '../../ui/Translation/Translation';
+import { Localization } from '../../../types/localization';
+import { DirectoryFollower } from '../../../hooks/useDirectoryFollowers';
+import { isValidUrl } from '../../../utils/validators';
+
+const { Text, Title, Paragraph } = Typography;
+
+export interface DirectoryListingsProps {
+ directories: DirectoryFollower[];
+ loading?: boolean;
+ onRemove: (actorIRI: string) => Promise<void>;
+}
+
+// DirectoryListings shows the directories that are currently listing this
+// server (accepted directory followers), with the option to remove this server
+// from any of them. It renders nothing when there are none.
+export const DirectoryListings: FC<DirectoryListingsProps> = ({
+ directories,
+ loading = false,
+ onRemove,
+}) => {
+ const { t } = useTranslation();
+ const [pendingIRI, setPendingIRI] = useState<string | null>(null);
+
+ const handleRemove = async (actorIRI: string) => {
+ setPendingIRI(actorIRI);
+ try {
+ await onRemove(actorIRI);
+ } catch {
+ message.error(t(Localization.Admin.FeaturedStreams.failedToRemoveDirectory));
+ } finally {
+ setPendingIRI(null);
+ }
+ };
+
+ return (
+ <div>
+ <Title level={3}>
+ <Translation
+ translationKey={Localization.Admin.FeaturedStreams.directoryListingsTitle}
+ defaultText="Directories listing you"
+ />
+ </Title>
+ <Paragraph type="secondary">
+ <Translation
+ translationKey={Localization.Admin.FeaturedStreams.directoryListingsDescription}
+ defaultText="These directories follow your server so they can list your stream. Each one receives your live status. Remove one to stop sending it your status and drop your server from its listing."
+ />
+ </Paragraph>
+ {!loading && directories.length === 0 ? (
+ <Paragraph type="secondary">
+ <Translation
+ translationKey={Localization.Admin.FeaturedStreams.directoryListingsEmpty}
+ defaultText="No directories are featuring your stream yet."
+ />
+ </Paragraph>
+ ) : (
+ <List
+ loading={loading}
+ dataSource={directories}
+ rowKey="link"
+ renderItem={directory => (
+ <List.Item
+ actions={[
+ <Popconfirm
+ key="remove"
+ title={
+ <Translation
+ translationKey={Localization.Admin.FeaturedStreams.removeFromDirectoryConfirm}
+ defaultText="Remove your server from this directory?"
+ />
+ }
+ onConfirm={() => handleRemove(directory.link)}
+ okText={
+ <Translation
+ translationKey={Localization.Admin.FeaturedStreams.confirmYes}
+ defaultText="Yes"
+ />
+ }
+ cancelText={
+ <Translation
+ translationKey={Localization.Admin.FeaturedStreams.confirmNo}
+ defaultText="No"
+ />
+ }
+ >
+ <Button
+ danger
+ size="small"
+ icon={<DeleteOutlined />}
+ loading={pendingIRI === directory.link}
+ >
+ <Translation
+ translationKey={Localization.Admin.FeaturedStreams.removeFromDirectoryButton}
+ defaultText="Remove"
+ />
+ </Button>
+ </Popconfirm>,
+ ]}
+ >
+ <List.Item.Meta
+ avatar={
+ directory.image ? (
+ <Avatar src={directory.image} />
+ ) : (
+ <Avatar>{(directory.name || directory.username || '?').charAt(0)}</Avatar>
+ )
+ }
+ title={
+ // Only render the remote-supplied link as a clickable anchor
+ // when it is a valid http(s) URL; otherwise show plain text so a
+ // hostile value (e.g. a javascript: URL) can't reach href.
+ isValidUrl(directory.link) ? (
+ <a href={directory.link} target="_blank" rel="noopener noreferrer">
+ {directory.name || directory.username || directory.link}
+ </a>
+ ) : (
+ <span>{directory.name || directory.username || directory.link}</span>
+ )
+ }
+ description={<Text type="secondary">{directory.username || directory.link}</Text>}
+ />
+ </List.Item>
+ )}
+ />
+ )}
+ </div>
+ );
+};
diff --git a/web/hooks/useDirectoryFollowers.tsx b/web/hooks/useDirectoryFollowers.tsx
new file mode 100644
index 0000000000..493cd16d6e
--- /dev/null
+++ b/web/hooks/useDirectoryFollowers.tsx
@@ -0,0 +1,77 @@
+import { useState, useEffect, useCallback } from 'react';
+import { message } from 'antd';
+import { useTranslation } from 'next-export-i18n';
+import { Localization } from '../types/localization';
+
+// DirectoryFollower is a directory that is currently listing this server: it
+// followed this server with the directory marker and the operator approved it.
+// It matches the Follower shape the backend serializes (link is the remote
+// actor IRI).
+export interface DirectoryFollower {
+ link: string;
+ name?: string;
+ username?: string;
+ image?: string;
+ timestamp?: string;
+}
+
+export interface UseDirectoryFollowersResult {
+ directories: DirectoryFollower[];
+ loading: boolean;
+ remove: (actorIRI: string) => Promise<void>;
+ refetch: () => void;
+}
+
+const API_DIRECTORY_FOLLOWERS = '/api/admin/followers/directory';
+const API_REMOVE_FOLLOWER = '/api/admin/followers/remove';
+
+// useDirectoryFollowers fetches the directories that are currently listing this
+// server and lets the operator remove one. Removing sends the directory a
+// Reject of its follow, so it drops this server from its listing rather than
+// leaving it showing offline forever.
+export function useDirectoryFollowers(): UseDirectoryFollowersResult {
+ const { t } = useTranslation();
+ const [directories, setDirectories] = useState<DirectoryFollower[]>([]);
+ const [loading, setLoading] = useState(true);
+
+ const fetchDirectories = useCallback(async () => {
+ setLoading(true);
+ try {
+ const response = await fetch(API_DIRECTORY_FOLLOWERS, { credentials: 'include' });
+ if (!response.ok) {
+ throw new Error(`Failed to fetch directory listings: ${response.statusText}`);
+ }
+ const data = await response.json();
+ setDirectories(data || []);
+ } catch (err: any) {
+ message.error(err.message || t(Localization.Admin.FeaturedStreams.failedToRemoveDirectory));
+ } finally {
+ setLoading(false);
+ }
+ }, [t]);
+
+ const remove = async (actorIRI: string) => {
+ const response = await fetch(API_REMOVE_FOLLOWER, {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ credentials: 'include',
+ body: JSON.stringify({ actorIRI }),
+ });
+
+ if (!response.ok) {
+ throw new Error(t(Localization.Admin.FeaturedStreams.failedToRemoveDirectory));
+ }
+
+ await fetchDirectories();
+ message.success(t(Localization.Admin.FeaturedStreams.directoryRemoved));
+ };
+
+ // Fetch once on mount. fetchDirectories must NOT be a dependency: it is keyed
+ // on `t`, which next-export-i18n returns fresh each render, so depending on it
+ // would loop. Consumers refetch explicitly via remove.
+ useEffect(() => {
+ fetchDirectories();
+ }, []);
+
+ return { directories, loading, remove, refetch: fetchDirectories };
+}
diff --git a/web/i18n/en/translation.json b/web/i18n/en/translation.json
index 05e2bf7eff..1afb9b6a3d 100644
--- a/web/i18n/en/translation.json
+++ b/web/i18n/en/translation.json
@@ -1,398 +1,407 @@
{
- "Admin": {
- "AccessTokens": {
- "createNewAccessToken": "Create New Access token",
- "nameDescription": "The name will be displayed as the chat user when sending messages with this access token.",
- "namePlaceholder": "Name of bot, service, or integration",
- "selectAll": "Select all",
- "selectPermissions": "Select the permissions this access token will have. It cannot be edited after it's created."
- },
- "Actions": {
- "createNewAction": "Create New Action",
- "createNewActionTitle": "Create New Action",
- "customHtml": "Custom HTML",
- "description": "External action URLs are 3rd party UI you can display, embedded, into your Owncast page when a user clicks on a button to launch your action.",
- "descriptionPlaceholder": "Optional description",
- "editActionTitle": "Edit Action",
- "htmlEmbedPlaceholder": "HTML embed code (required)",
- "iconPlaceholder": "https://myserver.com/action/icon.png (optional)",
- "linkOrEmbedUrl": "Link or embed an URL",
- "modalDescription": "Add the URL for the external action you want to present.",
- "onlyHttpsSupported": "Only HTTPS URLs and embeds are supported.",
- "openExternally": "Open in a new tab instead of within your page.",
- "optionalBackgroundColor": "Optional background color of the action button.",
- "readMoreAboutActions": "Read more about external actions.",
- "readMoreLink": "Read more about how to use actions, with examples, at",
- "selectActionType": "Select an action type",
- "title": "External Actions",
- "titlePlaceholder": "Your action title (required)",
- "urlPlaceholder": "https://myserver.com/action (required)"
- },
- "EditFavicon": {
- "label": "Favicon",
- "resetButton": "Reset",
- "resetConfirmCancel": "No",
- "resetConfirmOk": "Yes",
- "resetConfirmTitle": "Reset to default favicon?",
- "tip": "Upload a custom favicon (PNG or ICO format, max 200KB). This icon appears in browser tabs and bookmarks."
- },
- "EditInstanceDetails": {
- "directoryDescription": "Increase your audience by appearing in the <a href=\"https://owncast.directory\" target=\"_blank\" rel=\"noreferrer\"><strong>Owncast Directory</strong></a>. This is an external service run by the Owncast project. <a href=\"https://owncast.online/docs/directory/?source=admin\" target=\"_blank\" rel=\"noopener noreferrer\">Learn more</a>.",
- "offlineMessageDescription": "The offline message is displayed to your page visitors when you're not streaming. Markdown is supported.",
- "serverUrlRequiredForDirectory": "You must set your <strong>Server URL</strong> above to enable the directory."
- },
- "FeaturedStreams": {
- "actions": "Actions",
- "added": "Added",
- "approveButton": "Approve",
- "confirmNo": "No",
- "confirmYes": "Yes",
- "enterStreamUrl": "Please enter a stream URL",
- "enterValidUrl": "Please enter a valid URL",
- "failedToApprove": "<strong><em>Missing translation Admin.FeaturedStreams.failedToApprove: Please report</em></strong>",
- "failedToFeature": "Failed to feature stream",
- "failedToUnfeature": "<strong><em>Missing translation Admin.FeaturedStreams.failedToUnfeature: Please report</em></strong>",
- "featureRequestsDescription": "These Owncast servers have asked to show your stream in their featured streams directory. Approve a server to let it display your live status.",
- "featureRequestsTitle": "Requests to feature your stream",
- "featureStreamAction": "Feature Stream",
- "featureStreamButton": "Feature Live Stream",
- "federationSettings": "Federation settings",
- "lastChecked": "Last Checked",
- "modalTitle": "Feature Live Stream",
- "never": "Never",
- "offline": "Offline",
- "online": "Online",
- "pendingApproval": "Pending approval",
- "onlyDefaultPortSupported": "Only the default HTTPS port (443) is supported",
- "onlyHttpsSupported": "Only HTTPS URLs are supported",
- "pageDescription": "Feature other Owncast streams to display their streaming status on your server. When enabled, visitors can discover and navigate to other featured streams through a dedicated \"Featured\" tab on your main page.",
- "pageDescriptionSecondary": "This creates a network effect, allowing users to discover and navigate to other Owncast servers easily. It also gives visitors somewhere to go if your stream is offline.",
- "pageTitle": "Featured Streams",
- "rejectButton": "Reject",
- "requirementDefaultPort": "The stream must be on the default HTTPS port (443)",
- "requirementFeaturedStreams": "The stream must support featured streams",
- "requirementHttps": "The stream must be accessible via HTTPS",
- "requirementOwncast": "The stream must be an Owncast instance",
- "socialFeaturesRequired": "Social features must be enabled",
- "socialFeaturesRequiredDesc": "before you can feature other streams.",
- "status": "Status",
- "streamFeaturedSuccess": "<strong><em>Missing translation Admin.FeaturedStreams.streamFeaturedSuccess: Please report</em></strong>",
- "streamName": "Stream Name",
- "streamRequirements": "Stream Requirements",
- "streamUnfeaturedSuccess": "<strong><em>Missing translation Admin.FeaturedStreams.streamUnfeaturedSuccess: Please report</em></strong>",
- "streamUrlHelp": "Enter the URL of an Owncast stream (e.g., stream.example.com)",
- "streamUrlLabel": "Stream URL",
- "streamUrlPlaceholder": "stream.example.com",
- "unfeatureButton": "Unfeature",
- "unfeatureConfirm": "Unfeature {{name}}?",
- "unsupportedFeaturedStreams": "This Owncast server does not support featured streams yet. Ask the server owner to upgrade Owncast.",
- "url": "URL"
- },
- "HardwareInfo": {
- "cpu": "CPU",
- "disk": "Disk",
- "memory": "Memory",
- "noDetails": "No hardware details have been collected yet.",
- "pleaseWait": "Please wait",
- "title": "Hardware Info",
- "used": "used"
- },
- "Help": {
- "bugPlease": "If you found a bug, then please",
- "buildAddons": "I want to build add-ons for Owncast",
- "buildTools": "You can build your own bots, overlays, tools and add-ons with our",
- "commonTasks": "Common tasks",
- "configureBroadcasting": "Help configuring my broadcasting software",
- "configureInstance": "I want to configure my owncast instance",
- "customizeWebsite": "I want to customize my website",
- "developerApis": "developer APIs.",
- "discussions": "discussions",
- "documentation": "Documentation",
- "embedStream": "I want to embed my stream into another site",
- "faq": "FAQ",
- "fixProblems": "Fix your problems",
- "foundBug": "I found a bug",
- "generalAnswered": "Most general questions are answered in our",
- "generalQuestion": "I have a general question",
- "learnMore": "Learn more",
- "letUsKnow": "let us know",
- "orExist": "or exist in our",
- "other": "Other",
- "readDocs": "Read the Docs",
- "title": "How can we help you?",
- "troubleshooting": "Troubleshooting",
- "tweakVideo": "I want to tweak my video output",
- "useStorage": "I want to use an external storage provider"
- },
- "LogTable": {
- "error": "Error",
- "info": "Info",
- "level": "Level",
- "logs": "Logs",
- "message": "Message",
- "timestamp": "Timestamp",
- "warning": "Warning"
- },
- "NewsFeed": {
- "link": "Link",
- "noNews": "No news.",
- "title": "News & Updates from Owncast"
- },
- "Plugins": {
- "PermissionNames": {
- "chatFilter": "Filter chat messages",
- "chatHistory": "Read chat history",
- "chatModerate": "Moderate chat",
- "chatSend": "Send chat messages",
- "eventsEmit": "Emit events",
- "fediversePost": "Post to the fediverse",
- "httpServe": "Serve HTTP",
- "httpSse": "Push realtime updates",
- "networkFetch": "Make outbound HTTP requests",
- "notificationsSend": "Send notifications",
- "serverRead": "Read server state",
- "storageFs": "Read and write files",
- "storageKv": "Store data",
- "storageUpload": "Upload files",
- "uiModify": "Add UI elements",
- "usersModerate": "Moderate users",
- "usersRead": "Read user list",
- "videoconfigRead": "Read video settings",
- "videoconfigWrite": "Change video settings"
- },
- "Permissions": {
- "chatFilter": "Inspect and modify chat messages before they are broadcast, or drop them entirely.",
- "chatHistory": "Read recent chat messages.",
- "chatModerate": "Hide chat messages and ban users.",
- "chatSend": "Post chat messages as the plugin’s own bot identity.",
- "eventsEmit": "Publish custom events that other plugins can subscribe to.",
- "fediversePost": "Post a public note to the fediverse from the configured Owncast account.",
- "httpServe": "Serve HTTP requests at /plugins/<name>/ (static assets and a dynamic handler).",
- "httpSse": "Push Server-Sent-Events to subscribed browser clients.",
- "networkFetch": "Make outbound HTTP requests to other services.",
- "notificationsSend": "Send broadcaster notifications via the configured channels.",
- "serverRead": "Read Owncast configuration and current server state.",
- "storageFs": "Read and write files in a private, server-side directory only this plugin can access.",
- "storageKv": "Read and write a per-plugin key-value store that persists across reloads.",
- "storageUpload": "Upload files to Owncast’s public files area for browser-accessible URLs.",
- "uiModify": "Make changes to the Owncast user interface.",
- "usersModerate": "Disable or re-enable chat users.",
- "usersRead": "Read the chat user list and per-user details.",
- "videoconfigRead": "Read stream and video output configuration (encoders, variants).",
- "videoconfigWrite": "Modify stream and video output configuration."
- },
- "allowedHostsLabel": "Allowed hosts:",
- "approveButton": "Approve",
- "approveTooltip": "Approve the expanded permission set and load the plugin.",
- "browseEmpty": "No plugins are available in the registry yet.",
- "browseInstall": "Install",
- "browseInstalled": "Installed",
- "browsePreviewAlt": "{{name}} preview screenshot",
- "browseUnavailableDescription": "Owncast can't reach the plugin catalog right now. You can still upload .ocpkg files directly from the Installed tab.",
- "browseUnavailableRetry": "Retry",
- "browseUnavailableTitle": "The plugin catalog is currently unavailable",
- "browseUpdate": "Update to v{{version}}",
- "commandColumnHeader": "Command",
- "commandsTab": "Commands",
- "configure": "Configure",
- "descriptionColumnHeader": "Description",
- "enabledColumn": "Enabled",
- "errorTitle": "Plugin admin error",
- "installConfirmCancel": "Maybe later",
- "installConfirmEnable": "Enable plugin",
- "installConfirmNoPermissions": "This plugin doesn't request any permissions.",
- "installConfirmPrompt": "This plugin uses these capabilities:",
- "installConfirmTitle": "Enable {{name}}?",
- "installEnabledSuccess": "Enabled {{name}}",
- "instructionsLoadError": "Could not load this plugin's instructions.",
- "instructionsTab": "Instructions",
- "modOnlyTag": "mods only",
- "noPermissionsDescription": "This plugin does not declare any permissions in its manifest.",
- "noPermissionsTitle": "No permissions",
- "none": "none",
- "notFoundDescription": "No plugin named \"{{name}}\" is currently registered.",
- "notFoundTitle": "Plugin not found",
- "openPluginAdmin": "Open plugin admin",
- "overview": "All plugins",
- "pageDescription": "Plugins extend Owncast with new functionality. You can install plugins from this catalog, upload your own, or build your own.",
- "pageTitle": "Plugins",
- "permissionColumnHeader": "Permission",
- "permissionsColumn": "Permissions",
- "permissionsTab": "Permissions",
- "pluginColumn": "Plugin",
- "pluginErrorTitle": "Plugin error",
- "pluginFailedToLoad": "Plugin failed to load",
- "refresh": "Refresh",
- "reloadTooltip": "Reload this plugin",
- "sidebarTitle": "Plugins",
- "statusAutoDisabled": "auto-disabled",
- "statusAutoDisabledTooltip": "The host stopped invoking this plugin after repeated failures. Reload it to retry.",
- "statusColumn": "Status",
- "statusDisabled": "disabled",
- "statusEnabledNotLoaded": "enabled, not loaded",
- "statusError": "error",
- "statusPendingApproval": "needs re-approval",
- "statusPendingApprovalTooltip": "This plugin's manifest now requests more permissions than were originally approved. Review the new permissions in the plugin details, then click Approve to accept the new set and load the plugin.",
- "statusRunning": "running",
- "tabBrowse": "Browse",
- "tabInstalled": "Installed",
- "toggleAria": "Toggle {{name}}",
- "uninstallAria": "Uninstall {{name}}",
- "uninstallConfirmCancel": "Cancel",
- "uninstallConfirmDescription": "This removes \"{{name}}\" from the server.",
- "uninstallConfirmOk": "Uninstall",
- "uninstallConfirmTitle": "Uninstall plugin?",
- "uninstallSuccess": "Uninstalled {{name}}",
- "uninstallTooltip": "Uninstall this plugin",
- "updateAvailable": "Update available: v{{version}}",
- "updateConfirmCancel": "Cancel",
- "updateConfirmOk": "Update",
- "updateConfirmTitle": "Update {{name}} to v{{version}}?",
- "uploadButton": "Upload plugin",
- "uploadSuccess": "Installed {{name}}"
- },
- "StatusMessages": {
- "convertingEmoji": "Converting emoji...",
- "deletingEmoji": "Deleting emoji...",
- "emojiDeleted": "Emoji deleted",
- "emojiUploadedSuccessfully": "Emoji uploaded successfully!",
- "fileSizeTooBig": "File size is too big: {{size}}",
- "fileTypeNotSupported": "File type is not supported: {{type}}",
- "latencyBufferUpdated": "Latency buffer level updated.",
- "pleaseEnterTag": "Please enter a tag",
- "tagAlreadyUsed": "This tag is already used!",
- "tagsUpdated": "Tags updated.",
- "thereWasAnError": "There was an error: {{message}}",
- "updated": "Updated.",
- "uploadingEmoji": "Uploading emoji...",
- "variantsUpdated": "Variants updated",
- "videoCodecUpdated": "Video codec updated."
- },
- "VideoVariantForm": {
- "bitrateDisabledPassthrough": "Bitrate selection is disabled when Video Passthrough is enabled.",
- "bitrateGoodForHigh": "Good for high speed & high bitrate viewers.",
- "bitrateGoodForMost": "Good for most viewers, bandwidths and resolutions.",
- "bitrateGoodForSlow": "Good for slow, mobile and low bitrate viewers.",
- "bitrateValueKbps": "{{bitrate}} kbps"
- },
- "ViewerInfo": {
- "currentStream": "Current stream",
- "currentViewers": "Current viewers",
- "last12Hours": "Last 12 hours",
- "last24Hours": "Last 24 hours",
- "last30Days": "Last 30 days",
- "last3Months": "Last 3 months",
- "last6Months": "Last 6 months",
- "last7Days": "Last 7 days",
- "maxViewers": "Max viewers",
- "maxViewersLastStream": "Max viewers last stream",
- "maxViewersThisStream": "Max viewers this stream",
- "noData": "No viewer data has been collected yet.",
- "pleaseWait": "Please wait",
- "title": "Viewer Info",
- "viewers": "Viewers"
- },
- "Webhooks": {
- "createNewWebhook": "Create New Webhook",
- "selectAll": "Select all",
- "selectEvents": "Select the events that will be sent to this webhook.",
- "webhookUrlPlaceholder": "https://myserver.com/webhook"
- },
- "deleteEmoji": "Delete emoji",
- "emojiPageDescription": "Here you can upload new custom emojis for usage in the chat. When uploading a new emoji, the filename without extension will be used as emoji name. Additionally, emoji names are case-insensitive. For best results, ensure all emoji have unique names.",
- "emojiUploadBulkGuide": "Want to upload custom emojis in bulk? Check out our <a href=\"https://owncast.online/docs/chat/emoji\" rel=\"noopener noreferrer\" target=\"_blank\">Emoji guide</a>.",
- "emojis": "Emojis",
- "uploadNewEmoji": "Upload new emoji"
- },
- "Common": {
- "poweredByOwncastVersion": "Powered by <a href='https://owncast.online'>Owncast v{{versionNumber}}</a>"
- },
- "Frontend": {
- "BrowserNotifyModal": {
- "allowButton": "Allow",
- "blockButton": "Block",
- "deniedDescription": "To enable push notifications from {{hostname}} access your browser permissions for this site and turn on notifications. Then reload this page to apply your updated settings on this site. <a href='https://owncast.online/docs/notifications'>Learn more.</a>",
- "deniedTitle": "Notifications are blocked on your device",
- "enabledDescription": "To disable push notifications from {{hostname}} access your browser permissions for this site and turn off notifications. <a href='https://owncast.online/docs/notifications'>Learn more.</a>",
- "enabledTitle": "Notifications are enabled",
- "errorMessage": "Error registering for live notifications: {{message}}. Make sure you're not inside a private browser environment or have previously disabled notifications for this stream.",
- "errorTitle": "Browser Notification Error",
- "iosAddButton": "Add",
- "iosAddToHomeScreen": "Add to Home Screen",
- "iosAllowPrompt": "Allow",
- "iosComeBack": "Come back to this screen and enable notifications.",
- "iosDescription": "It takes a couple extra steps to make sure you get notified when your favorite streams go live.",
- "iosNameAndTap": "Give this link a name and tap the new icon on your home screen",
- "iosShareButton": "share",
- "iosTitle": "Get notified on iOS",
- "learnMore": "Learn more",
- "learnMoreAboutNotifications": "<a href='https://owncast.online/docs/notifications/#browser-notifications'>Learn more</a> about Owncast browser notifications.",
- "mainDescription": "Get notified right in the browser each time this stream goes live.",
- "permissionWantsTo": "{{hostname}} wants to",
- "showNotifications": "Show notifications",
- "unsupported": "Browser notifications are not supported in your browser.",
- "unsupportedLocal": "Browser notifications are not supported for local servers."
- },
- "Chat": {
- "authenticateToChat": "Authenticate to chat",
- "moderatorNotification": "You are now a moderator.",
- "nameChangeText": "is now known as",
- "userJoined": "joined the chat.",
- "userLeft": "left the chat."
- },
- "FollowModal": {
- "description": "By following this stream you'll get notified on the Fediverse when it goes live. Now is a great time to",
- "followButton": "Follow",
- "followError": "Follow Error",
- "instructions": "Enter your username @server to follow",
- "joinFediverse": "Join the Fediverse",
- "learnFediverse": "learn about the Fediverse",
- "newToYou": "if it's new to you.",
- "placeholder": "Your fediverse account @account@server",
- "redirectMessage": "You'll be redirected to your Fediverse server and asked to confirm the action.",
- "unableToFollow": "Unable to follow."
- },
- "Footer": {
- "contribute": "Contribute",
- "documentation": "Documentation",
- "source": "Source"
- },
- "Header": {
- "chatOffline": "Chat is offline",
- "chatWillBeAvailable": "Chat will be available when the stream is live.",
- "skipToContent": "Skip to page content",
- "skipToFooter": "Skip to footer",
- "skipToOfflineMessage": "Skip to offline message",
- "skipToPlayer": "Skip to player"
- },
- "NameChangeModal": {
- "authInfo": "You can also authenticate an IndieAuth or Fediverse account via the \"Authenticate\" menu.",
- "buttonText": "Change name",
- "colorLabel": "Your Color",
- "description": "Your chat display name is what people see when you send chat messages.",
- "overLimit": "Over limit",
- "placeholder": "Your chat display name"
- },
- "StreamsTab": {
- "errorLoadingStreams": "Error loading streams",
- "loadingStreams": "Loading featured streams...",
- "noFeaturedStreams": "No featured streams available"
- },
- "chatDisabled": "Chat is disabled",
- "chatEmbedTitle": "{{name}} Chat",
- "chatOffline": "Chat is offline",
- "componentError": "Error: {{message}}",
- "helloWorld": "Hello world",
- "lastLiveAgo": "Last live {{timeAgo}} ago",
- "offlineBasic": "This stream is offline. Check back soon!",
- "offlineFediverseOnly": "This stream is offline. <span class='follow-link'>Follow</span> {{fediverseAccount}} on the Fediverse to see the next time {{streamer}} goes live.",
- "offlineNotifyAndFediverse": "This stream is offline. You can <span class='notify-link'>be notified</span> the next time {{streamer}} goes live or <span class='follow-link'>follow</span> {{fediverseAccount}} on the Fediverse.",
- "offlineNotifyOnly": "This stream is offline. <span class='notify-link'>Be notified</span> the next time {{streamer}} goes live."
- },
- "Testing": {
- "itemCount": "You have {{count}} items",
- "messageCount": "You have {{count}} messages from {{sender}}",
- "noPluralKey": "This key has no plural variants - {{count}} things",
- "simpleKey": "Simple translation text"
- }
-}
\ No newline at end of file
+ "Admin": {
+ "AccessTokens": {
+ "createNewAccessToken": "Create New Access token",
+ "nameDescription": "The name will be displayed as the chat user when sending messages with this access token.",
+ "namePlaceholder": "Name of bot, service, or integration",
+ "selectAll": "Select all",
+ "selectPermissions": "Select the permissions this access token will have. It cannot be edited after it's created."
+ },
+ "Actions": {
+ "createNewAction": "Create New Action",
+ "createNewActionTitle": "Create New Action",
+ "customHtml": "Custom HTML",
+ "description": "External action URLs are 3rd party UI you can display, embedded, into your Owncast page when a user clicks on a button to launch your action.",
+ "descriptionPlaceholder": "Optional description",
+ "editActionTitle": "Edit Action",
+ "htmlEmbedPlaceholder": "HTML embed code (required)",
+ "iconPlaceholder": "https://myserver.com/action/icon.png (optional)",
+ "linkOrEmbedUrl": "Link or embed an URL",
+ "modalDescription": "Add the URL for the external action you want to present.",
+ "onlyHttpsSupported": "Only HTTPS URLs and embeds are supported.",
+ "openExternally": "Open in a new tab instead of within your page.",
+ "optionalBackgroundColor": "Optional background color of the action button.",
+ "readMoreAboutActions": "Read more about external actions.",
+ "readMoreLink": "Read more about how to use actions, with examples, at",
+ "selectActionType": "Select an action type",
+ "title": "External Actions",
+ "titlePlaceholder": "Your action title (required)",
+ "urlPlaceholder": "https://myserver.com/action (required)"
+ },
+ "EditFavicon": {
+ "label": "Favicon",
+ "resetButton": "Reset",
+ "resetConfirmCancel": "No",
+ "resetConfirmOk": "Yes",
+ "resetConfirmTitle": "Reset to default favicon?",
+ "tip": "Upload a custom favicon (PNG or ICO format, max 200KB). This icon appears in browser tabs and bookmarks."
+ },
+ "EditInstanceDetails": {
+ "directoryDescription": "Increase your audience by appearing in the <a href=\"https://owncast.directory\" target=\"_blank\" rel=\"noreferrer\"><strong>Owncast Directory</strong></a>. This is an external service run by the Owncast project. <a href=\"https://owncast.online/docs/directory/?source=admin\" target=\"_blank\" rel=\"noopener noreferrer\">Learn more</a>.",
+ "offlineMessageDescription": "The offline message is displayed to your page visitors when you're not streaming. Markdown is supported.",
+ "serverUrlRequiredForDirectory": "You must set your <strong>Server URL</strong> above to enable the directory."
+ },
+ "FeaturedStreams": {
+ "actions": "Actions",
+ "added": "Added",
+ "approveButton": "Approve",
+ "confirmNo": "No",
+ "confirmYes": "Yes",
+ "enterStreamUrl": "Please enter a stream URL",
+ "enterValidUrl": "Please enter a valid URL",
+ "failedToApprove": "<strong><em>Missing translation Admin.FeaturedStreams.failedToApprove: Please report</em></strong>",
+ "failedToFeature": "Failed to feature stream",
+ "failedToUnfeature": "<strong><em>Missing translation Admin.FeaturedStreams.failedToUnfeature: Please report</em></strong>",
+ "featureRequestsDescription": "These Owncast servers have asked to show your stream in their featured streams directory. Approve a server to let it display your live status.",
+ "featureRequestsTitle": "Requests to feature your stream",
+ "streamsYouFeatureTab": "Streams you feature",
+ "featuringYouTab": "Featuring you",
+ "directoryListingsTitle": "Directories listing you",
+ "directoryListingsDescription": "These directories follow your server so they can list your stream. Each one receives your live status. Remove one to stop sending it your status and drop your server from its listing.",
+ "directoryListingsEmpty": "No directories are featuring your stream yet.",
+ "removeFromDirectoryButton": "Remove",
+ "removeFromDirectoryConfirm": "Remove your server from this directory?",
+ "directoryRemoved": "Removed from the directory.",
+ "failedToRemoveDirectory": "Failed to remove from the directory.",
+ "featureStreamAction": "Feature Stream",
+ "featureStreamButton": "Feature Live Stream",
+ "federationSettings": "Federation settings",
+ "lastChecked": "Last Checked",
+ "modalTitle": "Feature Live Stream",
+ "never": "Never",
+ "offline": "Offline",
+ "online": "Online",
+ "pendingApproval": "Pending approval",
+ "onlyDefaultPortSupported": "Only the default HTTPS port (443) is supported",
+ "onlyHttpsSupported": "Only HTTPS URLs are supported",
+ "pageDescription": "Feature other Owncast streams to display their streaming status on your server. When enabled, visitors can discover and navigate to other featured streams through a dedicated \"Featured\" tab on your main page.",
+ "pageDescriptionSecondary": "This creates a network effect, allowing users to discover and navigate to other Owncast servers easily. It also gives visitors somewhere to go if your stream is offline.",
+ "pageTitle": "Featured Streams",
+ "rejectButton": "Reject",
+ "requirementDefaultPort": "The stream must be on the default HTTPS port (443)",
+ "requirementFeaturedStreams": "The stream must support featured streams",
+ "requirementHttps": "The stream must be accessible via HTTPS",
+ "requirementOwncast": "The stream must be an Owncast instance",
+ "socialFeaturesRequired": "Social features must be enabled",
+ "socialFeaturesRequiredDesc": "before you can feature other streams.",
+ "status": "Status",
+ "streamFeaturedSuccess": "<strong><em>Missing translation Admin.FeaturedStreams.streamFeaturedSuccess: Please report</em></strong>",
+ "streamName": "Stream Name",
+ "streamRequirements": "Stream Requirements",
+ "streamUnfeaturedSuccess": "<strong><em>Missing translation Admin.FeaturedStreams.streamUnfeaturedSuccess: Please report</em></strong>",
+ "streamUrlHelp": "Enter the URL of an Owncast stream (e.g., stream.example.com)",
+ "streamUrlLabel": "Stream URL",
+ "streamUrlPlaceholder": "stream.example.com",
+ "unfeatureButton": "Unfeature",
+ "unfeatureConfirm": "Unfeature {{name}}?",
+ "unsupportedFeaturedStreams": "This Owncast server does not support featured streams yet. Ask the server owner to upgrade Owncast.",
+ "url": "URL"
+ },
+ "HardwareInfo": {
+ "cpu": "CPU",
+ "disk": "Disk",
+ "memory": "Memory",
+ "noDetails": "No hardware details have been collected yet.",
+ "pleaseWait": "Please wait",
+ "title": "Hardware Info",
+ "used": "used"
+ },
+ "Help": {
+ "bugPlease": "If you found a bug, then please",
+ "buildAddons": "I want to build add-ons for Owncast",
+ "buildTools": "You can build your own bots, overlays, tools and add-ons with our",
+ "commonTasks": "Common tasks",
+ "configureBroadcasting": "Help configuring my broadcasting software",
+ "configureInstance": "I want to configure my owncast instance",
+ "customizeWebsite": "I want to customize my website",
+ "developerApis": "developer APIs.",
+ "discussions": "discussions",
+ "documentation": "Documentation",
+ "embedStream": "I want to embed my stream into another site",
+ "faq": "FAQ",
+ "fixProblems": "Fix your problems",
+ "foundBug": "I found a bug",
+ "generalAnswered": "Most general questions are answered in our",
+ "generalQuestion": "I have a general question",
+ "learnMore": "Learn more",
+ "letUsKnow": "let us know",
+ "orExist": "or exist in our",
+ "other": "Other",
+ "readDocs": "Read the Docs",
+ "title": "How can we help you?",
+ "troubleshooting": "Troubleshooting",
+ "tweakVideo": "I want to tweak my video output",
+ "useStorage": "I want to use an external storage provider"
+ },
+ "LogTable": {
+ "error": "Error",
+ "info": "Info",
+ "level": "Level",
+ "logs": "Logs",
+ "message": "Message",
+ "timestamp": "Timestamp",
+ "warning": "Warning"
+ },
+ "NewsFeed": {
+ "link": "Link",
+ "noNews": "No news.",
+ "title": "News & Updates from Owncast"
+ },
+ "Plugins": {
+ "PermissionNames": {
+ "chatFilter": "Filter chat messages",
+ "chatHistory": "Read chat history",
+ "chatModerate": "Moderate chat",
+ "chatSend": "Send chat messages",
+ "eventsEmit": "Emit events",
+ "fediversePost": "Post to the fediverse",
+ "httpServe": "Serve HTTP",
+ "httpSse": "Push realtime updates",
+ "networkFetch": "Make outbound HTTP requests",
+ "notificationsSend": "Send notifications",
+ "serverRead": "Read server state",
+ "storageFs": "Read and write files",
+ "storageKv": "Store data",
+ "storageUpload": "Upload files",
+ "uiModify": "Add UI elements",
+ "usersModerate": "Moderate users",
+ "usersRead": "Read user list",
+ "videoconfigRead": "Read video settings",
+ "videoconfigWrite": "Change video settings"
+ },
+ "Permissions": {
+ "chatFilter": "Inspect and modify chat messages before they are broadcast, or drop them entirely.",
+ "chatHistory": "Read recent chat messages.",
+ "chatModerate": "Hide chat messages and ban users.",
+ "chatSend": "Post chat messages as the plugin’s own bot identity.",
+ "eventsEmit": "Publish custom events that other plugins can subscribe to.",
+ "fediversePost": "Post a public note to the fediverse from the configured Owncast account.",
+ "httpServe": "Serve HTTP requests at /plugins/<name>/ (static assets and a dynamic handler).",
+ "httpSse": "Push Server-Sent-Events to subscribed browser clients.",
+ "networkFetch": "Make outbound HTTP requests to other services.",
+ "notificationsSend": "Send broadcaster notifications via the configured channels.",
+ "serverRead": "Read Owncast configuration and current server state.",
+ "storageFs": "Read and write files in a private, server-side directory only this plugin can access.",
+ "storageKv": "Read and write a per-plugin key-value store that persists across reloads.",
+ "storageUpload": "Upload files to Owncast’s public files area for browser-accessible URLs.",
+ "uiModify": "Make changes to the Owncast user interface.",
+ "usersModerate": "Disable or re-enable chat users.",
+ "usersRead": "Read the chat user list and per-user details.",
+ "videoconfigRead": "Read stream and video output configuration (encoders, variants).",
+ "videoconfigWrite": "Modify stream and video output configuration."
+ },
+ "allowedHostsLabel": "Allowed hosts:",
+ "approveButton": "Approve",
+ "approveTooltip": "Approve the expanded permission set and load the plugin.",
+ "browseEmpty": "No plugins are available in the registry yet.",
+ "browseInstall": "Install",
+ "browseInstalled": "Installed",
+ "browsePreviewAlt": "{{name}} preview screenshot",
+ "browseUnavailableDescription": "Owncast can't reach the plugin catalog right now. You can still upload .ocpkg files directly from the Installed tab.",
+ "browseUnavailableRetry": "Retry",
+ "browseUnavailableTitle": "The plugin catalog is currently unavailable",
+ "browseUpdate": "Update to v{{version}}",
+ "commandColumnHeader": "Command",
+ "commandsTab": "Commands",
+ "configure": "Configure",
+ "descriptionColumnHeader": "Description",
+ "enabledColumn": "Enabled",
+ "errorTitle": "Plugin admin error",
+ "installConfirmCancel": "Maybe later",
+ "installConfirmEnable": "Enable plugin",
+ "installConfirmNoPermissions": "This plugin doesn't request any permissions.",
+ "installConfirmPrompt": "This plugin uses these capabilities:",
+ "installConfirmTitle": "Enable {{name}}?",
+ "installEnabledSuccess": "Enabled {{name}}",
+ "instructionsLoadError": "Could not load this plugin's instructions.",
+ "instructionsTab": "Instructions",
+ "modOnlyTag": "mods only",
+ "noPermissionsDescription": "This plugin does not declare any permissions in its manifest.",
+ "noPermissionsTitle": "No permissions",
+ "none": "none",
+ "notFoundDescription": "No plugin named \"{{name}}\" is currently registered.",
+ "notFoundTitle": "Plugin not found",
+ "openPluginAdmin": "Open plugin admin",
+ "overview": "All plugins",
+ "pageDescription": "Plugins extend Owncast with new functionality. You can install plugins from this catalog, upload your own, or build your own.",
+ "pageTitle": "Plugins",
+ "permissionColumnHeader": "Permission",
+ "permissionsColumn": "Permissions",
+ "permissionsTab": "Permissions",
+ "pluginColumn": "Plugin",
+ "pluginErrorTitle": "Plugin error",
+ "pluginFailedToLoad": "Plugin failed to load",
+ "refresh": "Refresh",
+ "reloadTooltip": "Reload this plugin",
+ "sidebarTitle": "Plugins",
+ "statusAutoDisabled": "auto-disabled",
+ "statusAutoDisabledTooltip": "The host stopped invoking this plugin after repeated failures. Reload it to retry.",
+ "statusColumn": "Status",
+ "statusDisabled": "disabled",
+ "statusEnabledNotLoaded": "enabled, not loaded",
+ "statusError": "error",
+ "statusPendingApproval": "needs re-approval",
+ "statusPendingApprovalTooltip": "This plugin's manifest now requests more permissions than were originally approved. Review the new permissions in the plugin details, then click Approve to accept the new set and load the plugin.",
+ "statusRunning": "running",
+ "tabBrowse": "Browse",
+ "tabInstalled": "Installed",
+ "toggleAria": "Toggle {{name}}",
+ "uninstallAria": "Uninstall {{name}}",
+ "uninstallConfirmCancel": "Cancel",
+ "uninstallConfirmDescription": "This removes \"{{name}}\" from the server.",
+ "uninstallConfirmOk": "Uninstall",
+ "uninstallConfirmTitle": "Uninstall plugin?",
+ "uninstallSuccess": "Uninstalled {{name}}",
+ "uninstallTooltip": "Uninstall this plugin",
+ "updateAvailable": "Update available: v{{version}}",
+ "updateConfirmCancel": "Cancel",
+ "updateConfirmOk": "Update",
+ "updateConfirmTitle": "Update {{name}} to v{{version}}?",
+ "uploadButton": "Upload plugin",
+ "uploadSuccess": "Installed {{name}}"
+ },
+ "StatusMessages": {
+ "convertingEmoji": "Converting emoji...",
+ "deletingEmoji": "Deleting emoji...",
+ "emojiDeleted": "Emoji deleted",
+ "emojiUploadedSuccessfully": "Emoji uploaded successfully!",
+ "fileSizeTooBig": "File size is too big: {{size}}",
+ "fileTypeNotSupported": "File type is not supported: {{type}}",
+ "latencyBufferUpdated": "Latency buffer level updated.",
+ "pleaseEnterTag": "Please enter a tag",
+ "tagAlreadyUsed": "This tag is already used!",
+ "tagsUpdated": "Tags updated.",
+ "thereWasAnError": "There was an error: {{message}}",
+ "updated": "Updated.",
+ "uploadingEmoji": "Uploading emoji...",
+ "variantsUpdated": "Variants updated",
+ "videoCodecUpdated": "Video codec updated."
+ },
+ "VideoVariantForm": {
+ "bitrateDisabledPassthrough": "Bitrate selection is disabled when Video Passthrough is enabled.",
+ "bitrateGoodForHigh": "Good for high speed & high bitrate viewers.",
+ "bitrateGoodForMost": "Good for most viewers, bandwidths and resolutions.",
+ "bitrateGoodForSlow": "Good for slow, mobile and low bitrate viewers.",
+ "bitrateValueKbps": "{{bitrate}} kbps"
+ },
+ "ViewerInfo": {
+ "currentStream": "Current stream",
+ "currentViewers": "Current viewers",
+ "last12Hours": "Last 12 hours",
+ "last24Hours": "Last 24 hours",
+ "last30Days": "Last 30 days",
+ "last3Months": "Last 3 months",
+ "last6Months": "Last 6 months",
+ "last7Days": "Last 7 days",
+ "maxViewers": "Max viewers",
+ "maxViewersLastStream": "Max viewers last stream",
+ "maxViewersThisStream": "Max viewers this stream",
+ "noData": "No viewer data has been collected yet.",
+ "pleaseWait": "Please wait",
+ "title": "Viewer Info",
+ "viewers": "Viewers"
+ },
+ "Webhooks": {
+ "createNewWebhook": "Create New Webhook",
+ "selectAll": "Select all",
+ "selectEvents": "Select the events that will be sent to this webhook.",
+ "webhookUrlPlaceholder": "https://myserver.com/webhook"
+ },
+ "deleteEmoji": "Delete emoji",
+ "emojiPageDescription": "Here you can upload new custom emojis for usage in the chat. When uploading a new emoji, the filename without extension will be used as emoji name. Additionally, emoji names are case-insensitive. For best results, ensure all emoji have unique names.",
+ "emojiUploadBulkGuide": "Want to upload custom emojis in bulk? Check out our <a href=\"https://owncast.online/docs/chat/emoji\" rel=\"noopener noreferrer\" target=\"_blank\">Emoji guide</a>.",
+ "emojis": "Emojis",
+ "uploadNewEmoji": "Upload new emoji"
+ },
+ "Common": {
+ "poweredByOwncastVersion": "Powered by <a href='https://owncast.online'>Owncast v{{versionNumber}}</a>"
+ },
+ "Frontend": {
+ "BrowserNotifyModal": {
+ "allowButton": "Allow",
+ "blockButton": "Block",
+ "deniedDescription": "To enable push notifications from {{hostname}} access your browser permissions for this site and turn on notifications. Then reload this page to apply your updated settings on this site. <a href='https://owncast.online/docs/notifications'>Learn more.</a>",
+ "deniedTitle": "Notifications are blocked on your device",
+ "enabledDescription": "To disable push notifications from {{hostname}} access your browser permissions for this site and turn off notifications. <a href='https://owncast.online/docs/notifications'>Learn more.</a>",
+ "enabledTitle": "Notifications are enabled",
+ "errorMessage": "Error registering for live notifications: {{message}}. Make sure you're not inside a private browser environment or have previously disabled notifications for this stream.",
+ "errorTitle": "Browser Notification Error",
+ "iosAddButton": "Add",
+ "iosAddToHomeScreen": "Add to Home Screen",
+ "iosAllowPrompt": "Allow",
+ "iosComeBack": "Come back to this screen and enable notifications.",
+ "iosDescription": "It takes a couple extra steps to make sure you get notified when your favorite streams go live.",
+ "iosNameAndTap": "Give this link a name and tap the new icon on your home screen",
+ "iosShareButton": "share",
+ "iosTitle": "Get notified on iOS",
+ "learnMore": "Learn more",
+ "learnMoreAboutNotifications": "<a href='https://owncast.online/docs/notifications/#browser-notifications'>Learn more</a> about Owncast browser notifications.",
+ "mainDescription": "Get notified right in the browser each time this stream goes live.",
+ "permissionWantsTo": "{{hostname}} wants to",
+ "showNotifications": "Show notifications",
+ "unsupported": "Browser notifications are not supported in your browser.",
+ "unsupportedLocal": "Browser notifications are not supported for local servers."
+ },
+ "Chat": {
+ "authenticateToChat": "Authenticate to chat",
+ "moderatorNotification": "You are now a moderator.",
+ "nameChangeText": "is now known as",
+ "userJoined": "joined the chat.",
+ "userLeft": "left the chat."
+ },
+ "FollowModal": {
+ "description": "By following this stream you'll get notified on the Fediverse when it goes live. Now is a great time to",
+ "followButton": "Follow",
+ "followError": "Follow Error",
+ "instructions": "Enter your username @server to follow",
+ "joinFediverse": "Join the Fediverse",
+ "learnFediverse": "learn about the Fediverse",
+ "newToYou": "if it's new to you.",
+ "placeholder": "Your fediverse account @account@server",
+ "redirectMessage": "You'll be redirected to your Fediverse server and asked to confirm the action.",
+ "unableToFollow": "Unable to follow."
+ },
+ "Footer": {
+ "contribute": "Contribute",
+ "documentation": "Documentation",
+ "source": "Source"
+ },
+ "Header": {
+ "chatOffline": "Chat is offline",
+ "chatWillBeAvailable": "Chat will be available when the stream is live.",
+ "skipToContent": "Skip to page content",
+ "skipToFooter": "Skip to footer",
+ "skipToOfflineMessage": "Skip to offline message",
+ "skipToPlayer": "Skip to player"
+ },
+ "NameChangeModal": {
+ "authInfo": "You can also authenticate an IndieAuth or Fediverse account via the \"Authenticate\" menu.",
+ "buttonText": "Change name",
+ "colorLabel": "Your Color",
+ "description": "Your chat display name is what people see when you send chat messages.",
+ "overLimit": "Over limit",
+ "placeholder": "Your chat display name"
+ },
+ "StreamsTab": {
+ "errorLoadingStreams": "Error loading streams",
+ "loadingStreams": "Loading featured streams...",
+ "noFeaturedStreams": "No featured streams available"
+ },
+ "chatDisabled": "Chat is disabled",
+ "chatEmbedTitle": "{{name}} Chat",
+ "chatOffline": "Chat is offline",
+ "componentError": "Error: {{message}}",
+ "helloWorld": "Hello world",
+ "lastLiveAgo": "Last live {{timeAgo}} ago",
+ "offlineBasic": "This stream is offline. Check back soon!",
+ "offlineFediverseOnly": "This stream is offline. <span class='follow-link'>Follow</span> {{fediverseAccount}} on the Fediverse to see the next time {{streamer}} goes live.",
+ "offlineNotifyAndFediverse": "This stream is offline. You can <span class='notify-link'>be notified</span> the next time {{streamer}} goes live or <span class='follow-link'>follow</span> {{fediverseAccount}} on the Fediverse.",
+ "offlineNotifyOnly": "This stream is offline. <span class='notify-link'>Be notified</span> the next time {{streamer}} goes live."
+ },
+ "Testing": {
+ "itemCount": "You have {{count}} items",
+ "messageCount": "You have {{count}} messages from {{sender}}",
+ "noPluralKey": "This key has no plural variants - {{count}} things",
+ "simpleKey": "Simple translation text"
+ }
+}
diff --git a/web/pages/admin/config-featured.tsx b/web/pages/admin/config-featured.tsx
index 4b93356770..a1efd14d9c 100644
--- a/web/pages/admin/config-featured.tsx
+++ b/web/pages/admin/config-featured.tsx
@@ -1,5 +1,5 @@
/* eslint-disable react/no-unescaped-entities */
-import { Typography, Alert, Button, Space } from 'antd';
+import { Typography, Alert, Button, Space, Tabs } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import Link from 'next/link';
import React, { ReactElement, useContext, useState } from 'react';
@@ -9,8 +9,10 @@ import { AdminLayout } from '../../components/layouts/AdminLayout';
import { FederatedServersTable } from '../../components/admin/FederatedServers/FederatedServersTable';
import { FeatureStreamModal } from '../../components/admin/FederatedServers/FeatureStreamModal';
import { FeatureRequests } from '../../components/admin/FederatedServers/FeatureRequests';
+import { DirectoryListings } from '../../components/admin/FederatedServers/DirectoryListings';
import { useFederatedServers } from '../../hooks/useFederatedServers';
import { useFeatureRequests } from '../../hooks/useFeatureRequests';
+import { useDirectoryFollowers } from '../../hooks/useDirectoryFollowers';
import { ServerStatusContext } from '../../utils/server-status-context';
const ConfigFeatured = () => {
@@ -35,6 +37,12 @@ const ConfigFeatured = () => {
reject: rejectFeatureRequest,
} = useFeatureRequests();
+ const {
+ directories: directoryFollowers,
+ loading: directoriesLoading,
+ remove: removeDirectoryFollower,
+ } = useDirectoryFollowers();
+
const handleFeatureStream = async (url: string) => {
await addServer(url);
setModalOpen(false);
@@ -63,32 +71,66 @@ const ConfigFeatured = () => {
{federationEnabled ? (
<>
- <Space direction="vertical" size="large" style={{ width: '100%' }}>
- <FeatureRequests
- requests={featureRequests}
- loading={requestsLoading}
- onApprove={approveFeatureRequest}
- onReject={rejectFeatureRequest}
- />
+ <Tabs
+ defaultActiveKey="featuring"
+ items={[
+ {
+ key: 'featuring',
+ label: (
+ <Translation
+ translationKey={Localization.Admin.FeaturedStreams.streamsYouFeatureTab}
+ defaultText="Streams you feature"
+ />
+ ),
+ children: (
+ <Space direction="vertical" size="large" style={{ width: '100%' }}>
+ <Button
+ type="primary"
+ icon={<PlusOutlined />}
+ onClick={() => setModalOpen(true)}
+ size="large"
+ >
+ <Translation
+ translationKey={Localization.Admin.FeaturedStreams.featureStreamButton}
+ defaultText="Feature Live Stream"
+ />
+ </Button>
- <Button
- type="primary"
- icon={<PlusOutlined />}
- onClick={() => setModalOpen(true)}
- size="large"
- >
- <Translation
- translationKey={Localization.Admin.FeaturedStreams.featureStreamButton}
- defaultText="Feature Live Stream"
- />
- </Button>
+ <FederatedServersTable
+ servers={federatedServers}
+ loading={serversLoading}
+ onRemove={removeServer}
+ />
+ </Space>
+ ),
+ },
+ {
+ key: 'featuring-you',
+ label: (
+ <Translation
+ translationKey={Localization.Admin.FeaturedStreams.featuringYouTab}
+ defaultText="Featuring you"
+ />
+ ),
+ children: (
+ <Space direction="vertical" size="large" style={{ width: '100%' }}>
+ <FeatureRequests
+ requests={featureRequests}
+ loading={requestsLoading}
+ onApprove={approveFeatureRequest}
+ onReject={rejectFeatureRequest}
+ />
- <FederatedServersTable
- servers={federatedServers}
- loading={serversLoading}
- onRemove={removeServer}
- />
- </Space>
+ <DirectoryListings
+ directories={directoryFollowers}
+ loading={directoriesLoading}
+ onRemove={removeDirectoryFollower}
+ />
+ </Space>
+ ),
+ },
+ ]}
+ />
<FeatureStreamModal
open={modalOpen}
diff --git a/web/types/localization.ts b/web/types/localization.ts
index 69dbdd39a7..4184b11f34 100644
--- a/web/types/localization.ts
+++ b/web/types/localization.ts
@@ -335,6 +335,19 @@ export const Localization = {
featureRequestRejected: 'Admin.FeaturedStreams.featureRequestRejected',
failedToApprove: 'Admin.FeaturedStreams.failedToApprove',
failedToReject: 'Admin.FeaturedStreams.failedToReject',
+
+ // Tabs splitting streams you feature from directories featuring you
+ streamsYouFeatureTab: 'Admin.FeaturedStreams.streamsYouFeatureTab',
+ featuringYouTab: 'Admin.FeaturedStreams.featuringYouTab',
+
+ // Directories that are featuring/listing this server
+ directoryListingsTitle: 'Admin.FeaturedStreams.directoryListingsTitle',
+ directoryListingsDescription: 'Admin.FeaturedStreams.directoryListingsDescription',
+ directoryListingsEmpty: 'Admin.FeaturedStreams.directoryListingsEmpty',
+ removeFromDirectoryButton: 'Admin.FeaturedStreams.removeFromDirectoryButton',
+ removeFromDirectoryConfirm: 'Admin.FeaturedStreams.removeFromDirectoryConfirm',
+ directoryRemoved: 'Admin.FeaturedStreams.directoryRemoved',
+ failedToRemoveDirectory: 'Admin.FeaturedStreams.failedToRemoveDirectory',
},
// Logging and monitoring
diff --git a/webserver/handlers/admin.go b/webserver/handlers/admin.go
index 0a1b39681a..0b1f76a116 100644
--- a/webserver/handlers/admin.go
+++ b/webserver/handlers/admin.go
@@ -176,6 +176,14 @@ func (s *ServerInterfaceImpl) GetBlockedAndRejectedFollowersOptions(w http.Respo
s.h.middleware.RequireAdminAuth(s.h.admin.GetBlockedAndRejectedFollowers)(w, r)
}
+func (s *ServerInterfaceImpl) GetDirectoryFollowers(w http.ResponseWriter, r *http.Request) {
+ s.h.middleware.RequireAdminAuth(s.h.admin.GetDirectoryFollowers)(w, r)
+}
+
+func (s *ServerInterfaceImpl) GetDirectoryFollowersOptions(w http.ResponseWriter, r *http.Request) {
+ s.h.middleware.RequireAdminAuth(s.h.admin.GetDirectoryFollowers)(w, r)
+}
+
func (s *ServerInterfaceImpl) ApproveFollower(w http.ResponseWriter, r *http.Request) {
s.h.middleware.RequireAdminAuth(s.h.admin.ApproveFollower)(w, r)
}
diff --git a/webserver/handlers/admin/followers.go b/webserver/handlers/admin/followers.go
index caf6b7fae2..940edef946 100644
--- a/webserver/handlers/admin/followers.go
+++ b/webserver/handlers/admin/followers.go
@@ -4,6 +4,8 @@ import (
"encoding/json"
"net/http"
+ log "github.com/sirupsen/logrus"
+
"github.com/owncast/owncast/services/activitypub/requests"
"github.com/owncast/owncast/webserver/handlers/generated"
webutils "github.com/owncast/owncast/webserver/utils"
@@ -42,9 +44,9 @@ func (a *Admin) ApproveFollower(w http.ResponseWriter, r *http.Request) {
return
}
- // Featured-streams follows are a directory relationship, not a fan
- // follow, so don't fire the follower webhook for them.
- if !followRequest.IsOwncastServer {
+ // Directory follows are a listing relationship, not a fan follow, so
+ // don't fire the follower webhook for them.
+ if !followRequest.IsDirectory {
go a.webhooks.SendFediverseEngagementFollowEvent(*approval.ActorIRI)
}
@@ -85,6 +87,17 @@ func (a *Admin) RemoveFollower(w http.ResponseWriter, r *http.Request) {
return
}
+ // If this follower is a directory that is listing us, tell it we no longer
+ // accept its follow so it drops our entry, rather than leaving us showing
+ // offline in its listing forever. Best effort: we still remove the follower
+ // locally even if the Reject cannot be queued.
+ if follower, err := a.followersRepository.GetByIRI(request.ActorIRI); err == nil && follower != nil && follower.IsDirectory {
+ localAccountName := a.configRepository.GetDefaultFederationUsername()
+ if rejectErr := requests.SendFollowReject(a.activitypub.Workerpool(), follower.Inbox, follower.RequestObject, localAccountName, a.apBuilder, a.apSigner); rejectErr != nil {
+ log.Errorln("unable to send follow reject to directory", request.ActorIRI, rejectErr)
+ }
+ }
+
if err := a.followersRepository.RemoveByIRI(request.ActorIRI); err != nil {
webutils.WriteSimpleResponse(w, false, err.Error())
return
@@ -104,6 +117,20 @@ func (a *Admin) GetPendingFollowRequests(w http.ResponseWriter, r *http.Request)
webutils.WriteResponse(w, requests)
}
+// GetDirectoryFollowers returns the directories that are featuring/listing this
+// server: approved followers that identified themselves with the ns#directory
+// marker. The operator can review them here and remove any with the existing
+// RemoveFollower endpoint.
+func (a *Admin) GetDirectoryFollowers(w http.ResponseWriter, r *http.Request) {
+ followers, err := a.followersRepository.GetApprovedDirectoryFollowers()
+ if err != nil {
+ webutils.WriteSimpleResponse(w, false, err.Error())
+ return
+ }
+
+ webutils.WriteResponse(w, followers)
+}
+
// GetBlockedAndRejectedFollowers will return blocked and rejected followers.
func (a *Admin) GetBlockedAndRejectedFollowers(w http.ResponseWriter, r *http.Request) {
rejections, err := a.followersRepository.GetBlockedAndRejected()
diff --git a/webserver/handlers/generated/generated.gen.go b/webserver/handlers/generated/generated.gen.go
index ecfff1a6e1..caddaeda2b 100644
--- a/webserver/handlers/generated/generated.gen.go
+++ b/webserver/handlers/generated/generated.gen.go
@@ -444,6 +444,12 @@ type ServerInterface interface {
// (OPTIONS /admin/followers/blocked)
GetBlockedAndRejectedFollowersOptions(w http.ResponseWriter, r *http.Request)
+ // Get directories that are featuring/listing this server
+ // (GET /admin/followers/directory)
+ GetDirectoryFollowers(w http.ResponseWriter, r *http.Request)
+
+ // (OPTIONS /admin/followers/directory)
+ GetDirectoryFollowersOptions(w http.ResponseWriter, r *http.Request)
// Get a list of pending follow requests
// (GET /admin/followers/pending)
GetPendingFollowRequests(w http.ResponseWriter, r *http.Request)
@@ -1487,6 +1493,17 @@ func (_ Unimplemented) GetBlockedAndRejectedFollowersOptions(w http.ResponseWrit
w.WriteHeader(http.StatusNotImplemented)
}
+// Get directories that are featuring/listing this server
+// (GET /admin/followers/directory)
+func (_ Unimplemented) GetDirectoryFollowers(w http.ResponseWriter, r *http.Request) {
+ w.WriteHeader(http.StatusNotImplemented)
+}
+
+// (OPTIONS /admin/followers/directory)
+func (_ Unimplemented) GetDirectoryFollowersOptions(w http.ResponseWriter, r *http.Request) {
+ w.WriteHeader(http.StatusNotImplemented)
+}
+
// Get a list of pending follow requests
// (GET /admin/followers/pending)
func (_ Unimplemented) GetPendingFollowRequests(w http.ResponseWriter, r *http.Request) {
@@ -4352,6 +4369,38 @@ func (siw *ServerInterfaceWrapper) GetBlockedAndRejectedFollowersOptions(w http.
handler.ServeHTTP(w, r)
}
+// GetDirectoryFollowers operation middleware
+func (siw *ServerInterfaceWrapper) GetDirectoryFollowers(w http.ResponseWriter, r *http.Request) {
+ ctx := r.Context()
+
+ ctx = context.WithValue(ctx, BasicAuthScopes, []string{})
+
+ r = r.WithContext(ctx)
+
+ handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ siw.Handler.GetDirectoryFollowers(w, r)
+ }))
+
+ for _, middleware := range siw.HandlerMiddlewares {
+ handler = middleware(handler)
+ }
+
+ handler.ServeHTTP(w, r)
+}
+
+// GetDirectoryFollowersOptions operation middleware
+func (siw *ServerInterfaceWrapper) GetDirectoryFollowersOptions(w http.ResponseWriter, r *http.Request) {
+ handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ siw.Handler.GetDirectoryFollowersOptions(w, r)
+ }))
+
+ for _, middleware := range siw.HandlerMiddlewares {
+ handler = middleware(handler)
+ }
+
+ handler.ServeHTTP(w, r)
+}
+
// GetPendingFollowRequests operation middleware
func (siw *ServerInterfaceWrapper) GetPendingFollowRequests(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
@@ -6480,6 +6529,12 @@ func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handl
r.Group(func(r chi.Router) {
r.Options(options.BaseURL+"/admin/followers/blocked", wrapper.GetBlockedAndRejectedFollowersOptions)
})
+ r.Group(func(r chi.Router) {
+ r.Get(options.BaseURL+"/admin/followers/directory", wrapper.GetDirectoryFollowers)
+ })
+ r.Group(func(r chi.Router) {
+ r.Options(options.BaseURL+"/admin/followers/directory", wrapper.GetDirectoryFollowersOptions)
+ })
r.Group(func(r chi.Router) {
r.Get(options.BaseURL+"/admin/followers/pending", wrapper.GetPendingFollowRequests)
})