Compare commits

...

53 Commits

Author SHA1 Message Date
ton 046d3ce4e6 up version 2026-09-05 12:08:24 +07:00
ton 4f79b444d2 Merge pull request 'V0.6.10 garage presigned url' (#15) from v0.6.10-Garage_presigned_url into v0.6.10
Reviewed-on: #15
2026-09-05 05:04:51 +00:00
ton 599765d7ef update 2026-09-05 10:27:31 +07:00
ton 9ad732c436 update 2026-09-05 10:00:36 +07:00
ton 25ca9b96a2 update 2026-09-04 14:05:36 +07:00
ton 2827d22616 update 2026-09-04 13:58:28 +07:00
ton 151e4e74cf update 2026-09-01 14:35:57 +07:00
ton 42b66366ae update 2026-09-01 12:21:17 +07:00
ton b0761fae75 update 2026-09-01 12:21:02 +07:00
ton f9e952e5ed update 2026-09-01 12:06:41 +07:00
ton 397885511a add eventSink 2026-09-01 12:03:50 +07:00
ton ee8ade1189 update 2026-08-31 15:52:40 +07:00
ton 20c51cf39f update 2026-08-30 10:46:39 +07:00
ton f09a53b6c3 update 2026-08-29 19:25:04 +07:00
ton c078948a7c update 2026-08-29 19:12:14 +07:00
ton 3780eb41df update 2026-08-29 18:47:45 +07:00
ton c28b7ebf84 Merge pull request 'V0.6.2' (#14) from v0.6.2 into main
Reviewed-on: #14
2026-08-29 02:58:21 +00:00
ton 27fd52fa71 Merge pull request 'V0.6.2 fix precompile' (#13) from v0.6.2-fix_precompile into v0.6.2
Reviewed-on: #13
2026-08-29 02:56:16 +00:00
ton f88656172c object lifecycle works 2026-08-29 09:52:33 +07:00
ton 5c1b70107a slash works 2026-08-29 09:24:30 +07:00
ton 2b2b7a378e works 2026-08-29 09:00:21 +07:00
ton 3fb7457f61 1st commit 2026-08-29 08:22:46 +07:00
ton 1fc0f790d9 update 2026-08-28 19:48:29 +07:00
ton a559824faa update 2026-08-28 18:40:33 +07:00
ton d74635c47a update 2026-08-28 18:33:21 +07:00
ton 9d6a943503 update 2026-08-28 14:34:55 +07:00
ton c1c83eba77 update 2026-08-28 14:31:26 +07:00
ton dee5649254 update 2026-08-28 14:23:18 +07:00
ton fc62098071 update 2026-08-28 12:49:38 +07:00
ton 99996c1b04 update 2026-08-28 11:08:34 +07:00
ton 4466320927 update 2026-08-28 08:30:46 +07:00
ton ff757c19dd update 2026-08-28 08:29:07 +07:00
ton c4741140f5 update 2026-08-28 08:28:35 +07:00
ton 27703c3324 update docs 2026-08-28 08:25:21 +07:00
ton 86b8582584 update 2026-08-28 07:52:07 +07:00
ton 32cd21e1ee update 2026-08-28 07:47:12 +07:00
ton 517a08365d update 2026-08-27 20:47:33 +07:00
ton d032cec0b2 fix garageS3 2026-08-27 20:46:23 +07:00
ton 64575d81b5 add garageS3 feature 2026-08-27 19:40:21 +07:00
ton fb54fddf10 update 2026-08-25 16:51:04 +07:00
ton 407447831a update 2026-07-24 20:23:54 +07:00
ton c475eb169c update 2026-07-24 20:12:54 +07:00
ton d1a279cca2 update 2026-07-24 20:09:21 +07:00
ton bf3b65ee7b update 2026-07-24 17:35:31 +07:00
ton 360d64c474 update 2026-07-24 16:42:23 +07:00
ton 41a354fa73 update 2026-07-24 15:34:02 +07:00
ton 801596fa7f update 2026-07-24 14:32:44 +07:00
ton 2fbe9d6e1a update 2026-07-24 13:21:04 +07:00
ton 2c2690e5dd update 2026-07-24 13:18:35 +07:00
ton 95db5f877d up version 2026-07-24 13:04:04 +07:00
ton 7e2ddd846e update 2026-07-24 13:03:40 +07:00
ton ab113acde5 up version 2026-07-24 12:45:55 +07:00
ton 7391f0f2ce add execute_postgres_sql 2026-07-24 12:45:14 +07:00
15 changed files with 1773 additions and 121 deletions
+27
View File
@@ -0,0 +1,27 @@
# 1. Garage Web Admin UI
garage-ui.yiem.cc {
reverse_proxy 192.168.88.106:3909
}
# 2. Garage S3 API (Path-Style & Single Domain)
s3-api.yiem.cc {
reverse_proxy 192.168.88.106:3900 {
header_up Host {host}
}
}
# 3. Garage S3 WEB (Path-Style & Single Domain)
s3-web.yiem.cc {
# /bucket -> /bucket/
@bucket_root path_regexp bucket_root ^/([^/]+)$
redir @bucket_root /{http.regexp.bucket_root.1}/ 301
# /bucket/... -> Garage
@bucket path_regexp bucket ^/([^/]+)(/.*)?$
rewrite @bucket {http.regexp.bucket.2}
reverse_proxy 192.168.88.106:3902 {
header_up Host {http.regexp.bucket.1}.s3-web.yiem.cc
}
}
+151 -79
View File
@@ -1,8 +1,20 @@
# This file is machine-generated - editing it directly is not advised # This file is machine-generated - editing it directly is not advised
julia_version = "1.12.6" julia_version = "1.12.7"
manifest_format = "2.0" manifest_format = "2.0"
project_hash = "a1c572efdd97cec1f432040f02784b67635102aa" project_hash = "c54613132b678b04efd2a70a95fabd5b0cdd02a2"
[[deps.AWS]]
deps = ["Base64", "Compat", "Dates", "Downloads", "GitHub", "HTTP", "IniFile", "JSON", "MD5", "Mocking", "OrderedCollections", "Random", "SHA", "ScopedValues", "Sockets", "URIs", "UUIDs", "XMLDict"]
git-tree-sha1 = "842075b12a7f763c5f815a04037a99b6ac346df9"
uuid = "fbe9abb3-538b-5e4e-ba9e-bc94f4f92ebc"
version = "1.99.0"
[[deps.AWSS3]]
deps = ["AWS", "ArrowTypes", "Base64", "Compat", "Dates", "EzXML", "FilePathsBase", "HTTP", "MbedTLS", "Mocking", "OrderedCollections", "Retry", "SymDict", "URIs", "UUIDs", "XMLDict"]
git-tree-sha1 = "af99cea71364c8c4483405a6b03697d197ab4d3b"
uuid = "1c724243-ef5b-51ab-93f4-b0a88ac62a95"
version = "0.11.6"
[[deps.Accessors]] [[deps.Accessors]]
deps = ["CompositionsBase", "ConstructionBase", "Dates", "InverseFunctions", "MacroTools"] deps = ["CompositionsBase", "ConstructionBase", "Dates", "InverseFunctions", "MacroTools"]
@@ -74,9 +86,9 @@ version = "1.11.0"
[[deps.CSV]] [[deps.CSV]]
deps = ["CodecZlib", "Dates", "FilePathsBase", "InlineStrings", "Mmap", "Parsers", "PooledArrays", "PrecompileTools", "SentinelArrays", "Tables", "Unicode", "WeakRefStrings", "WorkerUtilities"] deps = ["CodecZlib", "Dates", "FilePathsBase", "InlineStrings", "Mmap", "Parsers", "PooledArrays", "PrecompileTools", "SentinelArrays", "Tables", "Unicode", "WeakRefStrings", "WorkerUtilities"]
git-tree-sha1 = "8d8e0b0f350b8e1c91420b5e64e5de774c2f0f4d" git-tree-sha1 = "abed1e735dd4152f48c90cf0767e1790e25f332f"
uuid = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" uuid = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
version = "0.10.16" version = "0.10.17"
[[deps.CodeTracking]] [[deps.CodeTracking]]
deps = ["InteractiveUtils", "REPL", "UUIDs"] deps = ["InteractiveUtils", "REPL", "UUIDs"]
@@ -92,14 +104,15 @@ version = "0.3.4"
[[deps.CodecZlib]] [[deps.CodecZlib]]
deps = ["TranscodingStreams", "Zlib_jll"] deps = ["TranscodingStreams", "Zlib_jll"]
git-tree-sha1 = "962834c22b66e32aa10f7611c08c8ca4e20749a9" git-tree-sha1 = "970758a3d591a2a5c2a907c53f2e2f8c1b1d3537"
uuid = "944b1d66-785c-5afd-91f1-9de20f533193" uuid = "944b1d66-785c-5afd-91f1-9de20f533193"
version = "0.7.8" version = "0.7.9"
[[deps.CommonSolve]] [[deps.CommonSolve]]
git-tree-sha1 = "eeaad7cef88554c2fa56b5a3f71cfd5cb708c662" deps = ["PrecompileTools"]
git-tree-sha1 = "6c389fa857f6ca5a95474b52a52023fd77f24cb7"
uuid = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2" uuid = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2"
version = "0.2.11" version = "0.2.14"
[[deps.Compat]] [[deps.Compat]]
deps = ["TOML", "UUIDs"] deps = ["TOML", "UUIDs"]
@@ -119,7 +132,7 @@ version = "0.1.1"
[[deps.CompilerSupportLibraries_jll]] [[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"] deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
version = "1.3.0+1" version = "1.3.1+2"
[[deps.CompositionsBase]] [[deps.CompositionsBase]]
git-tree-sha1 = "802bb88cd69dfd1509f6670416bd4434015693ad" git-tree-sha1 = "802bb88cd69dfd1509f6670416bd4434015693ad"
@@ -146,14 +159,14 @@ version = "1.6.0"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
[[deps.Crayons]] [[deps.Crayons]]
git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15" git-tree-sha1 = "54b76cbb40d9a0f5368c880725b2f141da77c94f"
uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
version = "4.1.1" version = "4.2.0"
[[deps.DBInterface]] [[deps.DBInterface]]
git-tree-sha1 = "a444404b3f94deaa43ca2a58e18153a82695282b" git-tree-sha1 = "265d7f87f329c063cbde41920f9d00713a43cedd"
uuid = "a10d1c49-ce27-4219-8d33-6db1a4562965" uuid = "a10d1c49-ce27-4219-8d33-6db1a4562965"
version = "2.6.1" version = "2.7.0"
[[deps.DataAPI]] [[deps.DataAPI]]
git-tree-sha1 = "abe83f3a2f1b857aac70ef8b269080af17764bbe" git-tree-sha1 = "abe83f3a2f1b857aac70ef8b269080af17764bbe"
@@ -168,9 +181,9 @@ version = "1.8.2"
[[deps.DataStructures]] [[deps.DataStructures]]
deps = ["OrderedCollections"] deps = ["OrderedCollections"]
git-tree-sha1 = "6fb53a69613a0b2b68a0d12671717d307ab8b24e" git-tree-sha1 = "b0bc6d2cad1fed8b7fd59a1551a991cb3d2809e6"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.19.5" version = "0.19.6"
[[deps.DataValueInterfaces]] [[deps.DataValueInterfaces]]
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
@@ -208,9 +221,9 @@ version = "1.11.0"
[[deps.Distributions]] [[deps.Distributions]]
deps = ["AliasTables", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "Roots", "SpecialFunctions", "Statistics", "StatsAPI", "StatsBase", "StatsFuns"] deps = ["AliasTables", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "Roots", "SpecialFunctions", "Statistics", "StatsAPI", "StatsBase", "StatsFuns"]
git-tree-sha1 = "cd3c5ac74cd3923c8945c6a81518c46abd0e73a3" git-tree-sha1 = "a958ab3a40c755563f5e1405c0846cb0446bf19d"
uuid = "31c24e10-a181-5473-b8eb-7969acd0382f" uuid = "31c24e10-a181-5473-b8eb-7969acd0382f"
version = "0.25.129" version = "0.25.131"
[deps.Distributions.extensions] [deps.Distributions.extensions]
DistributionsChainRulesCoreExt = "ChainRulesCore" DistributionsChainRulesCoreExt = "ChainRulesCore"
@@ -240,9 +253,15 @@ uuid = "4e289a0a-7415-4d19-859d-a7e5c4648b56"
version = "1.0.7" version = "1.0.7"
[[deps.ExprTools]] [[deps.ExprTools]]
git-tree-sha1 = "27415f162e6028e81c72b82ef756bf321213b6ec" git-tree-sha1 = "d2e49e7efd29719d6f28b891b0e0e159daa9d2b4"
uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04" uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04"
version = "0.1.10" version = "0.1.11"
[[deps.EzXML]]
deps = ["Printf", "XML2_jll"]
git-tree-sha1 = "7ea1aa5869e2626ccae84480e4f37185bc6f41d3"
uuid = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615"
version = "1.2.3"
[[deps.FilePathsBase]] [[deps.FilePathsBase]]
deps = ["Compat", "Dates"] deps = ["Compat", "Dates"]
@@ -261,9 +280,9 @@ version = "1.11.0"
[[deps.FillArrays]] [[deps.FillArrays]]
deps = ["LinearAlgebra"] deps = ["LinearAlgebra"]
git-tree-sha1 = "2f979084d1e13948a3352cf64a25df6bd3b4dca3" git-tree-sha1 = "5bad39456d9f0166184fce2248783dd9862645c1"
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b" uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
version = "1.16.0" version = "1.17.0"
weakdeps = ["PDMats", "SparseArrays", "StaticArrays", "Statistics"] weakdeps = ["PDMats", "SparseArrays", "StaticArrays", "Statistics"]
[deps.FillArrays.extensions] [deps.FillArrays.extensions]
@@ -278,15 +297,22 @@ uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"
version = "1.11.0" version = "1.11.0"
[[deps.Gamma]] [[deps.Gamma]]
git-tree-sha1 = "86f86b6168a016ed88e4ae4e64577b98c3b59e8e" deps = ["LogExpFunctions"]
git-tree-sha1 = "becc397f7cfb06e343496ae6ffb04818a851da51"
uuid = "a0844989-3bd2-4988-8bea-c9407ab0941b" uuid = "a0844989-3bd2-4988-8bea-c9407ab0941b"
version = "1.1.0" version = "1.2.0"
[[deps.GeneralUtils]] [[deps.GeneralUtils]]
deps = ["CSV", "DataFrames", "DataStructures", "Dates", "Distributions", "Graphs", "HTTP", "JSON", "LibPQ", "NATS", "PrettyPrinting", "Random", "Revise", "SHA", "StringDistances", "UUIDs"] deps = ["AWS", "AWSS3", "CSV", "DataFrames", "DataStructures", "Dates", "Distributions", "Graphs", "HTTP", "JSON", "LibPQ", "NATS", "PrettyPrinting", "Random", "Revise", "SHA", "StringDistances", "UUIDs"]
path = "." path = "."
uuid = "c6c72f09-b708-4ac8-ac7c-2084d70108fe" uuid = "c6c72f09-b708-4ac8-ac7c-2084d70108fe"
version = "0.4.10" version = "0.6.1"
[[deps.GitHub]]
deps = ["Base64", "Dates", "HTTP", "JSON", "MbedTLS", "Sockets", "SodiumSeal", "URIs"]
git-tree-sha1 = "33de1bc5665494f0a9669fd6027e28180709d874"
uuid = "bc5e4493-9b4d-5f90-b8aa-2b2bcaad7a26"
version = "5.13.0"
[[deps.Graphs]] [[deps.Graphs]]
deps = ["ArnoldiMethod", "DataStructures", "Inflate", "LinearAlgebra", "Random", "SimpleTraits", "SparseArrays", "Statistics"] deps = ["ArnoldiMethod", "DataStructures", "Inflate", "LinearAlgebra", "Random", "SimpleTraits", "SparseArrays", "Statistics"]
@@ -303,9 +329,9 @@ version = "1.14.0"
[[deps.HTTP]] [[deps.HTTP]]
deps = ["Base64", "CodecZlib", "Dates", "EnumX", "PrecompileTools", "Random", "Reseau", "SHA", "URIs", "UUIDs", "Zlib_jll"] deps = ["Base64", "CodecZlib", "Dates", "EnumX", "PrecompileTools", "Random", "Reseau", "SHA", "URIs", "UUIDs", "Zlib_jll"]
git-tree-sha1 = "c2c808326222b6dc4bec295a83b55f79aeec98e0" git-tree-sha1 = "d6e390d1515836237b837fb7b6fca7ba1d752db6"
uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3"
version = "2.5.5" version = "2.6.5"
[[deps.HashArrayMappedTries]] [[deps.HashArrayMappedTries]]
git-tree-sha1 = "2eaa69a7cab70a52b9687c8bf950a5a93ec895ae" git-tree-sha1 = "2eaa69a7cab70a52b9687c8bf950a5a93ec895ae"
@@ -314,9 +340,9 @@ version = "0.2.0"
[[deps.HypergeometricFunctions]] [[deps.HypergeometricFunctions]]
deps = ["Gamma", "LinearAlgebra"] deps = ["Gamma", "LinearAlgebra"]
git-tree-sha1 = "18d7deab5fb0440dc6a7b6993c5c27b25420de10" git-tree-sha1 = "31bb6c92405c084617facc1d7ed9eb6c402d061e"
uuid = "34004b35-14d8-5ef3-9330-4cdb6864b03a" uuid = "34004b35-14d8-5ef3-9330-4cdb6864b03a"
version = "0.3.29" version = "0.3.30"
[[deps.ICU_jll]] [[deps.ICU_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"] deps = ["Artifacts", "JLLWrappers", "Libdl"]
@@ -335,6 +361,11 @@ git-tree-sha1 = "d1b1b796e47d94588b3757fe84fbf65a5ec4a80d"
uuid = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9" uuid = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9"
version = "0.1.5" version = "0.1.5"
[[deps.IniFile]]
git-tree-sha1 = "f550e6e32074c939295eb5ea6de31849ac2c9625"
uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f"
version = "0.5.1"
[[deps.InlineStrings]] [[deps.InlineStrings]]
git-tree-sha1 = "8f3d257792a522b4601c24a577954b0a8cd7334d" git-tree-sha1 = "8f3d257792a522b4601c24a577954b0a8cd7334d"
uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48" uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48"
@@ -394,9 +425,9 @@ version = "1.8.0"
[[deps.JSON]] [[deps.JSON]]
deps = ["Dates", "Logging", "Parsers", "PrecompileTools", "StructUtils", "UUIDs", "Unicode"] deps = ["Dates", "Logging", "Parsers", "PrecompileTools", "StructUtils", "UUIDs", "Unicode"]
git-tree-sha1 = "c89d196f5ffb64bfbf80985b699ea913b0d2c211" git-tree-sha1 = "c7345ab1a7ca4dc8a02c9f6510da0d9857bbe513"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "1.6.1" version = "1.7.1"
weakdeps = ["ArrowTypes"] weakdeps = ["ArrowTypes"]
[deps.JSON.extensions] [deps.JSON.extensions]
@@ -414,9 +445,9 @@ weakdeps = ["ArrowTypes"]
[[deps.JuliaInterpreter]] [[deps.JuliaInterpreter]]
deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"] deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"]
git-tree-sha1 = "58927c485919bf17ea308d9d82156de1adf4b006" git-tree-sha1 = "c3d401f110454b4ea24a76be33f6ee0d7d385103"
uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a" uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
version = "0.10.12" version = "0.11.4"
[[deps.JuliaSyntaxHighlighting]] [[deps.JuliaSyntaxHighlighting]]
deps = ["StyledStrings"] deps = ["StyledStrings"]
@@ -430,9 +461,9 @@ uuid = "b39eb1a6-c29a-53d7-8c32-632cd16f18da"
version = "1.21.3+0" version = "1.21.3+0"
[[deps.LaTeXStrings]] [[deps.LaTeXStrings]]
git-tree-sha1 = "dda21b8cbd6a6c40d9d02a73230f9d70fed6918c" git-tree-sha1 = "f88f3ccef05a6a72a0cf0ed417c8fd68530f4ab2"
uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
version = "1.4.0" version = "1.4.1"
[[deps.LayerDicts]] [[deps.LayerDicts]]
git-tree-sha1 = "6087ad3521d6278ebe5c27ae55e7bbb15ca312cb" git-tree-sha1 = "6087ad3521d6278ebe5c27ae55e7bbb15ca312cb"
@@ -480,6 +511,12 @@ version = "1.11.3+1"
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
version = "1.11.0" version = "1.11.0"
[[deps.Libiconv_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "be484f5c92fad0bd8acfef35fe017900b0b73809"
uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531"
version = "1.18.0+0"
[[deps.LinearAlgebra]] [[deps.LinearAlgebra]]
deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"]
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
@@ -507,9 +544,15 @@ version = "1.11.0"
[[deps.LoweredCodeUtils]] [[deps.LoweredCodeUtils]]
deps = ["CodeTracking", "Compiler", "JuliaInterpreter"] deps = ["CodeTracking", "Compiler", "JuliaInterpreter"]
git-tree-sha1 = "3733419e9a71156b389f3e331672d2e95436783f" git-tree-sha1 = "1d4c737ab26f51ceed52ab2019c09b7660eb7440"
uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b" uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b"
version = "3.6.2" version = "3.8.0"
[[deps.MD5]]
deps = ["Random", "SHA"]
git-tree-sha1 = "1576f756617d31eb397a4a517b68562fd28dc2b4"
uuid = "6ac74813-4b46-53a4-afec-0b5dc9d7885c"
version = "0.2.3"
[[deps.MacroTools]] [[deps.MacroTools]]
git-tree-sha1 = "1e0228a030642014fe5cfe68c2c0a818f9e3f522" git-tree-sha1 = "1e0228a030642014fe5cfe68c2c0a818f9e3f522"
@@ -567,9 +610,9 @@ version = "0.1.1"
[[deps.NanoDates]] [[deps.NanoDates]]
deps = ["Dates", "Parsers"] deps = ["Dates", "Parsers"]
git-tree-sha1 = "850a0557ae5934f6e67ac0dc5ca13d0328422d1f" git-tree-sha1 = "77c7e98ca39aefb481f9b97a2f4f5c5471c08a1d"
uuid = "46f1a544-deae-4307-8689-c12aa3c955c6" uuid = "46f1a544-deae-4307-8689-c12aa3c955c6"
version = "1.0.3" version = "1.1.0"
[[deps.NetworkOptions]] [[deps.NetworkOptions]]
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
@@ -599,7 +642,7 @@ version = "0.8.7+0"
[[deps.OpenSSL_jll]] [[deps.OpenSSL_jll]]
deps = ["Artifacts", "Libdl"] deps = ["Artifacts", "Libdl"]
uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
version = "3.5.4+0" version = "3.5.6+0"
[[deps.OpenSpecFun_jll]] [[deps.OpenSpecFun_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl"] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl"]
@@ -608,15 +651,15 @@ uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e"
version = "0.5.6+0" version = "0.5.6+0"
[[deps.OrderedCollections]] [[deps.OrderedCollections]]
git-tree-sha1 = "94ba93778373a53bfd5a0caaf7d809c445292ff4" git-tree-sha1 = "05f45c2e0de6259db764adbfd2f1dc6d3f8de13c"
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
version = "1.8.2" version = "2.0.1"
[[deps.PDMats]] [[deps.PDMats]]
deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"] deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"]
git-tree-sha1 = "26766d4b5f1a410c218a19b85a672c6edb693c65" git-tree-sha1 = "123266c25174ef6c8d4718920abc206452cf8de6"
uuid = "90014a1f-27ba-587c-ab20-58faa44d9150" uuid = "90014a1f-27ba-587c-ab20-58faa44d9150"
version = "0.11.40" version = "0.11.41"
weakdeps = ["StatsBase"] weakdeps = ["StatsBase"]
[deps.PDMats.extensions] [deps.PDMats.extensions]
@@ -624,9 +667,9 @@ weakdeps = ["StatsBase"]
[[deps.Parsers]] [[deps.Parsers]]
deps = ["Dates", "PrecompileTools", "UUIDs"] deps = ["Dates", "PrecompileTools", "UUIDs"]
git-tree-sha1 = "32a4e09c5f29402573d673901778a0e03b0807b9" git-tree-sha1 = "3de8f5e6e90ebfa8d6d1f86997d6cdcd6a912ff3"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "2.8.6" version = "2.8.7"
[[deps.PooledArrays]] [[deps.PooledArrays]]
deps = ["DataAPI", "Future"] deps = ["DataAPI", "Future"]
@@ -647,15 +690,15 @@ uuid = "21216c6a-2e73-6563-6e65-726566657250"
version = "1.5.2" version = "1.5.2"
[[deps.PrettyPrinting]] [[deps.PrettyPrinting]]
git-tree-sha1 = "142ee93724a9c5d04d78df7006670a93ed1b244e" git-tree-sha1 = "0b7f4ad437e31c51cf5b91fb103579b04025170a"
uuid = "54e16d92-306c-5ea0-a30b-337be88ac337" uuid = "54e16d92-306c-5ea0-a30b-337be88ac337"
version = "0.4.2" version = "0.4.3"
[[deps.PrettyTables]] [[deps.PrettyTables]]
deps = ["Crayons", "LaTeXStrings", "Markdown", "PrecompileTools", "Printf", "REPL", "Reexport", "StringManipulation", "Tables"] deps = ["Crayons", "LaTeXStrings", "Markdown", "PrecompileTools", "Printf", "REPL", "Reexport", "StringManipulation", "Tables"]
git-tree-sha1 = "ebf455bb866ee6737030e3d3816bb6a0683c4325" git-tree-sha1 = "1b8aa19f229b1cea7fc93874a52e49db6a854450"
uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
version = "3.4.0" version = "3.4.8"
[deps.PrettyTables.extensions] [deps.PrettyTables.extensions]
PrettyTablesExcelExt = "XLSX" PrettyTablesExcelExt = "XLSX"
@@ -716,15 +759,20 @@ version = "1.3.1"
[[deps.Reseau]] [[deps.Reseau]]
deps = ["NetworkOptions", "OpenSSL_jll", "PrecompileTools", "Random", "SHA"] deps = ["NetworkOptions", "OpenSSL_jll", "PrecompileTools", "Random", "SHA"]
git-tree-sha1 = "0eab6d95ed40c2ef3992255c1c71e4f9748932b5" git-tree-sha1 = "aaee74fab545e9af4b21d10c2203c93c636c4ae0"
uuid = "802f3686-a58f-41ce-bb0c-3c43c75bba36" uuid = "802f3686-a58f-41ce-bb0c-3c43c75bba36"
version = "1.3.1" version = "1.4.1"
[[deps.Retry]]
git-tree-sha1 = "41ac127cd281bb33e42aba46a9d3b25cd35fc6d5"
uuid = "20febd7b-183b-5ae2-ac4a-720e7ce64774"
version = "0.4.1"
[[deps.Revise]] [[deps.Revise]]
deps = ["CRC32c", "CodeTracking", "FileWatching", "InteractiveUtils", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "Preferences", "REPL", "UUIDs"] deps = ["CRC32c", "CodeTracking", "FileWatching", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "Preferences", "REPL", "UUIDs"]
git-tree-sha1 = "27e3ee13fc8739a59b380d6163d6a82f52c03bd7" git-tree-sha1 = "f6ad10ad2fa1063c2ae0f75d17d92d1d0cae4c77"
uuid = "295af30f-e4ad-537b-8983-00126c2a3abe" uuid = "295af30f-e4ad-537b-8983-00126c2a3abe"
version = "3.15.1" version = "3.16.5"
weakdeps = ["Distributed"] weakdeps = ["Distributed"]
[deps.Revise.extensions] [deps.Revise.extensions]
@@ -738,15 +786,15 @@ version = "0.9.0"
[[deps.Rmath_jll]] [[deps.Rmath_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"] deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "58cdd8fb2201a6267e1db87ff148dd6c1dbd8ad8" git-tree-sha1 = "6d40b2fe70437b01397d2a4d5b020008da4e7019"
uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f" uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f"
version = "0.5.1+0" version = "0.5.2+0"
[[deps.Roots]] [[deps.Roots]]
deps = ["Accessors", "CommonSolve", "Printf"] deps = ["Accessors", "CommonSolve", "Printf"]
git-tree-sha1 = "125cbd31a56de53169c3eed9c17180bc6c245f83" git-tree-sha1 = "13a9e0164267bb9ebc55c1c5d72fceea8f09555b"
uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
version = "3.0.4" version = "3.0.7"
[deps.Roots.extensions] [deps.Roots.extensions]
RootsChainRulesCoreExt = "ChainRulesCore" RootsChainRulesCoreExt = "ChainRulesCore"
@@ -811,6 +859,12 @@ git-tree-sha1 = "907703e0d50846f300650d7225bdcab145b7bca9"
uuid = "4f5b5e99-b0ad-42cd-b47a-334e172ec8bd" uuid = "4f5b5e99-b0ad-42cd-b47a-334e172ec8bd"
version = "1.1.2" version = "1.1.2"
[[deps.SodiumSeal]]
deps = ["Base64", "Libdl", "libsodium_jll"]
git-tree-sha1 = "80cef67d2953e33935b41c6ab0a178b9987b1c99"
uuid = "2133526b-2bfb-4018-ac12-889fb3908a75"
version = "0.1.1"
[[deps.SortingAlgorithms]] [[deps.SortingAlgorithms]]
deps = ["DataStructures"] deps = ["DataStructures"]
git-tree-sha1 = "13cd91cc9be159e3f4d95b857fa2aa383b53772a" git-tree-sha1 = "13cd91cc9be159e3f4d95b857fa2aa383b53772a"
@@ -824,9 +878,9 @@ version = "1.12.0"
[[deps.SpecialFunctions]] [[deps.SpecialFunctions]]
deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"]
git-tree-sha1 = "6547cbdd8ce32efba0d21c5a40fa96d1a3548f9f" git-tree-sha1 = "429071b23f4c9a13fb6582f807cc2ef454082408"
uuid = "276daf66-3868-5448-9aa4-cd146d93841b" uuid = "276daf66-3868-5448-9aa4-cd146d93841b"
version = "2.8.0" version = "2.9.0"
[deps.SpecialFunctions.extensions] [deps.SpecialFunctions.extensions]
SpecialFunctionsChainRulesCoreExt = "ChainRulesCore" SpecialFunctionsChainRulesCoreExt = "ChainRulesCore"
@@ -836,9 +890,9 @@ version = "2.8.0"
[[deps.StaticArrays]] [[deps.StaticArrays]]
deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"]
git-tree-sha1 = "246a8bb2e6667f832eea063c3a56aef96429a3db" git-tree-sha1 = "fac51faf3bb96e8bc0bf6f9f39ca4955652776bb"
uuid = "90137ffa-7385-5640-81b9-e52037218182" uuid = "90137ffa-7385-5640-81b9-e52037218182"
version = "1.9.18" version = "1.9.19"
[deps.StaticArrays.extensions] [deps.StaticArrays.extensions]
StaticArraysChainRulesCoreExt = "ChainRulesCore" StaticArraysChainRulesCoreExt = "ChainRulesCore"
@@ -871,15 +925,15 @@ version = "1.8.0"
[[deps.StatsBase]] [[deps.StatsBase]]
deps = ["AliasTables", "DataAPI", "DataStructures", "IrrationalConstants", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"] deps = ["AliasTables", "DataAPI", "DataStructures", "IrrationalConstants", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"]
git-tree-sha1 = "e4d7a1a0edc20af42689ea6f4f3587a2175d50ee" git-tree-sha1 = "adb9da019510162e67a4493fc235c23203d8b09e"
uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
version = "0.34.12" version = "0.34.13"
[[deps.StatsFuns]] [[deps.StatsFuns]]
deps = ["HypergeometricFunctions", "IrrationalConstants", "LogExpFunctions", "Reexport", "Rmath", "SpecialFunctions"] deps = ["HypergeometricFunctions", "IrrationalConstants", "LogExpFunctions", "Reexport", "Rmath", "SpecialFunctions"]
git-tree-sha1 = "770240df9a3b8888065046948f7a09b4e0f997d5" git-tree-sha1 = "91a5737baed20ee31f3faea0e51f57461f6a689e"
uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c" uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
version = "2.2.0" version = "2.2.1"
[deps.StatsFuns.extensions] [deps.StatsFuns.extensions]
StatsFunsChainRulesCoreExt = "ChainRulesCore" StatsFunsChainRulesCoreExt = "ChainRulesCore"
@@ -891,15 +945,15 @@ version = "2.2.0"
[[deps.StringDistances]] [[deps.StringDistances]]
deps = ["Distances", "StatsAPI"] deps = ["Distances", "StatsAPI"]
git-tree-sha1 = "cd83a04baf746e3b43b83c61b7de77ab0409b80a" git-tree-sha1 = "456f343c7a6c8f52d8b501c0da2a05538ab1b907"
uuid = "88034a9c-02f8-509d-84a9-84ec65e18404" uuid = "88034a9c-02f8-509d-84a9-84ec65e18404"
version = "1.0.0" version = "1.0.1"
[[deps.StringManipulation]] [[deps.StringManipulation]]
deps = ["PrecompileTools"] deps = ["PrecompileTools"]
git-tree-sha1 = "d05693d339e37d6ab134c5ab53c29fce5ee5d7d5" git-tree-sha1 = "773065c6e0e903924a9d838259be74338422aef2"
uuid = "892a3eda-7b42-436c-8928-eab12a02cf0e" uuid = "892a3eda-7b42-436c-8928-eab12a02cf0e"
version = "0.4.4" version = "0.5.0"
[[deps.StructTypes]] [[deps.StructTypes]]
deps = ["Dates", "UUIDs"] deps = ["Dates", "UUIDs"]
@@ -909,9 +963,9 @@ version = "1.11.0"
[[deps.StructUtils]] [[deps.StructUtils]]
deps = ["Dates", "UUIDs"] deps = ["Dates", "UUIDs"]
git-tree-sha1 = "82bee338d650aa515f31866c460cb7e3bcef90b8" git-tree-sha1 = "2d0fc55c61321ba245c47be599570d11bac50303"
uuid = "ec057cc2-7a8d-4b58-b3b3-92acb9f63b42" uuid = "ec057cc2-7a8d-4b58-b3b3-92acb9f63b42"
version = "2.8.2" version = "2.8.5"
[deps.StructUtils.extensions] [deps.StructUtils.extensions]
StructUtilsMeasurementsExt = ["Measurements"] StructUtilsMeasurementsExt = ["Measurements"]
@@ -936,6 +990,12 @@ deps = ["Artifacts", "Libdl", "libblastrampoline_jll"]
uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c"
version = "7.8.3+2" version = "7.8.3+2"
[[deps.SymDict]]
deps = ["Test"]
git-tree-sha1 = "0108ccdaea3ef69d9680eeafc8d5ad198b896ec8"
uuid = "2da68c74-98d7-5633-99d6-8493888d7b1e"
version = "0.3.0"
[[deps.TOML]] [[deps.TOML]]
deps = ["Dates"] deps = ["Dates"]
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
@@ -943,9 +1003,9 @@ version = "1.0.3"
[[deps.TZJData]] [[deps.TZJData]]
deps = ["Artifacts"] deps = ["Artifacts"]
git-tree-sha1 = "72df96b3a595b7aab1e101eb07d2a435963a97e2" git-tree-sha1 = "d3b30a9f29a898e21fb4bdf280101b7a12e1f39c"
uuid = "dc5dba14-91b3-4cab-a142-028a31da12f7" uuid = "dc5dba14-91b3-4cab-a142-028a31da12f7"
version = "1.5.0+2025b" version = "1.5.1+2025b"
[[deps.TableTraits]] [[deps.TableTraits]]
deps = ["IteratorInterfaceExtensions"] deps = ["IteratorInterfaceExtensions"]
@@ -955,9 +1015,9 @@ version = "1.0.1"
[[deps.Tables]] [[deps.Tables]]
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "OrderedCollections", "TableTraits"] deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "OrderedCollections", "TableTraits"]
git-tree-sha1 = "0f38a06c83f0007bbab3cf911262841c9a0f07e0" git-tree-sha1 = "a94d9bdda1b7bed0046cea645639ab3f62196fac"
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
version = "1.13.0" version = "1.14.0"
[[deps.Test]] [[deps.Test]]
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
@@ -980,9 +1040,9 @@ uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
version = "0.11.3" version = "0.11.3"
[[deps.URIs]] [[deps.URIs]]
git-tree-sha1 = "bef26fb046d031353ef97a82e3fdb6afe7f21b1a" git-tree-sha1 = "908fec9df6c5de98548ead82a468c95ccf6cd263"
uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
version = "1.6.1" version = "1.7.0"
[[deps.UTCDateTimes]] [[deps.UTCDateTimes]]
deps = ["Dates", "TimeZones"] deps = ["Dates", "TimeZones"]
@@ -1010,6 +1070,18 @@ git-tree-sha1 = "cd1659ba0d57b71a464a29e64dbc67cfe83d54e7"
uuid = "76eceee3-57b5-4d4a-8e66-0e911cebbf60" uuid = "76eceee3-57b5-4d4a-8e66-0e911cebbf60"
version = "1.6.1" version = "1.6.1"
[[deps.XML2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Zlib_jll"]
git-tree-sha1 = "3f3315d89fc954a28f5b471bce698ed6e27481be"
uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a"
version = "2.15.3+0"
[[deps.XMLDict]]
deps = ["EzXML", "IterTools", "OrderedCollections"]
git-tree-sha1 = "8e8cdc9c93e1f442eba471b56db6f86ffeb1a33a"
uuid = "228000da-037f-5747-90a9-8195ccbf91a5"
version = "0.4.2"
[[deps.Zlib_jll]] [[deps.Zlib_jll]]
deps = ["Libdl"] deps = ["Libdl"]
uuid = "83775a58-1f1d-513f-b197-d71354ab007a" uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
+14 -2
View File
@@ -1,9 +1,12 @@
name = "GeneralUtils" name = "GeneralUtils"
uuid = "c6c72f09-b708-4ac8-ac7c-2084d70108fe" uuid = "c6c72f09-b708-4ac8-ac7c-2084d70108fe"
version = "0.5.1" version = "0.6.10"
authors = ["tonaerospace <tonaerospace.etc@gmail.com>"] authors = ["tonaerospace <tonaerospace.etc@gmail.com"]
[deps] [deps]
AWS = "fbe9abb3-538b-5e4e-ba9e-bc94f4f92ebc"
AWSS3 = "1c724243-ef5b-51ab-93f4-b0a88ac62a95"
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
@@ -13,19 +16,28 @@ Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
LibPQ = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1" LibPQ = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1"
MbedTLS = "739be429-bea8-5141-9913-cc70e7f3736d"
NATS = "55e73f9c-eeeb-467f-b4cc-a633fde63d2a" NATS = "55e73f9c-eeeb-467f-b4cc-a633fde63d2a"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
PrettyPrinting = "54e16d92-306c-5ea0-a30b-337be88ac337" PrettyPrinting = "54e16d92-306c-5ea0-a30b-337be88ac337"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce" SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
StringDistances = "88034a9c-02f8-509d-84a9-84ec65e18404" StringDistances = "88034a9c-02f8-509d-84a9-84ec65e18404"
URIs = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
[compat] [compat]
AWS = "1.99.0"
AWSS3 = "0.11.6"
Base64 = "1.11.0"
Graphs = "1.14.0" Graphs = "1.14.0"
HTTP = "2.5.0 - 2.9.9" HTTP = "2.5.0 - 2.9.9"
JSON = "1.3.0 - 1.9.9" JSON = "1.3.0 - 1.9.9"
LibPQ = "1.18.0" LibPQ = "1.18.0"
MbedTLS = "1.1.10"
NATS = "0.1.0" NATS = "0.1.0"
OrderedCollections = "2.0.1"
Revise = "3.13.2" Revise = "3.13.2"
StringDistances = "1.0.0" StringDistances = "1.0.0"
URIs = "1.7.0"
View File
+52
View File
@@ -0,0 +1,52 @@
# ==========================================
# Garage Storage Engine Configuration
# ==========================================
# Core storage directories
metadata_dir = "/var/lib/garage/meta"
data_dir = "/var/lib/garage/data"
# LMDB is recommended for production performance
db_engine = "lmdb"
metadata_auto_snapshot_interval = "6h"
# Multi-node ready setup:
# Set to 1 for initial single node. Update to 3 when adding Node 2 and Node 3 later.
replication_factor = 1
compression_level = 2
# ==========================================
# Network & Node Identity Configuration
# ==========================================
# Bind to all interfaces for host network mode
rpc_bind_addr = "[::]:3901"
# IMPORTANT: Set to Node 1's publicly reachable IP or DNS name (e.g., 192.168.1.10:3901 or 203.0.113.10:3901)
rpc_public_addr = "192.168.88.106:3901"
# Generate with: openssl rand -hex 32 (MUST BE IDENTICAL ON ALL NODES IN CLUSTER)
rpc_secret = "3cf7a4d1da5d7b024a06db7fe6d73e2c160c6de640fda69b0b964d98678155a7"
# ==========================================
# Service APIs
# ==========================================
[s3_api]
s3_region = "garage"
api_bind_addr = "0.0.0.0:3900"
root_domain = ".s3-api.yiem.cc"
[s3_web]
bind_addr = "0.0.0.0:3902"
root_domain = ".s3-web.yiem.cc"
index = "index.html"
[k2v_api]
api_bind_addr = "0.0.0.0:3904"
[admin]
api_bind_addr = "0.0.0.0:3903"
# Generate with: openssl rand -hex 16
admin_token = "fd92f47a7c1ce8b072b06bb19dbc3fef"
metrics_token = "27d29618cc436a23ec7d842392fdf74b"
+48
View File
@@ -0,0 +1,48 @@
services:
garage:
image: dxflrs/garage:v2.3.0
container_name: garage
restart: unless-stopped
network_mode: "host"
volumes:
- ./garage.toml:/etc/garage.toml:ro
- garage_meta:/var/lib/garage/meta
- garage_data:/var/lib/garage/data
environment:
- RUST_LOG=garage=trace
healthcheck:
test: ["CMD", "/garage", "status"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
webui:
image: khairul169/garage-webui:latest
container_name: garage-webui
restart: unless-stopped
network_mode: "host"
volumes:
- ./garage.toml:/etc/garage.toml:ro
environment:
API_BASE_URL: "http://127.0.0.1:3903"
S3_ENDPOINT_URL: "https://s3-api.yiem.cc"
# Format: "username:bcrypt_hash" (generate via: htpasswd -nbBC 10 "admin" "yourpassword")
AUTH_USER_PASS: "admin:$$2y$$10$$fhEucJHW8N5p8NL7Gv4Bi.FZVngbq/zatVDCjl.V.xNtj5q1PNUZW"
depends_on:
garage:
condition: service_healthy
volumes:
garage_meta:
driver: local
driver_opts:
type: none
o: bind
device: ./data/meta
garage_data:
driver: local
driver_opts:
type: none
o: bind
device: ./data/storage
+2
View File
@@ -0,0 +1,2 @@
# dummy main.jl so i can do GeneralUtils precompile
using GeneralUtils
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 429 KiB

+2
View File
@@ -21,6 +21,8 @@ using .llmUtil
include("interface.jl") include("interface.jl")
using .interface using .interface
include("garageS3.jl")
using .garageS3
#------------------------------------------------------------------------------------------------100 #------------------------------------------------------------------------------------------------100
+96 -2
View File
@@ -1,13 +1,107 @@
module dbUtil module dbUtil
export dictToPostgresKeyValueString, generateInsertSQL, generateUpdateSQL export dictToPostgresKeyValueString, generateInsertSQL, generateUpdateSQL, find_text_vector_similarity,
execute_postgres_sql
using JSON, DataStructures, Distributions, Random, Dates, UUIDs, DataFrames, using JSON, DataStructures, Distributions, Random, Dates, UUIDs, DataFrames,
SHA SHA, NATS, LibPQ
using ..util using ..util
#[PENDING] update code to use JSON #[PENDING] update code to use JSON
# ---------------------------------------------- 100 --------------------------------------------- # # ---------------------------------------------- 100 --------------------------------------------- #
""" Execute SQL against a PostgreSQL database using LibPQ connection string.
# Arguments
- `pg_conn_str::AbstractString`: PostgreSQL connection string in format "host=... port=... dbname=... user=... password=..."
- `sql::AbstractString`: SQL query to execute
# Returns
- `LibPQ.Result` on success, `nothing` on failure
# Example
```julia
pg_conn_str = "host=localhost port=5432 dbname=mydb user=myuser password=mypass"
sql = "SELECT * FROM wine;"
result = execute_postgres_sql(pg_conn_str, sql)
```
"""
function execute_postgres_sql(pg_conn_str::T, sql::T) where {T<:AbstractString}
db_connection = LibPQ.Connection(pg_conn_str)
result = nothing
try
result = LibPQ.execute(db_connection, sql)
catch e
@error e
LibPQ.close(db_connection)
end
LibPQ.close(db_connection)
return result
end
""" find_text_vector_similarity
Find the most similar text records in a PostgreSQL database using vector embeddings and cosine similarity.
This function computes an embedding for the input text using the provided embedding function,
then queries the database to find records with the most similar vector representations using
PostgreSQL's cosine similarity operator (`<->`).
# Arguments
- `text::AbstractString`: The input text to find similar records for
- `tablename::AbstractString`: Name of the database table containing the embedding column
- `embeddingColumnName::AbstractString`: Name of the column storing vector embeddings
- `executesql::Function`: Function that executes SQL queries and returns results
- `get_embedding::Function`: Function that generates embeddings for text inputs
# Keyword Arguments
- `limit::Integer=1`: Maximum number of similar records to return
# Returns
- `DataFrame`: Database records ordered by similarity (most similar first), including a `distance` column
where smaller values indicate higher similarity
# Example
```julia
# Assume you have embedding and SQL execution functions
text = "a rich structured red wine"
tablename = "wine"
embeddingColumnName = "description_embedding"
df = find_text_vector_similarity(
text, tablename, embeddingColumnName,
executesql, get_embedding;
limit = 5
)
# Result contains columns from the table plus a 'distance' column
# where distance = 1 - cosine_similarity (smaller = more similar)
```
"""
function find_text_vector_similarity(text::T1, tablename::T2, embeddingColumnName::T3,
executesql::Function, get_embedding;
limit::Integer=1
)::DataFrame where {T1<:AbstractString, T2<:AbstractString, T3<:AbstractString}
# get embedding from LLM service
_embedding = get_embedding([text])
_embedding = _embedding["data"][1]["embedding"]
_embedding = "$_embedding"
embedding = _embedding[4:end] # remove 'Any' from Any[...]
# check whether there is close enough vector already store in executesql. if no, add, else skip
sql = """
SELECT *, $embeddingColumnName <-> '$embedding' as distance
FROM $tablename
ORDER BY distance LIMIT $limit;
"""
response = executesql(sql)
df = DataFrame(response)
return df
end
""" """
dictToPostgresKeyValueString - Convert dictionary to PostgreSQL key-value string format dictToPostgresKeyValueString - Convert dictionary to PostgreSQL key-value string format
+565
View File
@@ -0,0 +1,565 @@
module garageS3
export
LifecycleExpiration, build_lifecycle_xml,
GarageStorage, s3PutFile, s3GetFile, s3ListFiles, s3DeleteFile,
s3SetLifecycleExpiration, s3GetLifecycle, s3DeleteLifecycle,
s3SignUrl, s3SignUrlWeb
using AWS
@service S3
using AWSS3
using Dates: Dates
using URIs: URIs
using OrderedCollections: OrderedDict
using MbedTLS: digest, MD_SHA256
using Base64: bytes2hex
# ---------------------------------------------- 100 --------------------------------------------- #
# Garage uses Path-Style routing (https://s3-api.my-domain.com/bucket/key).
# this file use local AWS config
""" Example
storage1 = GeneralUtils.GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e", # key ID (create at garage-ui.yiem.cc)
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1", # key ID's secret key
"sommpanion"
)
# Safe to run inside concurrent HTTP handlers (e.g., Oxygen.jl, HTTP.jl)
# use UUID as filename because GarageS3 requires unique filename for each uploaded object
urls = GeneralUtils.s3PutFile(storage1, "transferjob-(GeneralUtils.uuid4snakecase())", "{\"status\": \"inactive\"}")
key = GeneralUtils.s3ListFiles(storage)
println("Read back: ", data)
println("Bucket keys: ", key)
# test with curl
curl -v \
-H 'Host: testbucket.s3-web.yiem.cc' \
http://192.168.88.106:3902/users-1002.json
# test with API
data = String(GeneralUtils.s3GetFile(storage, key[1]))
# test with a browser (urls.web)
https://s3-web.mydomain.com/my_bucket_name/users-1005.json
"""
# ===================================================================
# 1. Custom GarageConfig Definition (Thread-Safe, No Global State)
# ===================================================================
mutable struct SimpleCredentials
access_key_id::String
secret_key::String
token::String
end
mutable struct GarageConfig <: AWS.AbstractAWSConfig
endpoint::String
region::String
credentials::SimpleCredentials
end
# Required extensions for AWS.jl pipeline
AWS.refresh!(c::SimpleCredentials; force::Bool=false) = c
AWS.credentials(c::SimpleCredentials) = c
AWS.check_credentials(c::SimpleCredentials) = c
AWS.region(aws::GarageConfig) = aws.region
AWS.credentials(aws::GarageConfig) = aws.credentials
""" Generate the full service URL including the resource path for a Garage S3 request.
# Arguments
- `aws::GarageConfig`
The Garage configuration containing the endpoint.
- `service::String`
The AWS service name (e.g., `"s3"`).
- `resource::String`
The S3 resource path (e.g., `"/bucket/key"`).
# Return
- `String`: The full URL combining the endpoint and resource path.
"""
function AWS.generate_service_url(aws::GarageConfig, service::String, resource::String)
endpoint = strip(aws.endpoint, '/')
resource_path = startswith(resource, '/') ? resource : "/" * resource
return string(endpoint, resource_path)
end
# ===================================================================
# 2. Thread-Safe Storage Client Wrapper
# ===================================================================
""" Create a thread-safe Garage S3 storage client.
# Arguments
- `endpoint::String`
The Garage S3 API endpoint URL (e.g., `"https://s3-api.yiem.cc"`).
- `key::String`
The Garage access key ID (created via garage-ui).
- `secret::String`
The secret key corresponding to the access key.
- `bucket::String`
The name of the S3 bucket to use.
# Keyword Arguments
- `region::String = "garage"`
The region identifier for the Garage instance.
# Return
- `GarageStorage`: A thread-safe storage client instance.
# Examples
```jldoctest
julia> storage = GarageStorage("https://s3-api.yiem.cc", "GKb08015", "55114ff94828febca1", "sommpanion-s3")
GarageStorage(GarageConfig(...), "sommpanion-s3")
```
"""
mutable struct GarageStorage
config::GarageConfig
bucket::String
end
function GarageStorage(endpoint::String, key::String, secret::String, bucket::String; region::String="garage")
creds = SimpleCredentials(key, secret, "")
config = GarageConfig(endpoint, region, creds)
return GarageStorage(config, bucket)
end
""" Upload an object to the Garage S3 bucket (callable struct).
# Arguments
- `key::String`
The object key (name) in the bucket.
- `data::Union{String, Vector{UInt8}}`
The data to upload.
# Return
- `NamedTuple{(:api, :web)}`: A tuple with `api` and `web` URLs.
# Examples
```jldoctest
julia> storage1 = GarageStorage("https://s3-api.yiem.cc", "GKb08015", "55114ff94828febca1", "sommpanion-s3")
julia> s3PutFile1 = s3PutFile(storage1)
julia> downloadUrl = s3PutFile1("test.json", "{\"status\": \"active\"}")
Successfully uploaded: test.json
julia> downloadUrl.api
"https://s3-api.yiem.cc/sommpanion-s3/test.json"
julia> downloadUrl.web
"https://s3-web.yiem.cc/sommpanion-s3/test.json"
```
"""
mutable struct s3PutFile
storage::GarageStorage
end
function (pf::s3PutFile)(key::String, data::Union{String, Vector{UInt8}}
)::NamedTuple{(:api, :web), Tuple{String, String}}
AWSS3.s3_put(pf.storage.config, pf.storage.bucket, key, data)
println("Successfully uploaded: ", key)
# object url
api = "$(pf.storage.config.endpoint)/$(pf.storage.bucket)/$key"
# file download URL using browser
web = replace(api, "s3-api" => "s3-web")
return (api=api, web=web)
end
""" Upload an object to the Garage S3 bucket.
# Arguments
- `storage::GarageStorage`
The storage client instance.
- `key::String`
The object key (name) in the bucket.
- `data::Union{String, Vector{UInt8}}`
The data to upload.
# Return
- `NamedTuple{(:api, :web)}`: A tuple with `api` and `web` URLs.
# Examples
```julia
julia> result = s3PutFile(storage, "test.json", "{\"status\": \"active\"}")
Successfully uploaded: test.json
julia> result.api
"https://s3-api.yiem.cc/sommpanion-s3/test.json"
julia> result.web
"https://s3-web.yiem.cc/sommpanion-s3/test.json"
```
"""
function s3PutFile(storage::GarageStorage, key::String, data::Union{String, Vector{UInt8}}
)::NamedTuple{(:api, :web), Tuple{String, String}}
AWSS3.s3_put(storage.config, storage.bucket, key, data)
println("Successfully uploaded: ", key)
# object url
api = "$(storage.config.endpoint)/$(storage.bucket)/$key"
# file download URL using browser
web = replace(api, "s3-api" => "s3-web")
return (api=api, web=web)
end
""" Download an object from the Garage S3 bucket.
# Arguments
- `storage::GarageStorage`
The storage client instance.
- `key::String`
The object key (name) in the bucket.
# Return
- `Vector{UInt8}`: The raw bytes of the downloaded object.
# Examples
```julia
julia> data = String(s3GetFile(storage, "test.json"))
"\"{\\\"status\\\": \\\"active\\\"}\""
```
"""
function s3GetFile(storage::GarageStorage, key::String)::Union{Vector{UInt8}, Nothing}
try
return AWSS3.s3_get(storage.config, storage.bucket, key)
catch
return nothing
end
end
""" List all object keys in the Garage S3 bucket.
# Arguments
- `storage::GarageStorage`
The storage client instance.
# Return
- `Vector{String}`: A list of object keys (file names) in the bucket.
# Examples
```julia
julia> keys = s3ListFiles(storage)
3-element Vector{String}:
"test1.json"
"test2.json"
"users-1002.json"
```
"""
function s3ListFiles(storage::GarageStorage)
# Use delimiter="" to get all individual keys (no grouping by "directory")
objects = AWSS3.s3_list_objects(storage.config, storage.bucket; delimiter="")
return [obj["Key"] for obj in objects]
end
""" Delete an object from the Garage S3 bucket.
# Arguments
- `storage::GarageStorage`
The storage client instance.
- `key::String`
The object key (name) to delete.
# Examples
```julia
julia> s3DeleteFile(storage, "test.json")
```
"""
function s3DeleteFile(storage::GarageStorage, key::String)
AWSS3.s3_delete(storage.config, storage.bucket, key)
end
"""
s3SignUrl(storage, key, seconds=3600; verb="GET", content_type="application/octet-stream", signature_version="v4") -> String
Generate a pre-signed URL for an object in the Garage S3 bucket.
A pre-signed URL grants temporary access without AWS credentials. Signature is computed
using AWS Signature Version 4 (HMAC-SHA256).
# Arguments
- `storage::GarageStorage`: Storage client from `GarageStorage(endpoint, key, secret, bucket)`.
- `key::String`: Object key. Supports nested paths like `"folder/subfolder/file.txt"`.
- `seconds::Int`: URL validity in seconds. Default: 3600.
# Keyword Arguments
- `verb::String = "GET"`: HTTP method (`"GET"` downloads, `"PUT"` uploads).
- `content_type::String = "application/octet-stream"`: Required `Content-Type` header.
For PUT, set to the file's MIME type (`"image/png"`, `"application/json"`, etc.).
- `signature_version::String = "v4"`: Always use `"v4"` (v2 is deprecated).
# Return
`String`: The pre-signed URL.
# Examples
```julia
using GeneralUtils: GarageStorage, s3SignUrl, s3ListFiles, s3PutFile
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"sommpanion"
)
# Upload — PUT with curl
url = s3SignUrl(storage, "photo.jpg", 3600; verb="PUT", content_type="image/jpeg")
# curl -X PUT -T "/path/to/photo.jpg" -H 'Host: s3-api.yiem.cc' -H 'Content-Type: image/jpeg' <url>
# Download — GET with curl
url = s3SignUrl(storage, "photo.jpg", 3600; verb="GET")
# curl <url> → returns file content
# Upload JSON
url = s3SignUrl(storage, "data/config.json", 3600; verb="PUT", content_type="application/json")
# curl -X PUT -T "/tmp/config.json" -H 'Host: s3-api.yiem.cc' -H 'Content-Type: application/json' <url>
# Delete
url = s3SignUrl(storage, "photo.jpg", 3600; verb="DELETE")
# curl -X DELETE url
# Multiple uploads (chat app)
urls = [s3SignUrl(storage, "chat/\$(GeneralUtils.uuid4snakecase())", 300;
verb="PUT", content_type="image/png")
for _ in 1:10]
# Signature differs by verb and content_type
url_get = s3SignUrl(storage, "file.txt", 3600; verb="GET")
url_put = s3SignUrl(storage, "file.txt", 3600; verb="PUT", content_type="text/plain")
```
# Notes
- URLs are valid until `seconds` expires; they can be used **multiple times** (not one-time).
- Server clocks must be within ~5 minutes of the Garage server (UTC time in signature).
- PUT uploads require the client's `Content-Type` to match `content_type`.
- For browser CORS uploads, configure Garage bucket CORS rules for `Origin` and `Method`.
"""
function s3SignUrl(
storage::GarageStorage,
key::String,
seconds::Int=3600;
verb::String="GET",
content_type::String="application/octet-stream",
signature_version::String="v4",
)::String
config = storage.config
creds = config.credentials
bucket = storage.bucket
region = config.region
endpoint = strip(config.endpoint, '/')
scheme = "AWS4"
algorithm = "HMAC-SHA256"
terminator = "aws4_request"
service = "s3"
now_datetime = Dates.now(Dates.UTC)
datetime_stamp = Dates.format(now_datetime, "YYYYmmddTHHMMSS\\Z")
date_stamp = Dates.format(now_datetime, "YYYYmmdd")
scope = "$date_stamp/$region/$service/$terminator"
headers = OrderedDict{String,String}("Host" => URIs.URI(endpoint).host)
if verb == "PUT"
headers["Content-Type"] = content_type
end
sort!(headers; by=name -> lowercase(name))
canonical_header_names = join(map(name -> lowercase(name), collect(keys(headers))), ";")
query = OrderedDict{String,String}(
"X-Amz-Expires" => string(seconds),
"X-Amz-Algorithm" => "$scheme-$algorithm",
"X-Amz-Credential" => "$(creds.access_key_id)/$scope",
"X-Amz-Date" => datetime_stamp,
"X-Amz-SignedHeaders" => canonical_header_names,
)
if !isempty(creds.token)
query["X-Amz-Security-Token"] = creds.token
end
canonical_headers = join(
map(
header -> "$(lowercase(header.first)):$(lowercase(header.second))\n",
collect(headers),
),
)
resource_path = "/$bucket/$key"
# Build canonical query string: sort by key=value pair lexicographically,
# URL-encoding each key and value (matching Garage's uri_encode)
sorted_q = sort(
[URIs.escapeuri(k) * "=" * URIs.escapeuri(v) for (k, v) in pairs(query)],
by=lowercase,
)
canonical_query = join(sorted_q, "&")
canonical_request = string(
"$verb\n",
resource_path,
"\n",
canonical_query,
"\n",
canonical_headers,
"\n",
canonical_header_names,
"\n",
"UNSIGNED-PAYLOAD",
)
string_to_sign = string(
"$scheme-$algorithm\n",
"$datetime_stamp\n",
"$scope\n",
bytes2hex(digest(MD_SHA256, canonical_request)),
)
key_secret_bytes = Vector{UInt8}(string(scheme, creds.secret_key))
key_date = digest(MD_SHA256, date_stamp, key_secret_bytes)
key_region = digest(MD_SHA256, region, key_date)
key_service = digest(MD_SHA256, service, key_region)
key_signing = digest(MD_SHA256, terminator, key_service)
signature = digest(MD_SHA256, string_to_sign, key_signing)
query["X-Amz-Signature"] = bytes2hex(signature)
query_string = URIs.escapeuri(query)
return "$(endpoint)/$bucket/$key?$query_string"
end
""" Generate a pre-signed URL using the Garage S3 web endpoint (s3-web).
Useful for direct browser access — URLs look like
`https://s3-web.yiem.cc/bucket/key?X-Amz-Signature=...`
Arguments and keyword arguments are the same as `s3SignUrl`.
"""
function s3SignUrlWeb(
storage::GarageStorage,
key::String,
seconds::Int=3600;
verb::String="GET",
content_type::String="application/octet-stream",
signature_version::String="v4",
)::String
web_endpoint = replace(storage.config.endpoint, "s3-api" => "s3-web")
web_creds = SimpleCredentials(
storage.config.credentials.access_key_id,
storage.config.credentials.secret_key,
storage.config.credentials.token,
)
web_config = GarageConfig(web_endpoint, storage.config.region, web_creds)
web_storage = GarageStorage(web_config, storage.bucket)
return s3SignUrl(web_storage, key, seconds; verb, content_type, signature_version)
end
# ===================================================================
# 3. Bucket Lifecycle Configuration
# ===================================================================
""" Lifecycle expiration configuration for a bucket.
# Fields
- `prefix::String`: Object key prefix this rule applies to.
- `days::Int`: Number of days after object creation to expire/delete.
- `enabled::Bool`: Whether the rule is active (default: `true`).
- `id::String`: Unique identifier for the rule (default: auto-generated).
"""
mutable struct LifecycleExpiration
prefix::String
days::Int
enabled::Bool
id::String
end
function LifecycleExpiration(prefix::String, days::Int; enabled::Bool=true, id::String="")
rule_id = isempty(id) ? "expire-" * replace(prefix, "/" => "_") * "-" * string(days) * "d" : id
return LifecycleExpiration(prefix, days, enabled, rule_id)
end
""" Build the XML body for a PutBucketLifecycleConfiguration request.
Supports a single rule with expiration by prefix.
"""
function build_lifecycle_xml(rule::LifecycleExpiration)::String
status = rule.enabled ? "Enabled" : "Disabled"
return """<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration>
<Rule>
<ID>$(rule.id)</ID>
<Filter>
<Prefix>$(rule.prefix)</Prefix>
</Filter>
<Status>$status</Status>
<Expiration>
<Days>$(rule.days)</Days>
</Expiration>
</Rule>
</LifecycleConfiguration>"""
end
""" Set bucket lifecycle expiration rule.
# Arguments
- `storage::GarageStorage`: The storage client instance.
- `rule::LifecycleExpiration`: The lifecycle expiration rule.
# Returns
- `Dict{String, Any}`: Parsed response from the server.
# Example
```julia
rule = LifecycleExpiration("uploads/", 30)
s3SetLifecycleExpiration(storage, rule)
```
"""
function s3SetLifecycleExpiration(storage::GarageStorage, rule::LifecycleExpiration)
xml_body = build_lifecycle_xml(rule)
args = Dict{String,Any}("body" => xml_body)
return S3.put_bucket_lifecycle_configuration(storage.bucket, args; aws_config=storage.config)
end
""" Get the bucket lifecycle configuration.
# Arguments
- `storage::GarageStorage`: The storage client instance.
# Returns
- `Dict{String, Any}`: Parsed lifecycle configuration, or `nothing` if no lifecycle is configured.
# Example
```julia
config = s3GetLifecycle(storage)
```
"""
function s3GetLifecycle(storage::GarageStorage)::Union{Dict{String,Any},Nothing}
try
return S3.get_bucket_lifecycle_configuration(storage.bucket; aws_config=storage.config)
catch e
if isa(e, AWS.AWSException) && e.code == "NoSuchLifecycleConfiguration"
return nothing
end
rethrow(e)
end
end
""" Delete the bucket lifecycle configuration.
# Arguments
- `storage::GarageStorage`: The storage client instance.
# Returns
- `Dict{String, Any}`: Parsed response from the server.
# Example
```julia
s3DeleteLifecycle(storage)
```
"""
function s3DeleteLifecycle(storage::GarageStorage)
return S3.delete_bucket_lifecycle(storage.bucket; aws_config=storage.config)
end
end # module GarageS3
+102 -2
View File
@@ -4,12 +4,12 @@ export timedifference, showstracktrace, findHighestIndexKey, uuid4snakecase, rep
findMatchingDictKey, randstring, randstrings, timeout, findMatchingDictKey, randstring, randstrings, timeout,
dataframeToCSV, dfToVectorDict, disintegrate_vectorDict, getDataFrameValue, dfRowtoString, dataframeToCSV, dfToVectorDict, disintegrate_vectorDict, getDataFrameValue, dfRowtoString,
dfToString, dataframe_to_json_list, dictToString, dictToString_noKey, issomething, dfToString, dataframe_to_json_list, dictToString, dictToString_noKey, issomething,
dictToString_numbering, extract_triple_backtick_text, dictToString_numbering, extract_triple_backtick_text, eventSink,
countGivenWords, remove_french_accents, removestring, countGivenWords, remove_french_accents, removestring,
extractTextBetweenCharacter, extractTextBetweenString, extractTextBetweenCharacter, extractTextBetweenString,
convertCamelSnakeKebabCase, fitrange, recentElementsIndex, nonRecentElementsIndex convertCamelSnakeKebabCase, fitrange, recentElementsIndex, nonRecentElementsIndex
using JSON, DataStructures, Distributions, Random, Dates, UUIDs, DataFrames using JSON, DataStructures, Distributions, Random, Dates, UUIDs, DataFrames, NATS, Dates
# ---------------------------------------------- 100 --------------------------------------------- # # ---------------------------------------------- 100 --------------------------------------------- #
@@ -1173,6 +1173,106 @@ function removestring(text::String, removelist::Vector{String})::String
end end
"""
Create an event sink for logging messages and/or publishing to NATS or printing to console. File logging defaults to false.
# Fields
- `natsConn`: NATS connection, or `nothing` for file-only sink
- `topic`: NATS topic to publish to, or `nothing` for file-only sink
- `service_name`: Optional prefix added to log entries
- `log_file`: Path to the log file
- `max_log_entries`: Maximum number of entries to keep in the log file
# Callable interface
```julia
(es::eventSink)(msg::String; log=false, publish=true, console=true) -> Nothing
```
Three independent outputs — each defaults to `true` except `log`:
- `console` (default `true`) → println to stdout
- `publish` (default `true`) → publish to NATS topic (no-op if no connection)
- `log` (default `false`) → append to `log_file`
# Examples
```julia
using NATS, Dates
conn = NATS.connect("nats.yiem.cc")
# ——— With NATS (console + NATS by default) ———
es = eventSink(natsConn=conn, topic="agent.events", service_name="agent1")
es("starting up") # console + NATS
es("logged"; log=true) # console + file + NATS
es("quiet"; console=false) # NATS only
es("file+nats"; log=true, console=false) # file + NATS
es("console-only"; publish=false, log=false) # console only
# ——— File-only sink (no NATS connection) ———
es2 = eventSink(log_file="./log/eventSink2.md", service_name="worker")
es2("ready") # console only
es2("file-logged"; log=true) # console + file
es2("file-only"; log=true, console=false) # file only
es2("silent"; console=false) # nothing (no NATS, log=false, console=false)
NATS.drain(conn)
```
"""
struct eventSink
natsConn::Union{NATS.Connection, Nothing}
topic::Union{String, Nothing}
service_name::String
log_file::String
max_log_entries::Int
end
eventSink(; natsConn=nothing, topic=nothing, service_name="", log_file="./log/eventSink.md", max_log_entries=100) =
eventSink(natsConn, topic, service_name, log_file, max_log_entries)
function (es::eventSink)(msg::String; log=false, publish=true, console=true)
timestamp = Dates.format(now(), "yyyy-mm-ddTHH:MM:SS.sss")
svc_prefix = isempty(es.service_name) ? "" : "[$(es.service_name)] "
entry = "- [$timestamp] $svc_prefix$msg\n"
if console
println("[$timestamp] $svc_prefix$msg")
end
if log
log_dir = dirname(es.log_file)
mkpath(log_dir)
open(es.log_file, "a") do f
write(f, entry)
end
# Rotate after write — keep only last max_log_entries entries
content = read(es.log_file, String)
entries = split(content, r"- \[", keepempty=false)
if length(entries) > es.max_log_entries
rotate!(es)
end
end
if publish && es.topic !== nothing && es.natsConn !== nothing
try
NATS.publish(es.natsConn, es.topic, entry)
catch e
@warn "eventSink NATS publish failed" exception=e
end
end
end
"""
rotate!(es::eventSink) -> Nothing
Rewrite the log file keeping only the last `max_log_entries` entries.
Call after writing when the entry count reaches the limit.
"""
function rotate!(es::eventSink)
content = read(es.log_file, String)
entries = split(content, r"- \[", keepempty=false)
open(es.log_file, "w") do f
write(f, "- [")
for e in entries[2:end]
write(f, "- [", e)
end
end
end
+130
View File
@@ -0,0 +1,130 @@
curl -X PUT -H "Content-Type: application/json" \
-d '{"test": "data"}' \
"https://s3-api.yiem.cc/sommpanion/pcimage.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GKb080154a2e5b19100b1b2c6e%2F20260904%2Fgarage%2Fs3%2Faws4_request&X-Amz-Date=20260904T103745Z&X-Amz-Expires=300&X-Amz-Security-Token=&X-Amz-SignedHeaders=host&X-Amz-Signature=0e195a48f824a2f8ffcb06461396cd6a8bddd5b61d93e9006f947ae10ecf525f"
curl -v -X PUT -T "/home/ton/docker-apps/sommpanion/etc/GeneralUtils/photo.jpg" \
-H 'Host: s3-api.yiem.cc' \
-H 'Content-Type: image/jpeg' \
"https://s3-api.yiem.cc/sommpanion/photo.jpg?X-Amz-Expires=300&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GKb080154a2e5b19100b1b2c6e%2F20260905%2Fgarage%2Fs3%2Faws4_request&X-Amz-Date=20260905T030315Z&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Signature=1107a31f36f8b8ceb9663d69b9a7be7733df14d019e700e750944cbdad50df5d"
read
./garage.toml
./Caddyfile
./src/garageS3.jl
julia> url = GeneralUtils.s3_sign_url(storage1, "photo.jpg", 36000; verb="PUT", content_type="image/jpeg")
"https://s3-api.yiem.cc/sommpanion/photo.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GKb080154a2e5b19100b1b2c6e%2F20260904%2Fgarage%2Fs3%2Faws4_request&X-Amz-Date=20260904T145004Z&X-Amz-Expires=36000&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Signature=92cd634dbb0f66db4b8b039ef5939c138203de260e8342fe27ef78979d90a824"
---
ton@server12vm-dev:~/docker-apps/sommpanion/etc/AWS.jl$
curl -v -X PUT -T "/home/ton/docker-apps/sommpanion/etc/GeneralUtils/photo.jpg" \
-H 'Host: s3-api.yiem.cc' \
-H 'Content-Type: image/jpeg' \
"https://s3-api.yiem.cc/sommpanion/photo.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GKb080154a2e5b19100b1b2c6e%2F20260904%2Fgarage%2Fs3%2Faws4_request&X-Amz-Date=20260904T152217Z&X-Amz-Expires=36000&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Signature=7eb874abb813427a71beab956514c3a0539cacf765013aa194be8517dd081f02"
Note: Unnecessary use of -X or --request, PUT is already inferred.
* Trying 110.77.160.154:443...
* Connected to s3-api.yiem.cc (110.77.160.154) port 443 (#0)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* CAfile: /etc/ssl/certs/ca-certificates.crt
* CApath: /etc/ssl/certs
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_CHACHA20_POLY1305_SHA256
* ALPN: server accepted h2
* Server certificate:
* subject: CN=s3-api.yiem.cc
* start date: Aug 27 04:27:02 2026 GMT
* expire date: Nov 25 04:27:01 2026 GMT
* subjectAltName: host "s3-api.yiem.cc" matched cert's "s3-api.yiem.cc"
* issuer: C=US; O=Let's Encrypt; CN=YE2
* SSL certificate verify ok.
* using HTTP/2
* h2h3 [:method: PUT]
* h2h3 [:path: /sommpanion/photo.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GKb080154a2e5b19100b1b2c6e%2F20260904%2Fgarage%2Fs3%2Faws4_request&X-Amz-Date=20260904T152217Z&X-Amz-Expires=36000&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Signature=7eb874abb813427a71beab956514c3a0539cacf765013aa194be8517dd081f02]
* h2h3 [:scheme: https]
* h2h3 [:authority: s3-api.yiem.cc]
* h2h3 [user-agent: curl/7.88.1]
* h2h3 [accept: */*]
* h2h3 [content-type: image/jpeg]
* h2h3 [content-length: 439490]
* Using Stream ID: 1 (easy handle 0x559a08824c80)
> PUT /sommpanion/photo.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GKb080154a2e5b19100b1b2c6e%2F20260904%2Fgarage%2Fs3%2Faws4_request&X-Amz-Date=20260904T152217Z&X-Amz-Expires=36000&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Signature=7eb874abb813427a71beab956514c3a0539cacf765013aa194be8517dd081f02 HTTP/2
> Host: s3-api.yiem.cc
> user-agent: curl/7.88.1
> accept: */*
> content-type: image/jpeg
> content-length: 439490
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* We are completely uploaded and fine
< HTTP/2 403
< access-control-allow-origin: *
< alt-svc: h3=":443"; ma=2592000
< content-type: application/xml
< date: Fri, 04 Sep 2026 15:23:13 GMT
< via: 1.1 Caddy
< content-length: 190
<
* Connection #0 to host s3-api.yiem.cc left intact
<?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>Forbidden: Invalid signature</Message><Resource>/sommpanion/photo.jpg</Resource><Region>garage</Region></Error>
2026-09-04T15:23:13.796037Z INFO garage_api_common::generic_server: 110.77.160.154 (via 192.168.88.21:57926) PUT /sommpanion/photo.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GKb080154a2e5b19100b1b2c6e%2F20260904%2Fgarage%2Fs3%2Faws4_request&X-Amz-Date=20260904T152217Z&X-Amz-Expires=36000&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Signature=7eb874abb813427a71beab956514c3a0539cacf765013aa194be8517dd081f02
2026-09-04T15:23:13.796077Z DEBUG garage_api_common::generic_server: Request { method: PUT, uri: /sommpanion/photo.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GKb080154a2e5b19100b1b2c6e%2F20260904%2Fgarage%2Fs3%2Faws4_request&X-Amz-Date=20260904T152217Z&X-Amz-Expires=36000&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Signature=7eb874abb813427a71beab956514c3a0539cacf765013aa194be8517dd081f02, version: HTTP/1.1, headers: {"host": "s3-api.yiem.cc", "user-agent": "curl/7.88.1", "content-length": "439490", "accept": "*/*", "content-type": "image/jpeg", "via": "2.0 Caddy", "x-forwarded-for": "110.77.160.154", "x-forwarded-host": "s3-api.yiem.cc", "x-forwarded-proto": "https", "accept-encoding": "gzip"}, body: Body(Streaming) }
2026-09-04T15:23:13.796181Z DEBUG garage_api_common::generic_server: Endpoint: PutObject
2026-09-04T15:23:13.796461Z INFO garage_api_common::generic_server: error 403 Forbidden, Forbidden: Invalid signature in response to 110.77.160.154 (via 192.168.88.21:57926) PUT /sommpanion/photo.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GKb080154a2e5b19100b1b2c6e%2F20260904%2Fgarage%2Fs3%2Faws4_request&X-Amz-Date=20260904T152217Z&X-Amz-Expires=36000&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Signature=7eb874abb813427a71beab956514c3a0539cacf765013aa194be8517dd081f02
+573 -25
View File
@@ -1,39 +1,587 @@
using Test using Test
using GeneralUtils: detect_keyword using GeneralUtils
using GeneralUtils.garageS3
using AWS
using URIs
@testset "detect_keyword tests" begin @testset "garageS3.jl" begin
@test detect_keyword(["test"], "this is a test") == Dict("test" => 1)
@test detect_keyword(["hello", "world"], "hello world hello") == Dict("hello" => 2, "world" => 1) # --- SimpleCredentials ---
@test detect_keyword(["cat"], "category") == Dict("cat" => 1) @testset "SimpleCredentials construction" begin
creds = GeneralUtils.garageS3.SimpleCredentials("AKIAIOSFODNN7EXAMPLE", "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", "sessiontoken")
@test creds.access_key_id == "AKIAIOSFODNN7EXAMPLE"
@test creds.secret_key == "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
@test creds.token == "sessiontoken"
end
@test detect_keyword(["cat"], "category"; mode="individual") == Dict("cat" => 0) @testset "SimpleCredentials AWS extensions" begin
creds = GeneralUtils.garageS3.SimpleCredentials("key1", "secret1", "token1")
@test AWS.credentials(creds) === creds
@test AWS.check_credentials(creds) === creds
@test AWS.refresh!(creds; force=false) === creds
@test AWS.refresh!(creds) === creds
end
@test detect_keyword(["dog"], "dogs and cats"; mode="individual", delimiter=[' ']) == Dict("dog" => 0) # --- GarageConfig ---
@test detect_keyword(["test"], "test.case"; mode="individual", delimiter=['.']) == Dict("test" => 1) @testset "GarageConfig construction" begin
creds = GeneralUtils.garageS3.SimpleCredentials("key", "secret", "")
config = GeneralUtils.garageS3.GarageConfig("https://s3-api.example.com", "us-east-1", creds)
@test config.endpoint == "https://s3-api.example.com"
@test config.region == "us-east-1"
@test config.credentials === creds
@test config isa AWS.AbstractAWSConfig
end
@test detect_keyword(["word"], "") == Dict("word" => 0) @testset "GarageConfig AWS extensions" begin
creds = GeneralUtils.garageS3.SimpleCredentials("key", "secret", "")
config = GeneralUtils.garageS3.GarageConfig("https://s3-api.example.com", "garage", creds)
@test AWS.region(config) == "garage"
@test AWS.credentials(config) === creds
end
@test detect_keyword(String[], "some text") == Dict{String, Integer}() # --- AWS.generate_service_url ---
@test detect_keyword(["a", "b"], "a.b\nc"; delimiter=['.', '\n']) == Dict("a" => 1, "b" => 1) @testset "generate_service_url with resource starting with /" begin
creds = GeneralUtils.garageS3.SimpleCredentials("key", "secret", "")
config = GeneralUtils.garageS3.GarageConfig("https://s3-api.example.com", "garage", creds)
url = AWS.generate_service_url(config, "s3", "/mybucket/key")
@test url == "https://s3-api.example.com/mybucket/key"
end
multiline_text = """ @testset "generate_service_url with resource NOT starting with /" begin
first line creds = GeneralUtils.garageS3.SimpleCredentials("key", "secret", "")
second line config = GeneralUtils.garageS3.GarageConfig("https://s3-api.example.com", "garage", creds)
first word url = AWS.generate_service_url(config, "s3", "mybucket/key")
""" @test url == "https://s3-api.example.com/mybucket/key"
@test detect_keyword(["first"], multiline_text) == Dict("first" => 2) end
@test detect_keyword(["word"], "word"; mode="individual") == Dict("word" => 1) @testset "generate_service_url strips trailing slashes from endpoint" begin
creds = GeneralUtils.garageS3.SimpleCredentials("key", "secret", "")
config = GeneralUtils.garageS3.GarageConfig("https://s3-api.example.com/", "garage", creds)
url = AWS.generate_service_url(config, "s3", "/bucket/key")
@test url == "https://s3-api.example.com/bucket/key"
end
@testset "generate_service_url with multiple trailing slashes" begin
creds = GeneralUtils.garageS3.SimpleCredentials("key", "secret", "")
config = GeneralUtils.garageS3.GarageConfig("https://s3-api.example.com///", "garage", creds)
url = AWS.generate_service_url(config, "s3", "/bucket/key")
@test url == "https://s3-api.example.com/bucket/key"
end
@testset "generate_service_url preserves http endpoint" begin
creds = GeneralUtils.garageS3.SimpleCredentials("key", "secret", "")
config = GeneralUtils.garageS3.GarageConfig("http://localhost:3900", "garage", creds)
url = AWS.generate_service_url(config, "s3", "/bucket/key")
@test url == "http://localhost:3900/bucket/key"
end
@testset "generate_service_url with http endpoint and trailing slash" begin
creds = GeneralUtils.garageS3.SimpleCredentials("key", "secret", "")
config = GeneralUtils.garageS3.GarageConfig("http://localhost:3900/", "garage", creds)
url = AWS.generate_service_url(config, "s3", "/bucket/key")
@test url == "http://localhost:3900/bucket/key"
end
# --- GarageStorage ---
@testset "GarageStorage default region" begin
storage = GarageStorage("https://s3-api.example.com", "key123", "secret123", "mybucket")
@test storage.bucket == "mybucket"
@test storage.config.region == "garage"
@test storage.config.endpoint == "https://s3-api.example.com"
end
@testset "GarageStorage custom region" begin
storage = GarageStorage("https://s3-api.example.com", "key123", "secret123", "mybucket"; region="custom-region")
@test storage.config.region == "custom-region"
end
@testset "GarageStorage endpoint without https" begin
storage = GarageStorage("http://localhost:3900", "key", "secret", "mybucket")
@test storage.config.endpoint == "http://localhost:3900"
end
@testset "GarageStorage credentials are SimpleCredentials" begin
storage = GarageStorage("https://s3-api.example.com", "mykey", "mysecret", "mybucket")
@test storage.config.credentials isa GeneralUtils.garageS3.SimpleCredentials
@test storage.config.credentials.access_key_id == "mykey"
@test storage.config.credentials.secret_key == "mysecret"
@test storage.config.credentials.token == ""
end
@testset "GarageStorage returns correct struct type" begin
storage = GarageStorage("https://s3-api.example.com", "key", "secret", "bucket")
@test storage isa GarageStorage
end
# --- put_file callable struct ---
@testset "put_file callable struct type is correct" begin
storage = GarageStorage("https://s3-api.example.com", "key", "secret", "bucket")
uploader = put_file(storage)
@test uploader isa put_file
end
@testset "put_file callable struct construction stores storage" begin
storage = GarageStorage("https://s3-api.example.com", "key", "secret", "bucket")
uploader = put_file(storage)
@test uploader.storage === storage
end
# --- Integration tests with real Garage server ---
@testset "integration: full CRUD lifecycle" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
test_key = "testrunner-$(GeneralUtils.uuid4snakecase()).json"
test_data = "{\"status\": \"testing\", \"runner\": \"runtests\"}"
# Test put_file(storage, key, data) - successful upload
result = put_file(storage, test_key, test_data)
@test result !== nothing
@test haskey(result, :api)
@test haskey(result, :web)
@test occursin("testbucket", result.api)
@test occursin("s3-api", result.api)
@test occursin("s3-web", result.web)
# Test get_file - retrieve the uploaded data
downloaded = get_file(storage, test_key)
@test downloaded !== nothing
@test downloaded isa Vector{UInt8}
@test String(downloaded) == test_data
# Test list_files - verify key appears in listing
keys = list_files(storage)
@test test_key in keys
# Test put_file callable struct
test_key2 = "testrunner-callable-$(GeneralUtils.uuid4snakecase()).json"
callable_result = put_file(storage)(test_key2, "callable-data")
@test callable_result !== nothing
@test callable_result.api != ""
@test callable_result.web != ""
# Verify callable upload
downloaded2 = get_file(storage, test_key2)
@test String(downloaded2) == "callable-data"
# Test delete_file
delete_file(storage, test_key)
deleted_data = get_file(storage, test_key)
@test deleted_data === nothing
# Cleanup callable test object
delete_file(storage, test_key2)
deleted_data2 = get_file(storage, test_key2)
@test deleted_data2 === nothing
end
@testset "integration: nested key CRUD - single level" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
test_key = "single/slash/test-$(GeneralUtils.uuid4snakecase()).json"
test_data = "{\"level\": 1, \"nested\": true}"
# Upload nested key
result = put_file(storage, test_key, test_data)
@test result isa NamedTuple
@test haskey(result, :api)
@test haskey(result, :web)
@test occursin("single/slash/", result.api)
@test occursin("single/slash/", result.web)
# Download and verify
downloaded = get_file(storage, test_key)
@test downloaded !== nothing
@test String(downloaded) == test_data
# Verify in listing
keys = list_files(storage)
@test test_key in keys
# Delete and verify gone
delete_file(storage, test_key)
@test get_file(storage, test_key) === nothing
end
@testset "integration: nested key CRUD - multi level" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
test_key = "deep/nested/folder/subfolder/test-$(GeneralUtils.uuid4snakecase()).json"
test_data = "{\"deeply\": \"nested\", \"path\": \"deep/nested/folder/subfolder/\"}"
# Upload deeply nested key
result = put_file(storage, test_key, test_data)
@test result isa NamedTuple
@test occursin("deep/nested/folder/subfolder/", result.api)
@test occursin("s3-api", result.api)
@test occursin("s3-web", result.web)
# Download and verify
downloaded = get_file(storage, test_key)
@test downloaded !== nothing
@test String(downloaded) == test_data
# Verify in listing
keys = list_files(storage)
@test test_key in keys
# Delete and verify gone
delete_file(storage, test_key)
@test get_file(storage, test_key) === nothing
end
@testset "integration: nested key with callable struct" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
test_key = "callable/nested/test-$(GeneralUtils.uuid4snakecase()).json"
test_data = "{\"callable\": true, \"nested\": true}"
uploader = put_file(storage)
result = uploader(test_key, test_data)
@test result isa NamedTuple
@test occursin("callable/nested/", result.api)
downloaded = get_file(storage, test_key)
@test String(downloaded) == test_data
delete_file(storage, test_key)
@test get_file(storage, test_key) === nothing
end
@testset "integration: get_file returns nothing for missing key" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
result = get_file(storage, "nonexistent-key-$(GeneralUtils.uuid4snakecase()).json")
@test result === nothing
end
@testset "integration: binary data upload and download" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
test_key = "testrunner-binary-$(GeneralUtils.uuid4snakecase()).bin"
binary_data = UInt8[0x00, 0x01, 0x02, 0xFF, 0xFE, 0xFD, 0x48, 0x65, 0x6c, 0x6c, 0x6f]
result = put_file(storage, test_key, binary_data)
@test result !== nothing
downloaded = get_file(storage, test_key)
@test downloaded == binary_data
delete_file(storage, test_key)
@test get_file(storage, test_key) === nothing
end
@testset "integration: list_files returns vector of strings" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
test_key = "testrunner-list-$(GeneralUtils.uuid4snakecase()).txt"
put_file(storage, test_key, "list-test-data")
keys = list_files(storage)
@test keys isa Vector{String}
@test test_key in keys
delete_file(storage, test_key)
end
@testset "integration: url format validation" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
test_key = "testrunner-url-$(GeneralUtils.uuid4snakecase()).json"
result = put_file(storage, test_key, "url-test")
@test startswith(result.api, "https://s3-api.yiem.cc/testbucket/")
@test occursin("/$test_key", result.api)
@test startswith(result.web, "https://s3-web.yiem.cc/testbucket/")
@test occursin("/$test_key", result.web)
delete_file(storage, test_key)
end
# --- Lifecycle configuration tests ---
@testset "LifecycleExpiration construction with default ID" begin
rule = LifecycleExpiration("uploads/", 30)
@test rule.prefix == "uploads/"
@test rule.days == 30
@test rule.enabled == true
@test rule.id == "expire-uploads_-30d"
end
@testset "LifecycleExpiration construction with custom ID" begin
rule = LifecycleExpiration("data/", 7; id="my-rule")
@test rule.prefix == "data/"
@test rule.days == 7
@test rule.enabled == true
@test rule.id == "my-rule"
end
@testset "LifecycleExpiration with disabled flag" begin
rule = LifecycleExpiration("temp/", 1; enabled=false)
@test rule.enabled == false
end
@testset "LifecycleExpiration with nested prefix" begin
rule = LifecycleExpiration("deep/nested/", 90)
@test rule.prefix == "deep/nested/"
end
@testset "build_lifecycle_xml generates valid XML" begin
rule = LifecycleExpiration("test/", 14; id="test-rule")
xml = build_lifecycle_xml(rule)
@test occursin("<?xml version=\"1.0\"", xml)
@test occursin("<LifecycleConfiguration>", xml)
@test occursin("<ID>test-rule</ID>", xml)
@test occursin("<Prefix>test/</Prefix>", xml)
@test occursin("<Status>Enabled</Status>", xml)
@test occursin("<Days>14</Days>", xml)
@test occursin("</LifecycleConfiguration>", xml)
end
@testset "build_lifecycle_xml generates disabled rule XML" begin
rule = LifecycleExpiration("temp/", 1; enabled=false)
xml = build_lifecycle_xml(rule)
@test occursin("<Status>Disabled</Status>", xml)
end
@testset "integration: lifecycle CRUD - set and get" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
# Should return nothing when no lifecycle is set
lc = get_lifecycle(storage)
@test lc === nothing
# Set lifecycle
rule = LifecycleExpiration("lifecycle-test/", 45)
set_lifecycle_expiration(storage, rule)
# Should return configuration after setting
lc = get_lifecycle(storage)
@test lc !== nothing
@test haskey(lc, "Rule")
# Delete lifecycle
delete_lifecycle(storage)
# Should return nothing after deletion
lc = get_lifecycle(storage)
@test lc === nothing
end
@testset "integration: lifecycle with nested prefix" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
rule = LifecycleExpiration("a/b/c/", 20; id="nested-rule")
set_lifecycle_expiration(storage, rule)
lc = get_lifecycle(storage)
@test lc !== nothing
@test haskey(lc, "Rule")
delete_lifecycle(storage)
@test get_lifecycle(storage) === nothing
end
@testset "integration: lifecycle enabled/disabled toggle" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
# Set enabled rule
rule1 = LifecycleExpiration("toggle/", 10; enabled=true)
set_lifecycle_expiration(storage, rule1)
lc = get_lifecycle(storage)
@test lc !== nothing
# Override with disabled rule
rule2 = LifecycleExpiration("toggle/", 10; enabled=false)
set_lifecycle_expiration(storage, rule2)
lc = get_lifecycle(storage)
@test lc !== nothing
delete_lifecycle(storage)
end
# --- Pre-signed URL tests ---
@testset "s3_sign_url returns a string" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
url = s3_sign_url(storage, "test.json", 3600)
@test url isa String
@test !isempty(url)
end
@testset "s3_sign_url URL format contains correct endpoint, bucket, key" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
url = s3_sign_url(storage, "mykey.json", 1800)
@test occursin("https://s3-api.yiem.cc", url)
@test occursin("/testbucket/mykey.json?", url)
end
@testset "s3_sign_url contains required query parameters" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
url = s3_sign_url(storage, "test.json", 3600)
@test occursin("X-Amz-Algorithm=AWS4-HMAC-SHA256", url)
@test occursin("X-Amz-Expires=3600", url)
@test occursin("X-Amz-Credential=", url)
@test occursin("X-Amz-Date=", url)
@test occursin("X-Amz-SignedHeaders=", url)
@test occursin("X-Amz-Signature=", url)
end
@testset "s3_sign_url with custom expiry duration" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
url = s3_sign_url(storage, "test.json", 600)
@test occursin("X-Amz-Expires=600", url)
end
@testset "s3_sign_url with GET verb produces different signature than default" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
url_get = s3_sign_url(storage, "test.json", 3600; verb="GET")
url_default = s3_sign_url(storage, "test.json", 3600)
# GET verb should produce a valid signature
@test occursin("X-Amz-Signature=", url_get)
@test occursin("X-Amz-Signature=", url_default)
# Both URLs should have the same structure but potentially different signatures
@test occursin("X-Amz-Algorithm=AWS4-HMAC-SHA256", url_get)
end
@testset "s3_sign_url with PUT verb and content_type" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
url_put = s3_sign_url(storage, "upload.json", 300; verb="PUT", content_type="application/json")
url_get = s3_sign_url(storage, "upload.json", 300; verb="GET")
# PUT and GET should produce different signatures (different canonical request)
@test occursin("X-Amz-Signature=", url_put)
@test occursin("X-Amz-Signature=", url_get)
end
@testset "s3_sign_url with special characters in key" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
test_key = "folder/sub folder/file with spaces.json"
url = s3_sign_url(storage, test_key, 3600)
@test occursin("testbucket/", url)
end
@testset "s3_sign_url with deeply nested key" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
test_key = "a/b/c/d/e/deep-file.json"
url = s3_sign_url(storage, test_key, 3600)
@test occursin("/testbucket/a/b/c/d/e/deep-file.json", url)
end
@testset "integration: pre-signed URL can download existing file" begin
storage = GarageStorage(
"https://s3-api.yiem.cc",
"GKb080154a2e5b19100b1b2c6e",
"a2c6b1379c2f731d3e6e5a408dd4d6cffca7511717675f55114ff94828febca1",
"testbucket"
)
test_key = "testrunner-presign-$(GeneralUtils.uuid4snakecase()).json"
test_data = "{\"presign\": true, \"test\": \"$(GeneralUtils.uuid4snakecase())\"}"
put_file(storage, test_key, test_data)
url = s3_sign_url(storage, test_key, 300)
@test occursin("https://s3-api.yiem.cc/testbucket/", url)
delete_file(storage, test_key)
end
@test detect_keyword(["test"], "testing.test.tester"; mode="individual", delimiter=['.']) == Dict("test" => 1)
end end
Binary file not shown.

After

Width:  |  Height:  |  Size: 429 KiB