├── .dockerignore ├── .github └── workflows │ ├── cross-compile.yml │ ├── quickstart.yml │ └── upload.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── Dockerfile ├── Makefile ├── README.md ├── sample.csv └── src ├── index.hbs └── main.rs /.dockerignore: -------------------------------------------------------------------------------- 1 | target 2 | Dockerfile* 3 | sample.csv 4 | Makefile 5 | README.md -------------------------------------------------------------------------------- /.github/workflows/cross-compile.yml: -------------------------------------------------------------------------------- 1 | # We could use `@actions-rs/cargo` Action ability to automatically install `cross` tool 2 | # in order to compile our application for some unusual targets. 3 | 4 | on: [push, pull_request] 5 | 6 | name: Cross-compile 7 | 8 | jobs: 9 | build: 10 | name: Build - ${{ matrix.target }} @ ${{ matrix.os }} 11 | runs-on: ${{ matrix.os }} 12 | strategy: 13 | matrix: 14 | include: 15 | - target: aarch64-unknown-linux-musl 16 | os: ubuntu-latest 17 | cross: true 18 | - target: armv7-unknown-linux-musleabihf 19 | os: ubuntu-latest 20 | cross: true 21 | - target: arm-unknown-linux-musleabi 22 | os: ubuntu-latest 23 | cross: true 24 | # Already built on the quickstart job 25 | # - target: x86_64-unknown-linux-musl 26 | # os: ubuntu-latest 27 | # cross: true 28 | - target: x86_64-apple-darwin 29 | os: macos-latest 30 | cross: false 31 | - target: x86_64-pc-windows-msvc 32 | os: windows-latest 33 | cross: false 34 | steps: 35 | - uses: actions/checkout@v2 36 | - uses: actions-rs/toolchain@v1 37 | with: 38 | toolchain: stable 39 | target: ${{ matrix.target }} 40 | override: true 41 | - uses: actions-rs/cargo@v1 42 | with: 43 | use-cross: ${{ matrix.cross }} 44 | command: build 45 | args: --target=${{ matrix.target }} 46 | -------------------------------------------------------------------------------- /.github/workflows/quickstart.yml: -------------------------------------------------------------------------------- 1 | on: [push, pull_request] 2 | 3 | name: Continuous integration 4 | 5 | jobs: 6 | check: 7 | name: Check 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v2 11 | - uses: actions-rs/toolchain@v1 12 | with: 13 | profile: minimal 14 | toolchain: stable 15 | override: true 16 | - uses: actions-rs/cargo@v1 17 | with: 18 | command: check 19 | 20 | test: 21 | name: Test Suite 22 | runs-on: ubuntu-latest 23 | steps: 24 | - uses: actions/checkout@v2 25 | - uses: actions-rs/toolchain@v1 26 | with: 27 | profile: minimal 28 | toolchain: stable 29 | override: true 30 | - uses: actions-rs/cargo@v1 31 | with: 32 | command: test 33 | 34 | fmt: 35 | name: Rustfmt 36 | runs-on: ubuntu-latest 37 | steps: 38 | - uses: actions/checkout@v2 39 | - uses: actions-rs/toolchain@v1 40 | with: 41 | profile: minimal 42 | toolchain: stable 43 | override: true 44 | - run: rustup component add rustfmt 45 | - uses: actions-rs/cargo@v1 46 | with: 47 | command: fmt 48 | args: --all -- --check 49 | 50 | clippy: 51 | name: Clippy 52 | runs-on: ubuntu-latest 53 | steps: 54 | - uses: actions/checkout@v2 55 | - uses: actions-rs/toolchain@v1 56 | with: 57 | profile: minimal 58 | toolchain: stable 59 | override: true 60 | - run: rustup component add clippy 61 | - uses: actions-rs/cargo@v1 62 | with: 63 | command: clippy 64 | args: -- -D warnings -------------------------------------------------------------------------------- /.github/workflows/upload.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | release: 5 | types: [created] 6 | 7 | jobs: 8 | release: 9 | name: Release - ${{ matrix.target }} @ ${{ matrix.os }} 10 | runs-on: ${{ matrix.os }} 11 | strategy: 12 | matrix: 13 | include: 14 | - target: aarch64-unknown-linux-musl 15 | os: ubuntu-latest 16 | cross: true 17 | - target: armv7-unknown-linux-musleabihf 18 | os: ubuntu-latest 19 | cross: true 20 | - target: arm-unknown-linux-musleabi 21 | os: ubuntu-latest 22 | cross: true 23 | - target: x86_64-unknown-linux-musl 24 | os: ubuntu-latest 25 | cross: true 26 | - target: x86_64-apple-darwin 27 | os: macos-latest 28 | cross: false 29 | - target: x86_64-pc-windows-msvc 30 | os: windows-latest 31 | cross: false 32 | steps: 33 | - uses: actions/checkout@v2 34 | - uses: actions-rs/toolchain@v1 35 | with: 36 | toolchain: stable 37 | target: ${{ matrix.target }} 38 | override: true 39 | - uses: actions-rs/cargo@v1 40 | with: 41 | use-cross: ${{ matrix.cross }} 42 | command: build 43 | args: --release --target=${{ matrix.target }} 44 | - name: Build archive 45 | shell: bash 46 | run: | 47 | staging="october_${{ matrix.target }}_${{ github.event.release.tag_name }}" 48 | mkdir -p "$staging" 49 | cp README.md "$staging/" 50 | if [ "${{ matrix.os }}" = "windows-latest" ]; then 51 | cp target/${{ matrix.target }}/release/october.exe "$staging/" 52 | 7z a "$staging.zip" "$staging" 53 | echo "ASSET=$staging.zip" >> $GITHUB_ENV 54 | else 55 | cp target/${{ matrix.target }}/release/october "$staging/" 56 | tar czf "$staging.tar.gz" "$staging" 57 | echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV 58 | fi 59 | - name: Upload Release Asset 60 | uses: actions/upload-release-asset@v1 61 | env: 62 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 63 | with: 64 | upload_url: ${{ github.event.release.upload_url }} 65 | asset_path: ${{ env.ASSET }} 66 | asset_name: ${{ env.ASSET }} 67 | asset_content_type: application/octet-stream 68 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "ansi_term" 7 | version = "0.11.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" 10 | dependencies = [ 11 | "winapi", 12 | ] 13 | 14 | [[package]] 15 | name = "ansi_term" 16 | version = "0.12.1" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" 19 | dependencies = [ 20 | "winapi", 21 | ] 22 | 23 | [[package]] 24 | name = "async-trait" 25 | version = "0.1.51" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e" 28 | dependencies = [ 29 | "proc-macro2", 30 | "quote", 31 | "syn", 32 | ] 33 | 34 | [[package]] 35 | name = "atty" 36 | version = "0.2.14" 37 | source = "registry+https://github.com/rust-lang/crates.io-index" 38 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 39 | dependencies = [ 40 | "hermit-abi", 41 | "libc", 42 | "winapi", 43 | ] 44 | 45 | [[package]] 46 | name = "autocfg" 47 | version = "1.0.1" 48 | source = "registry+https://github.com/rust-lang/crates.io-index" 49 | checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" 50 | 51 | [[package]] 52 | name = "axum" 53 | version = "0.3.2" 54 | source = "registry+https://github.com/rust-lang/crates.io-index" 55 | checksum = "c5e874ee652f2ec443faed3073b80f0ac7a2042a3605fc0704d28bbbf22d623c" 56 | dependencies = [ 57 | "async-trait", 58 | "bitflags", 59 | "bytes", 60 | "futures-util", 61 | "http", 62 | "http-body", 63 | "hyper", 64 | "matchit", 65 | "mime", 66 | "percent-encoding", 67 | "pin-project-lite", 68 | "serde", 69 | "serde_json", 70 | "serde_urlencoded", 71 | "sync_wrapper", 72 | "tokio", 73 | "tokio-util", 74 | "tower", 75 | "tower-http", 76 | "tower-layer", 77 | "tower-service", 78 | ] 79 | 80 | [[package]] 81 | name = "bitflags" 82 | version = "1.3.2" 83 | source = "registry+https://github.com/rust-lang/crates.io-index" 84 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 85 | 86 | [[package]] 87 | name = "block-buffer" 88 | version = "0.7.3" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" 91 | dependencies = [ 92 | "block-padding", 93 | "byte-tools", 94 | "byteorder", 95 | "generic-array", 96 | ] 97 | 98 | [[package]] 99 | name = "block-padding" 100 | version = "0.1.5" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" 103 | dependencies = [ 104 | "byte-tools", 105 | ] 106 | 107 | [[package]] 108 | name = "bstr" 109 | version = "0.2.17" 110 | source = "registry+https://github.com/rust-lang/crates.io-index" 111 | checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" 112 | dependencies = [ 113 | "lazy_static", 114 | "memchr", 115 | "regex-automata", 116 | "serde", 117 | ] 118 | 119 | [[package]] 120 | name = "byte-tools" 121 | version = "0.3.1" 122 | source = "registry+https://github.com/rust-lang/crates.io-index" 123 | checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" 124 | 125 | [[package]] 126 | name = "byteorder" 127 | version = "1.4.3" 128 | source = "registry+https://github.com/rust-lang/crates.io-index" 129 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 130 | 131 | [[package]] 132 | name = "bytes" 133 | version = "1.1.0" 134 | source = "registry+https://github.com/rust-lang/crates.io-index" 135 | checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" 136 | 137 | [[package]] 138 | name = "cfg-if" 139 | version = "1.0.0" 140 | source = "registry+https://github.com/rust-lang/crates.io-index" 141 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 142 | 143 | [[package]] 144 | name = "clap" 145 | version = "2.33.3" 146 | source = "registry+https://github.com/rust-lang/crates.io-index" 147 | checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" 148 | dependencies = [ 149 | "ansi_term 0.11.0", 150 | "atty", 151 | "bitflags", 152 | "strsim", 153 | "textwrap", 154 | "unicode-width", 155 | "vec_map", 156 | ] 157 | 158 | [[package]] 159 | name = "csv" 160 | version = "1.1.6" 161 | source = "registry+https://github.com/rust-lang/crates.io-index" 162 | checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" 163 | dependencies = [ 164 | "bstr", 165 | "csv-core", 166 | "itoa", 167 | "ryu", 168 | "serde", 169 | ] 170 | 171 | [[package]] 172 | name = "csv-core" 173 | version = "0.1.10" 174 | source = "registry+https://github.com/rust-lang/crates.io-index" 175 | checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" 176 | dependencies = [ 177 | "memchr", 178 | ] 179 | 180 | [[package]] 181 | name = "digest" 182 | version = "0.8.1" 183 | source = "registry+https://github.com/rust-lang/crates.io-index" 184 | checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" 185 | dependencies = [ 186 | "generic-array", 187 | ] 188 | 189 | [[package]] 190 | name = "fake-simd" 191 | version = "0.1.2" 192 | source = "registry+https://github.com/rust-lang/crates.io-index" 193 | checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" 194 | 195 | [[package]] 196 | name = "fnv" 197 | version = "1.0.7" 198 | source = "registry+https://github.com/rust-lang/crates.io-index" 199 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 200 | 201 | [[package]] 202 | name = "form_urlencoded" 203 | version = "1.0.1" 204 | source = "registry+https://github.com/rust-lang/crates.io-index" 205 | checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" 206 | dependencies = [ 207 | "matches", 208 | "percent-encoding", 209 | ] 210 | 211 | [[package]] 212 | name = "futures-channel" 213 | version = "0.3.17" 214 | source = "registry+https://github.com/rust-lang/crates.io-index" 215 | checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888" 216 | dependencies = [ 217 | "futures-core", 218 | ] 219 | 220 | [[package]] 221 | name = "futures-core" 222 | version = "0.3.17" 223 | source = "registry+https://github.com/rust-lang/crates.io-index" 224 | checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d" 225 | 226 | [[package]] 227 | name = "futures-sink" 228 | version = "0.3.17" 229 | source = "registry+https://github.com/rust-lang/crates.io-index" 230 | checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11" 231 | 232 | [[package]] 233 | name = "futures-task" 234 | version = "0.3.17" 235 | source = "registry+https://github.com/rust-lang/crates.io-index" 236 | checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99" 237 | 238 | [[package]] 239 | name = "futures-util" 240 | version = "0.3.17" 241 | source = "registry+https://github.com/rust-lang/crates.io-index" 242 | checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481" 243 | dependencies = [ 244 | "autocfg", 245 | "futures-core", 246 | "futures-task", 247 | "pin-project-lite", 248 | "pin-utils", 249 | ] 250 | 251 | [[package]] 252 | name = "generic-array" 253 | version = "0.12.4" 254 | source = "registry+https://github.com/rust-lang/crates.io-index" 255 | checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" 256 | dependencies = [ 257 | "typenum", 258 | ] 259 | 260 | [[package]] 261 | name = "handlebars" 262 | version = "4.1.4" 263 | source = "registry+https://github.com/rust-lang/crates.io-index" 264 | checksum = "e1874024f4a29f47d609014caec0b1c866f1c1eb0661a09c9733ecc4757f5f88" 265 | dependencies = [ 266 | "log", 267 | "pest", 268 | "pest_derive", 269 | "quick-error", 270 | "serde", 271 | "serde_json", 272 | ] 273 | 274 | [[package]] 275 | name = "heck" 276 | version = "0.3.3" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" 279 | dependencies = [ 280 | "unicode-segmentation", 281 | ] 282 | 283 | [[package]] 284 | name = "hermit-abi" 285 | version = "0.1.19" 286 | source = "registry+https://github.com/rust-lang/crates.io-index" 287 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 288 | dependencies = [ 289 | "libc", 290 | ] 291 | 292 | [[package]] 293 | name = "http" 294 | version = "0.2.5" 295 | source = "registry+https://github.com/rust-lang/crates.io-index" 296 | checksum = "1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b" 297 | dependencies = [ 298 | "bytes", 299 | "fnv", 300 | "itoa", 301 | ] 302 | 303 | [[package]] 304 | name = "http-body" 305 | version = "0.4.4" 306 | source = "registry+https://github.com/rust-lang/crates.io-index" 307 | checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" 308 | dependencies = [ 309 | "bytes", 310 | "http", 311 | "pin-project-lite", 312 | ] 313 | 314 | [[package]] 315 | name = "httparse" 316 | version = "1.5.1" 317 | source = "registry+https://github.com/rust-lang/crates.io-index" 318 | checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" 319 | 320 | [[package]] 321 | name = "httpdate" 322 | version = "1.0.1" 323 | source = "registry+https://github.com/rust-lang/crates.io-index" 324 | checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" 325 | 326 | [[package]] 327 | name = "hyper" 328 | version = "0.14.14" 329 | source = "registry+https://github.com/rust-lang/crates.io-index" 330 | checksum = "2b91bb1f221b6ea1f1e4371216b70f40748774c2fb5971b450c07773fb92d26b" 331 | dependencies = [ 332 | "bytes", 333 | "futures-channel", 334 | "futures-core", 335 | "futures-util", 336 | "http", 337 | "http-body", 338 | "httparse", 339 | "httpdate", 340 | "itoa", 341 | "pin-project-lite", 342 | "socket2", 343 | "tokio", 344 | "tower-service", 345 | "tracing", 346 | "want", 347 | ] 348 | 349 | [[package]] 350 | name = "instant" 351 | version = "0.1.12" 352 | source = "registry+https://github.com/rust-lang/crates.io-index" 353 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 354 | dependencies = [ 355 | "cfg-if", 356 | ] 357 | 358 | [[package]] 359 | name = "itoa" 360 | version = "0.4.8" 361 | source = "registry+https://github.com/rust-lang/crates.io-index" 362 | checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" 363 | 364 | [[package]] 365 | name = "lazy_static" 366 | version = "1.4.0" 367 | source = "registry+https://github.com/rust-lang/crates.io-index" 368 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 369 | 370 | [[package]] 371 | name = "libc" 372 | version = "0.2.107" 373 | source = "registry+https://github.com/rust-lang/crates.io-index" 374 | checksum = "fbe5e23404da5b4f555ef85ebed98fb4083e55a00c317800bc2a50ede9f3d219" 375 | 376 | [[package]] 377 | name = "lock_api" 378 | version = "0.4.5" 379 | source = "registry+https://github.com/rust-lang/crates.io-index" 380 | checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" 381 | dependencies = [ 382 | "scopeguard", 383 | ] 384 | 385 | [[package]] 386 | name = "log" 387 | version = "0.4.14" 388 | source = "registry+https://github.com/rust-lang/crates.io-index" 389 | checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" 390 | dependencies = [ 391 | "cfg-if", 392 | ] 393 | 394 | [[package]] 395 | name = "macaddr" 396 | version = "1.0.1" 397 | source = "registry+https://github.com/rust-lang/crates.io-index" 398 | checksum = "baee0bbc17ce759db233beb01648088061bf678383130602a298e6998eedb2d8" 399 | dependencies = [ 400 | "serde", 401 | ] 402 | 403 | [[package]] 404 | name = "maplit" 405 | version = "1.0.2" 406 | source = "registry+https://github.com/rust-lang/crates.io-index" 407 | checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" 408 | 409 | [[package]] 410 | name = "matches" 411 | version = "0.1.9" 412 | source = "registry+https://github.com/rust-lang/crates.io-index" 413 | checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" 414 | 415 | [[package]] 416 | name = "matchit" 417 | version = "0.4.4" 418 | source = "registry+https://github.com/rust-lang/crates.io-index" 419 | checksum = "58b6f41fdfbec185dd3dff58b51e323f5bc61692c0de38419a957b0dcfccca3c" 420 | 421 | [[package]] 422 | name = "memchr" 423 | version = "2.4.1" 424 | source = "registry+https://github.com/rust-lang/crates.io-index" 425 | checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" 426 | 427 | [[package]] 428 | name = "mime" 429 | version = "0.3.16" 430 | source = "registry+https://github.com/rust-lang/crates.io-index" 431 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 432 | 433 | [[package]] 434 | name = "mime_guess" 435 | version = "2.0.3" 436 | source = "registry+https://github.com/rust-lang/crates.io-index" 437 | checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" 438 | dependencies = [ 439 | "mime", 440 | "unicase", 441 | ] 442 | 443 | [[package]] 444 | name = "mio" 445 | version = "0.7.14" 446 | source = "registry+https://github.com/rust-lang/crates.io-index" 447 | checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" 448 | dependencies = [ 449 | "libc", 450 | "log", 451 | "miow", 452 | "ntapi", 453 | "winapi", 454 | ] 455 | 456 | [[package]] 457 | name = "miow" 458 | version = "0.3.7" 459 | source = "registry+https://github.com/rust-lang/crates.io-index" 460 | checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" 461 | dependencies = [ 462 | "winapi", 463 | ] 464 | 465 | [[package]] 466 | name = "ntapi" 467 | version = "0.3.6" 468 | source = "registry+https://github.com/rust-lang/crates.io-index" 469 | checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" 470 | dependencies = [ 471 | "winapi", 472 | ] 473 | 474 | [[package]] 475 | name = "num_cpus" 476 | version = "1.13.0" 477 | source = "registry+https://github.com/rust-lang/crates.io-index" 478 | checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 479 | dependencies = [ 480 | "hermit-abi", 481 | "libc", 482 | ] 483 | 484 | [[package]] 485 | name = "october" 486 | version = "0.1.0" 487 | dependencies = [ 488 | "axum", 489 | "csv", 490 | "handlebars", 491 | "hyper", 492 | "lazy_static", 493 | "macaddr", 494 | "serde", 495 | "structopt", 496 | "tokio", 497 | "tower-http", 498 | "tracing", 499 | "tracing-subscriber", 500 | ] 501 | 502 | [[package]] 503 | name = "once_cell" 504 | version = "1.8.0" 505 | source = "registry+https://github.com/rust-lang/crates.io-index" 506 | checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" 507 | 508 | [[package]] 509 | name = "opaque-debug" 510 | version = "0.2.3" 511 | source = "registry+https://github.com/rust-lang/crates.io-index" 512 | checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" 513 | 514 | [[package]] 515 | name = "parking_lot" 516 | version = "0.11.2" 517 | source = "registry+https://github.com/rust-lang/crates.io-index" 518 | checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" 519 | dependencies = [ 520 | "instant", 521 | "lock_api", 522 | "parking_lot_core", 523 | ] 524 | 525 | [[package]] 526 | name = "parking_lot_core" 527 | version = "0.8.5" 528 | source = "registry+https://github.com/rust-lang/crates.io-index" 529 | checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" 530 | dependencies = [ 531 | "cfg-if", 532 | "instant", 533 | "libc", 534 | "redox_syscall", 535 | "smallvec", 536 | "winapi", 537 | ] 538 | 539 | [[package]] 540 | name = "percent-encoding" 541 | version = "2.1.0" 542 | source = "registry+https://github.com/rust-lang/crates.io-index" 543 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 544 | 545 | [[package]] 546 | name = "pest" 547 | version = "2.1.3" 548 | source = "registry+https://github.com/rust-lang/crates.io-index" 549 | checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" 550 | dependencies = [ 551 | "ucd-trie", 552 | ] 553 | 554 | [[package]] 555 | name = "pest_derive" 556 | version = "2.1.0" 557 | source = "registry+https://github.com/rust-lang/crates.io-index" 558 | checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" 559 | dependencies = [ 560 | "pest", 561 | "pest_generator", 562 | ] 563 | 564 | [[package]] 565 | name = "pest_generator" 566 | version = "2.1.3" 567 | source = "registry+https://github.com/rust-lang/crates.io-index" 568 | checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" 569 | dependencies = [ 570 | "pest", 571 | "pest_meta", 572 | "proc-macro2", 573 | "quote", 574 | "syn", 575 | ] 576 | 577 | [[package]] 578 | name = "pest_meta" 579 | version = "2.1.3" 580 | source = "registry+https://github.com/rust-lang/crates.io-index" 581 | checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" 582 | dependencies = [ 583 | "maplit", 584 | "pest", 585 | "sha-1", 586 | ] 587 | 588 | [[package]] 589 | name = "pin-project" 590 | version = "1.0.8" 591 | source = "registry+https://github.com/rust-lang/crates.io-index" 592 | checksum = "576bc800220cc65dac09e99e97b08b358cfab6e17078de8dc5fee223bd2d0c08" 593 | dependencies = [ 594 | "pin-project-internal", 595 | ] 596 | 597 | [[package]] 598 | name = "pin-project-internal" 599 | version = "1.0.8" 600 | source = "registry+https://github.com/rust-lang/crates.io-index" 601 | checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389" 602 | dependencies = [ 603 | "proc-macro2", 604 | "quote", 605 | "syn", 606 | ] 607 | 608 | [[package]] 609 | name = "pin-project-lite" 610 | version = "0.2.7" 611 | source = "registry+https://github.com/rust-lang/crates.io-index" 612 | checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" 613 | 614 | [[package]] 615 | name = "pin-utils" 616 | version = "0.1.0" 617 | source = "registry+https://github.com/rust-lang/crates.io-index" 618 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 619 | 620 | [[package]] 621 | name = "proc-macro-error" 622 | version = "1.0.4" 623 | source = "registry+https://github.com/rust-lang/crates.io-index" 624 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" 625 | dependencies = [ 626 | "proc-macro-error-attr", 627 | "proc-macro2", 628 | "quote", 629 | "syn", 630 | "version_check", 631 | ] 632 | 633 | [[package]] 634 | name = "proc-macro-error-attr" 635 | version = "1.0.4" 636 | source = "registry+https://github.com/rust-lang/crates.io-index" 637 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" 638 | dependencies = [ 639 | "proc-macro2", 640 | "quote", 641 | "version_check", 642 | ] 643 | 644 | [[package]] 645 | name = "proc-macro2" 646 | version = "1.0.32" 647 | source = "registry+https://github.com/rust-lang/crates.io-index" 648 | checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" 649 | dependencies = [ 650 | "unicode-xid", 651 | ] 652 | 653 | [[package]] 654 | name = "quick-error" 655 | version = "2.0.1" 656 | source = "registry+https://github.com/rust-lang/crates.io-index" 657 | checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" 658 | 659 | [[package]] 660 | name = "quote" 661 | version = "1.0.10" 662 | source = "registry+https://github.com/rust-lang/crates.io-index" 663 | checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" 664 | dependencies = [ 665 | "proc-macro2", 666 | ] 667 | 668 | [[package]] 669 | name = "redox_syscall" 670 | version = "0.2.10" 671 | source = "registry+https://github.com/rust-lang/crates.io-index" 672 | checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" 673 | dependencies = [ 674 | "bitflags", 675 | ] 676 | 677 | [[package]] 678 | name = "regex-automata" 679 | version = "0.1.10" 680 | source = "registry+https://github.com/rust-lang/crates.io-index" 681 | checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" 682 | 683 | [[package]] 684 | name = "ryu" 685 | version = "1.0.5" 686 | source = "registry+https://github.com/rust-lang/crates.io-index" 687 | checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" 688 | 689 | [[package]] 690 | name = "scopeguard" 691 | version = "1.1.0" 692 | source = "registry+https://github.com/rust-lang/crates.io-index" 693 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 694 | 695 | [[package]] 696 | name = "serde" 697 | version = "1.0.130" 698 | source = "registry+https://github.com/rust-lang/crates.io-index" 699 | checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" 700 | dependencies = [ 701 | "serde_derive", 702 | ] 703 | 704 | [[package]] 705 | name = "serde_derive" 706 | version = "1.0.130" 707 | source = "registry+https://github.com/rust-lang/crates.io-index" 708 | checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" 709 | dependencies = [ 710 | "proc-macro2", 711 | "quote", 712 | "syn", 713 | ] 714 | 715 | [[package]] 716 | name = "serde_json" 717 | version = "1.0.69" 718 | source = "registry+https://github.com/rust-lang/crates.io-index" 719 | checksum = "e466864e431129c7e0d3476b92f20458e5879919a0596c6472738d9fa2d342f8" 720 | dependencies = [ 721 | "itoa", 722 | "ryu", 723 | "serde", 724 | ] 725 | 726 | [[package]] 727 | name = "serde_urlencoded" 728 | version = "0.7.0" 729 | source = "registry+https://github.com/rust-lang/crates.io-index" 730 | checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" 731 | dependencies = [ 732 | "form_urlencoded", 733 | "itoa", 734 | "ryu", 735 | "serde", 736 | ] 737 | 738 | [[package]] 739 | name = "sha-1" 740 | version = "0.8.2" 741 | source = "registry+https://github.com/rust-lang/crates.io-index" 742 | checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" 743 | dependencies = [ 744 | "block-buffer", 745 | "digest", 746 | "fake-simd", 747 | "opaque-debug", 748 | ] 749 | 750 | [[package]] 751 | name = "sharded-slab" 752 | version = "0.1.4" 753 | source = "registry+https://github.com/rust-lang/crates.io-index" 754 | checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" 755 | dependencies = [ 756 | "lazy_static", 757 | ] 758 | 759 | [[package]] 760 | name = "signal-hook-registry" 761 | version = "1.4.0" 762 | source = "registry+https://github.com/rust-lang/crates.io-index" 763 | checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" 764 | dependencies = [ 765 | "libc", 766 | ] 767 | 768 | [[package]] 769 | name = "smallvec" 770 | version = "1.7.0" 771 | source = "registry+https://github.com/rust-lang/crates.io-index" 772 | checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" 773 | 774 | [[package]] 775 | name = "socket2" 776 | version = "0.4.2" 777 | source = "registry+https://github.com/rust-lang/crates.io-index" 778 | checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516" 779 | dependencies = [ 780 | "libc", 781 | "winapi", 782 | ] 783 | 784 | [[package]] 785 | name = "strsim" 786 | version = "0.8.0" 787 | source = "registry+https://github.com/rust-lang/crates.io-index" 788 | checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" 789 | 790 | [[package]] 791 | name = "structopt" 792 | version = "0.3.25" 793 | source = "registry+https://github.com/rust-lang/crates.io-index" 794 | checksum = "40b9788f4202aa75c240ecc9c15c65185e6a39ccdeb0fd5d008b98825464c87c" 795 | dependencies = [ 796 | "clap", 797 | "lazy_static", 798 | "structopt-derive", 799 | ] 800 | 801 | [[package]] 802 | name = "structopt-derive" 803 | version = "0.4.18" 804 | source = "registry+https://github.com/rust-lang/crates.io-index" 805 | checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" 806 | dependencies = [ 807 | "heck", 808 | "proc-macro-error", 809 | "proc-macro2", 810 | "quote", 811 | "syn", 812 | ] 813 | 814 | [[package]] 815 | name = "syn" 816 | version = "1.0.81" 817 | source = "registry+https://github.com/rust-lang/crates.io-index" 818 | checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" 819 | dependencies = [ 820 | "proc-macro2", 821 | "quote", 822 | "unicode-xid", 823 | ] 824 | 825 | [[package]] 826 | name = "sync_wrapper" 827 | version = "0.1.1" 828 | source = "registry+https://github.com/rust-lang/crates.io-index" 829 | checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" 830 | 831 | [[package]] 832 | name = "textwrap" 833 | version = "0.11.0" 834 | source = "registry+https://github.com/rust-lang/crates.io-index" 835 | checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" 836 | dependencies = [ 837 | "unicode-width", 838 | ] 839 | 840 | [[package]] 841 | name = "thread_local" 842 | version = "1.1.3" 843 | source = "registry+https://github.com/rust-lang/crates.io-index" 844 | checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" 845 | dependencies = [ 846 | "once_cell", 847 | ] 848 | 849 | [[package]] 850 | name = "tokio" 851 | version = "1.13.0" 852 | source = "registry+https://github.com/rust-lang/crates.io-index" 853 | checksum = "588b2d10a336da58d877567cd8fb8a14b463e2104910f8132cd054b4b96e29ee" 854 | dependencies = [ 855 | "autocfg", 856 | "bytes", 857 | "libc", 858 | "memchr", 859 | "mio", 860 | "num_cpus", 861 | "once_cell", 862 | "parking_lot", 863 | "pin-project-lite", 864 | "signal-hook-registry", 865 | "tokio-macros", 866 | "winapi", 867 | ] 868 | 869 | [[package]] 870 | name = "tokio-macros" 871 | version = "1.5.1" 872 | source = "registry+https://github.com/rust-lang/crates.io-index" 873 | checksum = "114383b041aa6212c579467afa0075fbbdd0718de036100bc0ba7961d8cb9095" 874 | dependencies = [ 875 | "proc-macro2", 876 | "quote", 877 | "syn", 878 | ] 879 | 880 | [[package]] 881 | name = "tokio-util" 882 | version = "0.6.9" 883 | source = "registry+https://github.com/rust-lang/crates.io-index" 884 | checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" 885 | dependencies = [ 886 | "bytes", 887 | "futures-core", 888 | "futures-sink", 889 | "log", 890 | "pin-project-lite", 891 | "tokio", 892 | ] 893 | 894 | [[package]] 895 | name = "tower" 896 | version = "0.4.10" 897 | source = "registry+https://github.com/rust-lang/crates.io-index" 898 | checksum = "c00e500fff5fa1131c866b246041a6bf96da9c965f8fe4128cb1421f23e93c00" 899 | dependencies = [ 900 | "futures-core", 901 | "futures-util", 902 | "pin-project", 903 | "pin-project-lite", 904 | "tokio", 905 | "tokio-util", 906 | "tower-layer", 907 | "tower-service", 908 | "tracing", 909 | ] 910 | 911 | [[package]] 912 | name = "tower-http" 913 | version = "0.1.1" 914 | source = "registry+https://github.com/rust-lang/crates.io-index" 915 | checksum = "0b7b56efe69aa0ad2b5da6b942e57ea9f6fe683b7a314d4ff48662e2c8838de1" 916 | dependencies = [ 917 | "bytes", 918 | "futures-core", 919 | "futures-util", 920 | "http", 921 | "http-body", 922 | "mime", 923 | "mime_guess", 924 | "pin-project", 925 | "tokio", 926 | "tokio-util", 927 | "tower-layer", 928 | "tower-service", 929 | "tracing", 930 | ] 931 | 932 | [[package]] 933 | name = "tower-layer" 934 | version = "0.3.1" 935 | source = "registry+https://github.com/rust-lang/crates.io-index" 936 | checksum = "343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62" 937 | 938 | [[package]] 939 | name = "tower-service" 940 | version = "0.3.1" 941 | source = "registry+https://github.com/rust-lang/crates.io-index" 942 | checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" 943 | 944 | [[package]] 945 | name = "tracing" 946 | version = "0.1.29" 947 | source = "registry+https://github.com/rust-lang/crates.io-index" 948 | checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" 949 | dependencies = [ 950 | "cfg-if", 951 | "log", 952 | "pin-project-lite", 953 | "tracing-attributes", 954 | "tracing-core", 955 | ] 956 | 957 | [[package]] 958 | name = "tracing-attributes" 959 | version = "0.1.18" 960 | source = "registry+https://github.com/rust-lang/crates.io-index" 961 | checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" 962 | dependencies = [ 963 | "proc-macro2", 964 | "quote", 965 | "syn", 966 | ] 967 | 968 | [[package]] 969 | name = "tracing-core" 970 | version = "0.1.21" 971 | source = "registry+https://github.com/rust-lang/crates.io-index" 972 | checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" 973 | dependencies = [ 974 | "lazy_static", 975 | ] 976 | 977 | [[package]] 978 | name = "tracing-log" 979 | version = "0.1.2" 980 | source = "registry+https://github.com/rust-lang/crates.io-index" 981 | checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" 982 | dependencies = [ 983 | "lazy_static", 984 | "log", 985 | "tracing-core", 986 | ] 987 | 988 | [[package]] 989 | name = "tracing-subscriber" 990 | version = "0.3.1" 991 | source = "registry+https://github.com/rust-lang/crates.io-index" 992 | checksum = "80a4ddde70311d8da398062ecf6fc2c309337de6b0f77d6c27aff8d53f6fca52" 993 | dependencies = [ 994 | "ansi_term 0.12.1", 995 | "sharded-slab", 996 | "smallvec", 997 | "thread_local", 998 | "tracing-core", 999 | "tracing-log", 1000 | ] 1001 | 1002 | [[package]] 1003 | name = "try-lock" 1004 | version = "0.2.3" 1005 | source = "registry+https://github.com/rust-lang/crates.io-index" 1006 | checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" 1007 | 1008 | [[package]] 1009 | name = "typenum" 1010 | version = "1.14.0" 1011 | source = "registry+https://github.com/rust-lang/crates.io-index" 1012 | checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" 1013 | 1014 | [[package]] 1015 | name = "ucd-trie" 1016 | version = "0.1.3" 1017 | source = "registry+https://github.com/rust-lang/crates.io-index" 1018 | checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" 1019 | 1020 | [[package]] 1021 | name = "unicase" 1022 | version = "2.6.0" 1023 | source = "registry+https://github.com/rust-lang/crates.io-index" 1024 | checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" 1025 | dependencies = [ 1026 | "version_check", 1027 | ] 1028 | 1029 | [[package]] 1030 | name = "unicode-segmentation" 1031 | version = "1.8.0" 1032 | source = "registry+https://github.com/rust-lang/crates.io-index" 1033 | checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" 1034 | 1035 | [[package]] 1036 | name = "unicode-width" 1037 | version = "0.1.9" 1038 | source = "registry+https://github.com/rust-lang/crates.io-index" 1039 | checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" 1040 | 1041 | [[package]] 1042 | name = "unicode-xid" 1043 | version = "0.2.2" 1044 | source = "registry+https://github.com/rust-lang/crates.io-index" 1045 | checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" 1046 | 1047 | [[package]] 1048 | name = "vec_map" 1049 | version = "0.8.2" 1050 | source = "registry+https://github.com/rust-lang/crates.io-index" 1051 | checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" 1052 | 1053 | [[package]] 1054 | name = "version_check" 1055 | version = "0.9.3" 1056 | source = "registry+https://github.com/rust-lang/crates.io-index" 1057 | checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" 1058 | 1059 | [[package]] 1060 | name = "want" 1061 | version = "0.3.0" 1062 | source = "registry+https://github.com/rust-lang/crates.io-index" 1063 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 1064 | dependencies = [ 1065 | "log", 1066 | "try-lock", 1067 | ] 1068 | 1069 | [[package]] 1070 | name = "winapi" 1071 | version = "0.3.9" 1072 | source = "registry+https://github.com/rust-lang/crates.io-index" 1073 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1074 | dependencies = [ 1075 | "winapi-i686-pc-windows-gnu", 1076 | "winapi-x86_64-pc-windows-gnu", 1077 | ] 1078 | 1079 | [[package]] 1080 | name = "winapi-i686-pc-windows-gnu" 1081 | version = "0.4.0" 1082 | source = "registry+https://github.com/rust-lang/crates.io-index" 1083 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1084 | 1085 | [[package]] 1086 | name = "winapi-x86_64-pc-windows-gnu" 1087 | version = "0.4.0" 1088 | source = "registry+https://github.com/rust-lang/crates.io-index" 1089 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1090 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "october" 3 | version = "0.1.0" 4 | edition = "2018" 5 | 6 | [dependencies] 7 | tokio = { version = "1.12.0", features = ["full"] } 8 | axum = "0.3.2" 9 | hyper = "0.14.13" 10 | tower-http = { version = "0.1", features = ["fs", "trace"] } 11 | structopt = "0.3.23" 12 | handlebars = "4.1.3" 13 | serde = "1.0" 14 | tracing = "0.1" 15 | tracing-subscriber = "0.3.1" 16 | macaddr = { version = "1.0.1", features = ["serde_std"] } 17 | lazy_static = "1.3.0" 18 | csv = "1.1.6" 19 | 20 | [profile.release] 21 | lto = true 22 | codegen-units = 1 -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BUILDER_ARCH=armv7-musleabihf 2 | ARG TARGET_ARCH=armv7-unknown-linux-musleabihf 3 | 4 | FROM messense/rust-musl-cross:${BUILDER_ARCH} AS chef 5 | USER root 6 | RUN cargo install cargo-chef 7 | WORKDIR /app 8 | 9 | FROM chef AS planner 10 | COPY . . 11 | RUN cargo chef prepare --recipe-path recipe.json 12 | 13 | FROM chef AS builder 14 | ARG TARGET_ARCH 15 | COPY --from=planner /app/recipe.json recipe.json 16 | RUN cargo chef cook --release --target=${TARGET_ARCH} --recipe-path recipe.json 17 | COPY . . 18 | RUN cargo build --release --target=${TARGET_ARCH} 19 | RUN musl-strip -s /app/target/${TARGET_ARCH}/release/october 20 | 21 | FROM scratch AS runtime 22 | ARG VERSION 23 | ARG BUILD_DATE 24 | ARG TARGET_ARCH 25 | LABEL version="${VERSION}" \ 26 | description="Wake-on-lan webapp - Wake me up, when september ends" \ 27 | org.label-schema.schema-version="1.0" \ 28 | org.label-schema.name="october" \ 29 | org.label-schema.description="Wake-on-lan webapp - Wake me up, when september ends" \ 30 | org.label-schema.build-date="${BUILD_DATE}" \ 31 | org.label-schema.url="https://github.com/bltavares/october" \ 32 | org.label-schema.version="${VERSION}" \ 33 | org.label-schema.docker.cmd="docker run -d \ 34 | --restart=unless-stopped \ 35 | --network=host \ 36 | -p 3493:3493 \ 37 | -v sample.csv:/opt/sample.csv \ 38 | --name october \ 39 | bltavares/october -a /opt/sample.csv" 40 | COPY --from=builder /app/target/${TARGET_ARCH}/release/october /usr/local/bin/ 41 | WORKDIR /app 42 | ENTRYPOINT ["/usr/local/bin/october"] 43 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | IMAGE = bltavares/october 2 | VERSION = 0.1.0 3 | CACHE_BUST = $(shell date -u +"%Y-%m-%dT00:00:00Z") 4 | 5 | define build_image 6 | docker build . --pull \ 7 | --tag $(IMAGE):$(1) \ 8 | --tag $(IMAGE):$(VERSION)-$(1) \ 9 | --build-arg VERSION=$(VERSION) \ 10 | --build-arg BUILD_DATE=$(CACHE_BUST) \ 11 | --build-arg BUILDER_ARCH=$(2) \ 12 | --build-arg TARGET_ARCH=$(3) 13 | endef 14 | 15 | amd64: 16 | $(call build_image,amd64,x86_64-musl,x86_64-unknown-linux-musl) 17 | 18 | arm64: 19 | $(call build_image,arm64v8,aarch64-musl,aarch64-unknown-linux-musl) 20 | 21 | armhf: 22 | $(call build_image,arm32v7,armv7-musleabihf,armv7-unknown-linux-musleabihf) 23 | 24 | armel: 25 | $(call build_image,arm32v5,arm-musleabi,arm-unknown-linux-musleabi) 26 | 27 | 28 | publish: 29 | docker push $(IMAGE):amd64 30 | docker push $(IMAGE):arm32v5 31 | docker push $(IMAGE):arm32v7 32 | docker push $(IMAGE):arm64v8 33 | 34 | docker push $(IMAGE):$(VERSION)-amd64 35 | docker push $(IMAGE):$(VERSION)-arm32v5 36 | docker push $(IMAGE):$(VERSION)-arm32v7 37 | docker push $(IMAGE):$(VERSION)-arm64v8 38 | 39 | manifest: 40 | docker manifest create \ 41 | $(IMAGE):$(VERSION) \ 42 | $(IMAGE):$(VERSION)-amd64 \ 43 | $(IMAGE):$(VERSION)-arm32v5 \ 44 | $(IMAGE):$(VERSION)-arm32v7 \ 45 | $(IMAGE):$(VERSION)-arm64v8 46 | 47 | docker manifest annotate $(IMAGE):$(VERSION) \ 48 | $(IMAGE):$(VERSION)-amd64 --os linux \ 49 | --arch amd64 50 | 51 | docker manifest annotate $(IMAGE):$(VERSION) \ 52 | $(IMAGE):$(VERSION)-arm32v5 --os linux \ 53 | --arch arm --variant v5 54 | 55 | docker manifest annotate $(IMAGE):$(VERSION) \ 56 | $(IMAGE):$(VERSION)-arm32v7 --os linux \ 57 | --arch arm --variant v7 58 | 59 | docker manifest annotate $(IMAGE):$(VERSION) \ 60 | $(IMAGE):$(VERSION)-arm64v8 --os linux \ 61 | --arch arm64 62 | 63 | docker manifest push --purge $(IMAGE):$(VERSION) 64 | 65 | docker manifest create \ 66 | $(IMAGE):latest \ 67 | $(IMAGE):amd64 \ 68 | $(IMAGE):arm32v5 \ 69 | $(IMAGE):arm32v7 \ 70 | $(IMAGE):arm64v8 71 | 72 | docker manifest annotate $(IMAGE):latest \ 73 | $(IMAGE):amd64 --os linux \ 74 | --arch amd64 75 | 76 | docker manifest annotate $(IMAGE):latest \ 77 | $(IMAGE):arm32v5 --os linux \ 78 | --arch arm --variant v5 79 | 80 | docker manifest annotate $(IMAGE):latest \ 81 | $(IMAGE):arm32v7 --os linux \ 82 | --arch arm --variant v7 83 | 84 | docker manifest annotate $(IMAGE):latest \ 85 | $(IMAGE):arm64v8 --os linux \ 86 | --arch arm64 87 | 88 | docker manifest push --purge $(IMAGE):latest 89 | 90 | all: amd64 arm64 armel armhf 91 | 92 | .PHONY: all arm64 armel armhf amd64 publish manifest -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # October 2 | 3 | Wake-on-lan webapp - 🎵 Wake me up, when september ends 🎵 4 | 5 | ## Usage 6 | 7 | To start, run the self-contained binary with a CSV list of `host,mac` and visit [localhost:3493](http://localhost:3493). 8 | It should render a table of devices using a default template. 9 | 10 | ```sh 11 | october -a sample.csv 12 | ``` 13 | 14 | ### Overriding the template 15 | 16 | You can override the internal template with the `--template` flag, giving it a [handlebar](https://handlebarsjs.com/guide/) template file. 17 | For faster development, you can use the `--autoreload` flag to preview changes locally. 18 | 19 | The service will host the current working directory as HTTP assets if you want to provide images or CSS styling. 20 | 21 | ## Run 22 | 23 | This project aims to run on Docker with minimal size, and also targets multiplaform builds, including Windows, Linux and Raspberry Pi (Zero to 4). 24 | 25 | You can either compile it with `cargo build --release` or use the provided `bltavares/october` Docker image. 26 | 27 | To run properly, it requires to be on the `host` network without any isolation, otherwhise your router will not advertise the 'magic packet' to your devices. 28 | 29 | ### Targets 30 | 31 | | Platform | Docker | Size | 32 | |------------------|--------|--------| 33 | | armv7-musleabihf | Yes | 2.03MB | 34 | | arm-musleabi | Yes | 2.08MB | 35 | | aarch64-musl | Yes | 1.99MB | 36 | | x86_64-musl | Yes | 2.49MB | 37 | | Windows | No | 2.29MB | 38 | | Mac | No | N/A | 39 | 40 | ### Docker 41 | 42 | Example command for Docker 43 | 44 | ```shell 45 | docker run -d \ 46 | --restart=unless-stopped \ 47 | --network=host \ 48 | -p 3493:3493 \ 49 | -v sample.csv:/opt/sample.csv \ 50 | --name october \ 51 | bltavares/october -a /opt/sample.csv 52 | ``` 53 | 54 | ## Build 55 | 56 | To build and publish multi-architecture docker images: 57 | 58 | ```shell 59 | make all 60 | make publish 61 | make manifest 62 | ``` 63 | 64 | ## Debugging 65 | 66 | > sudo netcat -ulp 9 67 | 68 | Then you should see something from netcat. 69 | -------------------------------------------------------------------------------- /sample.csv: -------------------------------------------------------------------------------- 1 | example,01:23:45:67:89:AB 2 | another,01:23:45:67:89:BD -------------------------------------------------------------------------------- /src/index.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 |Wake-on-lan webapp - 🎵 Wake me up, when september ends 🎵
42 | 43 | {{#if this}} 44 |Host | 48 |MAC | 49 |Action | 50 |
---|---|---|
{{this.name}} | 56 |{{this.mac}} | 57 |58 | 62 | | 63 |
No registered addressess.
69 |Restart the service setting the --address
for quick access or use the
70 | POST /awake?mac="DD:AA:FF:CC"
endpoint
71 | directly.
72 |