Compare commits
56 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
db3d864de0 | ||
![]() |
93a5e9b5ca | ||
![]() |
df91279e6e | ||
![]() |
8716833ac4 | ||
![]() |
4b0423bc68 | ||
![]() |
96cfc0ad9b | ||
![]() |
346f297f12 | ||
![]() |
8861f81f06 | ||
![]() |
f20fbe83b6 | ||
![]() |
99ba75f6b1 | ||
![]() |
569c5ea566 | ||
![]() |
264367572a | ||
![]() |
74b7646d64 | ||
![]() |
190655c44f | ||
![]() |
3344c18ef2 | ||
![]() |
9360f06917 | ||
![]() |
f08d277267 | ||
![]() |
1c14a81e18 | ||
![]() |
a3ccc63d37 | ||
![]() |
631c41b171 | ||
![]() |
6e2fb6eae7 | ||
![]() |
629caef9e9 | ||
![]() |
a48f8760e4 | ||
![]() |
3ee173f8f3 | ||
![]() |
b4ab4e2f18 | ||
![]() |
e1e94ed2c4 | ||
![]() |
39172488d2 | ||
![]() |
384e460bc2 | ||
![]() |
0a6a1efc5f | ||
![]() |
ccc2dbc547 | ||
![]() |
59c2997dc2 | ||
![]() |
0655c968d0 | ||
![]() |
217961e18b | ||
![]() |
a962fb83b6 | ||
![]() |
06b27b4585 | ||
![]() |
bea5b1d6d9 | ||
![]() |
2c691c9161 | ||
![]() |
572a70a3ba | ||
![]() |
3ccd30d007 | ||
![]() |
f1ce7811f9 | ||
![]() |
9d0d834439 | ||
![]() |
327a57cbc7 | ||
![]() |
d5d0f31212 | ||
![]() |
b0531deb25 | ||
![]() |
864140da97 | ||
![]() |
24a181c856 | ||
![]() |
cfbb7e5198 | ||
![]() |
f382b04bfe | ||
![]() |
ceaae91d6f | ||
![]() |
a40c3e1896 | ||
![]() |
40bb5e0a54 | ||
![]() |
9c6d549f6e | ||
![]() |
94ee575402 | ||
![]() |
28058b7e67 | ||
![]() |
93e184ec71 | ||
![]() |
65e3cf64c4 |
9 changed files with 814 additions and 475 deletions
2
.github/workflows/dev.yml
vendored
2
.github/workflows/dev.yml
vendored
|
@ -15,7 +15,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --release --verbose
|
run: cargo build --release --verbose
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
|
|
6
.github/workflows/pr_main.yml
vendored
6
.github/workflows/pr_main.yml
vendored
|
@ -13,7 +13,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --release --verbose
|
run: cargo build --release --verbose
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
|
@ -25,7 +25,7 @@ jobs:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --release --verbose
|
run: cargo build --release --verbose
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
|
@ -37,7 +37,7 @@ jobs:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --release --verbose
|
run: cargo build --release --verbose
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
|
|
126
.github/workflows/rust.yml
vendored
126
.github/workflows/rust.yml
vendored
|
@ -2,99 +2,95 @@ name: Rust -> Build & Test & Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches: ["main"]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
PROJECT_NAME: ${{ github.event.repository.name }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_linux:
|
build_linux:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --release --verbose
|
run: cargo build --release --verbose
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test --verbose
|
run: cargo test --verbose
|
||||||
|
|
||||||
- name: Upload Linux Binary
|
- name: Upload Linux Binary
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: rust_tcp_file_transfer_linux_x64_86
|
name: ${{ env.PROJECT_NAME }}-linux-x64_86
|
||||||
path: target/release/*transfer
|
path: target/release/${{ env.PROJECT_NAME }}
|
||||||
|
|
||||||
build_windows:
|
build_windows:
|
||||||
|
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --release --verbose
|
run: cargo build --release --verbose
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test --verbose
|
run: cargo test --verbose
|
||||||
|
|
||||||
- name: Upload Windows Binary
|
- name: Upload Windows Binary
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: rust_tcp_file_transfer_windows_x64_86
|
name: ${{ env.PROJECT_NAME }}-windows-x64_86
|
||||||
path: target/release/*transfer.exe
|
path: target/release/${{ env.PROJECT_NAME }}.exe
|
||||||
|
|
||||||
build_macos:
|
build_macos:
|
||||||
|
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --release --verbose
|
run: cargo build --release --verbose
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test --verbose
|
run: cargo test --verbose
|
||||||
|
|
||||||
- name: Upload MacOS Binary
|
- name: Upload MacOS Binary
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: rust_tcp_file_transfer_macos_x64_86
|
name: ${{ env.PROJECT_NAME }}-macos-arm64
|
||||||
path: target/release/*transfer
|
path: target/release/${{ env.PROJECT_NAME }}
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: [build_linux, build_windows, build_macos]
|
needs: [build_linux, build_windows, build_macos]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Forge a Folder
|
||||||
|
run: mkdir Downloads
|
||||||
|
working-directory: /home/runner/work/${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}/
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/download-artifact@v4
|
||||||
- name: Forge a Folder
|
name: Download
|
||||||
run: mkdir Downloads
|
with:
|
||||||
working-directory: /home/runner/work/rust-tcp-file-transfer/rust-tcp-file-transfer/
|
path: Downloads/
|
||||||
|
|
||||||
- uses: actions/download-artifact@v3
|
- name: Rename Binaries
|
||||||
name: Download
|
run: |
|
||||||
with:
|
tree Downloads/
|
||||||
path: Downloads/
|
mv Downloads/${{ env.PROJECT_NAME }}-linux-x64_86/${{ env.PROJECT_NAME }} Downloads/${{ env.PROJECT_NAME }}-linux-x64_86/${{ env.PROJECT_NAME }}-linux-x64_86
|
||||||
|
mv Downloads/${{ env.PROJECT_NAME }}-windows-x64_86/${{ env.PROJECT_NAME }}.exe Downloads/${{ env.PROJECT_NAME }}-windows-x64_86/${{ env.PROJECT_NAME }}-windows-x64_86.exe
|
||||||
- name: Rename Binaries
|
mv Downloads/${{ env.PROJECT_NAME }}-macos-arm64/${{ env.PROJECT_NAME }} Downloads/${{ env.PROJECT_NAME }}-macos-arm64/${{ env.PROJECT_NAME }}-macos-arm64
|
||||||
run: |
|
- name: Git Commit SHA
|
||||||
mv Downloads/rust_tcp_file_transfer_linux_x64_86/rust-tcp-file-transfer Downloads/rust_tcp_file_transfer_linux_x64_86/rust-tcp-file-transfer-linux_x64_86
|
id: vars
|
||||||
mv Downloads/rust_tcp_file_transfer_windows_x64_86/rust-tcp-file-transfer.exe Downloads/rust_tcp_file_transfer_windows_x64_86/rust-tcp-file-transfer-windows_x64_86.exe
|
run: |
|
||||||
mv Downloads/rust_tcp_file_transfer_macos_x64_86/rust-tcp-file-transfer Downloads/rust_tcp_file_transfer_macos_x64_86/rust-tcp-file-transfer-macos_x64_86
|
calculatedSha=$(git rev-parse --short ${{ github.sha }})
|
||||||
|
echo "short_sha=$calculatedSha" >> $GITHUB_OUTPUT
|
||||||
- name: Git Commit SHA
|
|
||||||
id: vars
|
|
||||||
run: |
|
|
||||||
calculatedSha=$(git rev-parse --short ${{ github.sha }})
|
|
||||||
echo "short_sha=$calculatedSha" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: softprops/action-gh-release@v0.1.15
|
|
||||||
name: Release
|
|
||||||
with:
|
|
||||||
tag_name: ${{ steps.vars.outputs.short_sha }}
|
|
||||||
generate_release_notes: true
|
|
||||||
files: |
|
|
||||||
Downloads/*linux*/*transfer*
|
|
||||||
Downloads/*windows*/*transfer*
|
|
||||||
Downloads/*macos*/*transfer*
|
|
||||||
|
|
||||||
|
- uses: softprops/action-gh-release@v2
|
||||||
|
name: Release
|
||||||
|
with:
|
||||||
|
tag_name: ${{ steps.vars.outputs.short_sha }}
|
||||||
|
generate_release_notes: true
|
||||||
|
files: |
|
||||||
|
Downloads/*linux*/${{ env.PROJECT_NAME }}*
|
||||||
|
Downloads/*windows*/${{ env.PROJECT_NAME }}*
|
||||||
|
Downloads/*macos*/${{ env.PROJECT_NAME }}*
|
||||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,6 +2,7 @@
|
||||||
# will have compiled files and executables
|
# will have compiled files and executables
|
||||||
debug/
|
debug/
|
||||||
target/
|
target/
|
||||||
|
.vscode/
|
||||||
|
|
||||||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
||||||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
||||||
|
|
11
Cargo.toml
11
Cargo.toml
|
@ -3,6 +3,15 @@ name = "rust-tcp-file-transfer"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
[profile.release]
|
||||||
|
strip = "symbols"
|
||||||
|
opt-level = 3
|
||||||
|
overflow-checks = true
|
||||||
|
lto = true
|
||||||
|
codegen-units = 1
|
||||||
|
panic = "abort"
|
||||||
|
|
||||||
|
[lints.rust]
|
||||||
|
unsafe_code = "forbid"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
25
README.md
25
README.md
|
@ -2,14 +2,25 @@
|
||||||
# rust-tcp-file-transfer
|
# rust-tcp-file-transfer
|
||||||
TCP File Transfer Server and Client in Rust
|
TCP File Transfer Server and Client in Rust
|
||||||
|
|
||||||
|
**Usage**
|
||||||
|
> ./rust-tcp-file-transfer -h
|
||||||
|
>
|
||||||
|
<img src=assets/help_menu.png>
|
||||||
|
|
||||||
|
|
||||||
|
**Examples**
|
||||||
|
> ./rust-tcp-file-transfer -sv -s -l ~/Desktop/cat.png
|
||||||
|
>
|
||||||
|
> ./rust-tcp-file-transfer -cl -r -l ~/Documents/
|
||||||
|
|
||||||
|
<img src=assets/example.png>
|
||||||
|
|
||||||
|
**TO-DO List**
|
||||||
|
|
||||||
|
☑ Standard library only.
|
||||||
|
|
||||||
☑ File transfer over network.
|
☑ File transfer over network.
|
||||||
|
|
||||||
☑ Remove memory limitations. [d42412c](https://github.com/Tahinli/rust-tcp-file-transfer/pull/1/commits/d42412c57d7d95672ba64b3e489b95f1c4b04a08)
|
☑ Remove memory limitations. [d42412c](https://github.com/Tahinli/rust-tcp-file-transfer/pull/1/commits/d42412c57d7d95672ba64b3e489b95f1c4b04a08)
|
||||||
|
|
||||||
☐ Folder transfer.
|
☑ Bidirectional transfer. [b0531de](https://github.com/Tahinli/rust-tcp-file-transfer/commit/b0531deb257332f46fc76de16d3a17fb3b28acee)
|
||||||
|
|
||||||
☐ Remember where it stopped.
|
|
||||||
|
|
||||||
☐ Reach over NAT (peer to peer).
|
|
||||||
|
|
||||||
☐ Async.
|
|
||||||
|
|
BIN
assets/example.png
Normal file
BIN
assets/example.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 281 KiB |
BIN
assets/help_menu.png
Normal file
BIN
assets/help_menu.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
1106
src/main.rs
1106
src/main.rs
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue