neon_arch commited on
Commit
707bf15
2 Parent(s): 8904f34 e6bb981

Merge pull request #52 from neon-mmd/ability-to-have-config-on-diff-paths

Browse files
Files changed (3) hide show
  1. Cargo.lock +97 -97
  2. Cargo.toml +1 -1
  3. src/config_parser/parser.rs +52 -5
Cargo.lock CHANGED
@@ -4,19 +4,19 @@ version = 3
4
 
5
  [[package]]
6
  name = "actix-codec"
7
- version = "0.5.0"
8
  source = "registry+https://github.com/rust-lang/crates.io-index"
9
- checksum = "57a7559404a7f3573127aab53c08ce37a6c6a315c374a31070f3c91cd1b4a7fe"
10
  dependencies = [
11
  "bitflags",
12
  "bytes 1.4.0",
13
  "futures-core",
14
  "futures-sink",
15
- "log",
16
  "memchr",
17
  "pin-project-lite",
18
- "tokio 1.28.0",
19
  "tokio-util",
 
20
  ]
21
 
22
  [[package]]
@@ -53,7 +53,7 @@ dependencies = [
53
  "actix-service",
54
  "actix-utils",
55
  "ahash 0.8.3",
56
- "base64 0.21.0",
57
  "bitflags",
58
  "brotli",
59
  "bytes 1.4.0",
@@ -62,7 +62,7 @@ dependencies = [
62
  "encoding_rs",
63
  "flate2",
64
  "futures-core",
65
- "h2 0.3.18",
66
  "http 0.2.9",
67
  "httparse",
68
  "httpdate",
@@ -75,7 +75,7 @@ dependencies = [
75
  "rand 0.8.5",
76
  "sha1",
77
  "smallvec 1.10.0",
78
- "tokio 1.28.0",
79
  "tokio-util",
80
  "tracing",
81
  "zstd",
@@ -111,7 +111,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
111
  checksum = "15265b6b8e2347670eb363c47fc8c75208b4a4994b27192f345fcbe707804f3e"
112
  dependencies = [
113
  "futures-core",
114
- "tokio 1.28.0",
115
  ]
116
 
117
  [[package]]
@@ -128,7 +128,7 @@ dependencies = [
128
  "mio 0.8.6",
129
  "num_cpus",
130
  "socket2",
131
- "tokio 1.28.0",
132
  "tracing",
133
  ]
134
 
@@ -201,7 +201,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
201
  checksum = "2262160a7ae29e3415554a3f1fc04c764b1540c116aa524683208078b7a75bc9"
202
  dependencies = [
203
  "actix-router",
204
- "proc-macro2 1.0.56",
205
  "quote 1.0.27",
206
  "syn 1.0.109",
207
  ]
@@ -315,9 +315,9 @@ dependencies = [
315
 
316
  [[package]]
317
  name = "base64"
318
- version = "0.21.0"
319
  source = "registry+https://github.com/rust-lang/crates.io-index"
320
- checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"
321
 
322
  [[package]]
323
  name = "bit-set"
@@ -381,9 +381,9 @@ dependencies = [
381
 
382
  [[package]]
383
  name = "bumpalo"
384
- version = "3.12.1"
385
  source = "registry+https://github.com/rust-lang/crates.io-index"
386
- checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8"
387
 
388
  [[package]]
389
  name = "byteorder"
@@ -605,7 +605,7 @@ dependencies = [
605
  "itoa 1.0.6",
606
  "matches",
607
  "phf 0.10.1",
608
- "proc-macro2 1.0.56",
609
  "quote 1.0.27",
610
  "smallvec 1.10.0",
611
  "syn 1.0.109",
@@ -628,7 +628,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
628
  checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
629
  dependencies = [
630
  "convert_case",
631
- "proc-macro2 1.0.56",
632
  "quote 1.0.27",
633
  "rustc_version 0.4.0",
634
  "syn 1.0.109",
@@ -636,9 +636,9 @@ dependencies = [
636
 
637
  [[package]]
638
  name = "digest"
639
- version = "0.10.6"
640
  source = "registry+https://github.com/rust-lang/crates.io-index"
641
- checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f"
642
  dependencies = [
643
  "block-buffer",
644
  "crypto-common",
@@ -730,7 +730,7 @@ version = "0.1.8"
730
  source = "registry+https://github.com/rust-lang/crates.io-index"
731
  checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4"
732
  dependencies = [
733
- "proc-macro2 1.0.56",
734
  "quote 1.0.27",
735
  "syn 1.0.109",
736
  "synstructure",
@@ -959,9 +959,9 @@ dependencies = [
959
 
960
  [[package]]
961
  name = "h2"
962
- version = "0.3.18"
963
  source = "registry+https://github.com/rust-lang/crates.io-index"
964
- checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21"
965
  dependencies = [
966
  "bytes 1.4.0",
967
  "fnv",
@@ -971,16 +971,16 @@ dependencies = [
971
  "http 0.2.9",
972
  "indexmap",
973
  "slab",
974
- "tokio 1.28.0",
975
  "tokio-util",
976
  "tracing",
977
  ]
978
 
979
  [[package]]
980
  name = "handlebars"
981
- version = "4.3.6"
982
  source = "registry+https://github.com/rust-lang/crates.io-index"
983
- checksum = "035ef95d03713f2c347a72547b7cd38cbc9af7cd51e6099fb62d586d4a6dee3a"
984
  dependencies = [
985
  "log",
986
  "pest",
@@ -1035,7 +1035,7 @@ dependencies = [
1035
  "log",
1036
  "mac",
1037
  "markup5ever 0.11.0",
1038
- "proc-macro2 1.0.56",
1039
  "quote 1.0.27",
1040
  "syn 1.0.109",
1041
  ]
@@ -1149,7 +1149,7 @@ dependencies = [
1149
  "futures-channel",
1150
  "futures-core",
1151
  "futures-util",
1152
- "h2 0.3.18",
1153
  "http 0.2.9",
1154
  "http-body 0.4.5",
1155
  "httparse",
@@ -1157,7 +1157,7 @@ dependencies = [
1157
  "itoa 1.0.6",
1158
  "pin-project-lite",
1159
  "socket2",
1160
- "tokio 1.28.0",
1161
  "tower-service",
1162
  "tracing",
1163
  "want 0.3.0",
@@ -1185,7 +1185,7 @@ dependencies = [
1185
  "bytes 1.4.0",
1186
  "hyper 0.14.26",
1187
  "native-tls",
1188
- "tokio 1.28.0",
1189
  "tokio-native-tls",
1190
  ]
1191
 
@@ -1301,9 +1301,9 @@ dependencies = [
1301
 
1302
  [[package]]
1303
  name = "js-sys"
1304
- version = "0.3.62"
1305
  source = "registry+https://github.com/rust-lang/crates.io-index"
1306
- checksum = "68c16e1bfd491478ab155fd8b4896b86f9ede344949b641e61501e07c2b8b4d5"
1307
  dependencies = [
1308
  "wasm-bindgen",
1309
  ]
@@ -1338,9 +1338,9 @@ checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1"
1338
 
1339
  [[package]]
1340
  name = "linux-raw-sys"
1341
- version = "0.3.7"
1342
  source = "registry+https://github.com/rust-lang/crates.io-index"
1343
- checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f"
1344
 
1345
  [[package]]
1346
  name = "local-channel"
@@ -1631,9 +1631,9 @@ version = "0.1.1"
1631
  source = "registry+https://github.com/rust-lang/crates.io-index"
1632
  checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
1633
  dependencies = [
1634
- "proc-macro2 1.0.56",
1635
  "quote 1.0.27",
1636
- "syn 2.0.15",
1637
  ]
1638
 
1639
  [[package]]
@@ -1749,9 +1749,9 @@ checksum = "6c435bf1076437b851ebc8edc3a18442796b30f1728ffea6262d59bbe28b077e"
1749
  dependencies = [
1750
  "pest",
1751
  "pest_meta",
1752
- "proc-macro2 1.0.56",
1753
  "quote 1.0.27",
1754
- "syn 2.0.15",
1755
  ]
1756
 
1757
  [[package]]
@@ -1863,7 +1863,7 @@ dependencies = [
1863
  "phf_generator 0.10.0",
1864
  "phf_shared 0.10.0",
1865
  "proc-macro-hack",
1866
- "proc-macro2 1.0.56",
1867
  "quote 1.0.27",
1868
  "syn 1.0.109",
1869
  ]
@@ -1942,9 +1942,9 @@ dependencies = [
1942
 
1943
  [[package]]
1944
  name = "proc-macro2"
1945
- version = "1.0.56"
1946
  source = "registry+https://github.com/rust-lang/crates.io-index"
1947
- checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435"
1948
  dependencies = [
1949
  "unicode-ident",
1950
  ]
@@ -1974,7 +1974,7 @@ version = "1.0.27"
1974
  source = "registry+https://github.com/rust-lang/crates.io-index"
1975
  checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500"
1976
  dependencies = [
1977
- "proc-macro2 1.0.56",
1978
  ]
1979
 
1980
  [[package]]
@@ -2213,9 +2213,9 @@ dependencies = [
2213
 
2214
  [[package]]
2215
  name = "regex"
2216
- version = "1.8.1"
2217
  source = "registry+https://github.com/rust-lang/crates.io-index"
2218
- checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370"
2219
  dependencies = [
2220
  "aho-corasick",
2221
  "memchr",
@@ -2224,9 +2224,9 @@ dependencies = [
2224
 
2225
  [[package]]
2226
  name = "regex-syntax"
2227
- version = "0.7.1"
2228
  source = "registry+https://github.com/rust-lang/crates.io-index"
2229
- checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c"
2230
 
2231
  [[package]]
2232
  name = "reqwest"
@@ -2264,16 +2264,16 @@ dependencies = [
2264
 
2265
  [[package]]
2266
  name = "reqwest"
2267
- version = "0.11.17"
2268
  source = "registry+https://github.com/rust-lang/crates.io-index"
2269
- checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91"
2270
  dependencies = [
2271
- "base64 0.21.0",
2272
  "bytes 1.4.0",
2273
  "encoding_rs",
2274
  "futures-core",
2275
  "futures-util",
2276
- "h2 0.3.18",
2277
  "http 0.2.9",
2278
  "http-body 0.4.5",
2279
  "hyper 0.14.26",
@@ -2289,7 +2289,7 @@ dependencies = [
2289
  "serde",
2290
  "serde_json",
2291
  "serde_urlencoded 0.7.1",
2292
- "tokio 1.28.0",
2293
  "tokio-native-tls",
2294
  "tower-service",
2295
  "url 2.3.1",
@@ -2410,9 +2410,9 @@ dependencies = [
2410
 
2411
  [[package]]
2412
  name = "security-framework"
2413
- version = "2.8.2"
2414
  source = "registry+https://github.com/rust-lang/crates.io-index"
2415
- checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254"
2416
  dependencies = [
2417
  "bitflags",
2418
  "core-foundation",
@@ -2423,9 +2423,9 @@ dependencies = [
2423
 
2424
  [[package]]
2425
  name = "security-framework-sys"
2426
- version = "2.8.0"
2427
  source = "registry+https://github.com/rust-lang/crates.io-index"
2428
- checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4"
2429
  dependencies = [
2430
  "core-foundation-sys",
2431
  "libc",
@@ -2482,22 +2482,22 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
2482
 
2483
  [[package]]
2484
  name = "serde"
2485
- version = "1.0.162"
2486
  source = "registry+https://github.com/rust-lang/crates.io-index"
2487
- checksum = "71b2f6e1ab5c2b98c05f0f35b236b22e8df7ead6ffbf51d7808da7f8817e7ab6"
2488
  dependencies = [
2489
  "serde_derive",
2490
  ]
2491
 
2492
  [[package]]
2493
  name = "serde_derive"
2494
- version = "1.0.162"
2495
  source = "registry+https://github.com/rust-lang/crates.io-index"
2496
- checksum = "a2a0814352fd64b58489904a44ea8d90cb1a91dcb6b4f5ebabc32c8318e93cb6"
2497
  dependencies = [
2498
- "proc-macro2 1.0.56",
2499
  "quote 1.0.27",
2500
- "syn 2.0.15",
2501
  ]
2502
 
2503
  [[package]]
@@ -2680,7 +2680,7 @@ checksum = "f0f45ed1b65bf9a4bf2f7b7dc59212d1926e9eaf00fa998988e420fd124467c6"
2680
  dependencies = [
2681
  "phf_generator 0.7.24",
2682
  "phf_shared 0.7.24",
2683
- "proc-macro2 1.0.56",
2684
  "quote 1.0.27",
2685
  "string_cache_shared",
2686
  ]
@@ -2693,7 +2693,7 @@ checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988"
2693
  dependencies = [
2694
  "phf_generator 0.10.0",
2695
  "phf_shared 0.10.0",
2696
- "proc-macro2 1.0.56",
2697
  "quote 1.0.27",
2698
  ]
2699
 
@@ -2720,18 +2720,18 @@ version = "1.0.109"
2720
  source = "registry+https://github.com/rust-lang/crates.io-index"
2721
  checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
2722
  dependencies = [
2723
- "proc-macro2 1.0.56",
2724
  "quote 1.0.27",
2725
  "unicode-ident",
2726
  ]
2727
 
2728
  [[package]]
2729
  name = "syn"
2730
- version = "2.0.15"
2731
  source = "registry+https://github.com/rust-lang/crates.io-index"
2732
- checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822"
2733
  dependencies = [
2734
- "proc-macro2 1.0.56",
2735
  "quote 1.0.27",
2736
  "unicode-ident",
2737
  ]
@@ -2742,7 +2742,7 @@ version = "0.12.6"
2742
  source = "registry+https://github.com/rust-lang/crates.io-index"
2743
  checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
2744
  dependencies = [
2745
- "proc-macro2 1.0.56",
2746
  "quote 1.0.27",
2747
  "syn 1.0.109",
2748
  "unicode-xid 0.2.4",
@@ -2796,9 +2796,9 @@ version = "1.0.40"
2796
  source = "registry+https://github.com/rust-lang/crates.io-index"
2797
  checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
2798
  dependencies = [
2799
- "proc-macro2 1.0.56",
2800
  "quote 1.0.27",
2801
- "syn 2.0.15",
2802
  ]
2803
 
2804
  [[package]]
@@ -2875,9 +2875,9 @@ dependencies = [
2875
 
2876
  [[package]]
2877
  name = "tokio"
2878
- version = "1.28.0"
2879
  source = "registry+https://github.com/rust-lang/crates.io-index"
2880
- checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f"
2881
  dependencies = [
2882
  "autocfg 1.1.0",
2883
  "bytes 1.4.0",
@@ -2940,9 +2940,9 @@ version = "2.1.0"
2940
  source = "registry+https://github.com/rust-lang/crates.io-index"
2941
  checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e"
2942
  dependencies = [
2943
- "proc-macro2 1.0.56",
2944
  "quote 1.0.27",
2945
- "syn 2.0.15",
2946
  ]
2947
 
2948
  [[package]]
@@ -2952,7 +2952,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
2952
  checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
2953
  dependencies = [
2954
  "native-tls",
2955
- "tokio 1.28.0",
2956
  ]
2957
 
2958
  [[package]]
@@ -3037,7 +3037,7 @@ dependencies = [
3037
  "futures-core",
3038
  "futures-sink",
3039
  "pin-project-lite",
3040
- "tokio 1.28.0",
3041
  "tracing",
3042
  ]
3043
 
@@ -3061,9 +3061,9 @@ dependencies = [
3061
 
3062
  [[package]]
3063
  name = "tracing-core"
3064
- version = "0.1.30"
3065
  source = "registry+https://github.com/rust-lang/crates.io-index"
3066
- checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a"
3067
  dependencies = [
3068
  "once_cell",
3069
  ]
@@ -3243,9 +3243,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
3243
 
3244
  [[package]]
3245
  name = "wasm-bindgen"
3246
- version = "0.2.85"
3247
  source = "registry+https://github.com/rust-lang/crates.io-index"
3248
- checksum = "5b6cb788c4e39112fbe1822277ef6fb3c55cd86b95cb3d3c4c1c9597e4ac74b4"
3249
  dependencies = [
3250
  "cfg-if 1.0.0",
3251
  "wasm-bindgen-macro",
@@ -3253,24 +3253,24 @@ dependencies = [
3253
 
3254
  [[package]]
3255
  name = "wasm-bindgen-backend"
3256
- version = "0.2.85"
3257
  source = "registry+https://github.com/rust-lang/crates.io-index"
3258
- checksum = "35e522ed4105a9d626d885b35d62501b30d9666283a5c8be12c14a8bdafe7822"
3259
  dependencies = [
3260
  "bumpalo",
3261
  "log",
3262
  "once_cell",
3263
- "proc-macro2 1.0.56",
3264
  "quote 1.0.27",
3265
- "syn 2.0.15",
3266
  "wasm-bindgen-shared",
3267
  ]
3268
 
3269
  [[package]]
3270
  name = "wasm-bindgen-futures"
3271
- version = "0.4.35"
3272
  source = "registry+https://github.com/rust-lang/crates.io-index"
3273
- checksum = "083abe15c5d88556b77bdf7aef403625be9e327ad37c62c4e4129af740168163"
3274
  dependencies = [
3275
  "cfg-if 1.0.0",
3276
  "js-sys",
@@ -3280,9 +3280,9 @@ dependencies = [
3280
 
3281
  [[package]]
3282
  name = "wasm-bindgen-macro"
3283
- version = "0.2.85"
3284
  source = "registry+https://github.com/rust-lang/crates.io-index"
3285
- checksum = "358a79a0cb89d21db8120cbfb91392335913e4890665b1a7981d9e956903b434"
3286
  dependencies = [
3287
  "quote 1.0.27",
3288
  "wasm-bindgen-macro-support",
@@ -3290,28 +3290,28 @@ dependencies = [
3290
 
3291
  [[package]]
3292
  name = "wasm-bindgen-macro-support"
3293
- version = "0.2.85"
3294
  source = "registry+https://github.com/rust-lang/crates.io-index"
3295
- checksum = "4783ce29f09b9d93134d41297aded3a712b7b979e9c6f28c32cb88c973a94869"
3296
  dependencies = [
3297
- "proc-macro2 1.0.56",
3298
  "quote 1.0.27",
3299
- "syn 2.0.15",
3300
  "wasm-bindgen-backend",
3301
  "wasm-bindgen-shared",
3302
  ]
3303
 
3304
  [[package]]
3305
  name = "wasm-bindgen-shared"
3306
- version = "0.2.85"
3307
  source = "registry+https://github.com/rust-lang/crates.io-index"
3308
- checksum = "a901d592cafaa4d711bc324edfaff879ac700b19c3dfd60058d2b445be2691eb"
3309
 
3310
  [[package]]
3311
  name = "web-sys"
3312
- version = "0.3.62"
3313
  source = "registry+https://github.com/rust-lang/crates.io-index"
3314
- checksum = "16b5f940c7edfdc6d12126d98c9ef4d1b3d470011c47c76a6581df47ad9ba721"
3315
  dependencies = [
3316
  "js-sys",
3317
  "wasm-bindgen",
@@ -3319,7 +3319,7 @@ dependencies = [
3319
 
3320
  [[package]]
3321
  name = "websurfx"
3322
- version = "0.6.0"
3323
  dependencies = [
3324
  "actix-files",
3325
  "actix-web",
@@ -3331,12 +3331,12 @@ dependencies = [
3331
  "once_cell",
3332
  "rand 0.8.5",
3333
  "redis",
3334
- "reqwest 0.11.17",
3335
  "rlua",
3336
  "scraper",
3337
  "serde",
3338
  "serde_json",
3339
- "tokio 1.28.0",
3340
  ]
3341
 
3342
  [[package]]
 
4
 
5
  [[package]]
6
  name = "actix-codec"
7
+ version = "0.5.1"
8
  source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "617a8268e3537fe1d8c9ead925fca49ef6400927ee7bc26750e90ecee14ce4b8"
10
  dependencies = [
11
  "bitflags",
12
  "bytes 1.4.0",
13
  "futures-core",
14
  "futures-sink",
 
15
  "memchr",
16
  "pin-project-lite",
17
+ "tokio 1.28.1",
18
  "tokio-util",
19
+ "tracing",
20
  ]
21
 
22
  [[package]]
 
53
  "actix-service",
54
  "actix-utils",
55
  "ahash 0.8.3",
56
+ "base64 0.21.1",
57
  "bitflags",
58
  "brotli",
59
  "bytes 1.4.0",
 
62
  "encoding_rs",
63
  "flate2",
64
  "futures-core",
65
+ "h2 0.3.19",
66
  "http 0.2.9",
67
  "httparse",
68
  "httpdate",
 
75
  "rand 0.8.5",
76
  "sha1",
77
  "smallvec 1.10.0",
78
+ "tokio 1.28.1",
79
  "tokio-util",
80
  "tracing",
81
  "zstd",
 
111
  checksum = "15265b6b8e2347670eb363c47fc8c75208b4a4994b27192f345fcbe707804f3e"
112
  dependencies = [
113
  "futures-core",
114
+ "tokio 1.28.1",
115
  ]
116
 
117
  [[package]]
 
128
  "mio 0.8.6",
129
  "num_cpus",
130
  "socket2",
131
+ "tokio 1.28.1",
132
  "tracing",
133
  ]
134
 
 
201
  checksum = "2262160a7ae29e3415554a3f1fc04c764b1540c116aa524683208078b7a75bc9"
202
  dependencies = [
203
  "actix-router",
204
+ "proc-macro2 1.0.58",
205
  "quote 1.0.27",
206
  "syn 1.0.109",
207
  ]
 
315
 
316
  [[package]]
317
  name = "base64"
318
+ version = "0.21.1"
319
  source = "registry+https://github.com/rust-lang/crates.io-index"
320
+ checksum = "3f1e31e207a6b8fb791a38ea3105e6cb541f55e4d029902d3039a4ad07cc4105"
321
 
322
  [[package]]
323
  name = "bit-set"
 
381
 
382
  [[package]]
383
  name = "bumpalo"
384
+ version = "3.13.0"
385
  source = "registry+https://github.com/rust-lang/crates.io-index"
386
+ checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1"
387
 
388
  [[package]]
389
  name = "byteorder"
 
605
  "itoa 1.0.6",
606
  "matches",
607
  "phf 0.10.1",
608
+ "proc-macro2 1.0.58",
609
  "quote 1.0.27",
610
  "smallvec 1.10.0",
611
  "syn 1.0.109",
 
628
  checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
629
  dependencies = [
630
  "convert_case",
631
+ "proc-macro2 1.0.58",
632
  "quote 1.0.27",
633
  "rustc_version 0.4.0",
634
  "syn 1.0.109",
 
636
 
637
  [[package]]
638
  name = "digest"
639
+ version = "0.10.7"
640
  source = "registry+https://github.com/rust-lang/crates.io-index"
641
+ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
642
  dependencies = [
643
  "block-buffer",
644
  "crypto-common",
 
730
  source = "registry+https://github.com/rust-lang/crates.io-index"
731
  checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4"
732
  dependencies = [
733
+ "proc-macro2 1.0.58",
734
  "quote 1.0.27",
735
  "syn 1.0.109",
736
  "synstructure",
 
959
 
960
  [[package]]
961
  name = "h2"
962
+ version = "0.3.19"
963
  source = "registry+https://github.com/rust-lang/crates.io-index"
964
+ checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782"
965
  dependencies = [
966
  "bytes 1.4.0",
967
  "fnv",
 
971
  "http 0.2.9",
972
  "indexmap",
973
  "slab",
974
+ "tokio 1.28.1",
975
  "tokio-util",
976
  "tracing",
977
  ]
978
 
979
  [[package]]
980
  name = "handlebars"
981
+ version = "4.3.7"
982
  source = "registry+https://github.com/rust-lang/crates.io-index"
983
+ checksum = "83c3372087601b532857d332f5957cbae686da52bb7810bf038c3e3c3cc2fa0d"
984
  dependencies = [
985
  "log",
986
  "pest",
 
1035
  "log",
1036
  "mac",
1037
  "markup5ever 0.11.0",
1038
+ "proc-macro2 1.0.58",
1039
  "quote 1.0.27",
1040
  "syn 1.0.109",
1041
  ]
 
1149
  "futures-channel",
1150
  "futures-core",
1151
  "futures-util",
1152
+ "h2 0.3.19",
1153
  "http 0.2.9",
1154
  "http-body 0.4.5",
1155
  "httparse",
 
1157
  "itoa 1.0.6",
1158
  "pin-project-lite",
1159
  "socket2",
1160
+ "tokio 1.28.1",
1161
  "tower-service",
1162
  "tracing",
1163
  "want 0.3.0",
 
1185
  "bytes 1.4.0",
1186
  "hyper 0.14.26",
1187
  "native-tls",
1188
+ "tokio 1.28.1",
1189
  "tokio-native-tls",
1190
  ]
1191
 
 
1301
 
1302
  [[package]]
1303
  name = "js-sys"
1304
+ version = "0.3.63"
1305
  source = "registry+https://github.com/rust-lang/crates.io-index"
1306
+ checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790"
1307
  dependencies = [
1308
  "wasm-bindgen",
1309
  ]
 
1338
 
1339
  [[package]]
1340
  name = "linux-raw-sys"
1341
+ version = "0.3.8"
1342
  source = "registry+https://github.com/rust-lang/crates.io-index"
1343
+ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519"
1344
 
1345
  [[package]]
1346
  name = "local-channel"
 
1631
  source = "registry+https://github.com/rust-lang/crates.io-index"
1632
  checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
1633
  dependencies = [
1634
+ "proc-macro2 1.0.58",
1635
  "quote 1.0.27",
1636
+ "syn 2.0.16",
1637
  ]
1638
 
1639
  [[package]]
 
1749
  dependencies = [
1750
  "pest",
1751
  "pest_meta",
1752
+ "proc-macro2 1.0.58",
1753
  "quote 1.0.27",
1754
+ "syn 2.0.16",
1755
  ]
1756
 
1757
  [[package]]
 
1863
  "phf_generator 0.10.0",
1864
  "phf_shared 0.10.0",
1865
  "proc-macro-hack",
1866
+ "proc-macro2 1.0.58",
1867
  "quote 1.0.27",
1868
  "syn 1.0.109",
1869
  ]
 
1942
 
1943
  [[package]]
1944
  name = "proc-macro2"
1945
+ version = "1.0.58"
1946
  source = "registry+https://github.com/rust-lang/crates.io-index"
1947
+ checksum = "fa1fb82fc0c281dd9671101b66b771ebbe1eaf967b96ac8740dcba4b70005ca8"
1948
  dependencies = [
1949
  "unicode-ident",
1950
  ]
 
1974
  source = "registry+https://github.com/rust-lang/crates.io-index"
1975
  checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500"
1976
  dependencies = [
1977
+ "proc-macro2 1.0.58",
1978
  ]
1979
 
1980
  [[package]]
 
2213
 
2214
  [[package]]
2215
  name = "regex"
2216
+ version = "1.8.2"
2217
  source = "registry+https://github.com/rust-lang/crates.io-index"
2218
+ checksum = "d1a59b5d8e97dee33696bf13c5ba8ab85341c002922fba050069326b9c498974"
2219
  dependencies = [
2220
  "aho-corasick",
2221
  "memchr",
 
2224
 
2225
  [[package]]
2226
  name = "regex-syntax"
2227
+ version = "0.7.2"
2228
  source = "registry+https://github.com/rust-lang/crates.io-index"
2229
+ checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78"
2230
 
2231
  [[package]]
2232
  name = "reqwest"
 
2264
 
2265
  [[package]]
2266
  name = "reqwest"
2267
+ version = "0.11.18"
2268
  source = "registry+https://github.com/rust-lang/crates.io-index"
2269
+ checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55"
2270
  dependencies = [
2271
+ "base64 0.21.1",
2272
  "bytes 1.4.0",
2273
  "encoding_rs",
2274
  "futures-core",
2275
  "futures-util",
2276
+ "h2 0.3.19",
2277
  "http 0.2.9",
2278
  "http-body 0.4.5",
2279
  "hyper 0.14.26",
 
2289
  "serde",
2290
  "serde_json",
2291
  "serde_urlencoded 0.7.1",
2292
+ "tokio 1.28.1",
2293
  "tokio-native-tls",
2294
  "tower-service",
2295
  "url 2.3.1",
 
2410
 
2411
  [[package]]
2412
  name = "security-framework"
2413
+ version = "2.9.1"
2414
  source = "registry+https://github.com/rust-lang/crates.io-index"
2415
+ checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8"
2416
  dependencies = [
2417
  "bitflags",
2418
  "core-foundation",
 
2423
 
2424
  [[package]]
2425
  name = "security-framework-sys"
2426
+ version = "2.9.0"
2427
  source = "registry+https://github.com/rust-lang/crates.io-index"
2428
+ checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7"
2429
  dependencies = [
2430
  "core-foundation-sys",
2431
  "libc",
 
2482
 
2483
  [[package]]
2484
  name = "serde"
2485
+ version = "1.0.163"
2486
  source = "registry+https://github.com/rust-lang/crates.io-index"
2487
+ checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2"
2488
  dependencies = [
2489
  "serde_derive",
2490
  ]
2491
 
2492
  [[package]]
2493
  name = "serde_derive"
2494
+ version = "1.0.163"
2495
  source = "registry+https://github.com/rust-lang/crates.io-index"
2496
+ checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e"
2497
  dependencies = [
2498
+ "proc-macro2 1.0.58",
2499
  "quote 1.0.27",
2500
+ "syn 2.0.16",
2501
  ]
2502
 
2503
  [[package]]
 
2680
  dependencies = [
2681
  "phf_generator 0.7.24",
2682
  "phf_shared 0.7.24",
2683
+ "proc-macro2 1.0.58",
2684
  "quote 1.0.27",
2685
  "string_cache_shared",
2686
  ]
 
2693
  dependencies = [
2694
  "phf_generator 0.10.0",
2695
  "phf_shared 0.10.0",
2696
+ "proc-macro2 1.0.58",
2697
  "quote 1.0.27",
2698
  ]
2699
 
 
2720
  source = "registry+https://github.com/rust-lang/crates.io-index"
2721
  checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
2722
  dependencies = [
2723
+ "proc-macro2 1.0.58",
2724
  "quote 1.0.27",
2725
  "unicode-ident",
2726
  ]
2727
 
2728
  [[package]]
2729
  name = "syn"
2730
+ version = "2.0.16"
2731
  source = "registry+https://github.com/rust-lang/crates.io-index"
2732
+ checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01"
2733
  dependencies = [
2734
+ "proc-macro2 1.0.58",
2735
  "quote 1.0.27",
2736
  "unicode-ident",
2737
  ]
 
2742
  source = "registry+https://github.com/rust-lang/crates.io-index"
2743
  checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
2744
  dependencies = [
2745
+ "proc-macro2 1.0.58",
2746
  "quote 1.0.27",
2747
  "syn 1.0.109",
2748
  "unicode-xid 0.2.4",
 
2796
  source = "registry+https://github.com/rust-lang/crates.io-index"
2797
  checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
2798
  dependencies = [
2799
+ "proc-macro2 1.0.58",
2800
  "quote 1.0.27",
2801
+ "syn 2.0.16",
2802
  ]
2803
 
2804
  [[package]]
 
2875
 
2876
  [[package]]
2877
  name = "tokio"
2878
+ version = "1.28.1"
2879
  source = "registry+https://github.com/rust-lang/crates.io-index"
2880
+ checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105"
2881
  dependencies = [
2882
  "autocfg 1.1.0",
2883
  "bytes 1.4.0",
 
2940
  source = "registry+https://github.com/rust-lang/crates.io-index"
2941
  checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e"
2942
  dependencies = [
2943
+ "proc-macro2 1.0.58",
2944
  "quote 1.0.27",
2945
+ "syn 2.0.16",
2946
  ]
2947
 
2948
  [[package]]
 
2952
  checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
2953
  dependencies = [
2954
  "native-tls",
2955
+ "tokio 1.28.1",
2956
  ]
2957
 
2958
  [[package]]
 
3037
  "futures-core",
3038
  "futures-sink",
3039
  "pin-project-lite",
3040
+ "tokio 1.28.1",
3041
  "tracing",
3042
  ]
3043
 
 
3061
 
3062
  [[package]]
3063
  name = "tracing-core"
3064
+ version = "0.1.31"
3065
  source = "registry+https://github.com/rust-lang/crates.io-index"
3066
+ checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a"
3067
  dependencies = [
3068
  "once_cell",
3069
  ]
 
3243
 
3244
  [[package]]
3245
  name = "wasm-bindgen"
3246
+ version = "0.2.86"
3247
  source = "registry+https://github.com/rust-lang/crates.io-index"
3248
+ checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73"
3249
  dependencies = [
3250
  "cfg-if 1.0.0",
3251
  "wasm-bindgen-macro",
 
3253
 
3254
  [[package]]
3255
  name = "wasm-bindgen-backend"
3256
+ version = "0.2.86"
3257
  source = "registry+https://github.com/rust-lang/crates.io-index"
3258
+ checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb"
3259
  dependencies = [
3260
  "bumpalo",
3261
  "log",
3262
  "once_cell",
3263
+ "proc-macro2 1.0.58",
3264
  "quote 1.0.27",
3265
+ "syn 2.0.16",
3266
  "wasm-bindgen-shared",
3267
  ]
3268
 
3269
  [[package]]
3270
  name = "wasm-bindgen-futures"
3271
+ version = "0.4.36"
3272
  source = "registry+https://github.com/rust-lang/crates.io-index"
3273
+ checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e"
3274
  dependencies = [
3275
  "cfg-if 1.0.0",
3276
  "js-sys",
 
3280
 
3281
  [[package]]
3282
  name = "wasm-bindgen-macro"
3283
+ version = "0.2.86"
3284
  source = "registry+https://github.com/rust-lang/crates.io-index"
3285
+ checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258"
3286
  dependencies = [
3287
  "quote 1.0.27",
3288
  "wasm-bindgen-macro-support",
 
3290
 
3291
  [[package]]
3292
  name = "wasm-bindgen-macro-support"
3293
+ version = "0.2.86"
3294
  source = "registry+https://github.com/rust-lang/crates.io-index"
3295
+ checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8"
3296
  dependencies = [
3297
+ "proc-macro2 1.0.58",
3298
  "quote 1.0.27",
3299
+ "syn 2.0.16",
3300
  "wasm-bindgen-backend",
3301
  "wasm-bindgen-shared",
3302
  ]
3303
 
3304
  [[package]]
3305
  name = "wasm-bindgen-shared"
3306
+ version = "0.2.86"
3307
  source = "registry+https://github.com/rust-lang/crates.io-index"
3308
+ checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93"
3309
 
3310
  [[package]]
3311
  name = "web-sys"
3312
+ version = "0.3.63"
3313
  source = "registry+https://github.com/rust-lang/crates.io-index"
3314
+ checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2"
3315
  dependencies = [
3316
  "js-sys",
3317
  "wasm-bindgen",
 
3319
 
3320
  [[package]]
3321
  name = "websurfx"
3322
+ version = "0.8.0"
3323
  dependencies = [
3324
  "actix-files",
3325
  "actix-web",
 
3331
  "once_cell",
3332
  "rand 0.8.5",
3333
  "redis",
3334
+ "reqwest 0.11.18",
3335
  "rlua",
3336
  "scraper",
3337
  "serde",
3338
  "serde_json",
3339
+ "tokio 1.28.1",
3340
  ]
3341
 
3342
  [[package]]
Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
  [package]
2
  name = "websurfx"
3
- version = "0.6.0"
4
  edition = "2021"
5
 
6
  # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
 
1
  [package]
2
  name = "websurfx"
3
+ version = "0.8.0"
4
  edition = "2021"
5
 
6
  # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
src/config_parser/parser.rs CHANGED
@@ -3,7 +3,11 @@
3
 
4
  use super::parser_models::Style;
5
  use rlua::Lua;
6
- use std::fs;
 
 
 
 
7
 
8
  /// A named struct which stores the parsed config file options.
9
  ///
@@ -40,13 +44,13 @@ impl Config {
40
  /// or io error if the config.lua file doesn't exists otherwise it returns a newly contructed
41
  /// Config struct with all the parsed config options from the parsed config file.
42
  pub fn parse() -> Result<Self, Box<dyn std::error::Error>> {
43
- let lua = Lua::new();
44
-
45
- lua.context(|context| {
46
  let globals = context.globals();
47
 
48
  context
49
- .load(&fs::read_to_string("./websurfx/config.lua")?)
 
 
50
  .exec()?;
51
 
52
  let production_use = globals.get::<_, bool>("production_use")?;
@@ -70,4 +74,47 @@ impl Config {
70
  })
71
  })
72
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  }
 
3
 
4
  use super::parser_models::Style;
5
  use rlua::Lua;
6
+ use std::{format, fs, path::Path};
7
+
8
+ // ------- Constants --------
9
+ static COMMON_DIRECTORY_NAME: &str = "websurfx";
10
+ static CONFIG_FILE_NAME: &str = "config.lua";
11
 
12
  /// A named struct which stores the parsed config file options.
13
  ///
 
44
  /// or io error if the config.lua file doesn't exists otherwise it returns a newly contructed
45
  /// Config struct with all the parsed config options from the parsed config file.
46
  pub fn parse() -> Result<Self, Box<dyn std::error::Error>> {
47
+ Lua::new().context(|context| -> Result<Self, Box<dyn std::error::Error>> {
 
 
48
  let globals = context.globals();
49
 
50
  context
51
+ .load(&fs::read_to_string(
52
+ Config::handle_different_config_file_path()?,
53
+ )?)
54
  .exec()?;
55
 
56
  let production_use = globals.get::<_, bool>("production_use")?;
 
74
  })
75
  })
76
  }
77
+ /// A helper function which returns an appropriate config file path checking if the config
78
+ /// file exists on that path.
79
+ ///
80
+ /// # Error
81
+ ///
82
+ /// Returns a `config file not found!!` error if the config file is not present under following
83
+ /// paths which are:
84
+ /// 1. `~/.config/websurfx/` if it not present here then it fallbacks to the next one (2)
85
+ /// 2. `/etc/xdg/websurfx/config.lua` if it is not present here then it fallbacks to the next
86
+ /// one (3).
87
+ /// 3. `websurfx/` (under project folder ( or codebase in other words)) if it is not present
88
+ /// here then it returns an error as mentioned above.
89
+ fn handle_different_config_file_path() -> Result<String, Box<dyn std::error::Error>> {
90
+ if Path::new(
91
+ format!(
92
+ "{}/.config/{}/config.lua",
93
+ std::env::var("HOME").unwrap(),
94
+ COMMON_DIRECTORY_NAME
95
+ )
96
+ .as_str(),
97
+ )
98
+ .exists()
99
+ {
100
+ Ok(format!(
101
+ "{}/.config/{}/{}",
102
+ std::env::var("HOME").unwrap(),
103
+ COMMON_DIRECTORY_NAME,
104
+ CONFIG_FILE_NAME
105
+ ))
106
+ } else if Path::new(
107
+ format!("/etc/xdg/{}/{}", COMMON_DIRECTORY_NAME, CONFIG_FILE_NAME).as_str(),
108
+ )
109
+ .exists()
110
+ {
111
+ Ok("/etc/xdg/websurfx/config.lua".to_string())
112
+ } else if Path::new(format!("./{}/{}", COMMON_DIRECTORY_NAME, CONFIG_FILE_NAME).as_str())
113
+ .exists()
114
+ {
115
+ Ok("./websurfx/config.lua".to_string())
116
+ } else {
117
+ Err(format!("Config file not found!!").into())
118
+ }
119
+ }
120
  }