-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ui: show env only when set * chores: use hex instead of npub * chores: increase limits * feat(logging): log processing errors as warnings * fix(core): json escaping of some characters * feat(deploy): merge deploy with build * feat(deploy): only build & deploy on main & PR * feat(deploy): use github.sha * feat(deploy): show correct version * feat(ui): favicon * feat(ui): larger favicon
- Loading branch information
1 parent
523eedb
commit 4b97b44
Showing
22 changed files
with
78 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Netstr/Extensions/JsonExtensions.cs → src/Netstr/Json/JsonExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.Text.Encodings.Web; | ||
|
||
namespace Netstr.Json | ||
{ | ||
/// <summary> | ||
/// Json encoder for nostr events which follows NIP-01's character escaping rules. | ||
/// </summary> | ||
public class NostrJsonEncoder : JavaScriptEncoder | ||
{ | ||
private static int[] EscapableCharacters = [0x0A, 0x22, 0x5C, 0x0D, 0x09, 0x08, 0x0C]; | ||
|
||
public override int MaxOutputCharactersPerInputCharacter => JavaScriptEncoder.Default.MaxOutputCharactersPerInputCharacter; | ||
|
||
public override unsafe int FindFirstCharacterToEncode(char* text, int textLength) | ||
{ | ||
return JavaScriptEncoder.UnsafeRelaxedJsonEscaping.FindFirstCharacterToEncode(text, textLength); | ||
} | ||
|
||
public override unsafe bool TryEncodeUnicodeScalar(int unicodeScalar, char* buffer, int bufferLength, out int numberOfCharactersWritten) | ||
{ | ||
return JavaScriptEncoder.UnsafeRelaxedJsonEscaping.TryEncodeUnicodeScalar(unicodeScalar, buffer, bufferLength, out numberOfCharactersWritten); | ||
} | ||
|
||
public override bool WillEncode(int unicodeScalar) | ||
{ | ||
return EscapableCharacters.Contains(unicodeScalar); | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
.../Converters/UnixTimestampJsonConverter.cs → ...Netstr/Json/UnixTimestampJsonConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using Netstr.Extensions; | ||
using Netstr.Json; | ||
using Netstr.Messaging.Models; | ||
using System.Text.Json; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/Netstr/Messaging/MessageHandlers/FilterMessageHandlerBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Netstr/Messaging/MessageHandlers/UnsubscribeMessageHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using Netstr.Extensions; | ||
using Netstr.Json; | ||
using Netstr.Messaging.Models; | ||
using System.Text.Json; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using Netstr.Converters; | ||
using Netstr.Json; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,10 +29,10 @@ | |
}, | ||
"Limits": { | ||
"MaxPayloadSize": 524288, | ||
"MaxInitialLimit": 100, | ||
"MaxInitialLimit": 1000, | ||
"MinPowDifficulty": 0, | ||
"MaxFilters": 20, | ||
"MaxSubscriptions": 30, | ||
"MaxSubscriptions": 50, | ||
"MaxSubscriptionIdLength": 128, | ||
"MaxSubscriptionLimit": 1000, | ||
"MaxEventTags": 1000, | ||
|
@@ -46,7 +46,7 @@ | |
"RelayInformation": { | ||
"Name": "netstr.io", | ||
"Description": "A nostr relay", | ||
"PublicKey": "npub1q84c9lheynjl33u6ha5ulfdd25yw0p90w2zqx6f23w6cjrn7w76s373p35", | ||
"PublicKey": "01eb82fef924e5f8c79abf69cfa5ad5508e784af728403692a8bb5890e7e77b5", | ||
"Contact": "[email protected]", | ||
"SupportedNips": [ 1, 2, 4, 9, 11, 13, 17, 40, 42, 45, 70 ], | ||
"Version": "v0.0.0" | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters