Init commit

This commit is contained in:
ShreejitPanchal
2026-05-19 19:56:02 +08:00
commit 6601501eff
4047 changed files with 2185372 additions and 0 deletions

BIN
packages/tests/fixtures/1080p_60fps.mp4 vendored Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,93 @@
{
"headers": {
"user-agent": "http.rb/3.3.0 (Mastodon/2.5.0; +http://localhost:3000/)",
"host": "localhost",
"date": "Mon, 22 Oct 2018 13:34:22 GMT",
"accept-encoding": "gzip",
"digest": "SHA-256=FEr5j2WSSfdEMcG3NTOXuGU0lUchfTJx4+BtUlWOwDk=",
"content-type": "application/activity+json",
"signature": "keyId=\"http://localhost:3000/users/ronan2#main-key\",algorithm=\"rsa-sha256\",headers=\"(request-target) host date digest content-type\",signature=\"oLKbgxdFXdXsHJ3x/UsG9Svu7oa8Dyqiy6Jif4wqNuhAqRVMRaG18f+dd2OcfFX3XRGF8p8flZkU6vvoEQBauTwGRGcgXAJuKC1zYIWGk+PeiW8lNUnE4qGapWcTiFnIo7FKauNdsgqg/tvgs1pQIdHkDDjZMI64twP7sTN/4vG1PCq+kyqi/DM+ORLi/W7vFuLVHt2Iz7ikfw/R3/mMtS4FwLops+tVYBQ2iQ9DVRhTwLKVbeL/LLVB/tdGzNZ4F4nImBAQQ9I7WpPM6J/k+cBmoEbrUKs8ptx9gbX3OSsl5wlvPVMNzU9F9yb2MrB/Y/J4qssKz+LbiaktKGj7OQ==\"",
"content-length": "2815"
},
"body": {
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/v1",
{
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
"sensitive": "as:sensitive",
"movedTo": {
"@id": "as:movedTo",
"@type": "@id"
},
"Hashtag": "as:Hashtag",
"ostatus": "http://ostatus.org#",
"atomUri": "ostatus:atomUri",
"inReplyToAtomUri": "ostatus:inReplyToAtomUri",
"conversation": "ostatus:conversation",
"toot": "http://joinmastodon.org/ns#",
"Emoji": "toot:Emoji",
"focalPoint": {
"@container": "@list",
"@id": "toot:focalPoint"
},
"featured": {
"@id": "toot:featured",
"@type": "@id"
},
"schema": "http://schema.org#",
"PropertyValue": "schema:PropertyValue",
"value": "schema:value"
}
],
"id": "http://localhost:3000/users/ronan2/statuses/100939547203370948/activity",
"type": "Create",
"actor": "http://localhost:3000/users/ronan2",
"published": "2018-10-22T13:34:18Z",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"http://localhost:3000/users/ronan2/followers",
"http://localhost:9000/accounts/ronan"
],
"object": {
"id": "http://localhost:3000/users/ronan2/statuses/100939547203370948",
"type": "Note",
"summary": null,
"inReplyTo": "http://localhost:9000/videos/watch/90e6f8ed-b369-423c-b0c8-f44e5350c752",
"published": "2018-10-22T13:34:18Z",
"url": "http://localhost:3000/@ronan2/100939547203370948",
"attributedTo": "http://localhost:3000/users/ronan2",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"http://localhost:3000/users/ronan2/followers",
"http://localhost:9000/accounts/ronan"
],
"sensitive": false,
"atomUri": "http://localhost:3000/users/ronan2/statuses/100939547203370948",
"inReplyToAtomUri": "http://localhost:9000/videos/watch/90e6f8ed-b369-423c-b0c8-f44e5350c752",
"conversation": "tag:localhost:3000,2018-10-19:objectId=72:objectType=Conversation",
"content": "<p><span class=\"h-card\"><a href=\"http://localhost:9000/accounts/ronan\" class=\"u-url mention\">@<span>ronan</span></a></span> zergzerg</p>",
"contentMap": {
"en": "<p><span class=\"h-card\"><a href=\"http://localhost:9000/accounts/ronan\" class=\"u-url mention\">@<span>ronan</span></a></span> zergzerg</p>"
},
"attachment": [],
"tag": [
{
"type": "Mention",
"href": "http://localhost:9000/accounts/ronan",
"name": "@ronan@localhost:9000"
}
]
},
"signature": {
"type": "RsaSignature2017",
"creator": "http://localhost:3000/users/ronan2#main-key",
"created": "2018-10-22T13:34:19Z",
"signatureValue": "x+xL4l8ERziYVhwEafHJyBQOInvNZ0gV4ccYd9AtFYeGJagc8fY6jjjhbDRCD7yMhgTjBX69z20MXnDuwpmM6wej3dt1wLKdIyXVViO84nAlqFz7KmNxtk5lDnAVX/vttscT5YUFvw4dbPT2mQiEd1lKbaLftRiIPEomZpQ37+fUkQdcPrnhruPAISO/Sof1n1LFW4mYIffozteQSZBH6HaCVp+MRMIhdMi5e8w7PD48/cZz8D/EU8Vqi91FM76/3tMqg6nLqQ+8bq74Jvt2kzwZlIufe+I55QMpZOmF6hGIJEt+R0JXdjQbtgcELONmNj2dr8sAlzu7zKlAGuJ24Q=="
}
}
}

View File

@@ -0,0 +1,93 @@
{
"headers": {
"user-agent": "http.rb/3.3.0 (Mastodon/2.5.0; +http://localhost:3000/)",
"host": "localhost",
"date": "Mon, 22 Oct 2018 13:34:22 GMT",
"accept-encoding": "gzip",
"digest": "SHA-256=FEr5j2WSSfdEMcG3NTOXuGU0lUchfTJx4+BtUlWOwDk=",
"content-type": "application/activity+json",
"signature": "keyId=\"http://localhost:3000/users/ronan2#main-key\",algorithm=\"rsa-sha256\",headers=\"(request-target) host date digest content-type\",signature=\"oLKbgxdFXdXsHJ3x/UsG9Svu7oa8Dyqiy6Jif4wqNuhAqRVMRaG18f+dd2OcfFX3XRGF8p8flZkU6vvoEQBauTwGRGcgXAJuKC1zYIWGk+PeiW8lNUnE4qGapWcTiFnIo7FKauNdsgqg/tvgs1pQIdHkDDjZMI64twP7sTN/4vG1PCq+kyqi/DM+ORLi/W7vFuLVHt2Iz7ikfw/R3/mMtS4FwLops+tVYBQ2iQ9DVRhTwLKVbeL/LLVB/tdGzNZ4F4nImBAQQ9I7WpPM6J/k+cBmoEbrUKs8ptx9gbX3OSsl4wlvPVMNzU9F9yb2MrB/Y/J4qssKz+LbiaktKGj7OQ==\"",
"content-length": "2815"
},
"body": {
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/v1",
{
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
"sensitive": "as:sensitive",
"movedTo": {
"@id": "as:movedTo",
"@type": "@id"
},
"Hashtag": "as:Hashtag",
"ostatus": "http://ostatus.org#",
"atomUri": "ostatus:atomUri",
"inReplyToAtomUri": "ostatus:inReplyToAtomUri",
"conversation": "ostatus:conversation",
"toot": "http://joinmastodon.org/ns#",
"Emoji": "toot:Emoji",
"focalPoint": {
"@container": "@list",
"@id": "toot:focalPoint"
},
"featured": {
"@id": "toot:featured",
"@type": "@id"
},
"schema": "http://schema.org#",
"PropertyValue": "schema:PropertyValue",
"value": "schema:value"
}
],
"id": "http://localhost:3000/users/ronan2/statuses/100939547203370948/activity",
"type": "Create",
"actor": "http://localhost:3000/users/ronan2",
"published": "2018-10-22T13:34:18Z",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"http://localhost:3000/users/ronan2/followers",
"http://localhost:9000/accounts/ronan"
],
"object": {
"id": "http://localhost:3000/users/ronan2/statuses/100939547203370948",
"type": "Note",
"summary": null,
"inReplyTo": "http://localhost:9000/videos/watch/90e6f8ed-b369-423c-b0c8-f44e5350c752",
"published": "2018-10-22T13:34:18Z",
"url": "http://localhost:3000/@ronan2/100939547203370948",
"attributedTo": "http://localhost:3000/users/ronan2",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"http://localhost:3000/users/ronan2/followers",
"http://localhost:9000/accounts/ronan"
],
"sensitive": false,
"atomUri": "http://localhost:3000/users/ronan2/statuses/100939547203370948",
"inReplyToAtomUri": "http://localhost:9000/videos/watch/90e6f8ed-b369-423c-b0c8-f44e5350c752",
"conversation": "tag:localhost:3000,2018-10-19:objectId=72:objectType=Conversation",
"content": "<p><span class=\"h-card\"><a href=\"http://localhost:9000/accounts/ronan\" class=\"u-url mention\">@<span>ronan</span></a></span> zergzerg</p>",
"contentMap": {
"en": "<p><span class=\"h-card\"><a href=\"http://localhost:9000/accounts/ronan\" class=\"u-url mention\">@<span>ronan</span></a></span> zergzerg</p>"
},
"attachment": [],
"tag": [
{
"type": "Mention",
"href": "http://localhost:9000/accounts/ronan",
"name": "@ronan@localhost:9000"
}
]
},
"signature": {
"type": "RsaSignature2017",
"creator": "http://localhost:3000/users/ronan2#main-key",
"created": "2018-10-22T13:34:19Z",
"signatureValue": "x+xL4l8ERziYVhwEafHJyBQOInvNZ0gV4ccYd9AtFYeGJagc8fY6jjjhbDRCD7yMhgTjBX69z20MXnDuwpmM6wej3dt1wLKdIyXVViO84nAlqFz7KmNxtk5lDnAVX/vttscT5YUFvw4dbPT2mQiEd1lKbaLftRiIPEomZpQ37+fUkQdcPrnhruPAISO/Sof1n1LFW4mYIffozteQSZBH6HaCVp+MRMIhdMi5e8w7PD48/cZz8D/EU8Vqi91FM76/3tMqg6nLqQ+8bq74Jvt2kzwZlIufe+I55QMpZOmF6hGIJEt+R0JXdjQbtgcELONmNj2dr8sAlzu7zKlAGuJ24Q=="
}
}
}

View File

@@ -0,0 +1,3 @@
{
"publicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0YyuthHtWWgDe0Fdgdp2\ndC5dTJsRqW6pFw5omIYYYjoES/WRewhVxEA54BhmxD3L1zChfx131N1TS8jVowhW\nm999jpUffKCCvLgYKIXETJDHiDeMONVx8wp7v9fS1HiFXo/E5und39gUMs14CMFZ\n6PE5jRV3r4XIKQJHQl7/X5n5FOb2934K+1TKUeBkbft/AushlKatYQakt3qHxpwx\nFvE+JjGo7QTnzdjaOx/e5QvojdGi2Kx4+jl77j2WVcSo5lOBz04OAVJtChtn82vS\nulPdDh3hZcDn+WK67yAhGP6AnzvOybZZS4zowlKiQ3kqjVVXKdl8gAsL4Y7MZ40R\nJQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -0,0 +1,81 @@
{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/v1",
{
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
"sensitive": "as:sensitive",
"movedTo": {
"@id": "as:movedTo",
"@type": "@id"
},
"Hashtag": "as:Hashtag",
"ostatus": "http://ostatus.org#",
"atomUri": "ostatus:atomUri",
"inReplyToAtomUri": "ostatus:inReplyToAtomUri",
"conversation": "ostatus:conversation",
"toot": "http://joinmastodon.org/ns#",
"Emoji": "toot:Emoji",
"focalPoint": {
"@container": "@list",
"@id": "toot:focalPoint"
},
"featured": {
"@id": "toot:featured",
"@type": "@id"
},
"schema": "http://schema.org#",
"PropertyValue": "schema:PropertyValue",
"value": "schema:value"
}
],
"id": "http://localhost:3000/users/ronan2/statuses/100939345950887698/activity",
"type": "Create",
"actor": "http://localhost:3000/users/ronan2",
"published": "2018-10-22T12:43:07Z",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"http://localhost:3000/users/ronan2/followers",
"http://localhost:9000/accounts/ronan"
],
"object": {
"id": "http://localhost:3000/users/ronan2/statuses/100939345950887698",
"type": "Note",
"summary": null,
"inReplyTo": "http://localhost:9000/videos/watch/90e6f8ed-b369-423c-b0c8-f44e5350c752",
"published": "2018-10-22T12:43:07Z",
"url": "http://localhost:3000/@ronan2/100939345950887698",
"attributedTo": "http://localhost:3000/users/ronan2",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"http://localhost:3000/users/ronan2/followers",
"http://localhost:9000/accounts/ronan"
],
"sensitive": false,
"atomUri": "http://localhost:3000/users/ronan2/statuses/100939345950887698",
"inReplyToAtomUri": "http://localhost:9000/videos/watch/90e6f8ed-b369-423c-b0c8-f44e5350c752",
"conversation": "tag:localhost:3000,2018-10-19:objectId=72:objectType=Conversation",
"content": "<p><span class=\"h-card\"><a href=\"http://localhost:9000/accounts/ronan\" class=\"u-url mention\">@<span>ronan</span></a></span> zerg</p>",
"contentMap": {
"en": "<p><span class=\"h-card\"><a href=\"http://localhost:9000/accounts/ronan\" class=\"u-url mention\">@<span>ronan</span></a></span> zerg</p>"
},
"attachment": [],
"tag": [
{
"type": "Mention",
"href": "http://localhost:9000/accounts/ronan",
"name": "@ronan@localhost:9000"
}
]
},
"signature": {
"type": "RsaSignature2017",
"creator": "http://localhost:3000/users/ronan2#main-key",
"created": "2018-10-22T12:43:08Z",
"signatureValue": "Vgr8nA0agPr9TcA4BlX+MWhmuE+rBcoIJLpnPbm3E5SnOCXbgjEfEaTLqfuzzkKNsR3PBbkvi3YWK4/DxJ0zmpzSB7yy4NRzluQMVQHqJiFKXAX3Sr3fIrK24xkWW9/F207c1NpFajSGbgnFKBdtFE0e5VqwSrSoOJkZukZW/2ATSnsyzblieuUmvTWpD0PqpUOsynPjw+RqZnqPn0cjw1z2Dm7ZRt3trnyMTXFYZw5U/YuqMY2kpadD6vq780md8kXlJIylxG6ZrlO2jz9fJdnfuVq43d4QFNsBm1K1r2WtNqX+i+wiqh+u3PjF4pzXtl/a3hJOH18IfZnK7I21mQ=="
}
}

View File

@@ -0,0 +1,81 @@
{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/v1",
{
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
"sensitive": "as:sensitive",
"movedTo": {
"@id": "as:movedTo",
"@type": "@id"
},
"Hashtag": "as:Hashtag",
"ostatus": "http://ostatus.org#",
"atomUri": "ostatus:atomUri",
"inReplyToAtomUri": "ostatus:inReplyToAtomUri",
"conversation": "ostatus:conversation",
"toot": "http://joinmastodon.org/ns#",
"Emoji": "toot:Emoji",
"focalPoint": {
"@container": "@list",
"@id": "toot:focalPoint"
},
"featured": {
"@id": "toot:featured",
"@type": "@id"
},
"schema": "http://schema.org#",
"PropertyValue": "schema:PropertyValue",
"value": "schema:value"
}
],
"id": "http://localhost:3000/users/ronan2/statuses/100939345950887698/activity",
"type": "Create",
"actor": "http://localhost:3000/users/ronan2",
"published": "2018-10-22T12:43:07Z",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"http://localhost:3000/users/ronan2/followers",
"http://localhost:9000/accounts/ronan"
],
"object": {
"id": "http://localhost:3000/users/ronan2/statuses/100939345950887698",
"type": "Note",
"summary": null,
"inReplyTo": "http://localhost:9000/videos/watch/90e6f8ed-b369-423c-b0c8-f44e5350c752",
"published": "2018-10-22T12:43:07Z",
"url": "http://localhost:3000/@ronan2/100939345950887698",
"attributedTo": "http://localhost:3000/users/ronan2",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"http://localhost:3000/users/ronan2/followers",
"http://localhost:9000/accounts/ronan"
],
"sensitive": false,
"atomUri": "http://localhost:3000/users/ronan2/statuses/100939345950887698",
"inReplyToAtomUri": "http://localhost:9000/videos/watch/90e6f8ed-b369-423c-b0c8-f44e5350c752",
"conversation": "tag:localhost:3000,2018-10-19:objectId=72:objectType=Conversation",
"content": "<p><span class=\"h-card\"><a href=\"http://localhost:9000/accounts/ronan\" class=\"u-url mention\">@<span>ronan</span></a></span> zerg</p>",
"contentMap": {
"en": "<p><span class=\"h-card\"><a href=\"http://localhost:9000/accounts/ronan\" class=\"u-url mention\">@<span>ronan</span></a></span> zerg</p>"
},
"attachment": [],
"tag": [
{
"type": "Mention",
"href": "http://localhost:9000/accounts/ronan",
"name": "@ronan@localhost:9000"
}
]
},
"signature": {
"type": "RsaSignature2017",
"creator": "http://localhost:3000/users/ronan2#main-key",
"created": "2018-10-22T12:43:08Z",
"signatureValue": "VgR8nA0agPr9TcA4BlX+MWhmuE+rBcoIJLpnPbm3E5SnOCXbgjEfEaTLqfuzzkKNsR3PBbkvi3YWK4/DxJ0zmpzSB7yy4NRzluQMVQHqJiFKXAX3Sr3fIrK24xkWW9/F207c1NpFajSGbgnFKBdtFE0e5VqwSrSoOJkZukZW/2ATSnsyzblieuUmvTWpD0PqpUOsynPjw+RqZnqPn0cjw1z2Dm7ZRt3trnyMTXFYZw5U/YuqMY2kpadD6vq780md8kXlJIylxG6ZrlO2jz9fJdnfuVq43d4QFNsBm1K1r2WtNqX+i+wiqh+u3PjF4pzXtl/a3hJOH18IfZnK7I21mQ=="
}
}

View File

@@ -0,0 +1,93 @@
{
"headers": {
"user-agent": "http.rb/3.3.0 (Mastodon/2.5.0; +http://localhost:3000/)",
"host": "localhost",
"date": "Mon, 22 Oct 2018 13:34:22 GMT",
"accept-encoding": "gzip",
"digest": "SHA-256=FEr5j2WSSfdEMcG3NTOXuGU0lUchfTJx4+BtUlWOwDk=",
"content-type": "application/activity+json",
"signature": "keyId=\"http://localhost:3000/users/ronan2#main-key\",algorithm=\"rsa-sha256\",headers=\"(request-target) host date digest content-type\",signature=\"oLKbgxdFXdXsHJ3x/UsG9Svu7oa8Dyqiy6Jif4wqNuhAqRVMRaG18f+dd2OcfFX3XRGF8p8flZkU6vvoEQBauTwGRGcgXAJuKC1zYIWGk+PeiW8lNUnE4qGapWcTiFnIo7FKauNdsgqg/tvgs1pQIdHkDDjZMI64twP7sTN/4vG1PCq+kyqi/DM+ORLi/W7vFuLVHt2Iz7ikfw/R3/mMtS4FwLops+tVYBQ2iQ9DVRhTwLKVbeL/LLVB/tdGzNZ4F4nImBAQQ9I7WpPM6J/k+cBmoEbrUKs8ptx9gbX3OSsl5wlvPVMNzU9F9yb2MrB/Y/J4qssKz+LbiaktKGj7OQ==\"",
"content-length": "2815"
},
"body": {
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/v1",
{
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
"sensitive": "as:sensitive",
"movedTo": {
"@id": "as:movedTo",
"@type": "@id"
},
"Hashtag": "as:Hashtag",
"ostatus": "http://ostatus.org#",
"atomUri": "ostatus:atomUri",
"inReplyToAtomUri": "ostatus:inReplyToAtomUri",
"conversation": "ostatus:conversation",
"toot": "http://joinmastodon.org/ns#",
"Emoji": "toot:Emoji",
"focalPoint": {
"@container": "@list",
"@id": "toot:focalPoint"
},
"featured": {
"@id": "toot:featured",
"@type": "@id"
},
"schema": "http://schema.org#",
"PropertyValue": "schema:PropertyValue",
"value": "schema:value"
}
],
"id": "http://localhost:3000/users/ronan2/statuses/100939547203370948/activity",
"type": "Create",
"actor": "http://localhost:3000/users/ronan2",
"published": "2018-10-22T13:34:18Z",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"http://localhost:3000/users/ronan2/followers",
"http://localhost:9000/accounts/ronan"
],
"object": {
"id": "http://localhost:3000/users/ronan2/statuses/100939547203370948",
"type": "Note",
"summary": null,
"inReplyTo": "http://localhost:9000/videos/watch/90e6f8ed-b369-423c-b0c8-f44e5350c752",
"published": "2018-10-22T13:34:18Z",
"url": "http://localhost:3000/@ronan2/100939547203370948",
"attributedTo": "http://localhost:3000/users/ronan2",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"http://localhost:3000/users/ronan2/followers",
"http://localhost:9000/accounts/ronan"
],
"sensitive": false,
"atomUri": "http://localhost:3000/users/ronan2/statuses/100939547203370948",
"inReplyToAtomUri": "http://localhost:9000/videos/watch/90e6f8ed-b369-423c-b0c8-f44e5350c752",
"conversation": "tag:localhost:3000,2018-10-19:objectId=72:objectType=Conversation",
"content": "<p><span class=\"h-card\"><a href=\"http://localhost:9000/accounts/ronan\" class=\"u-url mention\">@<span>ronan</span></a></span> zergzerg</p>",
"contentMap": {
"en": "<p><span class=\"h-card\"><a href=\"http://localhost:9000/accounts/ronan\" class=\"u-url mention\">@<span>ronan</span></a></span> zergzerg</p>"
},
"attachment": [],
"tag": [
{
"type": "Mention",
"href": "http://localhost:9000/accounts/ronan",
"name": "@ronan@localhost:9000"
}
]
},
"signature": {
"type": "RsaSignature2017",
"creator": "http://localhost:3000/users/ronan2#main-key",
"created": "2018-10-22T13:34:19Z",
"signatureValue": "x+xL4l8ERziYVhwEafHJyBQOInvNZ0gV4ccYd9AtFYeGJagc8fY6jjjhbDRCD7yMhgTjBX69z20MXnDuwpmM6wej3dt1wLKdIyXVViO84nAlqFz7KmNxtk5lDnAVX/vttscT5YUFvw4dbPT2mQiEd1lKbaLftRiIPEomZpQ37+fUkQdcPrnhruPAISO/Sof1n1LFW4mYIffozteQSZBH6HaCVp+MRMIhdMi5e8w7PD48/cZz8D/EU8Vqi91FM76/3tMqg6nLqQ+8bq74Jvt2kzwZlIufe+I55QMpZOmF6hGIJEt+R0JXdjQbtgcELONmNj2dr8sAlzu7zKlAGuJ24Q=="
}
}
}

View File

@@ -0,0 +1,3 @@
{
"publicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0YyuthHtWWgDe0Fdgdp2\ndC5dTJsRqW6pFw5omIYYYjoES/WRewhVxEA54BhmxD3L1zChfx131N1TS8jVowhW\nm999jpUffKCCvLgYKIXETJDHiDeMONVx8wp7v9fS1HiFXo/E5und39gUMs14CMFZ\n6PE5jRV3r4XIKQJHQl7/X5n5FOb2934K+1TKUeBkbft/AushlKatYQakt3qHxpwx\nFvE+JjGo7QTnzdjaOx/e5QvojdGi2Kx4+jl87j2WVcSo5lOBz04OAVJtChtn82vS\nulPdDh3hZcDn+WK67yAhGP6AnzvOybZZS4zowlKiQ3kqjVVXKdl8gAsL4Y7MZ40R\nJQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -0,0 +1,13 @@
{
"type": "Announce",
"id": "http://127.0.0.1:9002/videos/watch/997111d4-e8d8-4f45-99d3-857905785d05/announces/1",
"actor": "http://127.0.0.1:9002/accounts/peertube",
"object": "http://127.0.0.1:9002/videos/watch/997111d4-e8d8-4f45-99d3-857905785d05",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://127.0.0.1:9002/accounts/peertube/followers",
"http://127.0.0.1:9002/video-channels/root_channel/followers",
"http://127.0.0.1:9002/accounts/root/followers"
],
"cc": []
}

View File

@@ -0,0 +1,6 @@
{
"publicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqjQGdH6D3naKmSbbr/Df\nEh1H42F3WlHYXuxKLkm5Bemjdde+GwHYdz5m3fcIWw3HTzfA+y9Of8epGdfSrtYO\nwAyc3Zoy7afPNa4bZXqhJ1Im41rMGieiCuUn4uTPPucIjC0gCkVwvuQr3Elbk55s\nIkczDk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BCCmu7H40iiVmECgYEA3VGA2PzPL0/LdIl2\nyhe2e4Ii18Pt6jstZdRrTpwz81Lr3lD7+2hprmLdwmdGW/5v5vdW+eGSEgEt8VBb\n6FbA+efEkR6FybT11033Ntatnhi/3Ji77x1MsbJYvyQ8UXV3P7b0NytK/e1cQ7DE\nHJf87hT9f+LfCXZaGTJvFUWcK68CgYEAxN/3UGAvO9xgo7Ef69E84ljuDYcoYV7f\nlH3UzgT70SrWurgtRAcFvd+FGHj6xw27TJs183Vl3HaduAJd1MqiYXUCHGnnz8Da\nJTrm9XMvqFh9ZcQZKagGqwYIikjFD2OAH2QKXu38Fqfxn85EdOMj1+keVJnIJYnd\nqN6mIzZrVmcCgYA+kM7rCLUNe/JZVI8XXJLC4aw18PauM+KGmgFn7LKnA/cYFy7V\nCNRvbxWf4pA6a3h5A807wPAJVPoG8R+6U+QkAchI+ib6OcUSA8FyaEgWnIqIs0jV\ntSO8TF3YU0cWBC4c/fyWKBAALvzZSfx21OS07YwofhttUl7wJpjOm6olkwKBgAFn\nIykEdnGzwVCJS5PvmsJ2JcQc6XHALlGtj92j9XNpHbyY4WGxtx3CQP2KpybR9zq1\nhG3msUIf6kHMaoTAqOWO4uP28Truwd8wC0NGfdlyP/qAqjk8xEdltJvfpt/UMq6G\nlPhWM8yph7Q+0QgQMkowlBHAQsfZsqWoaICpu5wTAoGBAKRLzkmekcRX+1LKWwQS\nfZbcJALHnzOXuJk1XuH+1YxHgDKtwjQeo/qWUntX8J/DroyB6U+eiwqBqDAtUjqC\nyoO2OfNijde4xFWVgjJIn+NXd6JQ2RXYrLZ+n+AD2xWCnfxBKv7EH0TQs1K1xuoP\nOgIJwNHCz9Irs9uRAf0pXju1\n-----END PRIVATE KEY-----\n"
}

BIN
packages/tests/fixtures/avatar-big.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 727 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
packages/tests/fixtures/avatar.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
packages/tests/fixtures/avatar.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
packages/tests/fixtures/avatar.webp vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
packages/tests/fixtures/avatar2.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
packages/tests/fixtures/banner.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
packages/tests/fixtures/exif.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
packages/tests/fixtures/exif.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
packages/tests/fixtures/export-crash.zip vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
packages/tests/fixtures/live/0-000067.ts vendored Normal file

Binary file not shown.

BIN
packages/tests/fixtures/live/0-000068.ts vendored Normal file

Binary file not shown.

BIN
packages/tests/fixtures/live/0-000069.ts vendored Normal file

Binary file not shown.

BIN
packages/tests/fixtures/live/0-000070.ts vendored Normal file

Binary file not shown.

14
packages/tests/fixtures/live/0.m3u8 vendored Normal file
View File

@@ -0,0 +1,14 @@
#EXTM3U
#EXT-X-VERSION:6
#EXT-X-TARGETDURATION:2
#EXT-X-MEDIA-SEQUENCE:68
#EXT-X-INDEPENDENT-SEGMENTS
#EXTINF:2.000000,
#EXT-X-PROGRAM-DATE-TIME:2023-04-18T13:38:39.019+0200
0-000068.ts
#EXTINF:2.000000,
#EXT-X-PROGRAM-DATE-TIME:2023-04-18T13:38:41.019+0200
0-000069.ts
#EXTINF:2.000000,
#EXT-X-PROGRAM-DATE-TIME:2023-04-18T13:38:43.019+0200
0-000070.

BIN
packages/tests/fixtures/live/1-000067.ts vendored Normal file

Binary file not shown.

BIN
packages/tests/fixtures/live/1-000068.ts vendored Normal file

Binary file not shown.

BIN
packages/tests/fixtures/live/1-000069.ts vendored Normal file

Binary file not shown.

BIN
packages/tests/fixtures/live/1-000070.ts vendored Normal file

Binary file not shown.

14
packages/tests/fixtures/live/1.m3u8 vendored Normal file
View File

@@ -0,0 +1,14 @@
#EXTM3U
#EXT-X-VERSION:6
#EXT-X-TARGETDURATION:2
#EXT-X-MEDIA-SEQUENCE:68
#EXT-X-INDEPENDENT-SEGMENTS
#EXTINF:2.000000,
#EXT-X-PROGRAM-DATE-TIME:2023-04-18T13:38:39.019+0200
1-000068.ts
#EXTINF:2.000000,
#EXT-X-PROGRAM-DATE-TIME:2023-04-18T13:38:41.019+0200
1-000069.ts
#EXTINF:2.000000,
#EXT-X-PROGRAM-DATE-TIME:2023-04-18T13:38:43.019+0200
1-000070.ts

View File

@@ -0,0 +1,8 @@
#EXTM3U
#EXT-X-VERSION:6
#EXT-X-STREAM-INF:BANDWIDTH=1287342,RESOLUTION=640x360,CODECS="avc1.64001f,mp4a.40.2"
0.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=3051742,RESOLUTION=1280x720,CODECS="avc1.64001f,mp4a.40.2"
1.m3u8

BIN
packages/tests/fixtures/low-bitrate.mp4 vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,12 @@
async function register (options) {
options.unknownFunction()
}
async function unregister () {
return
}
module.exports = {
register,
unregister
}

View File

@@ -0,0 +1,20 @@
{
"name": "peertube-plugin-test-broken",
"version": "0.0.1",
"description": "Plugin test broken",
"engine": {
"peertube": ">=1.3.0"
},
"keywords": [
"peertube",
"plugin"
],
"homepage": "https://github.com/Chocobozzz/PeerTube",
"author": "Chocobozzz",
"bugs": "https://github.com/Chocobozzz/PeerTube/issues",
"library": "./main.js",
"staticDirs": {},
"css": [],
"clientScripts": [],
"translations": {}
}

View File

@@ -0,0 +1,85 @@
async function register ({
registerExternalAuth,
peertubeHelpers,
settingsManager,
unregisterExternalAuth
}) {
{
const result = registerExternalAuth({
authName: 'external-auth-1',
authDisplayName: () => 'External Auth 1',
onLogout: user => peertubeHelpers.logger.info('On logout %s', user.username),
onAuthRequest: (req, res) => {
const username = req.query.username
result.userAuthenticated({
req,
res,
username,
email: username + '@example.com'
})
}
})
}
{
const result = registerExternalAuth({
authName: 'external-auth-2',
authDisplayName: () => 'External Auth 2',
onAuthRequest: (req, res) => {
result.userAuthenticated({
req,
res,
username: 'kefka',
email: 'kefka@example.com',
role: 0,
displayName: 'Kefka Palazzo',
adminFlags: 1,
videoQuota: 42000,
videoQuotaDaily: 42100,
// Always use new value except for videoQuotaDaily field
userUpdater: ({ fieldName, currentValue, newValue }) => {
if (fieldName === 'videoQuotaDaily') return currentValue
return newValue
}
})
},
hookTokenValidity: (options) => {
if (options.type === 'refresh') {
return { valid: false }
}
if (options.type === 'access') {
const token = options.token
const now = new Date()
now.setTime(now.getTime() - 5000)
const createdAt = new Date(token.createdAt)
return { valid: createdAt.getTime() >= now.getTime() }
}
return { valid: true }
}
})
}
settingsManager.onSettingsChange(settings => {
if (settings.disableKefka) {
unregisterExternalAuth('external-auth-2')
}
})
}
async function unregister () {
return
}
module.exports = {
register,
unregister
}
// ###########################################################################

View File

@@ -0,0 +1,20 @@
{
"name": "peertube-plugin-test-external-auth-one",
"version": "0.0.1",
"description": "External auth one",
"engine": {
"peertube": ">=1.3.0"
},
"keywords": [
"peertube",
"plugin"
],
"homepage": "https://github.com/Chocobozzz/PeerTube",
"author": "Chocobozzz",
"bugs": "https://github.com/Chocobozzz/PeerTube/issues",
"library": "./main.js",
"staticDirs": {},
"css": [],
"clientScripts": [],
"translations": {}
}

View File

@@ -0,0 +1,71 @@
async function register ({
registerExternalAuth,
peertubeHelpers
}) {
{
const result = registerExternalAuth({
authName: 'external-auth-7',
authDisplayName: () => 'External Auth 7',
onAuthRequest: (req, res) => {
result.userAuthenticated({
req,
res,
username: 'cid',
email: 'cid@example.com',
displayName: 'Cid Marquez'
})
},
onLogout: (user, req) => {
return 'https://example.com/redirectUrl'
}
})
}
{
const result = registerExternalAuth({
authName: 'external-auth-8',
authDisplayName: () => 'External Auth 8',
onAuthRequest: (req, res) => {
result.userAuthenticated({
req,
res,
username: 'cid',
email: 'cid@example.com',
displayName: 'Cid Marquez'
})
},
onLogout: (user, req) => {
return 'https://example.com/redirectUrl?access_token=' + req.headers['authorization'].split(' ')[1]
}
})
}
const result = registerExternalAuth({
authName: 'external-auth-9',
authDisplayName: () => 'External Auth 9',
onAuthRequest: (req, res) => {
result.userAuthenticated({
req,
res,
username: 'cid',
email: 'cid@example.com',
displayName: 'Cid Marquez',
externalRedirectUri: 'https://external.com/some/redirect/path'
})
},
onLogout: (user, req) => {
return 'https://example.com/redirectUrl'
}
})
}
async function unregister () {
}
module.exports = {
register,
unregister
}
// ###########################################################################

View File

@@ -0,0 +1,20 @@
{
"name": "peertube-plugin-test-external-auth-three",
"version": "0.0.1",
"description": "External auth three",
"engine": {
"peertube": ">=1.3.0"
},
"keywords": [
"peertube",
"plugin"
],
"homepage": "https://github.com/Chocobozzz/PeerTube",
"author": "Chocobozzz",
"bugs": "https://github.com/Chocobozzz/PeerTube/issues",
"library": "./main.js",
"staticDirs": {},
"css": [],
"clientScripts": [],
"translations": {}
}

View File

@@ -0,0 +1,95 @@
async function register ({
registerExternalAuth,
peertubeHelpers
}) {
{
const result = registerExternalAuth({
authName: 'external-auth-3',
authDisplayName: () => 'External Auth 3',
onAuthRequest: (req, res) => {
result.userAuthenticated({
req,
res,
username: 'cid',
email: 'cid@example.com',
displayName: 'Cid Marquez'
})
}
})
}
{
const result = registerExternalAuth({
authName: 'external-auth-4',
authDisplayName: () => 'External Auth 4',
onAuthRequest: (req, res) => {
result.userAuthenticated({
req,
res,
username: 'kefka2',
email: 'kefka@example.com',
displayName: 'Kefka duplication'
})
}
})
}
{
const result = registerExternalAuth({
authName: 'external-auth-5',
authDisplayName: () => 'External Auth 5',
onAuthRequest: (req, res) => {
result.userAuthenticated({
req,
res,
username: 'kefka',
email: 'kefka@example.com',
displayName: 'Kefka duplication'
})
}
})
}
{
const result = registerExternalAuth({
authName: 'external-auth-6',
authDisplayName: () => 'External Auth 6',
onAuthRequest: (req, res) => {
result.userAuthenticated({
req,
res,
username: 'existing_user',
email: 'existing_user@example.com',
displayName: 'Existing user'
})
}
})
}
{
const result = registerExternalAuth({
authName: 'external-auth-7',
authDisplayName: () => 'External Auth 7',
onAuthRequest: (req, res) => {
result.userAuthenticated({
req,
res,
username: 'existing_user2',
email: 'custom_email_existing_user2@example.com',
displayName: 'Existing user 2'
})
}
})
}
}
async function unregister () {
return
}
module.exports = {
register,
unregister
}
// ###########################################################################

View File

@@ -0,0 +1,20 @@
{
"name": "peertube-plugin-test-external-auth-two",
"version": "0.0.1",
"description": "External auth two",
"engine": {
"peertube": ">=1.3.0"
},
"keywords": [
"peertube",
"plugin"
],
"homepage": "https://github.com/Chocobozzz/PeerTube",
"author": "Chocobozzz",
"bugs": "https://github.com/Chocobozzz/PeerTube/issues",
"library": "./main.js",
"staticDirs": {},
"css": [],
"clientScripts": [],
"translations": {}
}

View File

@@ -0,0 +1,3 @@
{
"Hello world": "Bonjour le monde"
}

View File

@@ -0,0 +1,3 @@
{
"Hello world": "Ciao, mondo!"
}

View File

@@ -0,0 +1,21 @@
async function register ({ registerHook, registerSetting, settingsManager, storageManager, peertubeHelpers }) {
registerHook({
target: 'filter:api.videos.list.params',
handler: obj => addToCount(obj)
})
}
async function unregister () {
return
}
module.exports = {
register,
unregister
}
// ############################################################################
function addToCount (obj) {
return Object.assign({}, obj, { count: obj.count + 1 })
}

View File

@@ -0,0 +1,23 @@
{
"name": "peertube-plugin-test-filter-translations",
"version": "0.0.1",
"description": "Plugin test filter and translations",
"engine": {
"peertube": ">=1.3.0"
},
"keywords": [
"peertube",
"plugin"
],
"homepage": "https://github.com/Chocobozzz/PeerTube",
"author": "Chocobozzz",
"bugs": "https://github.com/Chocobozzz/PeerTube/issues",
"library": "./main.js",
"staticDirs": {},
"css": [],
"clientScripts": [],
"translations": {
"fr-FR": "./languages/fr.json",
"it-IT": "./languages/it.json"
}
}

View File

@@ -0,0 +1,27 @@
async function register ({
getRouter
}) {
const router = getRouter()
router.get('/ping', (req, res) => res.json({ message: 'pong' }))
router.get('/is-authenticated', (req, res) => res.json({ isAuthenticated: res.locals.authenticated }))
router.post('/form/post/mirror', (req, res) => {
res.json(req.body)
})
router.post('/form/post/mirror-raw-body', (req, res) => {
res.json(JSON.parse(req.rawBody))
})
}
async function unregister () {
return
}
module.exports = {
register,
unregister
}
// ###########################################################################

View File

@@ -0,0 +1,20 @@
{
"name": "peertube-plugin-test-five",
"version": "0.0.1",
"description": "Plugin test 5",
"engine": {
"peertube": ">=1.3.0"
},
"keywords": [
"peertube",
"plugin"
],
"homepage": "https://github.com/Chocobozzz/PeerTube",
"author": "Chocobozzz",
"bugs": "https://github.com/Chocobozzz/PeerTube/issues",
"library": "./main.js",
"staticDirs": {},
"css": [],
"clientScripts": [],
"translations": {}
}

View File

@@ -0,0 +1,208 @@
async function register ({
peertubeHelpers,
registerHook,
getRouter
}) {
const logger = peertubeHelpers.logger
logger.info('Hello world from plugin four')
{
const username = 'root'
const results = await peertubeHelpers.database.query(
'SELECT "email" from "user" WHERE "username" = $username',
{
type: 'SELECT',
bind: { username }
}
)
logger.info('root email is ' + results[0]['email'])
}
{
registerHook({
target: 'action:api.video.viewed',
handler: async ({ video }) => {
const videoFromDB1 = await peertubeHelpers.videos.loadByUrl(video.url)
const videoFromDB2 = await peertubeHelpers.videos.loadByIdOrUUID(video.id)
const videoFromDB3 = await peertubeHelpers.videos.loadByIdOrUUID(video.uuid)
if (videoFromDB1.uuid !== videoFromDB2.uuid || videoFromDB2.uuid !== videoFromDB3.uuid) return
const videoWithFiles = await peertubeHelpers.videos.loadByIdOrUUIDWithFiles(video.id)
if (videoWithFiles.getHLSPlaylist().getMasterPlaylistUrl(videoWithFiles) === null) {
logger.error('Video with files could not be loaded.')
return
}
logger.info('video from DB uuid is %s.', videoFromDB1.uuid)
await peertubeHelpers.videos.removeVideo(video.id)
logger.info('Video deleted by plugin four.')
}
})
}
{
const serverActor = await peertubeHelpers.server.getServerActor()
logger.info('server actor name is %s', serverActor.preferredUsername)
}
{
logger.info('server url is %s', peertubeHelpers.config.getWebserverUrl())
}
{
const actions = {
blockServer,
unblockServer,
blockAccount,
unblockAccount,
blacklist,
unblacklist
}
const router = getRouter()
router.post('/commander', async (req, res) => {
try {
await actions[req.body.command](peertubeHelpers, req.body)
res.sendStatus(204)
} catch (err) {
logger.error('Error in commander.', { err })
res.sendStatus(500)
}
})
router.get('/server-config', async (req, res) => {
const serverConfig = await peertubeHelpers.config.getServerConfig()
return res.json({ serverConfig })
})
router.get('/server-listening-config', async (req, res) => {
const config = await peertubeHelpers.config.getServerListeningConfig()
return res.json({ config })
})
router.get('/static-route', async (req, res) => {
const staticRoute = peertubeHelpers.plugin.getBaseStaticRoute()
return res.json({ staticRoute })
})
router.get('/router-route', async (req, res) => {
const routerRoute = peertubeHelpers.plugin.getBaseRouterRoute()
return res.json({ routerRoute })
})
router.get('/user/:id', async (req, res) => {
const user = await peertubeHelpers.user.loadById(req.params.id)
if (!user) return res.status(404).end()
return res.json({
username: user.username
})
})
router.get('/user', async (req, res) => {
const user = await peertubeHelpers.user.getAuthUser(res)
if (!user) return res.sendStatus(404)
const isAdmin = user.role === 0
const isModerator = user.role === 1
const isUser = user.role === 2
return res.json({
id: user.id,
username: user.username,
displayName: user.Account.name,
isAdmin,
isModerator,
isUser
})
})
router.get('/video-files/:id', async (req, res) => {
const details = await peertubeHelpers.videos.getFiles(req.params.id)
if (!details) return res.sendStatus(404)
return res.json(details)
})
router.get('/ffprobe', async (req, res) => {
const result = await peertubeHelpers.videos.ffprobe(req.query.path)
if (!result) return res.sendStatus(404)
return res.json(result)
})
router.post('/send-notification', async (req, res) => {
peertubeHelpers.socket.sendNotification(req.body.userId, {
type: 1,
userId: req.body.userId
})
return res.sendStatus(201)
})
router.post('/send-video-live-new-state/:uuid', async (req, res) => {
const video = await peertubeHelpers.videos.loadByIdOrUUID(req.params.uuid)
peertubeHelpers.socket.sendVideoLiveNewState(video)
return res.sendStatus(201)
})
}
}
async function unregister () {
return
}
module.exports = {
register,
unregister
}
// ###########################################################################
async function blockServer (peertubeHelpers, body) {
const serverActor = await peertubeHelpers.server.getServerActor()
await peertubeHelpers.moderation.blockServer({ byAccountId: serverActor.Account.id, hostToBlock: body.hostToBlock })
}
async function unblockServer (peertubeHelpers, body) {
const serverActor = await peertubeHelpers.server.getServerActor()
await peertubeHelpers.moderation.unblockServer({ byAccountId: serverActor.Account.id, hostToUnblock: body.hostToUnblock })
}
async function blockAccount (peertubeHelpers, body) {
const serverActor = await peertubeHelpers.server.getServerActor()
await peertubeHelpers.moderation.blockAccount({ byAccountId: serverActor.Account.id, handleToBlock: body.handleToBlock })
}
async function unblockAccount (peertubeHelpers, body) {
const serverActor = await peertubeHelpers.server.getServerActor()
await peertubeHelpers.moderation.unblockAccount({ byAccountId: serverActor.Account.id, handleToUnblock: body.handleToUnblock })
}
async function blacklist (peertubeHelpers, body) {
await peertubeHelpers.moderation.blacklistVideo({
videoIdOrUUID: body.videoUUID,
createOptions: body
})
}
async function unblacklist (peertubeHelpers, body) {
await peertubeHelpers.moderation.unblacklistVideo({ videoIdOrUUID: body.videoUUID })
}

View File

@@ -0,0 +1,20 @@
{
"name": "peertube-plugin-test-four",
"version": "0.0.1",
"description": "Plugin test 4",
"engine": {
"peertube": ">=1.3.0"
},
"keywords": [
"peertube",
"plugin"
],
"homepage": "https://github.com/Chocobozzz/PeerTube",
"author": "Chocobozzz",
"bugs": "https://github.com/Chocobozzz/PeerTube/issues",
"library": "./main.js",
"staticDirs": {},
"css": [],
"clientScripts": [],
"translations": {}
}

View File

@@ -0,0 +1,69 @@
async function register ({
registerIdAndPassAuth,
peertubeHelpers,
settingsManager,
unregisterIdAndPassAuth
}) {
registerIdAndPassAuth({
authName: 'spyro-auth',
onLogout: () => {
peertubeHelpers.logger.info('On logout for auth 1 - 1')
},
getWeight: () => 15,
login (body) {
if (body.id === 'spyro' && body.password === 'spyro password') {
return Promise.resolve({
username: 'spyro',
email: 'spyro@example.com',
role: 2,
displayName: 'Spyro the Dragon'
})
}
return null
}
})
registerIdAndPassAuth({
authName: 'crash-auth',
onLogout: () => {
peertubeHelpers.logger.info('On logout for auth 1 - 2')
},
getWeight: () => 50,
login (body) {
if (body.id === 'crash' && body.password === 'crash password') {
return Promise.resolve({
username: 'crash',
email: 'crash@example.com',
role: 1,
displayName: 'Crash Bandicoot'
})
}
return null
}
})
settingsManager.onSettingsChange(settings => {
if (settings.disableSpyro) {
unregisterIdAndPassAuth('spyro-auth')
}
})
}
async function unregister () {
return
}
module.exports = {
register,
unregister
}
// ###########################################################################

View File

@@ -0,0 +1,20 @@
{
"name": "peertube-plugin-test-id-pass-auth-one",
"version": "0.0.1",
"description": "Id and pass auth one",
"engine": {
"peertube": ">=1.3.0"
},
"keywords": [
"peertube",
"plugin"
],
"homepage": "https://github.com/Chocobozzz/PeerTube",
"author": "Chocobozzz",
"bugs": "https://github.com/Chocobozzz/PeerTube/issues",
"library": "./main.js",
"staticDirs": {},
"css": [],
"clientScripts": [],
"translations": {}
}

View File

@@ -0,0 +1,106 @@
async function register ({
registerIdAndPassAuth,
peertubeHelpers
}) {
registerIdAndPassAuth({
authName: 'laguna-bad-auth',
onLogout: () => {
peertubeHelpers.logger.info('On logout for auth 3 - 1')
},
getWeight: () => 5,
login (body) {
if (body.id === 'laguna' && body.password === 'laguna password') {
return Promise.resolve({
username: 'laguna',
email: 'laguna@example.com',
displayName: 'Laguna Loire'
})
}
return null
}
})
registerIdAndPassAuth({
authName: 'ward-auth',
getWeight: () => 5,
login (body) {
if (body.id === 'ward') {
return Promise.resolve({
username: '-ward-42',
email: 'ward@example.com'
})
}
return null
}
})
registerIdAndPassAuth({
authName: 'kiros-auth',
getWeight: () => 5,
login (body) {
if (body.id === 'kiros') {
return Promise.resolve({
username: 'kiros',
email: 'kiros@example.com',
displayName: 'a'.repeat(5000)
})
}
return null
}
})
registerIdAndPassAuth({
authName: 'raine-auth',
getWeight: () => 5,
login (body) {
if (body.id === 'raine') {
return Promise.resolve({
username: 'raine',
email: 'raine@example.com',
role: 42
})
}
return null
}
})
registerIdAndPassAuth({
authName: 'ellone-auth',
getWeight: () => 5,
login (body) {
if (body.id === 'ellone') {
return Promise.resolve({
username: 'ellone'
})
}
return null
}
})
}
async function unregister () {
return
}
module.exports = {
register,
unregister
}
// ###########################################################################

View File

@@ -0,0 +1,20 @@
{
"name": "peertube-plugin-test-id-pass-auth-three",
"version": "0.0.1",
"description": "Id and pass auth three",
"engine": {
"peertube": ">=1.3.0"
},
"keywords": [
"peertube",
"plugin"
],
"homepage": "https://github.com/Chocobozzz/PeerTube",
"author": "Chocobozzz",
"bugs": "https://github.com/Chocobozzz/PeerTube/issues",
"library": "./main.js",
"staticDirs": {},
"css": [],
"clientScripts": [],
"translations": {}
}

View File

@@ -0,0 +1,65 @@
async function register ({
registerIdAndPassAuth,
peertubeHelpers
}) {
registerIdAndPassAuth({
authName: 'laguna-auth',
onLogout: () => {
peertubeHelpers.logger.info('On logout for auth 2 - 1')
},
getWeight: () => 30,
hookTokenValidity: (options) => {
if (options.type === 'refresh') {
return { valid: false }
}
if (options.type === 'access') {
const token = options.token
const now = new Date()
now.setTime(now.getTime() - 5000)
const createdAt = new Date(token.createdAt)
return { valid: createdAt.getTime() >= now.getTime() }
}
return { valid: true }
},
login (body) {
if (body.id === 'laguna' && body.password === 'laguna password') {
return Promise.resolve({
username: 'laguna',
email: 'laguna@example.com',
displayName: 'Laguna Loire',
adminFlags: 1,
videoQuota: 42000,
videoQuotaDaily: 42100,
// Always use new value except for videoQuotaDaily field
userUpdater: ({ fieldName, currentValue, newValue }) => {
if (fieldName === 'videoQuotaDaily') return currentValue
return newValue
}
})
}
return null
}
})
}
async function unregister () {
return
}
module.exports = {
register,
unregister
}
// ###########################################################################

View File

@@ -0,0 +1,20 @@
{
"name": "peertube-plugin-test-id-pass-auth-two",
"version": "0.0.1",
"description": "Id and pass auth two",
"engine": {
"peertube": ">=1.3.0"
},
"keywords": [
"peertube",
"plugin"
],
"homepage": "https://github.com/Chocobozzz/PeerTube",
"author": "Chocobozzz",
"bugs": "https://github.com/Chocobozzz/PeerTube/issues",
"library": "./main.js",
"staticDirs": {},
"css": [],
"clientScripts": [],
"translations": {}
}

View File

@@ -0,0 +1,21 @@
const print = require('a-native-example')
async function register ({ getRouter }) {
print('hello world')
const router = getRouter()
router.get('/', (req, res) => {
print('hello world')
res.sendStatus(204)
})
}
async function unregister () {
return
}
module.exports = {
register,
unregister
}

View File

@@ -0,0 +1,23 @@
{
"name": "peertube-plugin-test-native",
"version": "0.0.1",
"description": "Plugin test-native",
"engine": {
"peertube": ">=4.3.0"
},
"keywords": [
"peertube",
"plugin"
],
"homepage": "https://github.com/Chocobozzz/PeerTube",
"author": "Chocobozzz",
"bugs": "https://github.com/Chocobozzz/PeerTube/issues",
"library": "./main.js",
"staticDirs": {},
"css": [],
"clientScripts": [],
"translations": {},
"dependencies": {
"a-native-example": "^1.0.0"
}
}

View File

@@ -0,0 +1,82 @@
async function register ({ registerHook, registerSetting, settingsManager, storageManager, peertubeHelpers }) {
registerHook({
target: 'filter:feed.podcast.rss.create-custom-xmlns.result',
handler: (result, params) => {
return result.concat([
{
name: "biz",
value: "https://example.com/biz-xmlns",
},
])
}
})
registerHook({
target: 'filter:feed.podcast.channel.create-custom-tags.result',
handler: (result, params) => {
const { videoChannel } = params
return result.concat([
{
name: "fooTag",
attributes: { "bar": "baz" },
value: "42",
},
{
name: "biz:videoChannel",
attributes: { "name": videoChannel.name, "id": videoChannel.id },
},
{
name: "biz:buzzItem",
value: [
{
name: "nestedTag",
value: "example nested tag",
},
],
},
])
}
})
registerHook({
target: 'filter:feed.podcast.video.create-custom-tags.result',
handler: (result, params) => {
const { video, liveItem } = params
return result.concat([
{
name: "fizzTag",
attributes: { "bar": "baz" },
value: "21",
},
{
name: "biz:video",
attributes: { "name": video.name, "id": video.id, "isLive": liveItem },
},
{
name: "biz:buzz",
value: [
{
name: "nestedTag",
value: "example nested tag",
},
],
}
])
}
})
}
async function unregister () {
return
}
module.exports = {
register,
unregister
}
// ############################################################################
function addToCount (obj) {
return Object.assign({}, obj, { count: obj.count + 1 })
}

View File

@@ -0,0 +1,19 @@
{
"name": "peertube-plugin-test-podcast-custom-tags",
"version": "0.0.1",
"description": "Plugin test custom tags in Podcast RSS feeds",
"engine": {
"peertube": ">=1.3.0"
},
"keywords": [
"peertube",
"plugin"
],
"homepage": "https://github.com/Chocobozzz/PeerTube",
"author": "Chocobozzz",
"bugs": "https://github.com/Chocobozzz/PeerTube/issues",
"library": "./main.js",
"staticDirs": {},
"css": [],
"clientScripts": []
}

View File

@@ -0,0 +1,46 @@
const fs = require('fs')
const path = require('path')
async function register ({
storageManager,
peertubeHelpers,
getRouter
}) {
const { logger } = peertubeHelpers
{
await storageManager.storeData('superkey', { value: 'toto' })
await storageManager.storeData('anotherkey', { value: 'toto2' })
await storageManager.storeData('storedArrayKey', ['toto', 'toto2'])
const result = await storageManager.getData('superkey')
logger.info('superkey stored value is %s', result.value)
const storedArrayValue = await storageManager.getData('storedArrayKey')
logger.info('storedArrayKey isArray is %s', Array.isArray(storedArrayValue) ? 'true' : 'false')
logger.info('storedArrayKey stored value is %s', storedArrayValue.join(', '))
}
{
getRouter().get('/create-file', async (req, res) => {
const basePath = peertubeHelpers.plugin.getDataDirectoryPath()
fs.writeFile(path.join(basePath, 'Aladdin.txt'), 'Prince Ali', function (err) {
if (err) return res.sendStatus(500)
res.sendStatus(200)
})
})
}
}
async function unregister () {
return
}
module.exports = {
register,
unregister
}
// ###########################################################################

View File

@@ -0,0 +1,20 @@
{
"name": "peertube-plugin-test-six",
"version": "0.0.1",
"description": "Plugin test 6",
"engine": {
"peertube": ">=1.3.0"
},
"keywords": [
"peertube",
"plugin"
],
"homepage": "https://github.com/Chocobozzz/PeerTube",
"author": "Chocobozzz",
"bugs": "https://github.com/Chocobozzz/PeerTube/issues",
"library": "./main.js",
"staticDirs": {},
"css": [],
"clientScripts": [],
"translations": {}
}

View File

@@ -0,0 +1,92 @@
async function register ({ transcodingManager }) {
// Output options
{
{
const builder = () => {
return {
outputOptions: [
'-r 10'
]
}
}
transcodingManager.addVODProfile('libx264', 'low-vod', builder)
}
{
const builder = (options) => {
return {
outputOptions: [
'-r:' + options.streamNum + ' 50'
]
}
}
transcodingManager.addLiveProfile('libx264', 'high-live', builder)
}
}
// Input options
{
{
const builder = () => {
return {
inputOptions: [
'-r 5'
]
}
}
transcodingManager.addVODProfile('libx264', 'input-options-vod', builder)
}
{
const builder = () => {
return {
inputOptions: [
'-r 50'
]
}
}
transcodingManager.addLiveProfile('libx264', 'input-options-live', builder)
}
}
// Scale filters
{
{
const builder = () => {
return {
scaleFilter: {
name: 'Glomgold'
}
}
}
transcodingManager.addVODProfile('libx264', 'bad-scale-vod', builder)
}
{
const builder = () => {
return {
scaleFilter: {
name: 'Flintheart'
}
}
}
transcodingManager.addLiveProfile('libx264', 'bad-scale-live', builder)
}
}
}
async function unregister () {
return
}
module.exports = {
register,
unregister
}

View File

@@ -0,0 +1,20 @@
{
"name": "peertube-plugin-test-transcoding-one",
"version": "0.0.1",
"description": "Plugin test transcoding 1",
"engine": {
"peertube": ">=1.3.0"
},
"keywords": [
"peertube",
"plugin"
],
"homepage": "https://github.com/Chocobozzz/PeerTube",
"author": "Chocobozzz",
"bugs": "https://github.com/Chocobozzz/PeerTube/issues",
"library": "./main.js",
"staticDirs": {},
"css": [],
"clientScripts": [],
"translations": {}
}

View File

@@ -0,0 +1,38 @@
async function register ({ transcodingManager }) {
{
const builder = () => {
return {
outputOptions: []
}
}
transcodingManager.addVODProfile('libopus', 'test-vod-profile', builder)
transcodingManager.addVODProfile('libvpx-vp9', 'test-vod-profile', builder)
transcodingManager.addVODEncoderPriority('audio', 'libopus', 1000)
transcodingManager.addVODEncoderPriority('video', 'libvpx-vp9', 1000)
}
{
const builder = (options) => {
return {
outputOptions: [
'-b:' + options.streamNum + ' 10K'
]
}
}
transcodingManager.addLiveProfile('libopus', 'test-live-profile', builder)
transcodingManager.addLiveEncoderPriority('audio', 'libopus', 1000)
}
}
async function unregister () {
return
}
module.exports = {
register,
unregister
}

View File

@@ -0,0 +1,20 @@
{
"name": "peertube-plugin-test-transcoding-two",
"version": "0.0.1",
"description": "Plugin test transcoding 2",
"engine": {
"peertube": ">=1.3.0"
},
"keywords": [
"peertube",
"plugin"
],
"homepage": "https://github.com/Chocobozzz/PeerTube",
"author": "Chocobozzz",
"bugs": "https://github.com/Chocobozzz/PeerTube/issues",
"library": "./main.js",
"staticDirs": {},
"css": [],
"clientScripts": [],
"translations": {}
}

View File

@@ -0,0 +1,2 @@
const d = new Date()
exports.value = d.getTime()

View File

@@ -0,0 +1,14 @@
const lib = require('./lib')
async function register ({ getRouter }) {
const router = getRouter()
router.get('/get', (req, res) => res.json({ message: lib.value }))
}
async function unregister () {
}
module.exports = {
register,
unregister
}

Some files were not shown because too many files have changed in this diff Show More