1
0
mirror of https://github.com/aziascreations/BakaShrot.git synced 2026-11-23 20:58:46 +01:00

Added headers, Added license, Added docker example, Cleared trash

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-11 21:35:28 +01:00
parent 6eedc1ec21
commit 42bd1f76d9
78 changed files with 1455 additions and 203 deletions
@@ -1,2 +0,0 @@
[InternetShortcut]
URL=https://www.purebasic.fr/english/viewtopic.php?t=89425
+4
View File
@@ -107,6 +107,10 @@ suite: they take a few minutes in all.
`_Free` when it holds data), every field validated on decode. `_Free` when it holds data), every field validated on decode.
- **Every write goes through the writer** (`Server/Storage/Writer.pbi`, - **Every write goes through the writer** (`Server/Storage/Writer.pbi`,
under its mutex); reads use the thread's own connection. 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)" - **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 section in `Notes.md`, what's left goes to its open items, and the
`Design/` doc of that area is updated with it. `Design/` doc of that area is updated with it.
+17
View File
@@ -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 ; BakaShrot Client DLL
; ;
+17
View File
@@ -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 ; BakaShrot Client DLL - Prototypes
; ;
+17
View File
@@ -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 ; BakaShrot error codes
; ;
+17
View File
@@ -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 ; BakaShrot Cipher
; ;
+17
View File
@@ -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 ; BakaShrot Cryptography
; ;
+17
View File
@@ -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 ; BakaShrot Session
; ;
+17
View File
@@ -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 ; BakaShrot Connections
; ;
+17
View File
@@ -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 ; BakaShrot Names
; ;
+17
View File
@@ -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 ; BakaShrot Outbound connections
; ;
+16
View File
@@ -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 "../../Includes/PB-MessagePack/Includes/MessagePack.pbi"
XIncludeFile "Names.pbi" XIncludeFile "Names.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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
@@ -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
;}
; ============================================================================ ; ============================================================================
; ... ; ...
; ============================================================================ ; ============================================================================
+17
View File
@@ -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 ; BakaShrot Socket waits
; ;
+17
View File
@@ -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 ; BakaShrot Signal
; ;
+49
View File
@@ -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.
+3
View File
@@ -19,6 +19,9 @@
# DatabasePath = /var/lib/bakashrot/server.sqlite (relative paths are from # DatabasePath = /var/lib/bakashrot/server.sqlite (relative paths are from
# that folder too). # 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, # `docker stop` stops it cleanly (SIGTERM). Console commands (names, vacuum,
# restart...): start it with -it, then `docker attach bakashrot`, and # restart...): start it with -it, then `docker attach bakashrot`, and
# detach with Ctrl+P, Ctrl+Q. # detach with Ctrl+P, Ctrl+Q.
+38
View File
@@ -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:
+60
View File
@@ -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
+121
View File
@@ -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.
+5
View File
@@ -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 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 (~0.3 s, exit 0), data kept over a restart, commands with `-i`. Alpine was
tried: PureBasic needs glibc 2.38+. 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) ## Threat model (2026-11-08)
-13
View File
@@ -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.
+17
View File
@@ -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 ; BakaShrot Server - CLI entry point
; ;
+17
View File
@@ -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 ; BakaShrot Server Config
; ;
+17
View File
@@ -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 ; BakaShrot Server Networking
; ;
+17
View File
@@ -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 ; BakaShrot Server Peers
; ;
+17
View File
@@ -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 ; BakaShrot Server Root
; ;
+17
View File
@@ -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 ; BakaShrot Storage Attachments
; ;
+17
View File
@@ -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 ; BakaShrot Storage Names
; ;
+17
View File
@@ -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 ; BakaShrot Storage Retention
; ;
+17
View File
@@ -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 ; BakaShrot Storage
; ;
+17
View File
@@ -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 ; BakaShrot Storage Writer
; ;
+17
View File
@@ -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 ; A raw protocol client for the attachment cases the DLL never produces, run
; by Tests/AttachmentEdges-Test.ps1 against a running server. ; by Tests/AttachmentEdges-Test.ps1 against a running server.
+17
View File
@@ -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 ; BakaShrot Bench Client
; ;
+17
View File
@@ -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 ; BakaShrot Bench Seed
; ;
+17
View File
@@ -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 ; BakaShrot Bench Server
; ;
+18 -1
View File
@@ -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 ; Tests of Commons/Cryptography/Cipher.pbi, no sockets: round trips in both
; directions, and everything that must be refused (tampering, replay, ; directions, and everything that must be refused (tampering, replay,
; reordering, reflection, wrong key), empty and 16 MB buffers. ; reordering, reflection, wrong key), empty and 16 MB buffers.
+17
View File
@@ -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 ; Simulates the Hello -> ChallengeRequest -> ChallengeResponse handshake
; between a client and a server, without sockets. ; between a client and a server, without sockets.
@@ -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 ; BakaShrotGenerateKeyPairs
; ;
@@ -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 ; BakaShrotGetAttachment
; ;
@@ -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 ; BakaShrotGetLatestMessage
; ;
@@ -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 ; BakaShrotGetMessages
; ;
+17
View File
@@ -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 ; BakaShrotList
; ;
@@ -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 ; BakaShrotPushMessage
; ;
+17
View File
@@ -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 ; BakaShrotQuery
; ;
@@ -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 ; BakaShrotResolveIds
; ;
+17
View File
@@ -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 ; BakaShrot Tools - Client connection
; ;
+17
View File
@@ -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 ; BakaShrot Tools - Console
; ;
+36 -2
View File
@@ -1,11 +1,45 @@
# BakaShrot # 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.
-185
View File
@@ -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()