M .drone.yml => .drone.yml +75 -17
@@ 1,7 1,7 @@
---
kind: pipeline
type: docker
-name: starkingdoms_ci
+name: client_ci
trigger:
event:
exclude:
@@ 42,6 42,17 @@ steps:
target: builds/${DRONE_COMMIT_SHA}/client.tar.xz
path_style: true
+---
+kind: pipeline
+type: docker
+name: server_ci
+trigger:
+ event:
+ exclude:
+ - promote
+ - rollback
+
+steps:
- name: server_fmt
image: coresdev/stk_build_env
commands:
@@ 115,10 126,21 @@ steps:
target: builds/${DRONE_COMMIT_SHA}/starkingdoms-server
path_style: true
- - name: api_fmt
+---
+kind: pipeline
+type: docker
+name: backplane_ci
+trigger:
+ event:
+ exclude:
+ - promote
+ - rollback
+
+steps:
+ - name: backplane_fmt
image: coresdev/stk_build_env
commands:
- - cd starkingdoms-api
+ - cd starkingdoms-backplane
- rustfmt **/*.rs --check --edition 2021 --color always
environment:
SCCACHE_REGION: us-east-1
@@ 133,10 155,10 @@ steps:
RUSTC_WRAPPER: sccache
SCCACHE_USE_SSL: "true"
CARGO_INCREMENTAL: "0"
- - name: api_clippy
+ - name: backplane_clippy
image: coresdev/stk_build_env
commands:
- - cd starkingdoms-api
+ - cd starkingdoms-backplane
- cargo clippy --color always
environment:
SCCACHE_REGION: us-east-1
@@ 151,10 173,10 @@ steps:
RUSTC_WRAPPER: sccache
SCCACHE_USE_SSL: "true"
CARGO_INCREMENTAL: "0"
- - name: api_build
+ - name: backplane_build
image: coresdev/stk_build_env
commands:
- - cd starkingdoms-api
+ - cd starkingdoms-backplane
- cargo build --release --color always
environment:
SCCACHE_REGION: us-east-1
@@ 169,12 191,12 @@ steps:
RUSTC_WRAPPER: sccache
SCCACHE_USE_SSL: "true"
CARGO_INCREMENTAL: "0"
- - name: upload_api
+ - name: upload_backplane
image: plugins/s3
depends_on:
- - api_build
- - api_fmt
- - api_clippy
+ - backplane_build
+ - backplane_fmt
+ - backplane_clippy
settings:
bucket:
from_secret: s3_bucket
@@ 184,10 206,24 @@ steps:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
- source: target/release/starkingdoms-api
- target: builds/${DRONE_COMMIT_SHA}/starkingdoms-api
+ source: target/release/starkingdoms-backplane
+ target: builds/${DRONE_COMMIT_SHA}/starkingdoms-backplane
path_style: true
+---
+kind: pipeline
+type: docker
+name: trigger_deploy
+depends_on:
+ - client_ci
+ - server_ci
+ - backplane_ci
+trigger:
+ event:
+ exclude:
+ - promote
+ - rollback
+steps:
- name: promote-unstable
image: drone/cli
when:
@@ 202,10 238,6 @@ steps:
from_secret: drone_token
commands:
- drone build promote ${DRONE_REPO} ${DRONE_BUILD_NUMBER} unstable
- depends_on:
- - upload_client
- - upload_server
- - upload_api
---
kind: pipeline
@@ 232,3 264,29 @@ steps:
- echo "$VAULT_PWD" > vault_password.txt
- cat vault_password.txt
- ansible-playbook ansible/deploy.yml -i ansible/environments/unstable.yml --vault-password-file vault_password.txt -e "server_binary_url=$MINIO_BASE/$MINIO_BUCKET/builds/${DRONE_COMMIT_SHA}/starkingdoms-server/target/release/starkingdoms-server client_package_url=$MINIO_BASE/$MINIO_BUCKET/builds/${DRONE_COMMIT_SHA}/client.tar.xz/starkingdoms-client/dist/client.tar.xz"
+
+---
+kind: pipeline
+type: docker
+name: deploy-backplane
+trigger:
+ event:
+ - promote
+ target:
+ - backplane
+steps:
+ - name: deploy
+ image: pad92/ansible-alpine
+ environment:
+ VAULT_PWD:
+ from_secret: vault_password
+ MINIO_BASE:
+ from_secret: s3_host
+ MINIO_BUCKET:
+ from_secret: s3_bucket
+ ANSIBLE_FORCE_COLOR: 1
+ ANSIBLE_HOST_KEY_CHECKING: False
+ commands:
+ - echo "$VAULT_PWD" > vault_password.txt
+ - cat vault_password.txt
+ - ansible-playbook ansible/deploy_backplane.yml -i ansible/global/backplane.yml --vault-password-file vault_password.txt -e "backplane_binary_url=$MINIO_BASE/$MINIO_BUCKET/builds/${DRONE_COMMIT_SHA}/starkingdoms-backplane/target/release/starkingdoms-backplane"
M .gitignore => .gitignore +1 -1
@@ 12,4 12,4 @@ assets/final
starkingdoms-client/node_modules
starkingdoms-client/dist
client/node_modules
-starkingdoms-api/config.toml>
\ No newline at end of file
+starkingdoms-backplane/config.toml<
\ No newline at end of file
M Cargo.lock => Cargo.lock +235 -692
@@ 171,7 171,7 @@ dependencies = [
"futures-core",
"futures-util",
"mio",
- "socket2 0.5.5",
+ "socket2",
"tokio",
"tracing",
]
@@ 232,7 232,7 @@ dependencies = [
"serde_json",
"serde_urlencoded",
"smallvec",
- "socket2 0.5.5",
+ "socket2",
"time",
"url",
]
@@ 250,19 250,6 @@ dependencies = [
]
[[package]]
-name = "actix-web-prom"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f23f332a652836b8f3a6876103c70c9ed436d0e69fa779ab5d7f57b1d5c8d488"
-dependencies = [
- "actix-web",
- "futures-core",
- "pin-project-lite",
- "prometheus",
- "regex",
-]
-
-[[package]]
name = "addr2line"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 345,12 332,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04"
[[package]]
-name = "android-tzdata"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
-
-[[package]]
name = "android_log-sys"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 550,13 531,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
[[package]]
-name = "better-panic"
-version = "0.3.0"
+name = "bb8"
+version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6fa9e1d11a268684cbd90ed36370d7577afb6c62d912ddff5c15fc34343e5036"
+checksum = "98b4b0f25f18bcdc3ac72bdb486ed0acf7e185221fd4dc985bc15db5800b0ba2"
dependencies = [
- "backtrace",
- "console",
+ "async-trait",
+ "futures-channel",
+ "futures-util",
+ "parking_lot",
+ "tokio",
]
[[package]]
@@ 1180,18 1164,6 @@ dependencies = [
]
[[package]]
-name = "bitvec"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c"
-dependencies = [
- "funty",
- "radium",
- "tap",
- "wyz",
-]
-
-[[package]]
name = "blake2"
version = "0.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 1285,27 1257,6 @@ dependencies = [
]
[[package]]
-name = "bson"
-version = "2.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "58da0ae1e701ea752cc46c1bb9f39d5ecefc7395c3ecd526261a566d4f16e0c2"
-dependencies = [
- "ahash",
- "base64 0.13.1",
- "bitvec",
- "hex",
- "indexmap 1.9.3",
- "js-sys",
- "once_cell",
- "rand",
- "serde",
- "serde_bytes",
- "serde_json",
- "time",
- "uuid",
-]
-
-[[package]]
name = "bumpalo"
version = "3.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 1375,18 1326,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e"
[[package]]
-name = "chrono"
-version = "0.4.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38"
-dependencies = [
- "android-tzdata",
- "iana-time-zone",
- "num-traits",
- "windows-targets 0.48.5",
-]
-
-[[package]]
name = "codespan-reporting"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 1403,17 1342,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
[[package]]
-name = "colored"
-version = "2.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6"
-dependencies = [
- "is-terminal",
- "lazy_static",
- "windows-sys 0.48.0",
-]
-
-[[package]]
name = "com-rs"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 1429,18 1357,6 @@ dependencies = [
]
[[package]]
-name = "console"
-version = "0.15.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8"
-dependencies = [
- "encode_unicode",
- "lazy_static",
- "libc",
- "windows-sys 0.45.0",
-]
-
-[[package]]
name = "console_error_panic_hook"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 1641,77 1557,91 @@ dependencies = [
]
[[package]]
-name = "darling"
-version = "0.13.4"
+name = "data-encoding"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5"
+
+[[package]]
+name = "deranged"
+version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c"
+checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3"
dependencies = [
- "darling_core",
- "darling_macro",
+ "powerfmt",
]
[[package]]
-name = "darling_core"
-version = "0.13.4"
+name = "derive_more"
+version = "0.99.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610"
+checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
dependencies = [
- "fnv",
- "ident_case",
+ "convert_case",
"proc-macro2",
"quote",
- "strsim",
+ "rustc_version",
"syn 1.0.109",
]
[[package]]
-name = "darling_macro"
-version = "0.13.4"
+name = "diesel"
+version = "2.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835"
+checksum = "62c6fcf842f17f8c78ecf7c81d75c5ce84436b41ee07e03f490fbb5f5a8731d8"
dependencies = [
- "darling_core",
- "quote",
- "syn 1.0.109",
+ "bitflags 2.4.1",
+ "byteorder",
+ "diesel_derives",
+ "itoa",
+ "serde_json",
]
[[package]]
-name = "data-encoding"
-version = "2.5.0"
+name = "diesel-async"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5"
+checksum = "acada1517534c92d3f382217b485db8a8638f111b0e3f2a2a8e26165050f77be"
+dependencies = [
+ "async-trait",
+ "bb8",
+ "diesel",
+ "futures-util",
+ "scoped-futures",
+ "tokio",
+ "tokio-postgres",
+]
[[package]]
-name = "deranged"
-version = "0.3.9"
+name = "diesel_derives"
+version = "2.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3"
+checksum = "ef8337737574f55a468005a83499da720f20c65586241ffea339db9ecdfd2b44"
dependencies = [
- "powerfmt",
+ "diesel_table_macro_syntax",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.39",
]
[[package]]
-name = "derivative"
-version = "2.2.0"
+name = "diesel_migrations"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
+checksum = "6036b3f0120c5961381b570ee20a02432d7e2d27ea60de9578799cf9156914ac"
dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.109",
+ "diesel",
+ "migrations_internals",
+ "migrations_macros",
]
[[package]]
-name = "derive_more"
-version = "0.99.17"
+name = "diesel_table_macro_syntax"
+version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
+checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5"
dependencies = [
- "convert_case",
- "proc-macro2",
- "quote",
- "rustc_version 0.4.0",
- "syn 1.0.109",
+ "syn 2.0.39",
]
[[package]]
@@ 1776,12 1706,6 @@ dependencies = [
]
[[package]]
-name = "encode_unicode"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
-
-[[package]]
name = "encoding_rs"
version = "0.8.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 1791,15 1715,16 @@ dependencies = [
]
[[package]]
-name = "enum-as-inner"
-version = "0.4.0"
+name = "env_logger"
+version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73"
+checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece"
dependencies = [
- "heck",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
+ "humantime",
+ "is-terminal",
+ "log",
+ "regex",
+ "termcolor",
]
[[package]]
@@ 1864,6 1789,12 @@ dependencies = [
]
[[package]]
+name = "fallible-iterator"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7"
+
+[[package]]
name = "fastrand"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 1958,18 1889,13 @@ dependencies = [
]
[[package]]
-name = "funty"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c"
-
-[[package]]
name = "futures-channel"
version = "0.3.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb"
dependencies = [
"futures-core",
+ "futures-sink",
]
[[package]]
@@ 1979,17 1905,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c"
[[package]]
-name = "futures-executor"
-version = "0.3.29"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc"
-dependencies = [
- "futures-core",
- "futures-task",
- "futures-util",
-]
-
-[[package]]
name = "futures-io"
version = "0.3.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 2053,11 1968,11 @@ version = "0.3.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104"
dependencies = [
+ "futures-channel",
"futures-core",
- "futures-io",
"futures-macro",
+ "futures-sink",
"futures-task",
- "memchr",
"pin-project-lite",
"pin-utils",
"slab",
@@ 2228,24 2143,12 @@ dependencies = [
]
[[package]]
-name = "heck"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
-
-[[package]]
name = "hermit-abi"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7"
[[package]]
-name = "hex"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
-
-[[package]]
name = "hexasphere"
version = "9.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 2271,17 2174,6 @@ dependencies = [
]
[[package]]
-name = "hostname"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867"
-dependencies = [
- "libc",
- "match_cfg",
- "winapi",
-]
-
-[[package]]
name = "http"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 2305,44 2197,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
[[package]]
-name = "iana-time-zone"
-version = "0.1.58"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20"
-dependencies = [
- "android_system_properties",
- "core-foundation-sys",
- "iana-time-zone-haiku",
- "js-sys",
- "wasm-bindgen",
- "windows-core",
-]
-
-[[package]]
-name = "iana-time-zone-haiku"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
-dependencies = [
- "cc",
-]
-
-[[package]]
-name = "ident_case"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
-
-[[package]]
-name = "idna"
-version = "0.2.3"
+name = "humantime"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8"
-dependencies = [
- "matches",
- "unicode-bidi",
- "unicode-normalization",
-]
+checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]]
name = "idna"
@@ 2400,24 2258,6 @@ dependencies = [
]
[[package]]
-name = "ipconfig"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f"
-dependencies = [
- "socket2 0.5.5",
- "widestring",
- "windows-sys 0.48.0",
- "winreg",
-]
-
-[[package]]
-name = "ipnet"
-version = "2.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3"
-
-[[package]]
name = "is-terminal"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 2540,12 2380,6 @@ dependencies = [
]
[[package]]
-name = "linked-hash-map"
-version = "0.5.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
-
-[[package]]
name = "linux-raw-sys"
version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 2585,15 2419,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
[[package]]
-name = "lru-cache"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c"
-dependencies = [
- "linked-hash-map",
-]
-
-[[package]]
name = "malloc_buf"
version = "0.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 2603,12 2428,6 @@ dependencies = [
]
[[package]]
-name = "match_cfg"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4"
-
-[[package]]
name = "matchers"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 2618,12 2437,6 @@ dependencies = [
]
[[package]]
-name = "matches"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5"
-
-[[package]]
name = "matrixmultiply"
version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 2674,6 2487,27 @@ dependencies = [
]
[[package]]
+name = "migrations_internals"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0f23f71580015254b020e856feac3df5878c2c7a8812297edd6c0a485ac9dada"
+dependencies = [
+ "serde",
+ "toml 0.7.8",
+]
+
+[[package]]
+name = "migrations_macros"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cce3325ac70e67bbab5bd837a31cae01f1a6db64e0e744a33cb03a543469ef08"
+dependencies = [
+ "migrations_internals",
+ "proc-macro2",
+ "quote",
+]
+
+[[package]]
name = "mime"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 2701,57 2535,10 @@ dependencies = [
]
[[package]]
-name = "mongodb"
-version = "2.7.1"
+name = "naga"
+version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e7c926772050c3a3f87c837626bf6135c8ca688d91d31dd39a3da547fc2bc9fe"
-dependencies = [
- "async-trait",
- "base64 0.13.1",
- "bitflags 1.3.2",
- "bson",
- "chrono",
- "derivative",
- "derive_more",
- "futures-core",
- "futures-executor",
- "futures-io",
- "futures-util",
- "hex",
- "hmac",
- "lazy_static",
- "md-5",
- "pbkdf2",
- "percent-encoding",
- "rand",
- "rustc_version_runtime",
- "rustls",
- "rustls-pemfile",
- "serde",
- "serde_bytes",
- "serde_with",
- "sha-1",
- "sha2",
- "socket2 0.4.10",
- "stringprep",
- "strsim",
- "take_mut",
- "thiserror",
- "tokio",
- "tokio-rustls",
- "tokio-util",
- "trust-dns-proto",
- "trust-dns-resolver",
- "typed-builder",
- "uuid",
- "webpki-roots",
-]
-
-[[package]]
-name = "naga"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c1ceaaa4eedaece7e4ec08c55c640ba03dbb73fb812a6570a59bcf1930d0f70e"
+checksum = "c1ceaaa4eedaece7e4ec08c55c640ba03dbb73fb812a6570a59bcf1930d0f70e"
dependencies = [
"bit-set",
"bitflags 2.4.1",
@@ 2922,16 2709,6 @@ dependencies = [
]
[[package]]
-name = "num_cpus"
-version = "1.16.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
-dependencies = [
- "hermit-abi",
- "libc",
-]
-
-[[package]]
name = "num_enum"
version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 2974,15 2751,6 @@ dependencies = [
]
[[package]]
-name = "num_threads"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44"
-dependencies = [
- "libc",
-]
-
-[[package]]
name = "objc"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 3125,15 2893,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c"
[[package]]
-name = "pbkdf2"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917"
-dependencies = [
- "digest",
-]
-
-[[package]]
name = "percent-encoding"
version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 3150,6 2909,24 @@ dependencies = [
]
[[package]]
+name = "phf"
+version = "0.11.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc"
+dependencies = [
+ "phf_shared",
+]
+
+[[package]]
+name = "phf_shared"
+version = "0.11.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b"
+dependencies = [
+ "siphasher",
+]
+
+[[package]]
name = "pin-project-lite"
version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 3179,6 2956,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
[[package]]
+name = "postgres-protocol"
+version = "0.6.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "49b6c5ef183cd3ab4ba005f1ca64c21e8bd97ce4699cfea9e8d9a2c4958ca520"
+dependencies = [
+ "base64 0.21.5",
+ "byteorder",
+ "bytes",
+ "fallible-iterator",
+ "hmac",
+ "md-5",
+ "memchr",
+ "rand",
+ "sha2",
+ "stringprep",
+]
+
+[[package]]
+name = "postgres-types"
+version = "0.2.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8d2234cdee9408b523530a9b6d2d6b373d1db34f6a8e51dc03ded1828d7fb67c"
+dependencies = [
+ "bytes",
+ "fallible-iterator",
+ "postgres-protocol",
+]
+
+[[package]]
name = "powerfmt"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 3225,33 3031,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f89dff0959d98c9758c88826cc002e2c3d0b9dfac4139711d1f30de442f1139b"
[[package]]
-name = "prometheus"
-version = "0.13.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c"
-dependencies = [
- "cfg-if",
- "fnv",
- "lazy_static",
- "memchr",
- "parking_lot",
- "protobuf",
- "thiserror",
-]
-
-[[package]]
-name = "protobuf"
-version = "2.28.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94"
-
-[[package]]
-name = "quick-error"
-version = "1.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
-
-[[package]]
name = "quote"
version = "1.0.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 3261,12 3040,6 @@ dependencies = [
]
[[package]]
-name = "radium"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
-
-[[package]]
name = "radsort"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 3421,30 3194,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "216080ab382b992234dda86873c18d4c48358f5cfcb70fd693d7f6f2131b628b"
[[package]]
-name = "resolv-conf"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00"
-dependencies = [
- "hostname",
- "quick-error",
-]
-
-[[package]]
-name = "ring"
-version = "0.17.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "684d5e6e18f669ccebf64a92236bb7db9a34f07be010e3627368182027180866"
-dependencies = [
- "cc",
- "getrandom",
- "libc",
- "spin",
- "untrusted",
- "windows-sys 0.48.0",
-]
-
-[[package]]
name = "robust"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 3463,6 3212,12 @@ dependencies = [
]
[[package]]
+name = "rs-snowflake"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e60ef3b82994702bbe4e134d98aadca4b49ed04440148985678d415c68127666"
+
+[[package]]
name = "rustc-demangle"
version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 3476,30 3231,11 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]]
name = "rustc_version"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
-dependencies = [
- "semver 0.9.0",
-]
-
-[[package]]
-name = "rustc_version"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
dependencies = [
- "semver 1.0.20",
-]
-
-[[package]]
-name = "rustc_version_runtime"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d31b7153270ebf48bf91c65ae5b0c00e749c4cfad505f66530ac74950249582f"
-dependencies = [
- "rustc_version 0.2.3",
- "semver 0.9.0",
+ "semver",
]
[[package]]
@@ 3516,37 3252,6 @@ dependencies = [
]
[[package]]
-name = "rustls"
-version = "0.21.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9"
-dependencies = [
- "log",
- "ring",
- "rustls-webpki",
- "sct",
-]
-
-[[package]]
-name = "rustls-pemfile"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c"
-dependencies = [
- "base64 0.21.5",
-]
-
-[[package]]
-name = "rustls-webpki"
-version = "0.101.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765"
-dependencies = [
- "ring",
- "untrusted",
-]
-
-[[package]]
name = "ryu"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 3562,29 3267,20 @@ dependencies = [
]
[[package]]
-name = "scopeguard"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
-
-[[package]]
-name = "sct"
-version = "0.7.1"
+name = "scoped-futures"
+version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414"
+checksum = "b1473e24c637950c9bd38763220bea91ec3e095a89f672bbd7a10d03e77ba467"
dependencies = [
- "ring",
- "untrusted",
+ "cfg-if",
+ "pin-utils",
]
[[package]]
-name = "semver"
-version = "0.9.0"
+name = "scopeguard"
+version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
-dependencies = [
- "semver-parser",
-]
+checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "semver"
@@ 3593,12 3289,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090"
[[package]]
-name = "semver-parser"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
-
-[[package]]
name = "serde"
version = "1.0.193"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 3608,15 3298,6 @@ dependencies = [
]
[[package]]
-name = "serde_bytes"
-version = "0.11.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff"
-dependencies = [
- "serde",
-]
-
-[[package]]
name = "serde_derive"
version = "1.0.193"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 3633,7 3314,6 @@ version = "1.0.108"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b"
dependencies = [
- "indexmap 2.1.0",
"itoa",
"ryu",
"serde",
@@ 3661,39 3341,6 @@ dependencies = [
]
[[package]]
-name = "serde_with"
-version = "1.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff"
-dependencies = [
- "serde",
- "serde_with_macros",
-]
-
-[[package]]
-name = "serde_with_macros"
-version = "1.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082"
-dependencies = [
- "darling",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "sha-1"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "digest",
-]
-
-[[package]]
name = "sha1"
version = "0.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 3747,16 3394,10 @@ dependencies = [
]
[[package]]
-name = "simple_logger"
-version = "4.3.0"
+name = "siphasher"
+version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da0ca6504625ee1aa5fda33913d2005eab98c7a42dd85f116ecce3ff54c9d3ef"
-dependencies = [
- "colored",
- "log",
- "time",
- "windows-sys 0.48.0",
-]
+checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d"
[[package]]
name = "slab"
@@ 3796,16 3437,6 @@ dependencies = [
[[package]]
name = "socket2"
-version = "0.4.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "socket2"
version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9"
@@ 3827,12 3458,6 @@ dependencies = [
]
[[package]]
-name = "spin"
-version = "0.9.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
-
-[[package]]
name = "spirv"
version = "0.2.0+1.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 3843,27 3468,34 @@ dependencies = [
]
[[package]]
-name = "starkingdoms-api"
-version = "0.1.0"
+name = "starkingdoms-backplane"
+version = "0.0.1"
dependencies = [
"actix-cors",
"actix-web",
- "actix-web-prom",
"argon2",
- "better-panic",
- "bson",
- "futures-util",
+ "bb8",
+ "diesel",
+ "diesel-async",
+ "diesel_migrations",
+ "env_logger",
"hmac",
"jwt",
"log",
- "mongodb",
"password-hash",
- "prometheus",
+ "rand",
+ "rs-snowflake",
"serde",
"serde_json",
"sha2",
- "simple_logger",
- "toml",
+ "toml 0.8.8",
+]
+
+[[package]]
+name = "starkingdoms-common"
+version = "0.1.0"
+dependencies = [
+ "serde",
]
[[package]]
@@ 3876,6 3508,7 @@ dependencies = [
"rand",
"serde",
"serde_json",
+ "starkingdoms-common",
"tracing-subscriber",
]
@@ 3897,12 3530,6 @@ dependencies = [
]
[[package]]
-name = "strsim"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
-
-[[package]]
name = "subtle"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 3951,18 3578,6 @@ dependencies = [
]
[[package]]
-name = "take_mut"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60"
-
-[[package]]
-name = "tap"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
-
-[[package]]
name = "termcolor"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 4009,8 3624,6 @@ checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5"
dependencies = [
"deranged",
"itoa",
- "libc",
- "num_threads",
"powerfmt",
"serde",
"time-core",
@@ 4057,34 3670,37 @@ dependencies = [
"bytes",
"libc",
"mio",
- "num_cpus",
"parking_lot",
"pin-project-lite",
"signal-hook-registry",
- "socket2 0.5.5",
- "tokio-macros",
+ "socket2",
"windows-sys 0.48.0",
]
[[package]]
-name = "tokio-macros"
-version = "2.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.39",
-]
-
-[[package]]
-name = "tokio-rustls"
-version = "0.24.1"
+name = "tokio-postgres"
+version = "0.7.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081"
+checksum = "d340244b32d920260ae7448cb72b6e238bddc3d4f7603394e7dd46ed8e48f5b8"
dependencies = [
- "rustls",
+ "async-trait",
+ "byteorder",
+ "bytes",
+ "fallible-iterator",
+ "futures-channel",
+ "futures-util",
+ "log",
+ "parking_lot",
+ "percent-encoding",
+ "phf",
+ "pin-project-lite",
+ "postgres-protocol",
+ "postgres-types",
+ "rand",
+ "socket2",
"tokio",
+ "tokio-util",
+ "whoami",
]
[[package]]
@@ 4095,7 3711,6 @@ checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15"
dependencies = [
"bytes",
"futures-core",
- "futures-io",
"futures-sink",
"pin-project-lite",
"tokio",
@@ 4104,6 3719,18 @@ dependencies = [
[[package]]
name = "toml"
+version = "0.7.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257"
+dependencies = [
+ "serde",
+ "serde_spanned",
+ "toml_datetime",
+ "toml_edit 0.19.15",
+]
+
+[[package]]
+name = "toml"
version = "0.8.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35"
@@ 4130,6 3757,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421"
dependencies = [
"indexmap 2.1.0",
+ "serde",
+ "serde_spanned",
"toml_datetime",
"winnow",
]
@@ 4243,51 3872,6 @@ dependencies = [
]
[[package]]
-name = "trust-dns-proto"
-version = "0.21.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c31f240f59877c3d4bb3b3ea0ec5a6a0cff07323580ff8c7a605cd7d08b255d"
-dependencies = [
- "async-trait",
- "cfg-if",
- "data-encoding",
- "enum-as-inner",
- "futures-channel",
- "futures-io",
- "futures-util",
- "idna 0.2.3",
- "ipnet",
- "lazy_static",
- "log",
- "rand",
- "smallvec",
- "thiserror",
- "tinyvec",
- "tokio",
- "url",
-]
-
-[[package]]
-name = "trust-dns-resolver"
-version = "0.21.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e4ba72c2ea84515690c9fcef4c6c660bb9df3036ed1051686de84605b74fd558"
-dependencies = [
- "cfg-if",
- "futures-util",
- "ipconfig",
- "lazy_static",
- "log",
- "lru-cache",
- "parking_lot",
- "resolv-conf",
- "smallvec",
- "thiserror",
- "tokio",
- "trust-dns-proto",
-]
-
-[[package]]
name = "twite"
version = "0.1.0"
source = "git+https://gitlab.com/ghostlyzsh/twite.git#4998e404fefe46bea91048fb492b89e74b2f9596"
@@ 4299,17 3883,6 @@ dependencies = [
]
[[package]]
-name = "typed-builder"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89851716b67b937e393b3daa8423e67ddfc4bbbf1654bcf05488e95e0828db0c"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
name = "typenum"
version = "1.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 4349,19 3922,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c"
[[package]]
-name = "untrusted"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
-
-[[package]]
name = "url"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633"
dependencies = [
"form_urlencoded",
- "idna 0.5.0",
+ "idna",
"percent-encoding",
]
@@ 4487,12 4054,6 @@ dependencies = [
]
[[package]]
-name = "webpki-roots"
-version = "0.25.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10"
-
-[[package]]
name = "wgpu"
version = "0.17.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 4592,6 4153,16 @@ dependencies = [
]
[[package]]
+name = "whoami"
+version = "1.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50"
+dependencies = [
+ "wasm-bindgen",
+ "web-sys",
+]
+
+[[package]]
name = "wide"
version = "0.7.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 4659,15 4230,6 @@ dependencies = [
]
[[package]]
-name = "windows-core"
-version = "0.51.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64"
-dependencies = [
- "windows-targets 0.48.5",
-]
-
-[[package]]
name = "windows-implement"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 4924,25 4486,6 @@ dependencies = [
]
[[package]]
-name = "winreg"
-version = "0.50.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1"
-dependencies = [
- "cfg-if",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "wyz"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed"
-dependencies = [
- "tap",
-]
-
-[[package]]
name = "xml-rs"
version = "0.8.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
M Cargo.toml => Cargo.toml +2 -1
@@ 1,6 1,7 @@
[workspace]
members = [
"server",
- "starkingdoms-api"
+ "starkingdoms-backplane",
+ "starkingdoms-common"
]
resolver = "2"
A ansible/deploy_backplane.yml => ansible/deploy_backplane.yml +19 -0
@@ 0,0 1,19 @@
+- name: Deploy backplane
+ hosts: backplaneservers
+ connection: ssh
+ tasks:
+ - name: Ensure host connectivity
+ ansible.builtin.ping:
+ - name: Stop backplane server
+ ansible.builtin.command:
+ cmd: sv stop starkingdoms-backplane
+ become: true
+ - name: Download new game server file
+ ansible.builtin.get_url:
+ url: "{{ backplane_binary_url }}"
+ dest: /opt/starkingdoms-backplane/starkingdoms-backplane
+ mode: '0777'
+ - name: Start backplane server
+ ansible.builtin.command:
+ cmd: sv start starkingdoms-backplane
+ become: true<
\ No newline at end of file
A ansible/global/backplane.yml => ansible/global/backplane.yml +21 -0
@@ 0,0 1,21 @@
+backplaneservers:
+ hosts:
+ backplane.starkingdoms.io:
+ ansible_password: !vault |
+ $ANSIBLE_VAULT;1.1;AES256
+ 33613063633464623864346239346332383035366462393733643765376464363330326464353761
+ 3138363931396161326338313836303931643066316231650a383134383431316265623763613739
+ 39336332346130343133613831343533306435396337383663363561623831653230663036343463
+ 3531386332663837340a363737386338623765326330383738643031623734616538653236623131
+ 36323438343633323838333961616266643263343334366334346631656363383033383364366262
+ 6636386161313530646564363131346266393061386563303132
+ ansible_become_password: !vault |
+ $ANSIBLE_VAULT;1.1;AES256
+ 33613063633464623864346239346332383035366462393733643765376464363330326464353761
+ 3138363931396161326338313836303931643066316231650a383134383431316265623763613739
+ 39336332346130343133613831343533306435396337383663363561623831653230663036343463
+ 3531386332663837340a363737386338623765326330383738643031623734616538653236623131
+ 36323438343633323838333961616266643263343334366334346631656363383033383364366262
+ 6636386161313530646564363131346266393061386563303132
+ vars:
+ ansible_user: team<
\ No newline at end of file
M server/Cargo.toml => server/Cargo.toml +2 -0
@@ 2,6 2,7 @@
name = "starkingdoms-server"
version = "0.0.1"
edition = "2021"
+license = "AGPL-3"
[dependencies]
bevy = { version = "0.12", default-features = false }
@@ 11,3 12,4 @@ bevy_twite = { git = "https://gitlab.com/ghostlyzsh/twite.git" }
bevy_rapier2d = "0.23.0"
rand = "0.8.5"
tracing-subscriber = "0.3"
+starkingdoms-common = { version = "0.1", path = "../starkingdoms-common" }<
\ No newline at end of file
M server/src/component.rs => server/src/component.rs +15 -0
@@ 1,3 1,18 @@
+// StarKingdoms.IO, a browser game about drifting through space
+// Copyright (C) 2023 ghostly_zsh, TerraMaster85, core
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
use std::net::SocketAddr;
use bevy::prelude::*;
M server/src/macros.rs => server/src/macros.rs +15 -0
@@ 1,3 1,18 @@
+// StarKingdoms.IO, a browser game about drifting through space
+// Copyright (C) 2023 ghostly_zsh, TerraMaster85, core
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
#[macro_export]
macro_rules! err_or_cont {
($expr:expr) => {
M server/src/main.rs => server/src/main.rs +15 -0
@@ 1,3 1,18 @@
+// StarKingdoms.IO, a browser game about drifting through space
+// Copyright (C) 2023 ghostly_zsh, TerraMaster85, core
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
use std::net::Ipv4Addr;
use crate::mathutil::rot2d;
M server/src/mathutil.rs => server/src/mathutil.rs +15 -0
@@ 1,3 1,18 @@
+// StarKingdoms.IO, a browser game about drifting through space
+// Copyright (C) 2023 ghostly_zsh, TerraMaster85, core
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
use bevy::math::{vec2, Vec2, Vec3};
pub fn rot2d(uncast: Vec2, angle: f32) -> Vec2 {
M server/src/packet.rs => server/src/packet.rs +15 -0
@@ 1,3 1,18 @@
+// StarKingdoms.IO, a browser game about drifting through space
+// Copyright (C) 2023 ghostly_zsh, TerraMaster85, core
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
use crate::component::{PartType, PlanetType};
use serde::{Deserialize, Serialize};
D starkingdoms-api/Cargo.lock => starkingdoms-api/Cargo.lock +0 -2436
@@ 1,2436 0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 3
-
-[[package]]
-name = "actix-codec"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "617a8268e3537fe1d8c9ead925fca49ef6400927ee7bc26750e90ecee14ce4b8"
-dependencies = [
- "bitflags 1.3.2",
- "bytes",
- "futures-core",
- "futures-sink",
- "memchr",
- "pin-project-lite",
- "tokio",
- "tokio-util",
- "tracing",
-]
-
-[[package]]
-name = "actix-cors"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b340e9cfa5b08690aae90fb61beb44e9b06f44fe3d0f93781aaa58cfba86245e"
-dependencies = [
- "actix-utils",
- "actix-web",
- "derive_more",
- "futures-util",
- "log",
- "once_cell",
- "smallvec",
-]
-
-[[package]]
-name = "actix-http"
-version = "3.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a92ef85799cba03f76e4f7c10f533e66d87c9a7e7055f3391f09000ad8351bc9"
-dependencies = [
- "actix-codec",
- "actix-rt",
- "actix-service",
- "actix-utils",
- "ahash",
- "base64 0.21.4",
- "bitflags 2.4.0",
- "brotli",
- "bytes",
- "bytestring",
- "derive_more",
- "encoding_rs",
- "flate2",
- "futures-core",
- "h2",
- "http",
- "httparse",
- "httpdate",
- "itoa",
- "language-tags",
- "local-channel",
- "mime",
- "percent-encoding",
- "pin-project-lite",
- "rand",
- "sha1",
- "smallvec",
- "tokio",
- "tokio-util",
- "tracing",
- "zstd",
-]
-
-[[package]]
-name = "actix-macros"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb"
-dependencies = [
- "quote",
- "syn 2.0.38",
-]
-
-[[package]]
-name = "actix-router"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d66ff4d247d2b160861fa2866457e85706833527840e4133f8f49aa423a38799"
-dependencies = [
- "bytestring",
- "http",
- "regex",
- "serde",
- "tracing",
-]
-
-[[package]]
-name = "actix-rt"
-version = "2.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28f32d40287d3f402ae0028a9d54bef51af15c8769492826a69d28f81893151d"
-dependencies = [
- "futures-core",
- "tokio",
-]
-
-[[package]]
-name = "actix-server"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3eb13e7eef0423ea6eab0e59f6c72e7cb46d33691ad56a726b3cd07ddec2c2d4"
-dependencies = [
- "actix-rt",
- "actix-service",
- "actix-utils",
- "futures-core",
- "futures-util",
- "mio",
- "socket2 0.5.4",
- "tokio",
- "tracing",
-]
-
-[[package]]
-name = "actix-service"
-version = "2.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b894941f818cfdc7ccc4b9e60fa7e53b5042a2e8567270f9147d5591893373a"
-dependencies = [
- "futures-core",
- "paste",
- "pin-project-lite",
-]
-
-[[package]]
-name = "actix-utils"
-version = "3.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8"
-dependencies = [
- "local-waker",
- "pin-project-lite",
-]
-
-[[package]]
-name = "actix-web"
-version = "4.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0e4a5b5e29603ca8c94a77c65cf874718ceb60292c5a5c3e5f4ace041af462b9"
-dependencies = [
- "actix-codec",
- "actix-http",
- "actix-macros",
- "actix-router",
- "actix-rt",
- "actix-server",
- "actix-service",
- "actix-utils",
- "actix-web-codegen",
- "ahash",
- "bytes",
- "bytestring",
- "cfg-if",
- "cookie",
- "derive_more",
- "encoding_rs",
- "futures-core",
- "futures-util",
- "itoa",
- "language-tags",
- "log",
- "mime",
- "once_cell",
- "pin-project-lite",
- "regex",
- "serde",
- "serde_json",
- "serde_urlencoded",
- "smallvec",
- "socket2 0.5.4",
- "time",
- "url",
-]
-
-[[package]]
-name = "actix-web-codegen"
-version = "4.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eb1f50ebbb30eca122b188319a4398b3f7bb4a8cdf50ecfb73bfc6a3c3ce54f5"
-dependencies = [
- "actix-router",
- "proc-macro2",
- "quote",
- "syn 2.0.38",
-]
-
-[[package]]
-name = "addr2line"
-version = "0.21.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb"
-dependencies = [
- "gimli",
-]
-
-[[package]]
-name = "adler"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
-
-[[package]]
-name = "ahash"
-version = "0.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f"
-dependencies = [
- "cfg-if",
- "getrandom",
- "once_cell",
- "version_check",
-]
-
-[[package]]
-name = "aho-corasick"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "alloc-no-stdlib"
-version = "2.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3"
-
-[[package]]
-name = "alloc-stdlib"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece"
-dependencies = [
- "alloc-no-stdlib",
-]
-
-[[package]]
-name = "android-tzdata"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
-
-[[package]]
-name = "android_system_properties"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "argon2"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17ba4cac0a46bc1d2912652a751c47f2a9f3a7fe89bcae2275d418f5270402f9"
-dependencies = [
- "base64ct",
- "blake2",
- "cpufeatures",
- "password-hash",
-]
-
-[[package]]
-name = "async-trait"
-version = "0.1.74"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.38",
-]
-
-[[package]]
-name = "autocfg"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
-
-[[package]]
-name = "backtrace"
-version = "0.3.69"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837"
-dependencies = [
- "addr2line",
- "cc",
- "cfg-if",
- "libc",
- "miniz_oxide",
- "object",
- "rustc-demangle",
-]
-
-[[package]]
-name = "base64"
-version = "0.13.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
-
-[[package]]
-name = "base64"
-version = "0.21.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2"
-
-[[package]]
-name = "base64ct"
-version = "1.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
-
-[[package]]
-name = "better-panic"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6fa9e1d11a268684cbd90ed36370d7577afb6c62d912ddff5c15fc34343e5036"
-dependencies = [
- "backtrace",
- "console",
-]
-
-[[package]]
-name = "bitflags"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
-
-[[package]]
-name = "bitflags"
-version = "2.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635"
-
-[[package]]
-name = "bitvec"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c"
-dependencies = [
- "funty",
- "radium",
- "tap",
- "wyz",
-]
-
-[[package]]
-name = "blake2"
-version = "0.10.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
-dependencies = [
- "digest",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.10.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
-dependencies = [
- "generic-array",
-]
-
-[[package]]
-name = "brotli"
-version = "3.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f"
-dependencies = [
- "alloc-no-stdlib",
- "alloc-stdlib",
- "brotli-decompressor",
-]
-
-[[package]]
-name = "brotli-decompressor"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da74e2b81409b1b743f8f0c62cc6254afefb8b8e50bbfe3735550f7aeefa3448"
-dependencies = [
- "alloc-no-stdlib",
- "alloc-stdlib",
-]
-
-[[package]]
-name = "bson"
-version = "2.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "58da0ae1e701ea752cc46c1bb9f39d5ecefc7395c3ecd526261a566d4f16e0c2"
-dependencies = [
- "ahash",
- "base64 0.13.1",
- "bitvec",
- "hex",
- "indexmap 1.9.3",
- "js-sys",
- "once_cell",
- "rand",
- "serde",
- "serde_bytes",
- "serde_json",
- "time",
- "uuid",
-]
-
-[[package]]
-name = "bumpalo"
-version = "3.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec"
-
-[[package]]
-name = "bytes"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223"
-
-[[package]]
-name = "bytestring"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "238e4886760d98c4f899360c834fa93e62cf7f721ac3c2da375cbdf4b8679aae"
-dependencies = [
- "bytes",
-]
-
-[[package]]
-name = "carica"
-version = "0.1.0"
-dependencies = [
- "actix-cors",
- "actix-web",
- "argon2",
- "better-panic",
- "bson",
- "hmac",
- "jwt",
- "log",
- "mongodb",
- "serde",
- "sha2",
- "simple_logger",
- "toml",
-]
-
-[[package]]
-name = "cc"
-version = "1.0.83"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0"
-dependencies = [
- "jobserver",
- "libc",
-]
-
-[[package]]
-name = "cfg-if"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
-
-[[package]]
-name = "chrono"
-version = "0.4.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38"
-dependencies = [
- "android-tzdata",
- "iana-time-zone",
- "num-traits",
- "windows-targets 0.48.5",
-]
-
-[[package]]
-name = "colored"
-version = "2.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6"
-dependencies = [
- "is-terminal",
- "lazy_static",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "console"
-version = "0.15.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8"
-dependencies = [
- "encode_unicode",
- "lazy_static",
- "libc",
- "windows-sys 0.45.0",
-]
-
-[[package]]
-name = "convert_case"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e"
-
-[[package]]
-name = "cookie"
-version = "0.16.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb"
-dependencies = [
- "percent-encoding",
- "time",
- "version_check",
-]
-
-[[package]]
-name = "core-foundation-sys"
-version = "0.8.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
-
-[[package]]
-name = "cpufeatures"
-version = "0.2.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "crc32fast"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "crypto-common"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
-dependencies = [
- "generic-array",
- "typenum",
-]
-
-[[package]]
-name = "darling"
-version = "0.13.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c"
-dependencies = [
- "darling_core",
- "darling_macro",
-]
-
-[[package]]
-name = "darling_core"
-version = "0.13.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610"
-dependencies = [
- "fnv",
- "ident_case",
- "proc-macro2",
- "quote",
- "strsim",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "darling_macro"
-version = "0.13.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835"
-dependencies = [
- "darling_core",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "data-encoding"
-version = "2.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
-
-[[package]]
-name = "deranged"
-version = "0.3.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946"
-
-[[package]]
-name = "derivative"
-version = "2.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "derive_more"
-version = "0.99.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
-dependencies = [
- "convert_case",
- "proc-macro2",
- "quote",
- "rustc_version 0.4.0",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "digest"
-version = "0.10.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
-dependencies = [
- "block-buffer",
- "crypto-common",
- "subtle",
-]
-
-[[package]]
-name = "encode_unicode"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
-
-[[package]]
-name = "encoding_rs"
-version = "0.8.33"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "enum-as-inner"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73"
-dependencies = [
- "heck",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "equivalent"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
-
-[[package]]
-name = "errno"
-version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860"
-dependencies = [
- "libc",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "finl_unicode"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6"
-
-[[package]]
-name = "flate2"
-version = "1.0.27"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010"
-dependencies = [
- "crc32fast",
- "miniz_oxide",
-]
-
-[[package]]
-name = "fnv"
-version = "1.0.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
-
-[[package]]
-name = "form_urlencoded"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652"
-dependencies = [
- "percent-encoding",
-]
-
-[[package]]
-name = "funty"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c"
-
-[[package]]
-name = "futures-channel"
-version = "0.3.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2"
-dependencies = [
- "futures-core",
-]
-
-[[package]]
-name = "futures-core"
-version = "0.3.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c"
-
-[[package]]
-name = "futures-executor"
-version = "0.3.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0"
-dependencies = [
- "futures-core",
- "futures-task",
- "futures-util",
-]
-
-[[package]]
-name = "futures-io"
-version = "0.3.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964"
-
-[[package]]
-name = "futures-macro"
-version = "0.3.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.38",
-]
-
-[[package]]
-name = "futures-sink"
-version = "0.3.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e"
-
-[[package]]
-name = "futures-task"
-version = "0.3.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65"
-
-[[package]]
-name = "futures-util"
-version = "0.3.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533"
-dependencies = [
- "futures-core",
- "futures-io",
- "futures-macro",
- "futures-task",
- "memchr",
- "pin-project-lite",
- "pin-utils",
- "slab",
-]
-
-[[package]]
-name = "generic-array"
-version = "0.14.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
-dependencies = [
- "typenum",
- "version_check",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.2.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427"
-dependencies = [
- "cfg-if",
- "libc",
- "wasi",
-]
-
-[[package]]
-name = "gimli"
-version = "0.28.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0"
-
-[[package]]
-name = "h2"
-version = "0.3.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833"
-dependencies = [
- "bytes",
- "fnv",
- "futures-core",
- "futures-sink",
- "futures-util",
- "http",
- "indexmap 1.9.3",
- "slab",
- "tokio",
- "tokio-util",
- "tracing",
-]
-
-[[package]]
-name = "hashbrown"
-version = "0.12.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
-
-[[package]]
-name = "hashbrown"
-version = "0.14.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156"
-
-[[package]]
-name = "heck"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
-
-[[package]]
-name = "hermit-abi"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7"
-
-[[package]]
-name = "hex"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
-
-[[package]]
-name = "hmac"
-version = "0.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
-dependencies = [
- "digest",
-]
-
-[[package]]
-name = "hostname"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867"
-dependencies = [
- "libc",
- "match_cfg",
- "winapi",
-]
-
-[[package]]
-name = "http"
-version = "0.2.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482"
-dependencies = [
- "bytes",
- "fnv",
- "itoa",
-]
-
-[[package]]
-name = "httparse"
-version = "1.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"
-
-[[package]]
-name = "httpdate"
-version = "1.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
-
-[[package]]
-name = "iana-time-zone"
-version = "0.1.58"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20"
-dependencies = [
- "android_system_properties",
- "core-foundation-sys",
- "iana-time-zone-haiku",
- "js-sys",
- "wasm-bindgen",
- "windows-core",
-]
-
-[[package]]
-name = "iana-time-zone-haiku"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
-dependencies = [
- "cc",
-]
-
-[[package]]
-name = "ident_case"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
-
-[[package]]
-name = "idna"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8"
-dependencies = [
- "matches",
- "unicode-bidi",
- "unicode-normalization",
-]
-
-[[package]]
-name = "idna"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c"
-dependencies = [
- "unicode-bidi",
- "unicode-normalization",
-]
-
-[[package]]
-name = "indexmap"
-version = "1.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
-dependencies = [
- "autocfg",
- "hashbrown 0.12.3",
-]
-
-[[package]]
-name = "indexmap"
-version = "2.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897"
-dependencies = [
- "equivalent",
- "hashbrown 0.14.2",
-]
-
-[[package]]
-name = "ipconfig"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f"
-dependencies = [
- "socket2 0.5.4",
- "widestring",
- "windows-sys 0.48.0",
- "winreg",
-]
-
-[[package]]
-name = "ipnet"
-version = "2.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3"
-
-[[package]]
-name = "is-terminal"
-version = "0.4.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
-dependencies = [
- "hermit-abi",
- "rustix",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "itoa"
-version = "1.0.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
-
-[[package]]
-name = "jobserver"
-version = "0.1.27"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "js-sys"
-version = "0.3.64"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a"
-dependencies = [
- "wasm-bindgen",
-]
-
-[[package]]
-name = "jwt"
-version = "0.16.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6204285f77fe7d9784db3fdc449ecce1a0114927a51d5a41c4c7a292011c015f"
-dependencies = [
- "base64 0.13.1",
- "crypto-common",
- "digest",
- "hmac",
- "serde",
- "serde_json",
- "sha2",
-]
-
-[[package]]
-name = "language-tags"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388"
-
-[[package]]
-name = "lazy_static"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
-
-[[package]]
-name = "libc"
-version = "0.2.149"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b"
-
-[[package]]
-name = "linked-hash-map"
-version = "0.5.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
-
-[[package]]
-name = "linux-raw-sys"
-version = "0.4.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f"
-
-[[package]]
-name = "local-channel"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e0a493488de5f18c8ffcba89eebb8532ffc562dc400490eb65b84893fae0b178"
-dependencies = [
- "futures-core",
- "futures-sink",
- "local-waker",
-]
-
-[[package]]
-name = "local-waker"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e34f76eb3611940e0e7d53a9aaa4e6a3151f69541a282fd0dad5571420c53ff1"
-
-[[package]]
-name = "lock_api"
-version = "0.4.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16"
-dependencies = [
- "autocfg",
- "scopeguard",
-]
-
-[[package]]
-name = "log"
-version = "0.4.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
-
-[[package]]
-name = "lru-cache"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c"
-dependencies = [
- "linked-hash-map",
-]
-
-[[package]]
-name = "match_cfg"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4"
-
-[[package]]
-name = "matches"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5"
-
-[[package]]
-name = "md-5"
-version = "0.10.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf"
-dependencies = [
- "cfg-if",
- "digest",
-]
-
-[[package]]
-name = "memchr"
-version = "2.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
-
-[[package]]
-name = "mime"
-version = "0.3.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
-
-[[package]]
-name = "miniz_oxide"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7"
-dependencies = [
- "adler",
-]
-
-[[package]]
-name = "mio"
-version = "0.8.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2"
-dependencies = [
- "libc",
- "log",
- "wasi",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "mongodb"
-version = "2.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e22d517e7e678e1c9a2983ec704b43f3b22f38b1b7a247ea3ddb36d21578bf4e"
-dependencies = [
- "async-trait",
- "base64 0.13.1",
- "bitflags 1.3.2",
- "bson",
- "chrono",
- "derivative",
- "derive_more",
- "futures-core",
- "futures-executor",
- "futures-io",
- "futures-util",
- "hex",
- "hmac",
- "lazy_static",
- "md-5",
- "pbkdf2",
- "percent-encoding",
- "rand",
- "rustc_version_runtime",
- "rustls",
- "rustls-pemfile",
- "serde",
- "serde_bytes",
- "serde_with",
- "sha-1",
- "sha2",
- "socket2 0.4.10",
- "stringprep",
- "strsim",
- "take_mut",
- "thiserror",
- "tokio",
- "tokio-rustls",
- "tokio-util",
- "trust-dns-proto",
- "trust-dns-resolver",
- "typed-builder",
- "uuid",
- "webpki-roots",
-]
-
-[[package]]
-name = "num-traits"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "num_cpus"
-version = "1.16.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
-dependencies = [
- "hermit-abi",
- "libc",
-]
-
-[[package]]
-name = "num_threads"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "object"
-version = "0.32.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "once_cell"
-version = "1.18.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
-
-[[package]]
-name = "parking_lot"
-version = "0.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
-dependencies = [
- "lock_api",
- "parking_lot_core",
-]
-
-[[package]]
-name = "parking_lot_core"
-version = "0.9.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447"
-dependencies = [
- "cfg-if",
- "libc",
- "redox_syscall",
- "smallvec",
- "windows-targets 0.48.5",
-]
-
-[[package]]
-name = "password-hash"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166"
-dependencies = [
- "base64ct",
- "rand_core",
- "subtle",
-]
-
-[[package]]
-name = "paste"
-version = "1.0.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c"
-
-[[package]]
-name = "pbkdf2"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917"
-dependencies = [
- "digest",
-]
-
-[[package]]
-name = "percent-encoding"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94"
-
-[[package]]
-name = "pin-project-lite"
-version = "0.2.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58"
-
-[[package]]
-name = "pin-utils"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-
-[[package]]
-name = "pkg-config"
-version = "0.3.27"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
-
-[[package]]
-name = "ppv-lite86"
-version = "0.2.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.69"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "quick-error"
-version = "1.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
-
-[[package]]
-name = "quote"
-version = "1.0.33"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "radium"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
-
-[[package]]
-name = "rand"
-version = "0.8.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
-dependencies = [
- "libc",
- "rand_chacha",
- "rand_core",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
-dependencies = [
- "ppv-lite86",
- "rand_core",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
-dependencies = [
- "getrandom",
-]
-
-[[package]]
-name = "redox_syscall"
-version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
-dependencies = [
- "bitflags 1.3.2",
-]
-
-[[package]]
-name = "regex"
-version = "1.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d119d7c7ca818f8a53c300863d4f87566aac09943aef5b355bb83969dae75d87"
-dependencies = [
- "aho-corasick",
- "memchr",
- "regex-automata",
- "regex-syntax",
-]
-
-[[package]]
-name = "regex-automata"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "465c6fc0621e4abc4187a2bda0937bfd4f722c2730b29562e19689ea796c9a4b"
-dependencies = [
- "aho-corasick",
- "memchr",
- "regex-syntax",
-]
-
-[[package]]
-name = "regex-syntax"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3cbb081b9784b07cceb8824c8583f86db4814d172ab043f3c23f7dc600bf83d"
-
-[[package]]
-name = "resolv-conf"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00"
-dependencies = [
- "hostname",
- "quick-error",
-]
-
-[[package]]
-name = "ring"
-version = "0.16.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc"
-dependencies = [
- "cc",
- "libc",
- "once_cell",
- "spin",
- "untrusted",
- "web-sys",
- "winapi",
-]
-
-[[package]]
-name = "rustc-demangle"
-version = "0.1.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
-
-[[package]]
-name = "rustc_version"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
-dependencies = [
- "semver 0.9.0",
-]
-
-[[package]]
-name = "rustc_version"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
-dependencies = [
- "semver 1.0.20",
-]
-
-[[package]]
-name = "rustc_version_runtime"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d31b7153270ebf48bf91c65ae5b0c00e749c4cfad505f66530ac74950249582f"
-dependencies = [
- "rustc_version 0.2.3",
- "semver 0.9.0",
-]
-
-[[package]]
-name = "rustix"
-version = "0.38.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a74ee2d7c2581cd139b42447d7d9389b889bdaad3a73f1ebb16f2a3237bb19c"
-dependencies = [
- "bitflags 2.4.0",
- "errno",
- "libc",
- "linux-raw-sys",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "rustls"
-version = "0.21.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8"
-dependencies = [
- "log",
- "ring",
- "rustls-webpki",
- "sct",
-]
-
-[[package]]
-name = "rustls-pemfile"
-version = "1.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2"
-dependencies = [
- "base64 0.21.4",
-]
-
-[[package]]
-name = "rustls-webpki"
-version = "0.101.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe"
-dependencies = [
- "ring",
- "untrusted",
-]
-
-[[package]]
-name = "ryu"
-version = "1.0.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741"
-
-[[package]]
-name = "scopeguard"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
-
-[[package]]
-name = "sct"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4"
-dependencies = [
- "ring",
- "untrusted",
-]
-
-[[package]]
-name = "semver"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
-dependencies = [
- "semver-parser",
-]
-
-[[package]]
-name = "semver"
-version = "1.0.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090"
-
-[[package]]
-name = "semver-parser"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
-
-[[package]]
-name = "serde"
-version = "1.0.188"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e"
-dependencies = [
- "serde_derive",
-]
-
-[[package]]
-name = "serde_bytes"
-version = "0.11.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "serde_derive"
-version = "1.0.188"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.38",
-]
-
-[[package]]
-name = "serde_json"
-version = "1.0.107"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65"
-dependencies = [
- "indexmap 2.0.2",
- "itoa",
- "ryu",
- "serde",
-]
-
-[[package]]
-name = "serde_spanned"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "serde_urlencoded"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
-dependencies = [
- "form_urlencoded",
- "itoa",
- "ryu",
- "serde",
-]
-
-[[package]]
-name = "serde_with"
-version = "1.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff"
-dependencies = [
- "serde",
- "serde_with_macros",
-]
-
-[[package]]
-name = "serde_with_macros"
-version = "1.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082"
-dependencies = [
- "darling",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "sha-1"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "digest",
-]
-
-[[package]]
-name = "sha1"
-version = "0.10.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "digest",
-]
-
-[[package]]
-name = "sha2"
-version = "0.10.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "digest",
-]
-
-[[package]]
-name = "signal-hook-registry"
-version = "1.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "simple_logger"
-version = "4.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2230cd5c29b815c9b699fb610b49a5ed65588f3509d9f0108be3a885da629333"
-dependencies = [
- "colored",
- "log",
- "time",
- "windows-sys 0.42.0",
-]
-
-[[package]]
-name = "slab"
-version = "0.4.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "smallvec"
-version = "1.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a"
-
-[[package]]
-name = "socket2"
-version = "0.4.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "socket2"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e"
-dependencies = [
- "libc",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "spin"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
-
-[[package]]
-name = "stringprep"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6"
-dependencies = [
- "finl_unicode",
- "unicode-bidi",
- "unicode-normalization",
-]
-
-[[package]]
-name = "strsim"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
-
-[[package]]
-name = "subtle"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
-
-[[package]]
-name = "syn"
-version = "1.0.109"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "syn"
-version = "2.0.38"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "take_mut"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60"
-
-[[package]]
-name = "tap"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
-
-[[package]]
-name = "thiserror"
-version = "1.0.50"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "1.0.50"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.38",
-]
-
-[[package]]
-name = "time"
-version = "0.3.29"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe"
-dependencies = [
- "deranged",
- "itoa",
- "libc",
- "num_threads",
- "serde",
- "time-core",
- "time-macros",
-]
-
-[[package]]
-name = "time-core"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
-
-[[package]]
-name = "time-macros"
-version = "0.2.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20"
-dependencies = [
- "time-core",
-]
-
-[[package]]
-name = "tinyvec"
-version = "1.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
-dependencies = [
- "tinyvec_macros",
-]
-
-[[package]]
-name = "tinyvec_macros"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
-
-[[package]]
-name = "tokio"
-version = "1.33.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653"
-dependencies = [
- "backtrace",
- "bytes",
- "libc",
- "mio",
- "num_cpus",
- "parking_lot",
- "pin-project-lite",
- "signal-hook-registry",
- "socket2 0.5.4",
- "tokio-macros",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "tokio-macros"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.38",
-]
-
-[[package]]
-name = "tokio-rustls"
-version = "0.24.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081"
-dependencies = [
- "rustls",
- "tokio",
-]
-
-[[package]]
-name = "tokio-util"
-version = "0.7.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d"
-dependencies = [
- "bytes",
- "futures-core",
- "futures-io",
- "futures-sink",
- "pin-project-lite",
- "tokio",
- "tracing",
-]
-
-[[package]]
-name = "toml"
-version = "0.8.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ef75d881185fd2df4a040793927c153d863651108a93c7e17a9e591baa95cc6"
-dependencies = [
- "serde",
- "serde_spanned",
- "toml_datetime",
- "toml_edit",
-]
-
-[[package]]
-name = "toml_datetime"
-version = "0.6.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "toml_edit"
-version = "0.20.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "380f9e8120405471f7c9ad1860a713ef5ece6a670c7eae39225e477340f32fc4"
-dependencies = [
- "indexmap 2.0.2",
- "serde",
- "serde_spanned",
- "toml_datetime",
- "winnow",
-]
-
-[[package]]
-name = "tracing"
-version = "0.1.37"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
-dependencies = [
- "cfg-if",
- "log",
- "pin-project-lite",
- "tracing-core",
-]
-
-[[package]]
-name = "tracing-core"
-version = "0.1.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a"
-dependencies = [
- "once_cell",
-]
-
-[[package]]
-name = "trust-dns-proto"
-version = "0.21.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c31f240f59877c3d4bb3b3ea0ec5a6a0cff07323580ff8c7a605cd7d08b255d"
-dependencies = [
- "async-trait",
- "cfg-if",
- "data-encoding",
- "enum-as-inner",
- "futures-channel",
- "futures-io",
- "futures-util",
- "idna 0.2.3",
- "ipnet",
- "lazy_static",
- "log",
- "rand",
- "smallvec",
- "thiserror",
- "tinyvec",
- "tokio",
- "url",
-]
-
-[[package]]
-name = "trust-dns-resolver"
-version = "0.21.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e4ba72c2ea84515690c9fcef4c6c660bb9df3036ed1051686de84605b74fd558"
-dependencies = [
- "cfg-if",
- "futures-util",
- "ipconfig",
- "lazy_static",
- "log",
- "lru-cache",
- "parking_lot",
- "resolv-conf",
- "smallvec",
- "thiserror",
- "tokio",
- "trust-dns-proto",
-]
-
-[[package]]
-name = "typed-builder"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89851716b67b937e393b3daa8423e67ddfc4bbbf1654bcf05488e95e0828db0c"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "typenum"
-version = "1.17.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
-
-[[package]]
-name = "unicode-bidi"
-version = "0.3.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460"
-
-[[package]]
-name = "unicode-ident"
-version = "1.0.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
-
-[[package]]
-name = "unicode-normalization"
-version = "0.1.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921"
-dependencies = [
- "tinyvec",
-]
-
-[[package]]
-name = "untrusted"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
-
-[[package]]
-name = "url"
-version = "2.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5"
-dependencies = [
- "form_urlencoded",
- "idna 0.4.0",
- "percent-encoding",
-]
-
-[[package]]
-name = "uuid"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc"
-dependencies = [
- "getrandom",
- "serde",
-]
-
-[[package]]
-name = "version_check"
-version = "0.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
-
-[[package]]
-name = "wasi"
-version = "0.11.0+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
-
-[[package]]
-name = "wasm-bindgen"
-version = "0.2.87"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342"
-dependencies = [
- "cfg-if",
- "wasm-bindgen-macro",
-]
-
-[[package]]
-name = "wasm-bindgen-backend"
-version = "0.2.87"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd"
-dependencies = [
- "bumpalo",
- "log",
- "once_cell",
- "proc-macro2",
- "quote",
- "syn 2.0.38",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-macro"
-version = "0.2.87"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d"
-dependencies = [
- "quote",
- "wasm-bindgen-macro-support",
-]
-
-[[package]]
-name = "wasm-bindgen-macro-support"
-version = "0.2.87"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.38",
- "wasm-bindgen-backend",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-shared"
-version = "0.2.87"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1"
-
-[[package]]
-name = "web-sys"
-version = "0.3.64"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "webpki-roots"
-version = "0.25.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc"
-
-[[package]]
-name = "widestring"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8"
-
-[[package]]
-name = "winapi"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
-dependencies = [
- "winapi-i686-pc-windows-gnu",
- "winapi-x86_64-pc-windows-gnu",
-]
-
-[[package]]
-name = "winapi-i686-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
-
-[[package]]
-name = "winapi-x86_64-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
-
-[[package]]
-name = "windows-core"
-version = "0.51.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64"
-dependencies = [
- "windows-targets 0.48.5",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.42.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
-dependencies = [
- "windows_aarch64_gnullvm 0.42.2",
- "windows_aarch64_msvc 0.42.2",
- "windows_i686_gnu 0.42.2",
- "windows_i686_msvc 0.42.2",
- "windows_x86_64_gnu 0.42.2",
- "windows_x86_64_gnullvm 0.42.2",
- "windows_x86_64_msvc 0.42.2",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.45.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
-dependencies = [
- "windows-targets 0.42.2",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
-dependencies = [
- "windows-targets 0.48.5",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071"
-dependencies = [
- "windows_aarch64_gnullvm 0.42.2",
- "windows_aarch64_msvc 0.42.2",
- "windows_i686_gnu 0.42.2",
- "windows_i686_msvc 0.42.2",
- "windows_x86_64_gnu 0.42.2",
- "windows_x86_64_gnullvm 0.42.2",
- "windows_x86_64_msvc 0.42.2",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
-dependencies = [
- "windows_aarch64_gnullvm 0.48.5",
- "windows_aarch64_msvc 0.48.5",
- "windows_i686_gnu 0.48.5",
- "windows_i686_msvc 0.48.5",
- "windows_x86_64_gnu 0.48.5",
- "windows_x86_64_gnullvm 0.48.5",
- "windows_x86_64_msvc 0.48.5",
-]
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.42.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
-
-[[package]]
-name = "winnow"
-version = "0.5.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "winreg"
-version = "0.50.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1"
-dependencies = [
- "cfg-if",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "wyz"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed"
-dependencies = [
- "tap",
-]
-
-[[package]]
-name = "zstd"
-version = "0.12.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c"
-dependencies = [
- "zstd-safe",
-]
-
-[[package]]
-name = "zstd-safe"
-version = "6.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581"
-dependencies = [
- "libc",
- "zstd-sys",
-]
-
-[[package]]
-name = "zstd-sys"
-version = "2.0.8+zstd.1.5.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c"
-dependencies = [
- "cc",
- "libc",
- "pkg-config",
-]
D starkingdoms-api/src/config.rs => starkingdoms-api/src/config.rs +0 -8
@@ 1,8 0,0 @@
-use serde::{Deserialize, Serialize};
-
-#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
-pub struct Config {
- pub application_key: String,
- pub mongodb_url: String,
- pub mongodb_database: String,
-}
D starkingdoms-api/src/main.rs => starkingdoms-api/src/main.rs +0 -136
@@ 1,136 0,0 @@
-use crate::config::Config;
-use crate::error::APIErrorResponse;
-use actix_web::middleware::Logger;
-use actix_web::web::{Data, JsonConfig};
-use actix_web::{App, Error, HttpResponse, HttpServer};
-use actix_web_prom::PrometheusMetricsBuilder;
-use hmac::digest::KeyInit;
-use hmac::Hmac;
-use log::{error, info};
-use mongodb::options::{ClientOptions, ResolverConfig};
-use mongodb::Client;
-use sha2::Sha256;
-use std::fs;
-use std::path::PathBuf;
-
-pub mod error;
-#[macro_use]
-pub mod macros;
-pub mod config;
-pub mod response;
-pub mod tokens;
-
-#[derive(Clone)]
-pub struct AppState {
- pub key: Hmac<Sha256>,
- pub config: Config,
- pub db: Client,
-}
-
-#[actix_web::main]
-async fn main() -> Result<(), Box<dyn std::error::Error>> {
- better_panic::install();
- simple_logger::init_with_env().unwrap();
-
- // load config
- let mut args = std::env::args();
-
- let config_path = match args.nth(1) {
- Some(path) => path,
- None => {
- eprintln!("usage: starkingdoms-api <config_path>");
- std::process::exit(1);
- }
- };
-
- let config_pathbuf = PathBuf::from(config_path);
-
- info!(
- "StarKingdoms API v{} starting up",
- env!("CARGO_PKG_VERSION")
- );
- info!("Loading config from {}", config_pathbuf.display());
-
- let config_str = match fs::read_to_string(&config_pathbuf) {
- Ok(c_str) => c_str,
- Err(e) => {
- error!(
- "Error loading configuration from {}: {}",
- config_pathbuf.display(),
- e
- );
- std::process::exit(1);
- }
- };
-
- let config: Config = match toml::from_str(&config_str) {
- Ok(config) => config,
- Err(e) => {
- error!(
- "Error parsing configuration in {}: {}",
- config_pathbuf.display(),
- e
- );
- std::process::exit(1);
- }
- };
-
- info!("Creating JWT key");
-
- let key = Hmac::new_from_slice(config.application_key.as_bytes()).unwrap();
-
- // get db from env
-
- info!("Connecting to database at {}", config.mongodb_url);
-
- let options = ClientOptions::parse_with_resolver_config(
- &config.mongodb_url,
- ResolverConfig::cloudflare(),
- )
- .await?;
- let client = Client::with_options(options)?;
-
- info!("Creating user email unique index");
-
- let state = AppState {
- key,
- config: config.clone(),
- db: client,
- };
-
- info!("Database connected, state loaded");
-
- info!("Prometheus init");
-
- let prom = PrometheusMetricsBuilder::new("starkingdoms_api")
- .endpoint("/metrics")
- .build()
- .expect("Prometheus setup failed");
-
- let server = HttpServer::new(move || {
- App::new()
- .wrap(prom.clone())
- .app_data(JsonConfig::default().error_handler(|err, _req| {
- Error::from({
- let err2: APIErrorResponse = (&err).into();
- actix_web::error::InternalError::from_response(
- err,
- HttpResponse::BadRequest().json(err2),
- )
- })
- }))
- .wrap(Logger::default())
- .app_data(Data::new(state.clone()))
- .wrap(actix_cors::Cors::permissive())
- })
- .bind(("0.0.0.0", 8080))?;
-
- info!("HttpServer created, bound");
- info!("HttpServer start");
-
- server.run().await?;
-
- info!("Goodbye!");
-
- Ok(())
-}
D starkingdoms-api/src/response.rs => starkingdoms-api/src/response.rs +0 -43
@@ 1,43 0,0 @@
-use crate::error::APIErrorResponse;
-use actix_web::body::BoxBody;
-use actix_web::error::JsonPayloadError;
-use actix_web::http::StatusCode;
-use actix_web::{HttpRequest, HttpResponse, Responder};
-use serde::Serialize;
-use std::fmt::{Debug, Display, Formatter};
-
-#[derive(Debug)]
-pub enum JsonAPIResponse<T: Serialize + Debug> {
- Error(StatusCode, APIErrorResponse),
- Success(StatusCode, SuccessResponse<T>),
-}
-
-#[derive(Serialize, Debug)]
-pub struct SuccessResponse<T: Serialize + Debug> {
- pub success: bool,
- pub data: T,
-}
-
-impl<T: Serialize + Debug> Display for JsonAPIResponse<T> {
- fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
- write!(f, "{:?}", self)
- }
-}
-
-// Transparent pass-through to Json()
-impl<T: Serialize + Debug> Responder for JsonAPIResponse<T> {
- type Body = BoxBody;
-
- fn respond_to(self, _: &HttpRequest) -> HttpResponse<Self::Body> {
- match self {
- JsonAPIResponse::Error(c, r) => match serde_json::to_string(&r) {
- Ok(body) => HttpResponse::build(c).body(body),
- Err(err) => HttpResponse::from_error(JsonPayloadError::Serialize(err)),
- },
- JsonAPIResponse::Success(c, b) => match serde_json::to_string(&b) {
- Ok(body) => HttpResponse::build(c).body(body),
- Err(err) => HttpResponse::from_error(JsonPayloadError::Serialize(err)),
- },
- }
- }
-}
D starkingdoms-api/src/routes/mod.rs => starkingdoms-api/src/routes/mod.rs +0 -1
@@ 1,1 0,0 @@
-pub mod v1;
D starkingdoms-api/src/routes/v1/mod.rs => starkingdoms-api/src/routes/v1/mod.rs +0 -1
D starkingdoms-api/src/tokens.rs => starkingdoms-api/src/tokens.rs +0 -42
@@ 1,42 0,0 @@
-use crate::AppState;
-use actix_web::HttpRequest;
-use bson::doc;
-use jwt::VerifyWithKey;
-use std::error::Error;
-use std::time::SystemTime;
-pub async fn enforce_session(req: &HttpRequest, state: &AppState) -> Result<(), Box<dyn Error>> {
- let header = req
- .headers()
- .get("Authorization")
- .ok_or("Missing authorization header")?;
- let authorization = header.to_str()?;
-
- let authorization_split: Vec<&str> = authorization.split(' ').collect();
- if authorization_split[0] != "Bearer" {
- return Err("Not a bearer token".into());
- }
- let token_str = authorization_split[1];
-
- /*let token: UserToken = token_str.verify_with_key(&state.key)?;
-
- if SystemTime::now() > token.expires {
- return Err("expired".into());
- }
-
- // fetch the user from the db
- let user = state
- .db
- .database(&state.config.mongodb_database)
- .collection::<User>("users")
- .find_one(doc! {"_id": token.id}, None)
- .await?;
-
- if let Some(user) = user {
- Ok(user)
- } else {
- Err("user not found".into())
- }
-
- */
- Ok(())
-}
A starkingdoms-backplane/.env => starkingdoms-backplane/.env +1 -0
@@ 0,0 1,1 @@
+DATABASE_URL=postgres://postgres:postgres@localhost/stkapi<
\ No newline at end of file
R starkingdoms-api/Cargo.toml => starkingdoms-backplane/Cargo.toml +18 -15
@@ 1,26 1,29 @@
[package]
-name = "starkingdoms-api"
-version = "0.1.0"
+name = "starkingdoms-backplane"
+version = "0.0.1"
+authors = ["core <core@e3t.cc>"]
edition = "2021"
+description = "The backplane (auth) server that powers StarKingdoms"
+license = "AGPL-3"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
actix-web = "4"
+actix-cors = "0.6"
serde = { version = "1", features = ["derive"] }
+serde_json = "1"
+toml = "0.8"
log = "0.4"
-simple_logger = "4"
-better-panic = "0.3"
-jwt = "0.16"
-hmac = "0.12"
-sha2 = "0.10"
+env_logger = "0.10"
+diesel = { version = "2", features = ["serde_json"] }
+diesel-async = { version = "0.4", features = ["postgres", "bb8", "async-connection-wrapper"] }
+diesel_migrations = "2"
+bb8 = "0.8"
+rand = "0.8"
argon2 = "0.5"
password-hash = "0.5"
-actix-cors = "0.6"
-mongodb = "2.7"
-bson = "2.7"
-toml = "0.8"
-serde_json = "1"
-actix-web-prom = "0.7"
-prometheus = "0.13"
-futures-util = "0.3">
\ No newline at end of file
+rs-snowflake = "0.6"
+jwt = "0.16"
+sha2 = "0.10"
+hmac = "0.12"<
\ No newline at end of file
A starkingdoms-backplane/build.rs => starkingdoms-backplane/build.rs +18 -0
@@ 0,0 1,18 @@
+// StarKingdoms.IO, a browser game about drifting through space
+// Copyright (C) 2023 ghostly_zsh, TerraMaster85, core
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+fn main() {
+ println!("cargo:rerun-if-changed=migrations")
+}
A starkingdoms-backplane/diesel.toml => starkingdoms-backplane/diesel.toml +9 -0
@@ 0,0 1,9 @@
+# For documentation on how to configure this file,
+# see https://diesel.rs/guides/configuring-diesel-cli
+
+[print_schema]
+file = "src/schema.rs"
+custom_type_derives = ["diesel::query_builder::QueryId"]
+
+[migrations_directory]
+dir = "migrations"
A starkingdoms-backplane/migrations/.keep => starkingdoms-backplane/migrations/.keep +0 -0
A starkingdoms-backplane/migrations/00000000000000_diesel_initial_setup/down.sql => starkingdoms-backplane/migrations/00000000000000_diesel_initial_setup/down.sql +6 -0
@@ 0,0 1,6 @@
+-- This file was automatically created by Diesel to setup helper functions
+-- and other internal bookkeeping. This file is safe to edit, any future
+-- changes will be added to existing projects as new migrations.
+
+DROP FUNCTION IF EXISTS diesel_manage_updated_at(_tbl regclass);
+DROP FUNCTION IF EXISTS diesel_set_updated_at();
A starkingdoms-backplane/migrations/00000000000000_diesel_initial_setup/up.sql => starkingdoms-backplane/migrations/00000000000000_diesel_initial_setup/up.sql +36 -0
@@ 0,0 1,36 @@
+-- This file was automatically created by Diesel to setup helper functions
+-- and other internal bookkeeping. This file is safe to edit, any future
+-- changes will be added to existing projects as new migrations.
+
+
+
+
+-- Sets up a trigger for the given table to automatically set a column called
+-- `updated_at` whenever the row is modified (unless `updated_at` was included
+-- in the modified columns)
+--
+-- # Example
+--
+-- ```sql
+-- CREATE TABLE users (id SERIAL PRIMARY KEY, updated_at TIMESTAMP NOT NULL DEFAULT NOW());
+--
+-- SELECT diesel_manage_updated_at('users');
+-- ```
+CREATE OR REPLACE FUNCTION diesel_manage_updated_at(_tbl regclass) RETURNS VOID AS $$
+BEGIN
+ EXECUTE format('CREATE TRIGGER set_updated_at BEFORE UPDATE ON %s
+ FOR EACH ROW EXECUTE PROCEDURE diesel_set_updated_at()', _tbl);
+END;
+$$ LANGUAGE plpgsql;
+
+CREATE OR REPLACE FUNCTION diesel_set_updated_at() RETURNS trigger AS $$
+BEGIN
+ IF (
+ NEW IS DISTINCT FROM OLD AND
+ NEW.updated_at IS NOT DISTINCT FROM OLD.updated_at
+ ) THEN
+ NEW.updated_at := current_timestamp;
+ END IF;
+ RETURN NEW;
+END;
+$$ LANGUAGE plpgsql;
A starkingdoms-backplane/migrations/2023-11-30-013338_create_table_users/down.sql => starkingdoms-backplane/migrations/2023-11-30-013338_create_table_users/down.sql +1 -0
@@ 0,0 1,1 @@
+DROP TABLE users;<
\ No newline at end of file
A starkingdoms-backplane/migrations/2023-11-30-013338_create_table_users/up.sql => starkingdoms-backplane/migrations/2023-11-30-013338_create_table_users/up.sql +6 -0
@@ 0,0 1,6 @@
+CREATE TABLE users (
+ id BIGINT NOT NULL PRIMARY KEY,
+ username VARCHAR NOT NULL UNIQUE,
+ password_hash VARCHAR NOT NULL,
+ permission_level INT NOT NULL
+);<
\ No newline at end of file
A starkingdoms-backplane/src/auth.rs => starkingdoms-backplane/src/auth.rs +38 -0
@@ 0,0 1,38 @@
+// StarKingdoms.IO, a browser game about drifting through space
+// Copyright (C) 2023 ghostly_zsh, TerraMaster85, core
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+#[macro_export]
+macro_rules! auth {
+ ($i:expr,$c:expr) => {{
+ let authorization_hdr_value = match $i.headers().get("Authorization") {
+ Some(hdr) => hdr,
+ None => $crate::err!(
+ actix_web::http::StatusCode::UNAUTHORIZED,
+ $crate::make_err!("ERR_UNAUTHORIZED", "unauthorized")
+ ),
+ };
+ let hdr_value_split = $crate::handle_error!(authorization_hdr_value.to_str())
+ .split(' ')
+ .collect::<Vec<_>>();
+ if hdr_value_split.len() < 2 {
+ $crate::err!(
+ actix_web::http::StatusCode::UNAUTHORIZED,
+ $crate::make_err!("ERR_UNAUTHORIZED", "unauthorized")
+ )
+ }
+ let tokens = hdr_value_split[1..].to_vec();
+ }};
+}
A starkingdoms-backplane/src/config.rs => starkingdoms-backplane/src/config.rs +43 -0
@@ 0,0 1,43 @@
+// StarKingdoms.IO, a browser game about drifting through space
+// Copyright (C) 2023 ghostly_zsh, TerraMaster85, core
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+use serde::Deserialize;
+use std::net::IpAddr;
+
+#[derive(Deserialize, Clone)]
+pub struct Config {
+ pub server: ConfigServer,
+ pub database: ConfigDatabase,
+}
+
+#[derive(Deserialize, Clone)]
+pub struct ConfigServer {
+ pub bind: ConfigServerBind,
+ pub workers: Option<usize>,
+ pub machine_id: i32,
+ pub node_id: i32,
+ pub application_key: String,
+}
+
+#[derive(Deserialize, Clone)]
+pub struct ConfigServerBind {
+ pub ip: IpAddr,
+ pub port: u16,
+}
+
+#[derive(Deserialize, Clone)]
+pub struct ConfigDatabase {
+ pub url: String,
+}
R starkingdoms-api/src/error.rs => starkingdoms-backplane/src/error.rs +35 -14
@@ 1,13 1,34 @@
+// StarKingdoms.IO, a browser game about drifting through space
+// Copyright (C) 2023 ghostly_zsh, TerraMaster85, core
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
use actix_web::error::{JsonPayloadError, PayloadError};
use serde::Serialize;
use std::fmt::{Display, Formatter};
#[derive(Serialize, Debug)]
+pub struct APIErrorsResponse {
+ pub errors: Vec<APIErrorResponse>,
+}
+
+#[derive(Serialize, Debug)]
pub struct APIErrorResponse {
- pub success: bool,
pub code: String,
pub message: String,
+ pub path: Option<String>,
}
+
impl Display for APIErrorResponse {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self)
@@ 21,35 42,35 @@ impl From<&JsonPayloadError> for APIErrorResponse {
APIErrorResponse {
code: "ERR_PAYLOAD_OVERFLOW_KNOWN_LENGTH".to_string(),
message: format!("Payload size is bigger than allowed & content length header set. (length: {}, limit: {})", length, limit),
- success: false,
+ path: None,
}
},
JsonPayloadError::Overflow { limit } => {
APIErrorResponse {
code: "ERR_PAYLOAD_OVERFLOW".to_string(),
message: format!("Payload size is bigger than allowed but no content-length header is set. (limit: {})", limit),
- success: false,
+ path: None,
}
},
JsonPayloadError::ContentType => {
APIErrorResponse {
code: "ERR_NOT_JSON".to_string(),
message: "Content-Type header not set to expected application/json".to_string(),
- success: false,
+ path: None,
}
},
JsonPayloadError::Deserialize(e) => {
APIErrorResponse {
code: "ERR_JSON_DESERIALIZE".to_string(),
message: format!("Error deserializing JSON: {}", e),
- success: false,
+ path: None,
}
},
JsonPayloadError::Serialize(e) => {
APIErrorResponse {
code: "ERR_JSON_SERIALIZE".to_string(),
message: format!("Error serializing JSON: {}", e),
- success: false,
+ path: None,
}
},
JsonPayloadError::Payload(e) => {
@@ 59,7 80,7 @@ impl From<&JsonPayloadError> for APIErrorResponse {
APIErrorResponse {
code: "ERR_UNKNOWN_ERROR".to_string(),
message: "An unknown error has occured".to_string(),
- success: false,
+ path: None,
}
}
}
@@ 75,37 96,37 @@ impl From<&PayloadError> for APIErrorResponse {
None => "Payload reached EOF but was incomplete".to_string(),
Some(e) => format!("Payload reached EOF but was incomplete: {}", e),
},
- success: false,
+ path: None,
},
PayloadError::EncodingCorrupted => APIErrorResponse {
code: "ERR_CORRUPTED_PAYLOAD".to_string(),
message: "Payload content encoding corrupted".to_string(),
- success: false,
+ path: None,
},
PayloadError::Overflow => APIErrorResponse {
code: "ERR_PAYLOAD_OVERFLOW".to_string(),
message: "Payload reached size limit".to_string(),
- success: false,
+ path: None,
},
PayloadError::UnknownLength => APIErrorResponse {
code: "ERR_PAYLOAD_UNKNOWN_LENGTH".to_string(),
message: "Unable to determine payload length".to_string(),
- success: false,
+ path: None,
},
PayloadError::Http2Payload(e) => APIErrorResponse {
code: "ERR_HTTP2_ERROR".to_string(),
message: format!("HTTP/2 error: {}", e),
- success: false,
+ path: None,
},
PayloadError::Io(e) => APIErrorResponse {
code: "ERR_IO_ERROR".to_string(),
message: format!("I/O error: {}", e),
- success: false,
+ path: None,
},
_ => APIErrorResponse {
code: "ERR_UNKNOWN_ERROR".to_string(),
message: "An unknown error has occured".to_string(),
- success: false,
+ path: None,
},
}
}
A starkingdoms-backplane/src/main.rs => starkingdoms-backplane/src/main.rs +184 -0
@@ 0,0 1,184 @@
+// StarKingdoms.IO, a browser game about drifting through space
+// Copyright (C) 2023 ghostly_zsh, TerraMaster85, core
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+use crate::config::Config;
+use crate::error::APIErrorResponse;
+use actix_web::middleware::Logger;
+use actix_web::web::{Data, JsonConfig};
+use actix_web::{App, Error, HttpResponse, HttpServer};
+use diesel::Connection;
+use diesel_async::async_connection_wrapper::AsyncConnectionWrapper;
+use diesel_async::pooled_connection::bb8::Pool;
+use diesel_async::pooled_connection::AsyncDieselConnectionManager;
+use diesel_async::AsyncPgConnection;
+use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness};
+use hmac::digest::KeyInit;
+use hmac::Hmac;
+use log::{error, info};
+use sha2::Sha256;
+use snowflake::SnowflakeIdGenerator;
+use std::fs;
+use std::path::PathBuf;
+use std::sync::{Arc, Mutex};
+use std::time::{Duration, UNIX_EPOCH};
+
+pub mod error;
+#[macro_use]
+pub mod response;
+pub mod config;
+pub mod models;
+pub mod routes;
+pub mod schema;
+
+pub mod auth;
+pub mod tokens;
+
+#[derive(Clone)]
+pub struct AppState {
+ pub config: Config,
+ pub pool: bb8::Pool<AsyncDieselConnectionManager<AsyncPgConnection>>,
+ pub idgen: Arc<Mutex<SnowflakeIdGenerator>>,
+ pub key: Hmac<Sha256>,
+}
+
+pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!("migrations");
+
+#[actix_web::main]
+async fn main() {
+ env_logger::init();
+ info!(
+ "StarKingdoms API v{} starting up",
+ env!("CARGO_PKG_VERSION")
+ );
+
+ let mut args = std::env::args();
+ let config_path = match args.nth(1) {
+ Some(path) => path,
+ None => {
+ eprintln!("usage: starkingdoms-api <config_path>");
+ std::process::exit(1);
+ }
+ };
+
+ let config_pathbuf = PathBuf::from(config_path);
+ info!("Loading config from {}", config_pathbuf.display());
+
+ let config_str = match fs::read_to_string(&config_pathbuf) {
+ Ok(c_str) => c_str,
+ Err(e) => {
+ error!(
+ "Error loading configuration from {}: {}",
+ config_pathbuf.display(),
+ e
+ );
+ std::process::exit(1);
+ }
+ };
+
+ let config: Config = match toml::from_str(&config_str) {
+ Ok(config) => config,
+ Err(e) => {
+ error!(
+ "Error parsing configuration in {}: {}",
+ config_pathbuf.display(),
+ e
+ );
+ std::process::exit(1);
+ }
+ };
+
+ info!("Connecting to the database...");
+
+ let pool_config = AsyncDieselConnectionManager::<AsyncPgConnection>::new(&config.database.url);
+ let pool = match Pool::builder().build(pool_config).await {
+ Ok(pool) => pool,
+ Err(e) => {
+ error!("Error while creating database pool: {}", e);
+ std::process::exit(1);
+ }
+ };
+
+ info!("Running pending migrations...");
+
+ let local_config = config.clone();
+ let db_url = config.database.url.clone();
+
+ match actix_web::rt::task::spawn_blocking(move || {
+ // Lock block
+ let mut conn = match AsyncConnectionWrapper::<AsyncPgConnection>::establish(&db_url) {
+ Ok(conn) => conn,
+ Err(e) => {
+ error!("Error acquiring connection from pool: {}", e);
+ std::process::exit(1);
+ }
+ };
+
+ match conn.run_pending_migrations(MIGRATIONS) {
+ Ok(_) => (),
+ Err(e) => {
+ error!("Failed to run pending migrations: {}", e);
+ std::process::exit(1);
+ }
+ }
+ })
+ .await
+ {
+ Ok(_) => (),
+ Err(e) => {
+ error!("Error waiting for migrations: {}", e);
+ std::process::exit(1);
+ }
+ }
+
+ let key = Hmac::new_from_slice(config.server.application_key.as_bytes()).unwrap();
+
+ let stk_epoch = UNIX_EPOCH + Duration::from_secs(1616260136);
+ let id_generator = SnowflakeIdGenerator::with_epoch(
+ config.server.machine_id,
+ config.server.node_id,
+ stk_epoch,
+ );
+
+ let app_state = Data::new(AppState {
+ config,
+ pool,
+ idgen: Arc::new(Mutex::new(id_generator)),
+ key,
+ });
+
+ let server = HttpServer::new(move || {
+ App::new()
+ .app_data(JsonConfig::default().error_handler(|err, _rq| {
+ Error::from({
+ let err2: APIErrorResponse = (&err).into();
+ actix_web::error::InternalError::from_response(
+ err,
+ HttpResponse::BadRequest().json(err2),
+ )
+ })
+ }))
+ .service(routes::signup::signup_req)
+ .service(routes::login::user_login_req)
+ .wrap(Logger::default())
+ .wrap(actix_cors::Cors::permissive())
+ .app_data(app_state.clone())
+ })
+ .bind((local_config.server.bind.ip, local_config.server.bind.port))
+ .unwrap();
+
+ server.run().await.unwrap();
+
+ info!("Goodbye!");
+}
A starkingdoms-backplane/src/models.rs => starkingdoms-backplane/src/models.rs +27 -0
@@ 0,0 1,27 @@
+// StarKingdoms.IO, a browser game about drifting through space
+// Copyright (C) 2023 ghostly_zsh, TerraMaster85, core
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use diesel::{Identifiable, Insertable, Queryable, Selectable};
+
+#[derive(Queryable, Selectable, Insertable, Identifiable, Debug, PartialEq, Clone)]
+#[diesel(table_name = crate::schema::users)]
+#[diesel(check_for_backend(diesel::pg::Pg))]
+pub struct User {
+ pub id: i64,
+ pub username: String,
+ pub password_hash: String,
+ pub permission_level: i32,
+}
R starkingdoms-api/src/macros.rs => starkingdoms-backplane/src/response.rs +75 -62
@@ 1,43 1,69 @@
+// StarKingdoms.IO, a browser game about drifting through space
+// Copyright (C) 2023 ghostly_zsh, TerraMaster85, core
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+use crate::error::APIErrorsResponse;
+use actix_web::body::BoxBody;
+use actix_web::error::JsonPayloadError;
+use actix_web::http::StatusCode;
+use actix_web::{HttpRequest, HttpResponse, Responder};
+use serde::Serialize;
+use std::fmt::{Debug, Display, Formatter};
+
+#[derive(Debug)]
+pub enum JsonAPIResponse<T: Serialize + Debug> {
+ Error(StatusCode, APIErrorsResponse),
+ Success(StatusCode, T),
+}
+
+impl<T: Serialize + Debug> Display for JsonAPIResponse<T> {
+ fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+ write!(f, "{:?}", self)
+ }
+}
+
+impl<T: Serialize + Debug> Responder for JsonAPIResponse<T> {
+ type Body = BoxBody;
+
+ fn respond_to(self, _: &HttpRequest) -> HttpResponse<Self::Body> {
+ match self {
+ JsonAPIResponse::Error(c, r) => match serde_json::to_string(&r) {
+ Ok(body) => HttpResponse::build(c).body(body),
+ Err(err) => HttpResponse::from_error(JsonPayloadError::Serialize(err)),
+ },
+ JsonAPIResponse::Success(c, b) => match serde_json::to_string(&b) {
+ Ok(body) => HttpResponse::build(c).body(body),
+ Err(err) => HttpResponse::from_error(JsonPayloadError::Serialize(err)),
+ },
+ }
+ }
+}
+
#[macro_export]
macro_rules! err {
($c:expr,$e:expr) => {
return $crate::response::JsonAPIResponse::Error($c, $e)
};
}
-#[macro_export]
-macro_rules! resp_ok {
- ($e:expr) => {
- return $crate::response::JsonAPIResponse::Success(actix_web::http::StatusCode::OK, $e)
- };
-}
#[macro_export]
macro_rules! ok {
- ($e:expr) => {
- $crate::resp_ok!($crate::response::SuccessResponse {
- success: true,
- data: $e
- })
- };
-}
-
-#[macro_export]
-macro_rules! resp_ok_code {
($c:expr,$e:expr) => {
return $crate::response::JsonAPIResponse::Success($c, $e)
};
-}
-
-#[macro_export]
-macro_rules! ok_code {
- ($r:ident,$c:expr,$e:expr) => {
- $crate::resp_ok_code!(
- $c,
- $crate::response::SuccessResponse {
- success: true,
- data: $e
- }
- )
+ ($e:expr) => {
+ return $crate::response::JsonAPIResponse::Success(actix_web::http::StatusCode::OK, $e)
};
}
@@ 54,56 80,43 @@ macro_rules! internal_error {
#[macro_export]
macro_rules! handle_error {
- ($e:expr) => {
+ ($e:expr,$c:expr,$r:expr) => {
match $e {
Ok(r) => r,
Err(e) => {
- $crate::internal_error!(e)
+ log::error!("error: {}", e);
+ $crate::err!($c, $r)
}
}
};
-}
-
-#[macro_export]
-macro_rules! handle_error_custom {
- ($e:expr,$c:expr,$r:expr) => {
+ ($e:expr) => {
match $e {
Ok(r) => r,
Err(e) => {
- log::error!("error: {}", e);
- $crate::err!($c, $r)
+ $crate::internal_error!(e)
}
}
};
}
+
#[macro_export]
macro_rules! make_err {
- ($c:expr,$m:expr) => {
- $crate::error::APIErrorResponse {
- success: false,
- code: $c.to_string(),
- message: $m.to_string(),
+ ($c:expr,$m:expr,$p:expr) => {
+ $crate::error::APIErrorsResponse {
+ errors: vec![$crate::error::APIErrorResponse {
+ code: $c.to_string(),
+ message: $m.to_string(),
+ path: Some($p.to_string()),
+ }],
}
};
-}
-
-#[macro_export]
-macro_rules! unique {
- ($k:expr) => {
- IndexModel::builder()
- .keys($k)
- .options(IndexOptions::builder().unique(true).build())
- .build()
- };
-}
-
-#[macro_export]
-macro_rules! auth {
- ($r:expr,$s:expr) => {
- $crate::handle_error_custom!(
- $crate::tokens::enforce_session(&$r, &$s).await,
- actix_web::http::StatusCode::UNAUTHORIZED,
- $crate::make_err!("ERR_UNAUTHORIZED", "unauthorized")
- )
+ ($c:expr,$m:expr) => {
+ $crate::error::APIErrorsResponse {
+ errors: vec![$crate::error::APIErrorResponse {
+ code: $c.to_string(),
+ message: $m.to_string(),
+ path: None,
+ }],
+ }
};
}
A starkingdoms-backplane/src/routes/login.rs => starkingdoms-backplane/src/routes/login.rs +93 -0
@@ 0,0 1,93 @@
+// StarKingdoms.IO, a browser game about drifting through space
+// Copyright (C) 2023 ghostly_zsh, TerraMaster85, core
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use crate::models::User;
+use crate::response::JsonAPIResponse;
+use crate::schema::users;
+use crate::tokens::UserToken;
+use crate::AppState;
+use actix_web::{
+ http::StatusCode,
+ post,
+ web::{Data, Json},
+};
+use argon2::Argon2;
+use diesel::{ExpressionMethods, OptionalExtension, QueryDsl, SelectableHelper};
+use diesel_async::RunQueryDsl;
+use jwt::SignWithKey;
+use password_hash::{Encoding, PasswordHash};
+use serde::{Deserialize, Serialize};
+use std::time::{Duration, SystemTime};
+
+#[derive(Deserialize)]
+pub struct LoginRequest {
+ pub username: String,
+ pub password: String,
+}
+
+#[derive(Serialize, Debug)]
+pub struct LoginResponse {
+ pub token: String,
+ pub user: UserToken,
+}
+
+#[post("/login")]
+pub async fn user_login_req(
+ req: Json<LoginRequest>,
+ state: Data<AppState>,
+) -> JsonAPIResponse<LoginResponse> {
+ let mut conn = handle_error!(state.pool.get().await);
+
+ let user: User = match handle_error!(users::dsl::users
+ .filter(users::username.eq(&req.username))
+ .select(User::as_select())
+ .first(&mut conn)
+ .await
+ .optional())
+ {
+ Some(t) => t,
+ None => {
+ err!(
+ StatusCode::UNAUTHORIZED,
+ make_err!("ERR_UNAUTHORIZED", "user does not exist", "username")
+ );
+ }
+ };
+
+ let hash = handle_error!(PasswordHash::parse(&user.password_hash, Encoding::B64));
+ let pwd_ok = hash
+ .verify_password(&[&Argon2::default()], req.password.as_bytes())
+ .is_ok();
+ if !pwd_ok {
+ err!(
+ StatusCode::UNAUTHORIZED,
+ make_err!("ERR_UNAUTHORIZED", "unauthorized")
+ )
+ }
+
+ let token = UserToken {
+ id: user.id,
+ username: user.username.clone(),
+ permission_level: user.permission_level,
+ expires: SystemTime::now() + Duration::from_secs(86400 * 365), // 1 year
+ };
+ let jwt_str = handle_error!(token.clone().sign_with_key(&state.key));
+
+ ok!(LoginResponse {
+ token: jwt_str,
+ user: token
+ })
+}
A starkingdoms-backplane/src/routes/mod.rs => starkingdoms-backplane/src/routes/mod.rs +17 -0
@@ 0,0 1,17 @@
+// StarKingdoms.IO, a browser game about drifting through space
+// Copyright (C) 2023 ghostly_zsh, TerraMaster85, core
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+pub mod login;
+pub mod signup;
A starkingdoms-backplane/src/routes/signup.rs => starkingdoms-backplane/src/routes/signup.rs +69 -0
@@ 0,0 1,69 @@
+// StarKingdoms.IO, a browser game about drifting through space
+// Copyright (C) 2023 ghostly_zsh, TerraMaster85, core
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+use crate::models::User;
+use crate::response::JsonAPIResponse;
+use crate::AppState;
+use actix_web::post;
+use actix_web::web::{Data, Json};
+use argon2::Argon2;
+use diesel_async::RunQueryDsl;
+use password_hash::{PasswordHash, SaltString};
+use rand::rngs::OsRng;
+use serde::{Deserialize, Serialize};
+
+#[derive(Deserialize)]
+pub struct SignupRequest {
+ pub username: String,
+ pub password: String,
+}
+
+#[derive(Serialize, Debug)]
+pub struct SignupResponse {
+ pub id: i64,
+}
+
+#[post("/signup")]
+pub async fn signup_req(
+ req: Json<SignupRequest>,
+ state: Data<AppState>,
+) -> JsonAPIResponse<SignupResponse> {
+ let mut conn = handle_error!(state.pool.get().await);
+
+ let user_id = { handle_error!(state.idgen.lock()).real_time_generate() };
+
+ let salt = SaltString::generate(&mut OsRng);
+ let hash = handle_error!(PasswordHash::generate(
+ Argon2::default(),
+ req.password.as_bytes(),
+ &salt
+ ));
+
+ let new_user = User {
+ id: user_id,
+ username: req.username.to_string(),
+ password_hash: hash.to_string(),
+ permission_level: 0,
+ };
+
+ handle_error!(
+ diesel::insert_into(crate::schema::users::table)
+ .values(&new_user)
+ .execute(&mut conn)
+ .await
+ );
+
+ ok!(SignupResponse { id: user_id })
+}
A starkingdoms-backplane/src/schema.rs => starkingdoms-backplane/src/schema.rs +10 -0
@@ 0,0 1,10 @@
+// @generated automatically by Diesel CLI.
+
+diesel::table! {
+ users (id) {
+ id -> Int8,
+ username -> Varchar,
+ password_hash -> Varchar,
+ permission_level -> Int4,
+ }
+}
A starkingdoms-backplane/src/tokens.rs => starkingdoms-backplane/src/tokens.rs +26 -0
@@ 0,0 1,26 @@
+// StarKingdoms.IO, a browser game about drifting through space
+// Copyright (C) 2023 ghostly_zsh, TerraMaster85, core
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use serde::{Deserialize, Serialize};
+use std::time::SystemTime;
+
+#[derive(Serialize, Deserialize, Debug, Clone)]
+pub struct UserToken {
+ pub id: i64,
+ pub username: String,
+ pub permission_level: i32,
+ pub expires: SystemTime,
+}
M starkingdoms-client/index.html => starkingdoms-client/index.html +31 -92
@@ 2,41 2,24 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>StarKingdoms</title>
+ <title>StarKingdoms.IO</title>
</head>
<body class="bg-grid">
- <div id="gamewindow">
- <!-- Canvas gets added here by the game script -->
- </div>
-
<div class="popup popup-center popup-max-width-300" id="server_selector">
<h1>StarKingdoms</h1>
<h2>Join Game</h2>
- <form id="join-fm">
- <label>Choose server</label>
+ <form id="join-fm" class="form">
+ <label for="username" class="label">Username</label>
+ <input class="textentry" id="username" required autocomplete="off" />
- <div class="fm-select">
- <button
- class="fm-select-button"
- role="combobox"
- aria-labelledby="server selector"
- aria-haspopup="listbox"
- aria-expanded="false"
- aria-controls="fm-select-dropdown"
- >
- <span class="fm-selected-value">Loading servers list</span>
- <span class="fm-arrow"></span>
- </button>
- <ul class="fm-select-dropdown" role="listbox" id="fm-select-dropdown">
- <!-- Filled by TS -->
- </ul>
- </div>
+ <label class="label" for="select">Server</label>
+ <select id="select" class="select" autocomplete="off">
+ <option>Loading server list, please wait...</option>
+ </select>
+
+ <button id="launch-btn" class="btn">Launch!</button>
- <label for="username" class="username-label">Username</label>
- <input class="username-box" id="username" required autocomplete="off" />
- <button id="launch-btn" class="launch-btn">Launch!</button>
<span id="server-danger" class="server-danger hidden">
<svg
xmlns="http://www.w3.org/2000/svg"
@@ 53,75 36,31 @@
Here be dragons! You have a <b>prerelease server</b> selected. Expect
bugs, and save data on this server may be wiped at any time.
</span>
+
+ <span id="account-info" class="account-info"
+ >You are not logged in. Save data will be stored in your browser
+ cache. <a href="/login/">Log in</a> to save your data on the server
+ and sync it between devices.</span
+ >
</form>
</div>
- <div
- class="popup popup-wmin log-hidden log-container popup-max-width-300"
- id="packet_log"
+ <span class="footer-left" id="footer-left">StarKingdoms Client</span>
+ <span class="footer-right" id="footer-right"
+ >Made with
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 20 20"
+ fill="currentColor"
+ class="footer-icon"
+ >
+ <path
+ d="M9.653 16.915l-.005-.003-.019-.01a20.759 20.759 0 01-1.162-.682 22.045 22.045 0 01-2.582-1.9C4.045 12.733 2 10.352 2 7.5a4.5 4.5 0 018-2.828A4.5 4.5 0 0118 7.5c0 2.852-2.044 5.233-3.885 6.82a22.049 22.049 0 01-3.744 2.582l-.019.01-.005.003h-.002a.739.739 0 01-.69.001l-.002-.001z"
+ />
+ </svg>
+ by the StarKingdoms team</span
>
- <h1>Packet Log</h1>
- <table class="log">
- <thead>
- <tr class="log-wfull">
- <th class="log-wfull log-lalign log-header log-w50">#</th>
- <th class="log-wfull log-lalign log-header">Dir</th>
- <th class="log-wfull log-lalign log-header log-w240">Type</th>
- <th class="log-wfull log-lalign log-header">Delta</th>
- </tr>
- </thead>
- <tbody id="log_body"></tbody>
- </table>
- <hr />
- <h1>Packet Explorer</h1>
- <p id="explorer_selected" class="mono">Selected: --</p>
- <table class="mono json" id="explorer_json"></table>
- </div>
-
- <div class="popup chat-container hidden" id="chat">
- <h1>Chat</h1>
- <div id="chatbox" class="chat-table mono">
- <!-- Filled by script -->
- </div>
- <input
- placeholder="Enter message or command here..."
- class="chat-box"
- id="chatentry"
- required
- autocomplete="off"
- />
- </div>
-
- <div class="hud hidden" id="hud">
- <div class="popup" id="hud-content-wrapper">
- <table>
- <thead>
- <tr>
- <th class="hud-d">Position</th>
- <th class="hud-d">Velocity</th>
- <th class="hud-d">Track Angle</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td id="pos">
- <span id="pos-val-x">--</span>, <span id="pos-val-y">--</span>
- </td>
- <td id="velocity">
- <span id="velocity-val">--</span>
- </td>
- <td id="track">
- <span id="track-val">--</span>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
-
- <span class="footer-left" id="footer-left"></span>
- <span class="footer-right" id="footer-right"></span>
- <script type="module" src="src/main.ts"></script>
+ <script type="module" src="src/routes/menu/main.ts"></script>
</body>
</html>
M starkingdoms-client/package.json => starkingdoms-client/package.json +3 -0
@@ 11,7 11,10 @@
"devDependencies": {
"@types/debug": "^4.1.12",
"@types/node": "^20.10.0",
+ "autoprefixer": "^10.4.16",
+ "postcss": "^8.4.31",
"prettier": "^3.1.0",
+ "sass": "^1.69.5",
"typescript": "^5.2.2",
"vite": "^5.0.0"
},
A starkingdoms-client/play/index.html => starkingdoms-client/play/index.html +96 -0
@@ 0,0 1,96 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta
+ name="viewport"
+ content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
+ />
+ <meta http-equiv="X-UA-Compatible" content="ie=edge" />
+ <title>StarKingdoms.IO</title>
+ </head>
+ <body>
+ <div class="game" id="gamewindow"></div>
+
+ <div
+ class="popup popup-wmin log-hidden log-container popup-max-width-300"
+ id="packet_log"
+ >
+ <h1>Packet Log</h1>
+ <table class="log">
+ <thead>
+ <tr class="log-wfull">
+ <th class="log-wfull log-lalign log-header log-w50">#</th>
+ <th class="log-wfull log-lalign log-header">Dir</th>
+ <th class="log-wfull log-lalign log-header log-w240">Type</th>
+ <th class="log-wfull log-lalign log-header">Delta</th>
+ </tr>
+ </thead>
+ <tbody id="log_body"></tbody>
+ </table>
+ <hr />
+ <h1>Packet Explorer</h1>
+ <p id="explorer_selected" class="mono">Selected: --</p>
+ <table class="mono json" id="explorer_json"></table>
+ </div>
+
+ <div class="popup chat-container" id="chat">
+ <h1>Chat</h1>
+ <div id="chatbox" class="chat-table mono">
+ <!-- Filled by script -->
+ </div>
+ <input
+ placeholder="Enter message or command here..."
+ class="chat-box"
+ id="chatentry"
+ required
+ autocomplete="off"
+ />
+ </div>
+
+ <div class="hud" id="hud">
+ <div class="popup" id="hud-content-wrapper">
+ <table>
+ <thead>
+ <tr>
+ <th class="hud-d">Position</th>
+ <th class="hud-d">Velocity</th>
+ <th class="hud-d">Track Angle</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td id="pos">
+ <span id="pos-val-x">--</span>, <span id="pos-val-y">--</span>
+ </td>
+ <td id="velocity">
+ <span id="velocity-val">--</span>
+ </td>
+ <td id="track">
+ <span id="track-val">--</span>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+
+ <span class="footer-left" id="footer-left">StarKingdoms Client</span>
+ <span class="footer-right" id="footer-right"
+ >Made with
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 20 20"
+ fill="currentColor"
+ class="footer-icon"
+ >
+ <path
+ d="M9.653 16.915l-.005-.003-.019-.01a20.759 20.759 0 01-1.162-.682 22.045 22.045 0 01-2.582-1.9C4.045 12.733 2 10.352 2 7.5a4.5 4.5 0 018-2.828A4.5 4.5 0 0118 7.5c0 2.852-2.044 5.233-3.885 6.82a22.049 22.049 0 01-3.744 2.582l-.019.01-.005.003h-.002a.739.739 0 01-.69.001l-.002-.001z"
+ />
+ </svg>
+ by the StarKingdoms team</span
+ >
+
+ <script type="module" src="../src/routes/ingame/main.ts"></script>
+ </body>
+</html>
M starkingdoms-client/src/config.json => starkingdoms-client/src/config.json +2 -1
@@ 32,5 32,6 @@
"isDevelopment": true,
"isPrimary": false
}
- }
+ },
+ "backplane": "https://backplane.starkingdoms.io"
}
R starkingdoms-client/src/css/chat.css => starkingdoms-client/src/css/chat.scss +4 -2
@@ 1,11 1,13 @@
+@use "font";
+
.chat-container {
+ @extend .font-2;
+
position: absolute;
top: 0.5em;
right: 0.5em;
width: 30vw;
height: min-content;
- font-size: 0.875rem; /* 14px */
- line-height: 1.25rem; /* 20px */
font-weight: 500;
}
.chat-table {
A starkingdoms-client/src/css/font.scss => starkingdoms-client/src/css/font.scss +43 -0
@@ 0,0 1,43 @@
+:root {
+ --sans-serif-font-family: ui-sans-serif, system-ui, -apple-system,
+ BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
+ sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
+ "Noto Color Emoji";
+ --mono-font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
+ "Liberation Mono", "Courier New", monospace;
+
+ font-family: var(--sans-serif-font-family);
+ @extend .font-3;
+}
+
+.mono {
+ font-family: var(--mono-font-family);
+}
+
+.font-1 {
+ font-size: 0.75rem;
+ line-height: 1rem;
+}
+.font-2 {
+ font-size: 0.875rem;
+ line-height: 1.25rem;
+}
+.font-3 {
+ font-size: 1rem;
+ line-height: 1.5rem;
+}
+.font-4 {
+ font-size: 1.125rem;
+ line-height: 1.75rem;
+}
+.font-5 {
+ font-size: 1.25rem;
+ line-height: 1.75rem;
+}
+
+h1 {
+ @extend .font-5;
+}
+h2 {
+ @extend .font-4;
+}
R => +11 -7
@@ 1,15 1,19 @@
.footer-left {
font-size: 0.75rem;
line-height: 2rem;
@use "font";
%footer-common {
@extend .font-1;
position: absolute;
bottom: 0.5em;
}
.footer-left {
@extend %footer-common;
left: 1em;
}
.footer-right {
font-size: 0.75rem;
line-height: 2rem;
position: absolute;
bottom: 0.5em;
@extend %footer-common;
right: 1em;
}
.footer-icon {
D starkingdoms-client/src/css/form.css => starkingdoms-client/src/css/form.css +0 -158
@@ 1,158 0,0 @@
-.launch-btn {
- appearance: none;
- width: 100%;
- padding: 1em;
- margin-top: 1em;
- color: var(--text);
- background: transparent;
- border: 2px solid var(--links);
- border-radius: 5px;
- transition: 0.1s ease-in-out;
-}
-.launch-btn:hover {
- cursor: pointer;
- background-color: var(--links-transparent);
-}
-
-.username-label {
- margin-top: 1em;
-}
-.fm-select {
- margin-bottom: 1em;
- position: relative;
-}
-
-.username-box {
- appearance: none;
- background: transparent;
- color: var(--text);
- padding: 0.675em 1em;
- border: 1px solid var(--links);
- border-radius: 0.25rem;
- cursor: text;
- width: 100%;
- max-width: 100%;
-}
-.username-box:focus {
- outline: none;
- background-color: var(--links-ultratransparent);
-}
-
-.fm-select-button {
- appearance: none;
- background: transparent;
- color: var(--text);
- width: 100%;
- padding: 0.675em 1em;
- border: 1px solid var(--links);
- border-radius: 0.25rem;
- cursor: pointer;
- display: flex;
- justify-content: space-between;
- align-items: center;
-}
-.fm-selected-value {
- text-align: left;
-}
-.fm-arrow {
- border-left: 5px solid transparent;
- border-right: 5px solid transparent;
- border-top: 6px solid var(--links);
- transition: transform ease-in-out 0.3s;
-}
-.fm-select-dropdown {
- position: absolute;
- list-style: none;
- width: 100%;
- box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
- background-color: var(--bg-secondary-1);
- border: 1px solid var(--links);
- border-radius: 4px;
- padding: 10px;
- margin-top: 10px;
- max-height: 200px;
- overflow-y: auto;
- transition: 0.2s ease;
-
- /*transform: scaleY(0);*/
- opacity: 0;
- visibility: hidden;
-}
-.fm-select-dropdown:focus-within {
- box-shadow: 0 10px 25px var(--links-ultratransparent);
-}
-
-.fm-select-dropdown li {
- position: relative;
- cursor: pointer;
- display: flex;
- gap: 1rem;
- align-items: center;
-}
-
-.fm-select-dropdown li label {
- width: 100%;
- padding: 8px 10px;
- cursor: pointer;
-}
-
-.fm-select-dropdown::-webkit-scrollbar {
- width: 7px;
-}
-.fm-select-dropdown::-webkit-scrollbar-track {
- background: #f1f1f1;
- border-radius: 25px;
-}
-
-.fm-select-dropdown::-webkit-scrollbar-thumb {
- background: #ccc;
- border-radius: 25px;
-}
-
-.fm-select-dropdown li + li {
- margin-top: 5px;
-}
-
-.fm-select-dropdown li,
-.fm-select-dropdown input ~ label {
- border-radius: 5px;
-}
-
-.fm-select-dropdown li:hover,
-.fm-select-dropdown input:checked ~ label {
- background-color: var(--surface-0);
-}
-.fm-select-dropdown input:focus ~ label {
- background-color: var(--surface-1);
-}
-
-.fm-select-dropdown input[type="radio"] {
- position: absolute;
- left: 0;
- opacity: 0;
-}
-.fm-select.active .fm-arrow {
- transform: rotate(180deg);
-}
-.fm-select.active .fm-select-dropdown {
- opacity: 1;
- visibility: visible;
- /*transform: scaleY(1);*/
-}
-.server-danger {
- width: 100%;
- display: block;
- height: max-content;
- margin-top: 1em;
- color: var(--error);
- font-size: 0.875rem;
- line-height: 1.25rem;
-}
-.server-danger.hidden {
- display: none;
-}
-.server-danger-icon {
- height: 1.25rem;
- vertical-align: middle;
- display: inline-block;
-}
A starkingdoms-client/src/css/form.scss => starkingdoms-client/src/css/form.scss +80 -0
@@ 0,0 1,80 @@
+@use "font";
+
+.form {
+ input,
+ select {
+ margin-bottom: 0.75em;
+ }
+ button {
+ margin-top: 0.25em;
+ }
+}
+
+%form-element-shared {
+ appearance: none;
+ background: transparent;
+ color: var(--text);
+ padding: 0.675em 1em;
+ border: 1px solid var(--links);
+ border-radius: 0.25rem;
+ cursor: text;
+ width: 100%;
+ max-width: 100%;
+}
+
+.btn {
+ @extend %form-element-shared;
+ border: 2px solid var(--links);
+ transition: 0.1s ease-in-out;
+}
+.btn:hover {
+ cursor: pointer;
+ background-color: var(--links-transparent);
+}
+
+.textentry {
+ @extend %form-element-shared;
+}
+.textentry:focus {
+ outline: none;
+ background-color: var(--links-ultratransparent);
+}
+.textentry-error {
+ border: 1px solid var(--error);
+}
+
+.select {
+ @extend %form-element-shared;
+ position: relative;
+ border: 1px solid var(--links);
+ border-radius: 0.25em;
+ cursor: pointer;
+}
+.select::after {
+ content: "";
+ width: 0.8em;
+ height: 0.5em;
+ background-color: var(--links);
+ clip-path: polygon(100% 0%, 0 0%, 50% 100%);
+}
+
+%form-footer-shared {
+ @extend .font-2;
+ width: 100%;
+ display: block;
+ height: max-content;
+ margin-top: 1em;
+}
+
+.account-info {
+ @extend %form-footer-shared;
+}
+.server-danger {
+ @extend %form-footer-shared;
+ color: var(--error);
+}
+.server-danger-icon {
+ height: 1.25rem;
+ vertical-align: middle;
+ display: inline-block;
+}
R starkingdoms-client/src/css/game.css => starkingdoms-client/src/css/game.scss +0 -0
D starkingdoms-client/src/css/globals.css => starkingdoms-client/src/css/globals.css +0 -45
@@ 1,45 0,0 @@
-html {
- box-sizing: border-box;
-}
-*,
-*:before,
-*:after {
- box-sizing: inherit;
-}
-
-body {
- background-color: var(--bg);
- color: var(--body);
- /* Stolen from Tailwind. Looks good in most places. */
- font-family:
- ui-sans-serif,
- system-ui,
- -apple-system,
- BlinkMacSystemFont,
- "Segoe UI",
- Roboto,
- "Helvetica Neue",
- Arial,
- "Noto Sans",
- sans-serif,
- "Apple Color Emoji",
- "Segoe UI Emoji",
- "Segoe UI Symbol",
- "Noto Color Emoji";
- font-size: 1rem;
- line-height: 1.5rem;
-}
-
-.mono {
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
- "Liberation Mono", "Courier New", monospace;
-}
-
-h1 {
- font-size: 1.25rem;
- line-height: 1.75rem;
-}
-h2 {
- font-size: 1.125rem;
- line-height: 1.75rem;
-}
A starkingdoms-client/src/css/globals.scss => starkingdoms-client/src/css/globals.scss +19 -0
@@ 0,0 1,19 @@
+@use "font";
+
+html {
+ box-sizing: border-box;
+}
+*,
+*:before,
+*:after {
+ box-sizing: inherit;
+}
+
+body {
+ background-color: var(--bg);
+ color: var(--body);
+}
+
+a {
+ color: var(--links);
+}
R starkingdoms-client/src/css/grid.css => starkingdoms-client/src/css/grid.scss +0 -0
R starkingdoms-client/src/css/hud.css => starkingdoms-client/src/css/hud.scss +0 -0
R starkingdoms-client/src/css/json.css => starkingdoms-client/src/css/json.scss +0 -0
R starkingdoms-client/src/css/log.css => starkingdoms-client/src/css/log.scss +0 -0
R => +0 -4
@@ 29,7 29,3 @@
margin: 0 0 0.5em;
color: var(--sub-headline);
}
.hidden {
display: none;
visibility: hidden;
}
D starkingdoms-client/src/css/style.css => starkingdoms-client/src/css/style.css +0 -10
@@ 1,10 0,0 @@
-@import "globals.css";
-@import "grid.css";
-@import "popup.css";
-@import "footer.css";
-@import "form.css";
-@import "json.css";
-@import "log.css";
-@import "game.css";
-@import "hud.css";
-@import "chat.css";
A starkingdoms-client/src/css/style.scss => starkingdoms-client/src/css/style.scss +11 -0
@@ 0,0 1,11 @@
+@import "globals.scss";
+@import "grid.scss";
+@import "popup.scss";
+@import "footer.scss";
+@import "form.scss";
+@import "json.scss";
+@import "log.scss";
+@import "game.scss";
+@import "hud.scss";
+@import "chat.scss";
+@import "utils.scss";
R starkingdoms-client/src/css/themes/catppuccin-common/definitions.css => starkingdoms-client/src/css/themes/catppuccin-mocha.scss +27 -3
@@ 1,7 1,31 @@
-/* Common name definitions for all Catppuccin-based themes. */
-/* This is also a good reference if you want to make your own themes, for what variables you *must* define. */
-
:root {
+ --rosewater: 245, 224, 220;
+ --flamingo: 242, 205, 205;
+ --pink: 245, 194, 231;
+ --mauve: 203, 166, 247;
+ --red: 243, 139, 169;
+ --maroon: 235, 160, 172;
+ --peach: 250, 179, 135;
+ --yellow: 249, 226, 175;
+ --green: 166, 227, 161;
+ --teal: 148, 226, 213;
+ --sky: 137, 220, 235;
+ --sapphire: 116, 199, 236;
+ --blue: 137, 180, 250;
+ --lavender: 180, 190, 254;
+ --text: 205, 214, 244;
+ --subtext1: 186, 194, 222;
+ --subtext0: 166, 173, 200;
+ --overlay2: 147, 153, 178;
+ --overlay1: 127, 132, 156;
+ --overlay0: 108, 112, 134;
+ --surface2: 88, 91, 112;
+ --surface1: 69, 71, 90;
+ --surface0: 49, 50, 68;
+ --base: 30, 30, 46;
+ --mantle: 24, 24, 37;
+ --crust: 17, 17, 27;
+
/* Background colors */
--bg: rgb(var(--base));
--bg-secondary-1: rgb(var(--crust));
D starkingdoms-client/src/css/themes/catppuccin-mocha/colors.css => starkingdoms-client/src/css/themes/catppuccin-mocha/colors.css +0 -31
@@ 1,31 0,0 @@
-/* Color palette from Catppuccin Mocha. Thanks! */
-@import "../catppuccin-common/definitions.css";
-
-:root {
- --rosewater: 245, 224, 220;
- --flamingo: 242, 205, 205;
- --pink: 245, 194, 231;
- --mauve: 203, 166, 247;
- --red: 243, 139, 169;
- --maroon: 235, 160, 172;
- --peach: 250, 179, 135;
- --yellow: 249, 226, 175;
- --green: 166, 227, 161;
- --teal: 148, 226, 213;
- --sky: 137, 220, 235;
- --sapphire: 116, 199, 236;
- --blue: 137, 180, 250;
- --lavender: 180, 190, 254;
- --text: 205, 214, 244;
- --subtext1: 186, 194, 222;
- --subtext0: 166, 173, 200;
- --overlay2: 147, 153, 178;
- --overlay1: 127, 132, 156;
- --overlay0: 108, 112, 134;
- --surface2: 88, 91, 112;
- --surface1: 69, 71, 90;
- --surface0: 49, 50, 68;
- --base: 30, 30, 46;
- --mantle: 24, 24, 37;
- --crust: 17, 17, 27;
-}
A starkingdoms-client/src/css/utils.scss => starkingdoms-client/src/css/utils.scss +4 -0
@@ 0,0 1,4 @@
+.hidden {
+ display: none;
+ visibility: hidden;
+}
M starkingdoms-client/src/hub.ts => starkingdoms-client/src/hub.ts +1 -1
@@ 11,7 11,7 @@ import {
SpawnPlayerPacket,
} from "./protocol.ts";
import { appendPacket } from "./packet_ui.ts";
-import { global } from "./main.ts";
+import { global } from "./routes/ingame/main.ts";
import { startRender } from "./rendering.ts";
import { addMessage } from "./chat.ts";
A starkingdoms-client/src/jwt.ts => starkingdoms-client/src/jwt.ts +31 -0
@@ 0,0 1,31 @@
+// StarKingdoms.IO, a browser game about drifting through space
+// Copyright (C) 2023 ghostly_zsh, TerraMaster85, core
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+export function parseJwt(token: string) {
+ let base64Url = token.split(".")[1];
+ let base64 = base64Url.replace(/-/g, "+").replace(/_/g, "/");
+ let jsonPayload = decodeURIComponent(
+ window
+ .atob(base64)
+ .split("")
+ .map(function (c) {
+ return "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2);
+ })
+ .join(""),
+ );
+
+ return JSON.parse(jsonPayload);
+}
D starkingdoms-client/src/main.ts => starkingdoms-client/src/main.ts +0 -196
@@ 1,196 0,0 @@
-import createDebug from "debug";
-import { ClientHub, hub_connect } from "./hub.ts";
-import { ConfigServer, loadConfig } from "./config.ts";
-import "./css/style.css";
-import "./css/themes/catppuccin-mocha/colors.css";
-import { Part, Planet } from "./protocol.ts";
-import * as PIXI from "pixi.js";
-
-let config = await loadConfig();
-
-const logger = createDebug("main");
-logger(
- `Hello, world! StarKingdoms ${APP_VERSION} (${COMMIT_HASH}) at your service!`,
-);
-/*
-if (window.localStorage.getItem("stk-packet-mode") === "debug") {
- document.getElementById("packet_log")!.classList.remove("log-hidden");
-} else {
- document.getElementById("packet_log")!.remove();
-}
-
- */
-
-export interface GlobalData {
- client: ClientHub | null;
- me: GlobalMe | null;
-
- players_map: Map<number, string>;
- inverse_players_map: Map<string, number>;
-
- planets_map: Map<number, Planet>;
-
- parts_map: Map<number, Part>;
-
- up: boolean;
- down: boolean;
- left: boolean;
- right: boolean;
-
- rendering: GlobalRendering | null;
-}
-
-export interface GlobalRendering {
- app: PIXI.Application;
- player_text_map: Map<number, PIXI.Text>;
- planet_sprite_map: Map<number, PIXI.Sprite>;
- part_sprite_map: Map<number, PIXI.Sprite>;
-}
-
-export interface GlobalMe {
- username: string;
- part_id: number;
-}
-
-export const global: GlobalData = {
- client: null,
- me: null,
- players_map: new Map(),
- inverse_players_map: new Map(),
- planets_map: new Map(),
- parts_map: new Map(),
- up: false,
- down: false,
- left: false,
- right: false,
- rendering: null,
-};
-
-export function player(): Part | undefined {
- if (global.me !== null) {
- return global.parts_map.get(global.me!.part_id);
- } else {
- return undefined;
- }
-}
-
-const version_string = `StarKingdoms Client ${APP_VERSION} (${COMMIT_HASH})`;
-document.getElementById("footer-left")!.innerHTML = version_string;
-document.getElementById("footer-right")!.innerHTML =
- `Made with <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="footer-icon"><path d="M9.653 16.915l-.005-.003-.019-.01a20.759 20.759 0 01-1.162-.682 22.045 22.045 0 01-2.582-1.9C4.045 12.733 2 10.352 2 7.5a4.5 4.5 0 018-2.828A4.5 4.5 0 0118 7.5c0 2.852-2.044 5.233-3.885 6.82a22.049 22.049 0 01-3.744 2.582l-.019.01-.005.003h-.002a.739.739 0 01-.69.001l-.002-.001z" /></svg> by the StarKingdoms team`;
-
-// Dropdown stuff
-const custom_select = document.querySelector(".fm-select")!;
-const custom_select_btn = <HTMLButtonElement>(
- document.querySelector(".fm-select-button")!
-);
-
-custom_select_btn.onclick = (e) => {
- e.stopPropagation();
- e.preventDefault();
- custom_select.classList.toggle("active");
- custom_select_btn.setAttribute(
- "aria-expanded",
- custom_select_btn.getAttribute("aria-expanded") === "true"
- ? "false"
- : "true",
- );
-};
-
-const selected_value = document.querySelector(".fm-selected-value")!;
-
-// Populate the main page server selector
-
-let inverse_server_lookup: { [name: string]: string } = {};
-
-const dropdown = document.getElementById("fm-select-dropdown")!;
-
-dropdown.innerHTML = "";
-
-for (let server_id in config.servers) {
- let server: ConfigServer = config.servers[server_id];
- if (
- server.isDevelopment &&
- window.localStorage.getItem("stk-mode") !== "debug"
- ) {
- continue;
- }
- let html_text = `
- <li>
- <input type="radio" id="${server_id}" name="server" autocomplete="off" ${
- server.isPrimary ? "checked" : ""
- } />
- <label for="${server_id}">${server.name}</label>
- </li>
- `;
- inverse_server_lookup[server.name] = server_id;
- dropdown.innerHTML += html_text;
- if (server.isPrimary) {
- selected_value.textContent = server.name;
- }
-}
-
-const options_list = document.querySelectorAll(".fm-select-dropdown li");
-options_list.forEach((option) => {
- function handler(e: Event) {
- if (
- e.type === "click" &&
- (<PointerEvent>e).clientX !== 0 &&
- (<PointerEvent>e).clientY !== 0
- ) {
- // @ts-ignore
- selected_value.textContent = this.children[1].textContent;
- custom_select.classList.remove("active");
- }
- if (e.type === "keyup") {
- console.log((<KeyboardEvent>e).target!);
- // @ts-ignore
- selected_value.textContent = this.textContent;
- custom_select.classList.remove("active");
- }
- if (
- !config.servers[inverse_server_lookup[selected_value.textContent!]]
- .isProduction
- ) {
- document.getElementById("server-danger")!.classList.remove("hidden");
- } else {
- document.getElementById("server-danger")!.classList.add("hidden");
- }
- }
- // @ts-ignore
- option.onkeyup = handler;
- // @ts-ignore
- option.onclick = handler;
-});
-
-function setStatus(stat: string) {
- document.getElementById("launch-btn")!.textContent = stat;
-}
-
-document.getElementById("join-fm")!.onsubmit = async (e) => {
- e.preventDefault();
-
- setStatus("Connecting...");
- (<HTMLButtonElement>custom_select_btn).disabled = true;
- (<HTMLInputElement>document.getElementById("username")!).disabled = true;
-
- try {
- let server_name = selected_value.textContent!;
- let server_id = inverse_server_lookup[server_name];
- let server: ConfigServer = config.servers[server_id];
-
- let username = (<HTMLInputElement>document.getElementById("username")!)
- .value;
-
- logger(
- `connecting to ${server.clientHubUrl} as ${username} with auth = none`,
- );
-
- global.client = await hub_connect(server.clientHubUrl, username);
- } catch (e) {
- setStatus("Connection failed!");
- console.error(e);
- (<HTMLButtonElement>custom_select_btn).disabled = false;
- (<HTMLInputElement>document.getElementById("username")!).disabled = false;
- }
-};
M starkingdoms-client/src/packet_ui.ts => starkingdoms-client/src/packet_ui.ts +1 -2
@@ 1,5 1,4 @@
-// @ts-ignore
-import { Direction, Packet, type_direction } from "./protocol.ts";
+import { Packet, type_direction } from "./protocol.ts";
import createDebug from "debug";
const logger = createDebug("jsonview");
M starkingdoms-client/src/rendering.ts => starkingdoms-client/src/rendering.ts +1 -8
@@ 1,18 1,11 @@
import * as PIXI from "pixi.js";
-import { global, player } from "./main.ts";
+import { global, player } from "./routes/ingame/main.ts";
import { part_texture_url, planet_texture_url } from "./textures.ts";
const PART_WIDTH = 50;
const PART_HEIGHT = 50;
export function startRender() {
- // hide the launch popup
- document.getElementById("server_selector")!.classList.add("hidden");
- // show the HUD
- document.getElementById("hud")!.classList.remove("hidden");
- // and chat
- document.getElementById("chat")!.classList.remove("hidden");
-
let app = new PIXI.Application({
width: window.innerWidth,
height: window.innerHeight,
A starkingdoms-client/src/routes/ingame/main.ts => starkingdoms-client/src/routes/ingame/main.ts +114 -0
@@ 0,0 1,114 @@
+import createDebug from "debug";
+import { ClientHub, hub_connect } from "../../hub.ts";
+import "../../css/style.scss";
+import "../../css/themes/catppuccin-mocha.scss";
+import { Part, Planet } from "../../protocol.ts";
+import * as PIXI from "pixi.js";
+import { addMessage } from "../../chat.ts";
+import { loadConfig } from "../../config.ts";
+
+export interface GlobalData {
+ client: ClientHub | null;
+ me: GlobalMe | null;
+
+ players_map: Map<number, string>;
+ inverse_players_map: Map<string, number>;
+
+ planets_map: Map<number, Planet>;
+
+ parts_map: Map<number, Part>;
+
+ up: boolean;
+ down: boolean;
+ left: boolean;
+ right: boolean;
+
+ rendering: GlobalRendering | null;
+}
+
+export interface GlobalRendering {
+ app: PIXI.Application;
+ player_text_map: Map<number, PIXI.Text>;
+ planet_sprite_map: Map<number, PIXI.Sprite>;
+ part_sprite_map: Map<number, PIXI.Sprite>;
+}
+
+export interface GlobalMe {
+ username: string;
+ part_id: number;
+}
+
+export const global: GlobalData = {
+ client: null,
+ me: null,
+ players_map: new Map(),
+ inverse_players_map: new Map(),
+ planets_map: new Map(),
+ parts_map: new Map(),
+ up: false,
+ down: false,
+ left: false,
+ right: false,
+ rendering: null,
+};
+
+async function init() {
+ (window as any).__initialized = true;
+ // @ts-ignore
+ init = undefined;
+
+ const config = await loadConfig();
+
+ const logger = createDebug("main");
+ logger(
+ `Hello, world! StarKingdoms ${APP_VERSION} (${COMMIT_HASH}) at your service!`,
+ );
+ logger("Current view: /play");
+
+ document.getElementById("footer-left")!.innerHTML =
+ `StarKingdoms Client ${APP_VERSION} (${COMMIT_HASH})`;
+
+ addMessage("server-message", "Connecting to the game server...");
+
+ let params = new URLSearchParams(window.location.search);
+
+ if (!params.has("srv")) {
+ addMessage(
+ "server-error",
+ "Server ID missing. Redirecting to main menu in 5 seconds.",
+ );
+ setTimeout(() => {
+ window.location.href = "/";
+ }, 5000);
+ return;
+ }
+ if (!params.has("username")) {
+ addMessage(
+ "server-error",
+ "Username missing. Redirecting to main menu in 5 seconds.",
+ );
+ setTimeout(() => {
+ window.location.href = "/";
+ }, 5000);
+ return;
+ }
+
+ let server_id = params.get("srv")!;
+ let username = params.get("username")!;
+
+ let server = config.servers[server_id];
+
+ await hub_connect(server.clientHubUrl, username);
+}
+
+if ((window as any).__initialized === undefined) {
+ init();
+}
+
+export function player(): Part | undefined {
+ if (global.me !== null) {
+ return global.parts_map.get(global.me!.part_id);
+ } else {
+ return undefined;
+ }
+}
A starkingdoms-client/src/routes/menu/main.ts => starkingdoms-client/src/routes/menu/main.ts +77 -0
@@ 0,0 1,77 @@
+import { ConfigServer, loadConfig } from "../../config.ts";
+import createDebug from "debug";
+import "../../css/themes/catppuccin-mocha.scss";
+import "../../css/style.scss";
+import { parseJwt } from "../../jwt.ts";
+
+// HMR wrapper, to prevent doing reinit twice
+let initialized: boolean | undefined;
+
+async function init() {
+ let config = await loadConfig();
+
+ const logger = createDebug("main");
+ logger(
+ `Hello, world! StarKingdoms ${APP_VERSION} (${COMMIT_HASH}) at your service!`,
+ );
+ logger("Current view: <index>");
+
+ initialized = true;
+
+ const account_info = document.getElementById("account-info")!;
+
+ if (window.localStorage.getItem("stk-token") != null) {
+ let token = window.localStorage.getItem("stk-token")!;
+ let token_parsed: any = parseJwt(token);
+ account_info.innerText = `Logged in as ${token_parsed.username}! Saves will be stored on the server.`;
+ }
+
+ const is_development = window.localStorage.getItem("stk-mode") === "debug";
+
+ document.getElementById("footer-left")!.innerHTML =
+ `StarKingdoms Client ${APP_VERSION} (${COMMIT_HASH})`;
+
+ // fill in the select box
+ const select_box = <HTMLSelectElement>document.getElementById("select")!;
+ const username_box = <HTMLInputElement>document.getElementById("username")!;
+ const nonprod_warning = document.getElementById("server-danger")!;
+
+ const form = <HTMLFormElement>document.getElementById("join-fm")!;
+ form.onsubmit = (e) => {
+ e.preventDefault();
+ window.location.href = `/play/?srv=${select_box.value}&username=${username_box.value}`;
+ };
+
+ select_box.innerHTML = "";
+
+ select_box.onchange = () => {
+ if (
+ config.servers[select_box.value] !== undefined &&
+ !config.servers[select_box.value].isProduction
+ ) {
+ nonprod_warning.classList.remove("hidden");
+ } else {
+ nonprod_warning.classList.add("hidden");
+ }
+ };
+
+ for (let server_id in config.servers) {
+ let server: ConfigServer = config.servers[server_id];
+
+ if (server.isDevelopment && !is_development) continue;
+
+ let new_option = document.createElement("option");
+ new_option.value = server_id;
+ new_option.innerText = server.name;
+
+ select_box.appendChild(new_option);
+
+ if (server.isPrimary) {
+ select_box.value = server_id;
+ }
+ }
+}
+
+if (initialized === undefined) {
+ init();
+}
M starkingdoms-client/src/textures.ts => starkingdoms-client/src/textures.ts +2 -2
@@ 1,7 1,7 @@
import { PartType, PlanetType } from "./protocol.ts";
import tex_earth from "./assets/earth.svg";
import tex_hearty from "./assets/hearty.svg";
-import tex_cargo_on from "./assets/cargo_on.svg";
+import tex_cargo_off from "./assets/cargo_off.svg";
import tex_missing from "./assets/missing.svg";
export function planet_texture_url(type: PlanetType): string {
@@ 15,7 15,7 @@ export function part_texture_url(type: PartType): string {
if (type == PartType.Hearty) {
return tex_hearty;
} else if (type == PartType.Cargo) {
- return tex_cargo_on;
+ return tex_cargo_off;
}
return tex_missing;
}
M starkingdoms-client/vite.config.ts => starkingdoms-client/vite.config.ts +15 -0
@@ 1,5 1,8 @@
import { defineConfig } from "vite";
+import { resolve } from "path";
import * as child from "child_process";
+//@ts-ignore
+import autoprefixer from "autoprefixer";
const commitHash = child
.execSync("git describe --no-match --always --abbrev=8 --dirty")
@@ 15,5 18,17 @@ export default defineConfig({
build: {
target: ["chrome89", "edge89", "firefox89", "safari15"],
cssCodeSplit: false,
+ rollupOptions: {
+ input: {
+ main: resolve(__dirname, "index.html"),
+ play: resolve(__dirname, "play/index.html"),
+ },
+ },
+ },
+ appType: "mpa",
+ css: {
+ postcss: {
+ plugins: [autoprefixer({})],
+ },
},
});
M starkingdoms-client/yarn.lock => starkingdoms-client/yarn.lock +177 -1
@@ 426,6 426,48 @@
resolved "https://registry.yarnpkg.com/@types/offscreencanvas/-/offscreencanvas-2019.7.3.tgz#90267db13f64d6e9ccb5ae3eac92786a7c77a516"
integrity sha512-ieXiYmgSRXUDeOntE1InxjWyvEelZGP63M+cGuquuRLuIKKT1osnkXjxev9B7d1nXSug5vpunx+gNlbVxMlC9A==
+anymatch@~3.1.2:
+ version "3.1.3"
+ resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e"
+ integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==
+ dependencies:
+ normalize-path "^3.0.0"
+ picomatch "^2.0.4"
+
+autoprefixer@^10.4.16:
+ version "10.4.16"
+ resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.16.tgz#fad1411024d8670880bdece3970aa72e3572feb8"
+ integrity sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==
+ dependencies:
+ browserslist "^4.21.10"
+ caniuse-lite "^1.0.30001538"
+ fraction.js "^4.3.6"
+ normalize-range "^0.1.2"
+ picocolors "^1.0.0"
+ postcss-value-parser "^4.2.0"
+
+binary-extensions@^2.0.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"
+ integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==
+
+braces@~3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
+ integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
+ dependencies:
+ fill-range "^7.0.1"
+
+browserslist@^4.21.10:
+ version "4.22.1"
+ resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.22.1.tgz#ba91958d1a59b87dab6fed8dfbcb3da5e2e9c619"
+ integrity sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==
+ dependencies:
+ caniuse-lite "^1.0.30001541"
+ electron-to-chromium "^1.4.535"
+ node-releases "^2.0.13"
+ update-browserslist-db "^1.0.13"
+
call-bind@^1.0.0:
version "1.0.5"
resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.5.tgz#6fa2b7845ce0ea49bf4d8b9ef64727a2c2e2e513"
@@ 435,6 477,26 @@ call-bind@^1.0.0:
get-intrinsic "^1.2.1"
set-function-length "^1.1.1"
+caniuse-lite@^1.0.30001538, caniuse-lite@^1.0.30001541:
+ version "1.0.30001565"
+ resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001565.tgz#a528b253c8a2d95d2b415e11d8b9942acc100c4f"
+ integrity sha512-xrE//a3O7TP0vaJ8ikzkD2c2NgcVUvsEe2IvFTntV4Yd1Z9FVzh+gW+enX96L0psrbaFMcVcH2l90xNuGDWc8w==
+
+"chokidar@>=3.0.0 <4.0.0":
+ version "3.5.3"
+ resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"
+ integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==
+ dependencies:
+ anymatch "~3.1.2"
+ braces "~3.0.2"
+ glob-parent "~5.1.2"
+ is-binary-path "~2.1.0"
+ is-glob "~4.0.1"
+ normalize-path "~3.0.0"
+ readdirp "~3.6.0"
+ optionalDependencies:
+ fsevents "~2.3.2"
+
debug@^4.3.4:
version "4.3.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
@@ 456,6 518,11 @@ earcut@^2.2.4:
resolved "https://registry.yarnpkg.com/earcut/-/earcut-2.2.4.tgz#6d02fd4d68160c114825d06890a92ecaae60343a"
integrity sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==
+electron-to-chromium@^1.4.535:
+ version "1.4.599"
+ resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.599.tgz#754d368c7d6086c92099236de10dbbc93dfb7688"
+ integrity sha512-FdLI0/h+PvShEqmBMnZCdbgabAuQiiM9Ph8hVGmPOR5GU1XXZgwLRCMogE63OrUxcDEOBlEMVYAgtkJjWFnhRA==
+
esbuild@^0.19.3:
version "0.19.7"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.7.tgz#b9a7235097b81278dcf090e2532ed13c95a2ee84"
@@ 484,11 551,28 @@ esbuild@^0.19.3:
"@esbuild/win32-ia32" "0.19.7"
"@esbuild/win32-x64" "0.19.7"
+escalade@^3.1.1:
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
+ integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==
+
eventemitter3@^4.0.0:
version "4.0.7"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f"
integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==
+fill-range@^7.0.1:
+ version "7.0.1"
+ resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
+ integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
+ dependencies:
+ to-regex-range "^5.0.1"
+
+fraction.js@^4.3.6:
+ version "4.3.7"
+ resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.3.7.tgz#06ca0085157e42fda7f9e726e79fefc4068840f7"
+ integrity sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==
+
fsevents@~2.3.2, fsevents@~2.3.3:
version "2.3.3"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
@@ 509,6 593,13 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.3, get-intrinsic@^1.2.1, get-intrinsic@
has-symbols "^1.0.3"
hasown "^2.0.0"
+glob-parent@~5.1.2:
+ version "5.1.2"
+ resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
+ integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
+ dependencies:
+ is-glob "^4.0.1"
+
gopd@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c"
@@ 540,6 631,35 @@ hasown@^2.0.0:
dependencies:
function-bind "^1.1.2"
+immutable@^4.0.0:
+ version "4.3.4"
+ resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.4.tgz#2e07b33837b4bb7662f288c244d1ced1ef65a78f"
+ integrity sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA==
+
+is-binary-path@~2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
+ integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==
+ dependencies:
+ binary-extensions "^2.0.0"
+
+is-extglob@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
+ integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==
+
+is-glob@^4.0.1, is-glob@~4.0.1:
+ version "4.0.3"
+ resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084"
+ integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==
+ dependencies:
+ is-extglob "^2.1.1"
+
+is-number@^7.0.0:
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
+ integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
+
ismobilejs@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/ismobilejs/-/ismobilejs-1.1.1.tgz#c56ca0ae8e52b24ca0f22ba5ef3215a2ddbbaa0e"
@@ 555,6 675,21 @@ nanoid@^3.3.6:
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8"
integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==
+node-releases@^2.0.13:
+ version "2.0.13"
+ resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d"
+ integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==
+
+normalize-path@^3.0.0, normalize-path@~3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
+ integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
+
+normalize-range@^0.1.2:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942"
+ integrity sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==
+
object-inspect@^1.9.0:
version "1.13.1"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.1.tgz#b96c6109324ccfef6b12216a956ca4dc2ff94bc2"
@@ 565,6 700,11 @@ picocolors@^1.0.0:
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==
+picomatch@^2.0.4, picomatch@^2.2.1:
+ version "2.3.1"
+ resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
+ integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
+
pixi.js@^7.3.2:
version "7.3.2"
resolved "https://registry.yarnpkg.com/pixi.js/-/pixi.js-7.3.2.tgz#86f0287a3763e9141691f496e384a2763fb6552c"
@@ 601,6 741,11 @@ pixi.js@^7.3.2:
"@pixi/text-bitmap" "7.3.2"
"@pixi/text-html" "7.3.2"
+postcss-value-parser@^4.2.0:
+ version "4.2.0"
+ resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514"
+ integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==
+
postcss@^8.4.31:
version "8.4.31"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.31.tgz#92b451050a9f914da6755af352bdc0192508656d"
@@ 627,6 772,13 @@ qs@^6.11.2:
dependencies:
side-channel "^1.0.4"
+readdirp@~3.6.0:
+ version "3.6.0"
+ resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
+ integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==
+ dependencies:
+ picomatch "^2.2.1"
+
rollup@^4.2.0:
version "4.5.2"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.5.2.tgz#2cf0ef0a57cb4038c50a66356684fd30071d0595"
@@ 646,6 798,15 @@ rollup@^4.2.0:
"@rollup/rollup-win32-x64-msvc" "4.5.2"
fsevents "~2.3.2"
+sass@^1.69.5:
+ version "1.69.5"
+ resolved "https://registry.yarnpkg.com/sass/-/sass-1.69.5.tgz#23e18d1c757a35f2e52cc81871060b9ad653dfde"
+ integrity sha512-qg2+UCJibLr2LCVOt3OlPhr/dqVHWOa9XtZf2OjbLs/T4VPSJ00udtgJxH3neXZm+QqX8B+3cU7RaLqp1iVfcQ==
+ dependencies:
+ chokidar ">=3.0.0 <4.0.0"
+ immutable "^4.0.0"
+ source-map-js ">=0.6.2 <2.0.0"
+
set-function-length@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.1.1.tgz#4bc39fafb0307224a33e106a7d35ca1218d659ed"
@@ 665,11 826,18 @@ side-channel@^1.0.4:
get-intrinsic "^1.0.2"
object-inspect "^1.9.0"
-source-map-js@^1.0.2:
+"source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==
+to-regex-range@^5.0.1:
+ version "5.0.1"
+ resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
+ integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==
+ dependencies:
+ is-number "^7.0.0"
+
typescript@^5.2.2:
version "5.3.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.2.tgz#00d1c7c1c46928c5845c1ee8d0cc2791031d4c43"
@@ 680,6 848,14 @@ undici-types@~5.26.4:
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==
+update-browserslist-db@^1.0.13:
+ version "1.0.13"
+ resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4"
+ integrity sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==
+ dependencies:
+ escalade "^3.1.1"
+ picocolors "^1.0.0"
+
url@^0.11.0:
version "0.11.3"
resolved "https://registry.yarnpkg.com/url/-/url-0.11.3.tgz#6f495f4b935de40ce4a0a52faee8954244f3d3ad"
A starkingdoms-common/Cargo.toml => starkingdoms-common/Cargo.toml +9 -0
@@ 0,0 1,9 @@
+[package]
+name = "starkingdoms-common"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+serde = { version = "1", features = ["derive"] }<
\ No newline at end of file
A starkingdoms-common/src/lib.rs => starkingdoms-common/src/lib.rs +7 -0
@@ 0,0 1,7 @@
+use serde::{Deserialize, Serialize};
+
+#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
+#[serde(tag = "version", content = "data")]
+pub enum PlayerSaveFile {
+ V1 {},
+}