Compare commits
	
		
			2 Commits
		
	
	
		
			7230c2d015
			...
			57c2241e12
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 57c2241e12 | |||
| df978d7250 | 
							
								
								
									
										93
									
								
								Cargo.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										93
									
								
								Cargo.lock
									
									
									
										generated
									
									
									
								
							@ -21,8 +21,11 @@ checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
 | 
				
			|||||||
name = "admin-cli"
 | 
					name = "admin-cli"
 | 
				
			||||||
version = "0.1.0"
 | 
					version = "0.1.0"
 | 
				
			||||||
dependencies = [
 | 
					dependencies = [
 | 
				
			||||||
 | 
					 "base64",
 | 
				
			||||||
 "clap",
 | 
					 "clap",
 | 
				
			||||||
 "postgres",
 | 
					 "postgres",
 | 
				
			||||||
 | 
					 "serde",
 | 
				
			||||||
 | 
					 "serde_json",
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
@ -36,9 +39,9 @@ dependencies = [
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "anstream"
 | 
					name = "anstream"
 | 
				
			||||||
version = "0.6.17"
 | 
					version = "0.6.18"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338"
 | 
					checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b"
 | 
				
			||||||
dependencies = [
 | 
					dependencies = [
 | 
				
			||||||
 "anstyle",
 | 
					 "anstyle",
 | 
				
			||||||
 "anstyle-parse",
 | 
					 "anstyle-parse",
 | 
				
			||||||
@ -51,9 +54,9 @@ dependencies = [
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "anstyle"
 | 
					name = "anstyle"
 | 
				
			||||||
version = "1.0.9"
 | 
					version = "1.0.10"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56"
 | 
					checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "anstyle-parse"
 | 
					name = "anstyle-parse"
 | 
				
			||||||
@ -196,9 +199,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "bytemuck"
 | 
					name = "bytemuck"
 | 
				
			||||||
version = "1.19.0"
 | 
					version = "1.20.0"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "8334215b81e418a0a7bdb8ef0849474f40bb10c8b71f1c4ed315cff49f32494d"
 | 
					checksum = "8b37c88a63ffd85d15b406896cc343916d7cf57838a847b3a6f2ca5d39a5695a"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "byteorder"
 | 
					name = "byteorder"
 | 
				
			||||||
@ -214,9 +217,9 @@ checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "cc"
 | 
					name = "cc"
 | 
				
			||||||
version = "1.1.31"
 | 
					version = "1.2.1"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f"
 | 
					checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47"
 | 
				
			||||||
dependencies = [
 | 
					dependencies = [
 | 
				
			||||||
 "shlex",
 | 
					 "shlex",
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
@ -229,9 +232,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "clap"
 | 
					name = "clap"
 | 
				
			||||||
version = "4.5.20"
 | 
					version = "4.5.21"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8"
 | 
					checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f"
 | 
				
			||||||
dependencies = [
 | 
					dependencies = [
 | 
				
			||||||
 "clap_builder",
 | 
					 "clap_builder",
 | 
				
			||||||
 "clap_derive",
 | 
					 "clap_derive",
 | 
				
			||||||
@ -239,9 +242,9 @@ dependencies = [
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "clap_builder"
 | 
					name = "clap_builder"
 | 
				
			||||||
version = "4.5.20"
 | 
					version = "4.5.21"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54"
 | 
					checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec"
 | 
				
			||||||
dependencies = [
 | 
					dependencies = [
 | 
				
			||||||
 "anstream",
 | 
					 "anstream",
 | 
				
			||||||
 "anstyle",
 | 
					 "anstyle",
 | 
				
			||||||
@ -263,9 +266,9 @@ dependencies = [
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "clap_lex"
 | 
					name = "clap_lex"
 | 
				
			||||||
version = "0.7.2"
 | 
					version = "0.7.3"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97"
 | 
					checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "colorchoice"
 | 
					name = "colorchoice"
 | 
				
			||||||
@ -286,9 +289,9 @@ dependencies = [
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "cpufeatures"
 | 
					name = "cpufeatures"
 | 
				
			||||||
version = "0.2.14"
 | 
					version = "0.2.16"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0"
 | 
					checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3"
 | 
				
			||||||
dependencies = [
 | 
					dependencies = [
 | 
				
			||||||
 "libc",
 | 
					 "libc",
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
@ -395,9 +398,9 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "fastrand"
 | 
					name = "fastrand"
 | 
				
			||||||
version = "2.1.1"
 | 
					version = "2.2.0"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6"
 | 
					checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "figment"
 | 
					name = "figment"
 | 
				
			||||||
@ -563,9 +566,9 @@ dependencies = [
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "hashbrown"
 | 
					name = "hashbrown"
 | 
				
			||||||
version = "0.15.0"
 | 
					version = "0.15.1"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb"
 | 
					checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "heck"
 | 
					name = "heck"
 | 
				
			||||||
@ -699,9 +702,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "itoa"
 | 
					name = "itoa"
 | 
				
			||||||
version = "1.0.11"
 | 
					version = "1.0.13"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
 | 
					checksum = "540654e97a3f4470a492cd30ff187bc95d89557a903a2bbf112e2fae98104ef2"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "js-sys"
 | 
					name = "js-sys"
 | 
				
			||||||
@ -720,9 +723,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "libc"
 | 
					name = "libc"
 | 
				
			||||||
version = "0.2.161"
 | 
					version = "0.2.164"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1"
 | 
					checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "linux-raw-sys"
 | 
					name = "linux-raw-sys"
 | 
				
			||||||
@ -1021,9 +1024,9 @@ dependencies = [
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "proc-macro2"
 | 
					name = "proc-macro2"
 | 
				
			||||||
version = "1.0.89"
 | 
					version = "1.0.92"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e"
 | 
					checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0"
 | 
				
			||||||
dependencies = [
 | 
					dependencies = [
 | 
				
			||||||
 "unicode-ident",
 | 
					 "unicode-ident",
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
@ -1117,7 +1120,7 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
 | 
				
			|||||||
dependencies = [
 | 
					dependencies = [
 | 
				
			||||||
 "aho-corasick",
 | 
					 "aho-corasick",
 | 
				
			||||||
 "memchr",
 | 
					 "memchr",
 | 
				
			||||||
 "regex-automata 0.4.8",
 | 
					 "regex-automata 0.4.9",
 | 
				
			||||||
 "regex-syntax 0.8.5",
 | 
					 "regex-syntax 0.8.5",
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1132,9 +1135,9 @@ dependencies = [
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "regex-automata"
 | 
					name = "regex-automata"
 | 
				
			||||||
version = "0.4.8"
 | 
					version = "0.4.9"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3"
 | 
					checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
 | 
				
			||||||
dependencies = [
 | 
					dependencies = [
 | 
				
			||||||
 "aho-corasick",
 | 
					 "aho-corasick",
 | 
				
			||||||
 "memchr",
 | 
					 "memchr",
 | 
				
			||||||
@ -1243,9 +1246,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "rustix"
 | 
					name = "rustix"
 | 
				
			||||||
version = "0.38.38"
 | 
					version = "0.38.41"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a"
 | 
					checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6"
 | 
				
			||||||
dependencies = [
 | 
					dependencies = [
 | 
				
			||||||
 "bitflags",
 | 
					 "bitflags",
 | 
				
			||||||
 "errno",
 | 
					 "errno",
 | 
				
			||||||
@ -1280,18 +1283,18 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "serde"
 | 
					name = "serde"
 | 
				
			||||||
version = "1.0.214"
 | 
					version = "1.0.215"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5"
 | 
					checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f"
 | 
				
			||||||
dependencies = [
 | 
					dependencies = [
 | 
				
			||||||
 "serde_derive",
 | 
					 "serde_derive",
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "serde_derive"
 | 
					name = "serde_derive"
 | 
				
			||||||
version = "1.0.214"
 | 
					version = "1.0.215"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766"
 | 
					checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0"
 | 
				
			||||||
dependencies = [
 | 
					dependencies = [
 | 
				
			||||||
 "proc-macro2",
 | 
					 "proc-macro2",
 | 
				
			||||||
 "quote",
 | 
					 "quote",
 | 
				
			||||||
@ -1300,9 +1303,9 @@ dependencies = [
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "serde_json"
 | 
					name = "serde_json"
 | 
				
			||||||
version = "1.0.132"
 | 
					version = "1.0.133"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03"
 | 
					checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377"
 | 
				
			||||||
dependencies = [
 | 
					dependencies = [
 | 
				
			||||||
 "itoa",
 | 
					 "itoa",
 | 
				
			||||||
 "memchr",
 | 
					 "memchr",
 | 
				
			||||||
@ -1434,9 +1437,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "syn"
 | 
					name = "syn"
 | 
				
			||||||
version = "2.0.85"
 | 
					version = "2.0.89"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56"
 | 
					checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e"
 | 
				
			||||||
dependencies = [
 | 
					dependencies = [
 | 
				
			||||||
 "proc-macro2",
 | 
					 "proc-macro2",
 | 
				
			||||||
 "quote",
 | 
					 "quote",
 | 
				
			||||||
@ -1445,9 +1448,9 @@ dependencies = [
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "tempfile"
 | 
					name = "tempfile"
 | 
				
			||||||
version = "3.13.0"
 | 
					version = "3.14.0"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b"
 | 
					checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c"
 | 
				
			||||||
dependencies = [
 | 
					dependencies = [
 | 
				
			||||||
 "cfg-if",
 | 
					 "cfg-if",
 | 
				
			||||||
 "fastrand",
 | 
					 "fastrand",
 | 
				
			||||||
@ -1514,9 +1517,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "tokio"
 | 
					name = "tokio"
 | 
				
			||||||
version = "1.41.0"
 | 
					version = "1.41.1"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb"
 | 
					checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33"
 | 
				
			||||||
dependencies = [
 | 
					dependencies = [
 | 
				
			||||||
 "backtrace",
 | 
					 "backtrace",
 | 
				
			||||||
 "bytes",
 | 
					 "bytes",
 | 
				
			||||||
@ -1731,9 +1734,9 @@ checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "unicode-ident"
 | 
					name = "unicode-ident"
 | 
				
			||||||
version = "1.0.13"
 | 
					version = "1.0.14"
 | 
				
			||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
					source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
				
			||||||
checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
 | 
					checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[package]]
 | 
					[[package]]
 | 
				
			||||||
name = "unicode-normalization"
 | 
					name = "unicode-normalization"
 | 
				
			||||||
 | 
				
			|||||||
@ -6,3 +6,6 @@ edition = "2021"
 | 
				
			|||||||
[dependencies]
 | 
					[dependencies]
 | 
				
			||||||
clap = { version = "4.5.20", features = ["derive"] }
 | 
					clap = { version = "4.5.20", features = ["derive"] }
 | 
				
			||||||
postgres = "0.19.9"
 | 
					postgres = "0.19.9"
 | 
				
			||||||
 | 
					base64 = "0.22.1"
 | 
				
			||||||
 | 
					serde = "1.0.215"
 | 
				
			||||||
 | 
					serde_json = "1.0.133"
 | 
				
			||||||
 | 
				
			|||||||
@ -1,7 +1,10 @@
 | 
				
			|||||||
use std::env;
 | 
					use std::env;
 | 
				
			||||||
use std::fs;
 | 
					use std::fs;
 | 
				
			||||||
 | 
					use std::io::Read;
 | 
				
			||||||
use clap::Parser;
 | 
					use clap::Parser;
 | 
				
			||||||
use postgres::{Client, NoTls};
 | 
					use postgres::{Client, NoTls};
 | 
				
			||||||
 | 
					use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine as _};
 | 
				
			||||||
 | 
					use serde::Serialize;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[derive(Parser, Debug)]
 | 
					#[derive(Parser, Debug)]
 | 
				
			||||||
#[command(version, about, long_about = None)]
 | 
					#[command(version, about, long_about = None)]
 | 
				
			||||||
@ -9,31 +12,58 @@ struct Args {
 | 
				
			|||||||
    /// Setup everything from scratch
 | 
					    /// Setup everything from scratch
 | 
				
			||||||
    #[arg(short, long)]
 | 
					    #[arg(short, long)]
 | 
				
			||||||
    setup: bool,
 | 
					    setup: bool,
 | 
				
			||||||
    /// Setup just the Database
 | 
					 | 
				
			||||||
    #[arg(short, long)]
 | 
					 | 
				
			||||||
    db: bool
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fn execute_sql(connection_string: &str, filename: &'static str) -> Result<(), postgres::Error> {
 | 
					#[derive(Serialize)]
 | 
				
			||||||
    let content = fs::read_to_string(filename)
 | 
					struct Config {
 | 
				
			||||||
        .expect(&format!("Failed to load file: {}", filename));
 | 
					    postgres_user: String,
 | 
				
			||||||
    let mut client = Client::connect(connection_string, NoTls)?;
 | 
					    postgres_pass: String,
 | 
				
			||||||
    client.batch_execute(&content)
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fn setup_database() -> Result<(), postgres::Error> {
 | 
					fn random_string(size: usize) -> String {
 | 
				
			||||||
 | 
					    // Next we'll generate a bunch of random numbers
 | 
				
			||||||
 | 
					    let mut buffer = vec![0; size];
 | 
				
			||||||
 | 
					    let mut f = std::fs::File::open("/dev/urandom").unwrap();
 | 
				
			||||||
 | 
					    f.read_exact(&mut buffer).unwrap();
 | 
				
			||||||
 | 
					    URL_SAFE_NO_PAD.encode(buffer)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					fn full_setup() -> Result<Config, postgres::Error> {
 | 
				
			||||||
    // Check to make sure we have the DB url set to connect
 | 
					    // Check to make sure we have the DB url set to connect
 | 
				
			||||||
    const KEY: &'static str = "DB_CONNECTION_STRING" ;
 | 
					    const KEY: &'static str = "DB_CONNECTION_STRING" ;
 | 
				
			||||||
    let connection_string = env::var(KEY).expect(
 | 
					    let connection_string = env::var(KEY).expect(
 | 
				
			||||||
        &format!("The env var {} is not set!", KEY)
 | 
					        &format!("The env var {} is not set!", KEY)
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
    execute_sql(&connection_string, "../db/tables.sql")
 | 
					    let setup_tables_script = fs::read_to_string("db/setup-tables.sql")
 | 
				
			||||||
 | 
					        .expect("Failed to load file: db/setup-tables.sql");
 | 
				
			||||||
 | 
					    let bubble_admin_password = random_string(32);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    let mut client = Client::connect(&connection_string, NoTls)?;
 | 
				
			||||||
 | 
					    // Preliminary bs
 | 
				
			||||||
 | 
					    client.execute("DROP DATABASE IF EXISTS bubble;", &[])?;
 | 
				
			||||||
 | 
					    client.execute("CREATE DATABASE bubble;", &[])?;
 | 
				
			||||||
 | 
					    client.execute("DROP USER IF EXISTS bubble_admin;", &[])?;
 | 
				
			||||||
 | 
					    client.execute(
 | 
				
			||||||
 | 
					        &format!("CREATE USER bubble_admin WITH ENCRYPTED PASSWORD '{}';", bubble_admin_password), 
 | 
				
			||||||
 | 
					        &[]
 | 
				
			||||||
 | 
					    )?;
 | 
				
			||||||
 | 
					    // Ensure the admin has ownership of the db we created
 | 
				
			||||||
 | 
					    client.execute("ALTER DATABASE bubble OWNER TO bubble_admin", &[])?;
 | 
				
			||||||
 | 
					    // Service table creation
 | 
				
			||||||
 | 
					    client.batch_execute(&setup_tables_script)?;
 | 
				
			||||||
 | 
					    Ok(Config {
 | 
				
			||||||
 | 
					        postgres_user: "bubble_admin".into(),
 | 
				
			||||||
 | 
					        postgres_pass: bubble_admin_password
 | 
				
			||||||
 | 
					    })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fn main() {
 | 
					fn main() {
 | 
				
			||||||
    let args = Args::parse();
 | 
					    let args = Args::parse();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if args.db { let _ = setup_database(); }
 | 
					    if args.setup {
 | 
				
			||||||
    println!("Setup is {}", args.setup);
 | 
					        match full_setup() {
 | 
				
			||||||
    println!("Setup is {}", args.db);
 | 
					            Ok(config) => println!("{}", serde_json::to_string(&config).unwrap()),
 | 
				
			||||||
 | 
					            Err(e) => eprintln!("{:#?}", e)
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -1,8 +1,9 @@
 | 
				
			|||||||
-- Create the user that we'll use for service data
 | 
					-- TODO: IDK wtf is wrong with this statement but im forgoing making this
 | 
				
			||||||
DO $SERVICE_USER_CREATION$
 | 
					-- work for the time being
 | 
				
			||||||
 | 
					$$
 | 
				
			||||||
BEGIN
 | 
					BEGIN
 | 
				
			||||||
	CREATE ROLE bubble_admin WITH PASSWORD $1;
 | 
						IF NOT EXISTS (SELECT FROM pg_roles WHERE rolname = 'bubble_admin') THEN
 | 
				
			||||||
	EXCEPTION WHEN duplicate_object THEN RAISE NOTICE '%, skipping', SQLERRM USING ERRCODE = SQLSTATE;
 | 
							CREATE USER 'bubble_admin' WITH PASSWORD $1;
 | 
				
			||||||
 | 
						END IF
 | 
				
			||||||
END
 | 
					END
 | 
				
			||||||
$SERVICE_USER_CREATION$;
 | 
					$$
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										11
									
								
								docker-compose.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								docker-compose.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,11 @@
 | 
				
			|||||||
 | 
					services:
 | 
				
			||||||
 | 
					  postgres:
 | 
				
			||||||
 | 
					    image: postgres
 | 
				
			||||||
 | 
					    restart: always
 | 
				
			||||||
 | 
					    container_name: bubble-postgres
 | 
				
			||||||
 | 
					    environment:
 | 
				
			||||||
 | 
					      POSTGRES_USER: "${POSTGRES_USER}"
 | 
				
			||||||
 | 
					      POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
 | 
				
			||||||
 | 
					    ports:
 | 
				
			||||||
 | 
					      - '5432:5432'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user