diff --git a/BTJSON Framework (Better Json - New json handling framework) - PureBasic Forums - English.url b/BTJSON Framework (Better Json - New json handling framework) - PureBasic Forums - English.url deleted file mode 100644 index b88dba5..0000000 --- a/BTJSON Framework (Better Json - New json handling framework) - PureBasic Forums - English.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=https://www.purebasic.fr/english/viewtopic.php?t=89425 diff --git a/CLAUDE.md b/CLAUDE.md index ec84b15..ea671b2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -107,6 +107,10 @@ suite: they take a few minutes in all. `_Free` when it holds data), every field validated on decode. - **Every write goes through the writer** (`Server/Storage/Writer.pbi`, under its mutex); reads use the thread's own connection. +- **Every `.pb`/`.pbi` starts with a code header** (`;{- Code Header`, + like PB-MessagePack's): name, version (0.0.1 at this writing), tested + compilers. A release bumps the version in all of them; only list a + compiler/platform once every suite passed with it. - **Docs follow the code**: a finished piece gets a "Done: ... (date)" section in `Notes.md`, what's left goes to its open items, and the `Design/` doc of that area is updated with it. diff --git a/Client/BakaShrot_Client.pbi b/Client/BakaShrot_Client.pbi index d423564..d666be4 100644 --- a/Client/BakaShrot_Client.pbi +++ b/Client/BakaShrot_Client.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: BakaShrot_Client.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Client DLL ; diff --git a/Client/BakaShrot_Client_Prototypes.pbi b/Client/BakaShrot_Client_Prototypes.pbi index 91655f2..35b4710 100644 --- a/Client/BakaShrot_Client_Prototypes.pbi +++ b/Client/BakaShrot_Client_Prototypes.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: BakaShrot_Client_Prototypes.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Client DLL - Prototypes ; diff --git a/Client/BakaShrot_ErrorCodes.pbi b/Client/BakaShrot_ErrorCodes.pbi index 0554404..0ec758e 100644 --- a/Client/BakaShrot_ErrorCodes.pbi +++ b/Client/BakaShrot_ErrorCodes.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: BakaShrot_ErrorCodes.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot error codes ; diff --git a/Commons/Cryptography/Cipher.pbi b/Commons/Cryptography/Cipher.pbi index f9d7cf4..31aeb01 100644 --- a/Commons/Cryptography/Cipher.pbi +++ b/Commons/Cryptography/Cipher.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: Cipher.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Cipher ; diff --git a/Commons/Cryptography/Libsodium.pbi b/Commons/Cryptography/Libsodium.pbi index 09bb490..f7913ff 100644 --- a/Commons/Cryptography/Libsodium.pbi +++ b/Commons/Cryptography/Libsodium.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: Libsodium.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Cryptography ; diff --git a/Commons/Cryptography/Session.pbi b/Commons/Cryptography/Session.pbi index da06d0b..8041c97 100644 --- a/Commons/Cryptography/Session.pbi +++ b/Commons/Cryptography/Session.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: Session.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Session ; diff --git a/Commons/Networking/Connections.pbi b/Commons/Networking/Connections.pbi index f16c359..4937907 100644 --- a/Commons/Networking/Connections.pbi +++ b/Commons/Networking/Connections.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: Connections.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Connections ; diff --git a/Commons/Networking/Names.pbi b/Commons/Networking/Names.pbi index c5177a1..ffdcccc 100644 --- a/Commons/Networking/Names.pbi +++ b/Commons/Networking/Names.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: Names.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Names ; diff --git a/Commons/Networking/Outbound.pbi b/Commons/Networking/Outbound.pbi index 1352e79..8ed89f4 100644 --- a/Commons/Networking/Outbound.pbi +++ b/Commons/Networking/Outbound.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: Outbound.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Outbound connections ; diff --git a/Commons/Networking/Packets.pbi b/Commons/Networking/Packets.pbi index d8f9c8b..e08910d 100644 --- a/Commons/Networking/Packets.pbi +++ b/Commons/Networking/Packets.pbi @@ -1,3 +1,19 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: Packets.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} XIncludeFile "../../Includes/PB-MessagePack/Includes/MessagePack.pbi" XIncludeFile "Names.pbi" diff --git a/Commons/Networking/Packets/AttachmentChunkPacket.pbi b/Commons/Networking/Packets/AttachmentChunkPacket.pbi index d4fbcd6..afe9027 100644 --- a/Commons/Networking/Packets/AttachmentChunkPacket.pbi +++ b/Commons/Networking/Packets/AttachmentChunkPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: AttachmentChunkPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/AuthAcceptedPacket.pbi b/Commons/Networking/Packets/AuthAcceptedPacket.pbi index 44714a4..6a7d18c 100644 --- a/Commons/Networking/Packets/AuthAcceptedPacket.pbi +++ b/Commons/Networking/Packets/AuthAcceptedPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: AuthAcceptedPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/ChallengeRequestPacket.pbi b/Commons/Networking/Packets/ChallengeRequestPacket.pbi index 06fa71a..cc1c6b1 100644 --- a/Commons/Networking/Packets/ChallengeRequestPacket.pbi +++ b/Commons/Networking/Packets/ChallengeRequestPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: ChallengeRequestPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/ChallengeResponsePacket.pbi b/Commons/Networking/Packets/ChallengeResponsePacket.pbi index 70d0e88..b450f92 100644 --- a/Commons/Networking/Packets/ChallengeResponsePacket.pbi +++ b/Commons/Networking/Packets/ChallengeResponsePacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: ChallengeResponsePacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/ChunkStoredPacket.pbi b/Commons/Networking/Packets/ChunkStoredPacket.pbi index f2923fd..79831c8 100644 --- a/Commons/Networking/Packets/ChunkStoredPacket.pbi +++ b/Commons/Networking/Packets/ChunkStoredPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: ChunkStoredPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/GetAttachmentPacket.pbi b/Commons/Networking/Packets/GetAttachmentPacket.pbi index f329691..79a9fe5 100644 --- a/Commons/Networking/Packets/GetAttachmentPacket.pbi +++ b/Commons/Networking/Packets/GetAttachmentPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: GetAttachmentPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/GetLatestMessagePacket.pbi b/Commons/Networking/Packets/GetLatestMessagePacket.pbi index 07bdf62..0590c31 100644 --- a/Commons/Networking/Packets/GetLatestMessagePacket.pbi +++ b/Commons/Networking/Packets/GetLatestMessagePacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: GetLatestMessagePacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/GetMessagesPacket.pbi b/Commons/Networking/Packets/GetMessagesPacket.pbi index b910232..d43ad4e 100644 --- a/Commons/Networking/Packets/GetMessagesPacket.pbi +++ b/Commons/Networking/Packets/GetMessagesPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: GetMessagesPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/HelloPacket.pbi b/Commons/Networking/Packets/HelloPacket.pbi index 4ed90c0..8450c76 100644 --- a/Commons/Networking/Packets/HelloPacket.pbi +++ b/Commons/Networking/Packets/HelloPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: HelloPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/LatestMessagePacket.pbi b/Commons/Networking/Packets/LatestMessagePacket.pbi index fe6a3ac..601dd5b 100644 --- a/Commons/Networking/Packets/LatestMessagePacket.pbi +++ b/Commons/Networking/Packets/LatestMessagePacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: LatestMessagePacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/ListNamesPacket.pbi b/Commons/Networking/Packets/ListNamesPacket.pbi index d224fff..970686c 100644 --- a/Commons/Networking/Packets/ListNamesPacket.pbi +++ b/Commons/Networking/Packets/ListNamesPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: ListNamesPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/MessagePushedPacket.pbi b/Commons/Networking/Packets/MessagePushedPacket.pbi index 2a3b90f..23bee0e 100644 --- a/Commons/Networking/Packets/MessagePushedPacket.pbi +++ b/Commons/Networking/Packets/MessagePushedPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: MessagePushedPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/MessagesPacket.pbi b/Commons/Networking/Packets/MessagesPacket.pbi index 651ffd4..c7e444c 100644 --- a/Commons/Networking/Packets/MessagesPacket.pbi +++ b/Commons/Networking/Packets/MessagesPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: MessagesPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/MissingAttachmentsPacket.pbi b/Commons/Networking/Packets/MissingAttachmentsPacket.pbi index 58e5947..34561b0 100644 --- a/Commons/Networking/Packets/MissingAttachmentsPacket.pbi +++ b/Commons/Networking/Packets/MissingAttachmentsPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: MissingAttachmentsPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/MissingAttachmentsRequestPacket.pbi b/Commons/Networking/Packets/MissingAttachmentsRequestPacket.pbi index fa3640f..9d9b4f5 100644 --- a/Commons/Networking/Packets/MissingAttachmentsRequestPacket.pbi +++ b/Commons/Networking/Packets/MissingAttachmentsRequestPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: MissingAttachmentsRequestPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/NameResolvedPacket.pbi b/Commons/Networking/Packets/NameResolvedPacket.pbi index 59c9dc9..c7e90af 100644 --- a/Commons/Networking/Packets/NameResolvedPacket.pbi +++ b/Commons/Networking/Packets/NameResolvedPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: NameResolvedPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/NamesListPacket.pbi b/Commons/Networking/Packets/NamesListPacket.pbi index 21219cf..535668a 100644 --- a/Commons/Networking/Packets/NamesListPacket.pbi +++ b/Commons/Networking/Packets/NamesListPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: NamesListPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/PushMessagePacket.pbi b/Commons/Networking/Packets/PushMessagePacket.pbi index ec4de42..dd9a4fe 100644 --- a/Commons/Networking/Packets/PushMessagePacket.pbi +++ b/Commons/Networking/Packets/PushMessagePacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: PushMessagePacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/QueryRequestPacket.pbi b/Commons/Networking/Packets/QueryRequestPacket.pbi index b612500..060c5f3 100644 --- a/Commons/Networking/Packets/QueryRequestPacket.pbi +++ b/Commons/Networking/Packets/QueryRequestPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: QueryRequestPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/QueryResultPacket.pbi b/Commons/Networking/Packets/QueryResultPacket.pbi index c49ecf9..b5f3c35 100644 --- a/Commons/Networking/Packets/QueryResultPacket.pbi +++ b/Commons/Networking/Packets/QueryResultPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: QueryResultPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/ReplicateAttachmentChunkPacket.pbi b/Commons/Networking/Packets/ReplicateAttachmentChunkPacket.pbi index 639f2be..e0347cd 100644 --- a/Commons/Networking/Packets/ReplicateAttachmentChunkPacket.pbi +++ b/Commons/Networking/Packets/ReplicateAttachmentChunkPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: ReplicateAttachmentChunkPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/ReplicateMessagesPacket.pbi b/Commons/Networking/Packets/ReplicateMessagesPacket.pbi index 53667ff..7bc287b 100644 --- a/Commons/Networking/Packets/ReplicateMessagesPacket.pbi +++ b/Commons/Networking/Packets/ReplicateMessagesPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: ReplicateMessagesPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/RequestRefusedPacket.pbi b/Commons/Networking/Packets/RequestRefusedPacket.pbi index df5f08b..c48d8c0 100644 --- a/Commons/Networking/Packets/RequestRefusedPacket.pbi +++ b/Commons/Networking/Packets/RequestRefusedPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: RequestRefusedPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/ResolveNamePacket.pbi b/Commons/Networking/Packets/ResolveNamePacket.pbi index fc9d84d..a0b2bb7 100644 --- a/Commons/Networking/Packets/ResolveNamePacket.pbi +++ b/Commons/Networking/Packets/ResolveNamePacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: ResolveNamePacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/SyncStatePacket.pbi b/Commons/Networking/Packets/SyncStatePacket.pbi index af4a182..ed8032c 100644 --- a/Commons/Networking/Packets/SyncStatePacket.pbi +++ b/Commons/Networking/Packets/SyncStatePacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: SyncStatePacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/SyncStateRequestPacket.pbi b/Commons/Networking/Packets/SyncStateRequestPacket.pbi index a502ee6..a75550f 100644 --- a/Commons/Networking/Packets/SyncStateRequestPacket.pbi +++ b/Commons/Networking/Packets/SyncStateRequestPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: SyncStateRequestPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/UploadChunkPacket.pbi b/Commons/Networking/Packets/UploadChunkPacket.pbi index 5ca8c9c..5c639de 100644 --- a/Commons/Networking/Packets/UploadChunkPacket.pbi +++ b/Commons/Networking/Packets/UploadChunkPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: UploadChunkPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/UploadStartPacket.pbi b/Commons/Networking/Packets/UploadStartPacket.pbi index d3c5034..6f70dbe 100644 --- a/Commons/Networking/Packets/UploadStartPacket.pbi +++ b/Commons/Networking/Packets/UploadStartPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: UploadStartPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/Packets/UploadStartedPacket.pbi b/Commons/Networking/Packets/UploadStartedPacket.pbi index d0eeac9..39fecc4 100644 --- a/Commons/Networking/Packets/UploadStartedPacket.pbi +++ b/Commons/Networking/Packets/UploadStartedPacket.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: UploadStartedPacket.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; ... ; ============================================================================ diff --git a/Commons/Networking/SocketWait.pbi b/Commons/Networking/SocketWait.pbi index 8c2e44b..65edc5b 100644 --- a/Commons/Networking/SocketWait.pbi +++ b/Commons/Networking/SocketWait.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: SocketWait.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Socket waits ; diff --git a/Commons/Threading/Signal.pbi b/Commons/Threading/Signal.pbi index 427031e..d60cbe1 100644 --- a/Commons/Threading/Signal.pbi +++ b/Commons/Threading/Signal.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: Signal.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Signal ; diff --git a/Docker/README.md b/Docker/README.md new file mode 100644 index 0000000..7d87676 --- /dev/null +++ b/Docker/README.md @@ -0,0 +1,49 @@ +# BakaShrot - Docker +Docker image for the server, built on the PureBasic images from `git.nibblepoker.lu`. + +> [!NOTE] +> The PureBasic images are licensed, building requires a login to their registry. \ +> The final image only holds the compiled server, libsodium and SQLite. + + +## Running +Fill in [Server/server.ini](Server/server.ini), then, from `Docker/Server/`: +```shell +docker compose up -d --build +``` + +See [Server/docker-compose.yml](Server/docker-compose.yml) and the [Dockerfile](Server/Dockerfile) for more. + + +## Building +From the repository's root: +```shell +git submodule update --init --recursive +docker login git.nibblepoker.lu +docker build -t bakashrot-server -f Docker/Server/Dockerfile . +``` + + +## Uploading +Tag and push the image to both registries, with the version and as `latest`: + +### Gitea +```shell +docker login git.nibblepoker.lu +docker tag bakashrot-server git.nibblepoker.lu/aziascreations/bakashrot-server:0.0.1 +docker tag bakashrot-server git.nibblepoker.lu/aziascreations/bakashrot-server:latest +docker push git.nibblepoker.lu/aziascreations/bakashrot-server:0.0.1 +docker push git.nibblepoker.lu/aziascreations/bakashrot-server:latest +``` + +### GitHub +Requires a [personal access token](https://github.com/settings/tokens) with the `write:packages` scope as the password. +```shell +docker login ghcr.io -u aziascreations +docker tag bakashrot-server ghcr.io/aziascreations/bakashrot-server:0.0.1 +docker tag bakashrot-server ghcr.io/aziascreations/bakashrot-server:latest +docker push ghcr.io/aziascreations/bakashrot-server:0.0.1 +docker push ghcr.io/aziascreations/bakashrot-server:latest +``` + +The package then has to be linked to the repository, and made public if needed, in its settings on GitHub. diff --git a/Docker/Server/Dockerfile b/Docker/Server/Dockerfile index cb1445e..fe1f1b5 100644 --- a/Docker/Server/Dockerfile +++ b/Docker/Server/Dockerfile @@ -19,6 +19,9 @@ # DatabasePath = /var/lib/bakashrot/server.sqlite (relative paths are from # that folder too). # +# Or with docker-compose.yml, next to this file, and its empty server.ini +# to fill in. +# # `docker stop` stops it cleanly (SIGTERM). Console commands (names, vacuum, # restart...): start it with -it, then `docker attach bakashrot`, and # detach with Ctrl+P, Ctrl+Q. diff --git a/Docker/Server/docker-compose.yml b/Docker/Server/docker-compose.yml new file mode 100644 index 0000000..09786d2 --- /dev/null +++ b/Docker/Server/docker-compose.yml @@ -0,0 +1,38 @@ +# BakaShrot server, example compose file. +# +# Fill in server.ini next to this file first (a private key, topics, a +# client section: it's empty, the server refuses to start as it is), then, +# from this folder, with a login to the registry holding the PureBasic +# images (see the Dockerfile): +# docker compose up -d --build +# docker compose logs bakashrot # its public key, for client.ini +# docker compose down # stops it cleanly (SIGTERM) +# +# Console commands (names, vacuum, restart...): `docker attach bakashrot`, +# detach with Ctrl+P, Ctrl+Q (not Ctrl+C: that stops it). +# +# The database lives in the bakashrot-data volume, kept by `down` +# (`down -v` deletes it). + +services: + bakashrot: + build: + # The repository's root: the build needs Commons/, Includes/, Server/. + context: ../.. + dockerfile: Docker/Server/Dockerfile + image: bakashrot-server + container_name: bakashrot + restart: unless-stopped + ports: + # server.ini's [BakaShrot.Server] Port. + - "12345:12345" + volumes: + - ./server.ini:/etc/bakashrot/server.ini:ro + - bakashrot-data:/var/lib/bakashrot + # Only needed to type console commands with `docker attach bakashrot`. + # The server runs fine without these two lines. + stdin_open: true + tty: true + +volumes: + bakashrot-data: diff --git a/Docker/Server/server.ini b/Docker/Server/server.ini new file mode 100644 index 0000000..a90d72e --- /dev/null +++ b/Docker/Server/server.ini @@ -0,0 +1,60 @@ +; ============================================================================ +; BakaShrot server config, for docker-compose.yml: empty, fill it in. +; +; Every option is documented in Server/Config/schema.ini (config.example.ini +; in a release). Keys: BakaShrotGenerateKeyPairs.exe. Never commit a filled +; in copy, it holds the server's private key. +; ============================================================================ + +[BakaShrot] +; This server's private key. Its public key, which clients need as +; ServerPublicKey, is in the log when it starts (docker compose logs). +PrivateKey = + +; The node this server authenticates as when it links to peers. +Node = + + +[BakaShrot.Topics] +; One topic name per line. +; logs + + +[BakaShrot.Retention] +; topic = age (30d, 12h...), or nothing to keep everything forever. +; logs = 30d + + +[BakaShrot.Server] +; Empty: every interface (127.0.0.1 can't be reached from outside the +; container). The port must match docker-compose.yml's. +Host = +Port = 12345 +ReplicatingTopics = +NetThreadPoolSize = 4 +; In the bakashrot-data volume. +DatabasePath = /var/lib/bakashrot/server.sqlite +MaxAttachmentSize = 1G +Synchronous = FULL + + +; One section per peer, see schema.ini. +; [BakaShrot.Peer.other] +; Host = +; Port = +; Node = +; PublicKey = + + +; One section per client allowed to connect. +[BakaShrot.Client.example] +; The client's public key (client.ini's PublicKey). +PublicKeys = +; The node it writes as (client.ini's Node must say the same). +Node = +; DefaultTopic = logs +; PushTopics = logs +; ReadTopics = * +AllowRead = 1 +AllowWrite = 1 +AllowQuery = 0 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0e259d4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff --git a/Notes.md b/Notes.md index e8a0bc9..e85935e 100644 --- a/Notes.md +++ b/Notes.md @@ -681,6 +681,11 @@ still say the old names where they tell what was done then. Checked: pushes, reads and queries through the port, `docker stop` clean (~0.3 s, exit 0), data kept over a restart, commands with `-i`. Alpine was tried: PureBasic needs glibc 2.38+. +- **`Docker/Server/docker-compose.yml`** (2026-11-11): builds and runs the + image with `server.ini` next to it (an empty config to fill in: no key, + topic or client, the server refuses it as is), the `bakashrot-data` + volume and a console for `docker attach`. Not run yet (no Docker on the + dev machine). ## Threat model (2026-11-08) diff --git a/Review.md b/Review.md deleted file mode 100644 index c4be360..0000000 --- a/Review.md +++ /dev/null @@ -1,13 +0,0 @@ - -Ignore for the time being - -# Rules - -## ??? -Any structure related to networking cannot use the `.i` data type. -Any use of this type in those should fail the review. - -## ??? -Any enumerations related to networking must declare its values explicitely. -Not doing this can cause parsing failures. -Any missing value should fail the review. diff --git a/Server/BakaShrot_Server.pb b/Server/BakaShrot_Server.pb index 9722bf6..fa8a568 100644 --- a/Server/BakaShrot_Server.pb +++ b/Server/BakaShrot_Server.pb @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: BakaShrot_Server.pb +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Server - CLI entry point ; diff --git a/Server/Config/Config.pbi b/Server/Config/Config.pbi index e5a63a3..f1bad8b 100644 --- a/Server/Config/Config.pbi +++ b/Server/Config/Config.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: Config.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Server Config ; diff --git a/Server/Networking/Networking.pbi b/Server/Networking/Networking.pbi index ea53761..9145a26 100644 --- a/Server/Networking/Networking.pbi +++ b/Server/Networking/Networking.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: Networking.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Server Networking ; diff --git a/Server/Networking/Peers.pbi b/Server/Networking/Peers.pbi index 3c56418..10966eb 100644 --- a/Server/Networking/Peers.pbi +++ b/Server/Networking/Peers.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: Peers.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Server Peers ; diff --git a/Server/Root.pbi b/Server/Root.pbi index 0e59e8d..f03ee95 100644 --- a/Server/Root.pbi +++ b/Server/Root.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: Root.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Server Root ; diff --git a/Server/Storage/Attachments.pbi b/Server/Storage/Attachments.pbi index 11afd55..31647c3 100644 --- a/Server/Storage/Attachments.pbi +++ b/Server/Storage/Attachments.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: Attachments.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Storage Attachments ; diff --git a/Server/Storage/Names.pbi b/Server/Storage/Names.pbi index 1efccbf..d208fb2 100644 --- a/Server/Storage/Names.pbi +++ b/Server/Storage/Names.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: Names.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Storage Names ; diff --git a/Server/Storage/Retention.pbi b/Server/Storage/Retention.pbi index 122d7c8..14ba8b1 100644 --- a/Server/Storage/Retention.pbi +++ b/Server/Storage/Retention.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: Retention.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Storage Retention ; diff --git a/Server/Storage/Storage.pbi b/Server/Storage/Storage.pbi index 37fc094..36a7b03 100644 --- a/Server/Storage/Storage.pbi +++ b/Server/Storage/Storage.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: Storage.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Storage ; diff --git a/Server/Storage/Writer.pbi b/Server/Storage/Writer.pbi index f833496..2de5b67 100644 --- a/Server/Storage/Writer.pbi +++ b/Server/Storage/Writer.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: Writer.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Storage Writer ; diff --git a/Tests/AttachmentEdgeClient.pb b/Tests/AttachmentEdgeClient.pb index c1410a4..fac7e99 100644 --- a/Tests/AttachmentEdgeClient.pb +++ b/Tests/AttachmentEdgeClient.pb @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: AttachmentEdgeClient.pb +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; A raw protocol client for the attachment cases the DLL never produces, run ; by Tests/AttachmentEdges-Test.ps1 against a running server. diff --git a/Tests/Bench/BenchClient.pb b/Tests/Bench/BenchClient.pb index f456788..c7115bb 100644 --- a/Tests/Bench/BenchClient.pb +++ b/Tests/Bench/BenchClient.pb @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: BenchClient.pb +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Bench Client ; diff --git a/Tests/Bench/BenchSeed.pb b/Tests/Bench/BenchSeed.pb index d871194..9264fd7 100644 --- a/Tests/Bench/BenchSeed.pb +++ b/Tests/Bench/BenchSeed.pb @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: BenchSeed.pb +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Bench Seed ; diff --git a/Tests/Bench/BenchServer.pb b/Tests/Bench/BenchServer.pb index f458de5..f6b17c8 100644 --- a/Tests/Bench/BenchServer.pb +++ b/Tests/Bench/BenchServer.pb @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: BenchServer.pb +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Bench Server ; diff --git a/Tests/CipherTest.pb b/Tests/CipherTest.pb index 5281f37..7c67703 100644 --- a/Tests/CipherTest.pb +++ b/Tests/CipherTest.pb @@ -1,4 +1,21 @@ -; ============================================================================ +;{- Code Header +; ==- Basic Info -================================ +; Name: CipherTest.pb +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + +; ============================================================================ ; Tests of Commons/Cryptography/Cipher.pbi, no sockets: round trips in both ; directions, and everything that must be refused (tampering, replay, ; reordering, reflection, wrong key), empty and 16 MB buffers. diff --git a/Tests/HandshakeTest.pb b/Tests/HandshakeTest.pb index afa62cd..e09ad54 100644 --- a/Tests/HandshakeTest.pb +++ b/Tests/HandshakeTest.pb @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: HandshakeTest.pb +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; Simulates the Hello -> ChallengeRequest -> ChallengeResponse handshake ; between a client and a server, without sockets. diff --git a/Tools/BakaShrotGenerateKeyPairs/BakaShrotGenerateKeyPairs.pb b/Tools/BakaShrotGenerateKeyPairs/BakaShrotGenerateKeyPairs.pb index 88dae0a..f49ee1d 100644 --- a/Tools/BakaShrotGenerateKeyPairs/BakaShrotGenerateKeyPairs.pb +++ b/Tools/BakaShrotGenerateKeyPairs/BakaShrotGenerateKeyPairs.pb @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: BakaShrotGenerateKeyPairs.pb +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrotGenerateKeyPairs ; diff --git a/Tools/BakaShrotGetAttachment/BakaShrotGetAttachment.pb b/Tools/BakaShrotGetAttachment/BakaShrotGetAttachment.pb index 5b05bd1..31f1824 100644 --- a/Tools/BakaShrotGetAttachment/BakaShrotGetAttachment.pb +++ b/Tools/BakaShrotGetAttachment/BakaShrotGetAttachment.pb @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: BakaShrotGetAttachment.pb +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrotGetAttachment ; diff --git a/Tools/BakaShrotGetLatestMessage/BakaShrotGetLatestMessage.pb b/Tools/BakaShrotGetLatestMessage/BakaShrotGetLatestMessage.pb index 5b58929..0ddb5dc 100644 --- a/Tools/BakaShrotGetLatestMessage/BakaShrotGetLatestMessage.pb +++ b/Tools/BakaShrotGetLatestMessage/BakaShrotGetLatestMessage.pb @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: BakaShrotGetLatestMessage.pb +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrotGetLatestMessage ; diff --git a/Tools/BakaShrotGetMessages/BakaShrotGetMessages.pb b/Tools/BakaShrotGetMessages/BakaShrotGetMessages.pb index 5cb7233..4bb1afa 100644 --- a/Tools/BakaShrotGetMessages/BakaShrotGetMessages.pb +++ b/Tools/BakaShrotGetMessages/BakaShrotGetMessages.pb @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: BakaShrotGetMessages.pb +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrotGetMessages ; diff --git a/Tools/BakaShrotList/BakaShrotList.pb b/Tools/BakaShrotList/BakaShrotList.pb index d431673..d33a286 100644 --- a/Tools/BakaShrotList/BakaShrotList.pb +++ b/Tools/BakaShrotList/BakaShrotList.pb @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: BakaShrotList.pb +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrotList ; diff --git a/Tools/BakaShrotPushMessage/BakaShrotPushMessage.pb b/Tools/BakaShrotPushMessage/BakaShrotPushMessage.pb index 446d0f4..5303a42 100644 --- a/Tools/BakaShrotPushMessage/BakaShrotPushMessage.pb +++ b/Tools/BakaShrotPushMessage/BakaShrotPushMessage.pb @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: BakaShrotPushMessage.pb +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrotPushMessage ; diff --git a/Tools/BakaShrotQuery/BakaShrotQuery.pb b/Tools/BakaShrotQuery/BakaShrotQuery.pb index ffee09c..1bf5dc4 100644 --- a/Tools/BakaShrotQuery/BakaShrotQuery.pb +++ b/Tools/BakaShrotQuery/BakaShrotQuery.pb @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: BakaShrotQuery.pb +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrotQuery ; diff --git a/Tools/BakaShrotResolveIds/BakaShrotResolveIds.pb b/Tools/BakaShrotResolveIds/BakaShrotResolveIds.pb index d4bac57..9d237f2 100644 --- a/Tools/BakaShrotResolveIds/BakaShrotResolveIds.pb +++ b/Tools/BakaShrotResolveIds/BakaShrotResolveIds.pb @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: BakaShrotResolveIds.pb +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrotResolveIds ; diff --git a/Tools/Common/ToolClient.pbi b/Tools/Common/ToolClient.pbi index 676f145..b2e51a6 100644 --- a/Tools/Common/ToolClient.pbi +++ b/Tools/Common/ToolClient.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: ToolClient.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Tools - Client connection ; diff --git a/Tools/Common/ToolConsole.pbi b/Tools/Common/ToolConsole.pbi index 7fe32e9..922a50f 100644 --- a/Tools/Common/ToolConsole.pbi +++ b/Tools/Common/ToolConsole.pbi @@ -1,3 +1,20 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: ToolConsole.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Tested compiler versions: +; * PureBasic 5.73 LTS (Windows x64, Linux x64) +; * PureBasic 6.40 C Backend (Windows x64) +; * PureBasic 6.41 (Linux x64) +; * PureBasic 6.41 C Backend (Linux x64) +; +; ==- Links -===================================== +; GitHub: https://github.com/aziascreations/BakaShrot +;} + ; ============================================================================ ; BakaShrot Tools - Console ; diff --git a/readme.md b/readme.md index 78ba525..2d516de 100644 --- a/readme.md +++ b/readme.md @@ -1,11 +1,45 @@ # BakaShrot +A message store with replication, written in PureBasic. + +Servers take messages (usually JSON) per topic and node from authenticated clients, +store them in SQLite, and replicate them to their peers by name. + +> [!NOTE] +> Meant as an internal tool on trusted machines and networks. -## ??? +## Features +* Encrypted connections, both ends prove who they are (Ed25519, libsodium) +* Replication between peers, by topic and node names +* Attachments of any size, one per message +* Per-topic retention +* Read-only SQL queries on the stored messages +* Clients: + * A DLL, with PureBasic prototypes + * CLI tools to push, read, query and list + * A Python module over the DLL, without dependencies +## Building +Requires PureBasic 5.73 or 6.40+ and the submodules. -# +* **Development:** `powershell -ExecutionPolicy Bypass -File Build.ps1` (into `Build\`) +* **Release:** `powershell -ExecutionPolicy Bypass -File Release.ps1` (into `Release\`) +* **Docker:** See [Docker/README.md](Docker/README.md) + +See [Examples/](Examples/README.md) for ready-to-run setups, +and [Server/Config/schema.ini](Server/Config/schema.ini) for every option of the server. +## Cloning +Use one of these commands to clone the repository and its submodules: +``` +git clone --recurse-submodules https://github.com/aziascreations/BakaShrot.git +git clone --recurse-submodules https://git.nibblepoker.lu/aziascreations/BakaShrot.git +``` + +## License +All the code in this repo is released in the [Public Domain](LICENSE). + +Please note that this doesn't apply to the required PureBasic archives. diff --git a/sqlite_json_index_demo.py b/sqlite_json_index_demo.py deleted file mode 100644 index 7769df4..0000000 --- a/sqlite_json_index_demo.py +++ /dev/null @@ -1,185 +0,0 @@ -""" -SQLite JSON subfield indexing demo. - -Shows the pattern discussed: a table with a JSON blob column where rows have -varying shapes, a generated column that pulls one subfield out of the JSON, -and an index on that generated column so lookups by the subfield don't -require a full table scan. Also adds a couple of views so the result is -pleasant to poke around in a GUI tool like SQLiteStudio. - -Stdlib only (sqlite3, json, random, pathlib). Writes events.db next to this -script; re-running the script deletes and regenerates it from scratch. -""" - -import json -import random -import sqlite3 -from pathlib import Path - -DB_PATH = Path(__file__).resolve().parent / "events.db" -MIN_SQLITE_VERSION = (3, 31, 0) # generated columns require this - - -def check_sqlite_version() -> None: - version = tuple(int(part) for part in sqlite3.sqlite_version.split(".")) - if version < MIN_SQLITE_VERSION: - raise RuntimeError( - f"sqlite3 {sqlite3.sqlite_version} is too old; generated columns " - f"need >= {'.'.join(map(str, MIN_SQLITE_VERSION))}" - ) - - -def create_schema(conn: sqlite3.Connection) -> None: - conn.execute( - """ - CREATE TABLE events ( - id INTEGER PRIMARY KEY, - data TEXT NOT NULL, - -- pulled out of data for indexing/querying; not stored twice - msg_type TEXT GENERATED ALWAYS AS ( - json_extract(data, '$.messageData.MsgType') - ) VIRTUAL - ) - """ - ) - conn.execute("CREATE INDEX idx_events_msg_type ON events (msg_type)") - - -def create_views(conn: sqlite3.Connection) -> None: - # Flattened, browsable overview of every row regardless of shape -- - # fields that don't apply to a given msg_type just come back NULL. - conn.execute( - """ - CREATE VIEW event_summary AS - SELECT - id, - msg_type, - json_extract(data, '$.messageData.userId') AS user_id, - data - FROM events - """ - ) - - # Type-specific view: only PURCHASE rows, with cents converted to a - # normal dollar amount. This is the pattern for any other MsgType you - # want to drill into -- copy this, swap the WHERE and the extracted - # fields. - conn.execute( - """ - CREATE VIEW purchase_details AS - SELECT - id, - json_extract(data, '$.messageData.userId') AS user_id, - json_extract(data, '$.messageData.amountCents') / 100.0 AS amount_usd, - json_extract(data, '$.messageData.items') AS items - FROM events - WHERE msg_type = 'PURCHASE' - """ - ) - - -def make_row(msg_type: str) -> dict: - """Each MsgType has a genuinely different JSON shape.""" - if msg_type == "LOGIN": - return { - "messageData": { - "MsgType": "LOGIN", - "userId": random.randint(1, 500), - "ip": f"10.0.{random.randint(0, 255)}.{random.randint(0, 255)}", - } - } - if msg_type == "LOGOUT": - return { - "messageData": { - "MsgType": "LOGOUT", - "userId": random.randint(1, 500), - "sessionDurationSec": random.randint(5, 3600), - } - } - if msg_type == "PURCHASE": - return { - "messageData": { - "MsgType": "PURCHASE", - "userId": random.randint(1, 500), - "amountCents": random.randint(99, 20000), - "items": random.randint(1, 5), - } - } - if msg_type == "ERROR": - # no userId at all here -- deliberately a different shape - return { - "messageData": { - "MsgType": "ERROR", - "code": random.choice(["TIMEOUT", "BAD_AUTH", "RATE_LIMIT"]), - "retryable": random.choice([True, False]), - } - } - raise ValueError(f"unknown msg_type: {msg_type}") - - -def generate_rows(count: int) -> list[tuple[str]]: - weights = {"LOGIN": 40, "LOGOUT": 35, "PURCHASE": 15, "ERROR": 10} - types = list(weights.keys()) - picks = random.choices(types, weights=list(weights.values()), k=count) - return [(json.dumps(make_row(t)),) for t in picks] - - -def insert_rows(conn: sqlite3.Connection, rows: list[tuple[str]]) -> None: - conn.executemany("INSERT INTO events (data) VALUES (?)", rows) - - -def query_counts_by_type(conn: sqlite3.Connection) -> None: - print("-- counts by msg_type --") - for msg_type, count in conn.execute( - "SELECT msg_type, COUNT(*) FROM events GROUP BY msg_type ORDER BY msg_type" - ): - print(f"{msg_type:10s} {count}") - - -def query_purchases(conn: sqlite3.Connection) -> None: - print("\n-- sample PURCHASE rows (via the indexed column) --") - rows = conn.execute( - """ - SELECT id, - json_extract(data, '$.messageData.userId') AS user_id, - json_extract(data, '$.messageData.amountCents') AS amount_cents - FROM events - WHERE msg_type = 'PURCHASE' - ORDER BY id - LIMIT 5 - """ - ).fetchall() - for row in rows: - print(row) - - -def confirm_index_is_used(conn: sqlite3.Connection) -> None: - plan = conn.execute( - "EXPLAIN QUERY PLAN SELECT * FROM events WHERE msg_type = 'ERROR'" - ).fetchall() - plan_text = " | ".join(row[-1] for row in plan) - print(f"\n-- query plan for WHERE msg_type = 'ERROR' --\n{plan_text}") - if "idx_events_msg_type" not in plan_text: - raise AssertionError( - f"expected idx_events_msg_type to be used, got: {plan_text}" - ) - - -def main() -> None: - check_sqlite_version() - random.seed(0) # reproducible output - - conn = sqlite3.connect(":memory:") - create_schema(conn) - insert_rows(conn, generate_rows(2000)) - conn.commit() - - query_counts_by_type(conn) - query_purchases(conn) - confirm_index_is_used(conn) - - conn.close() - - -if __name__ == "__main__": - main()