Coder Social home page Coder Social logo

mihaigalos / aim Goto Github PK

View Code? Open in Web Editor NEW
97.0 97.0 6.0 2.37 MB

🎯 A command line download/upload tool with resume.

License: MIT License

Rust 82.71% Dockerfile 1.59% Shell 0.82% Just 14.88%
command-line command-line-tool commandline-tool curl download-resume downloader resume rust wget

aim's People

Contributors

mihaigalos avatar renovate[bot] avatar vkill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

aim's Issues

show reply when uploading

aim doesn't currently show the reply when an upload happens, this makes services like transfer.sh or 0x0.st unusable

usage
aim file.txt http://0x0.st
aim file.txt http://transfer.sh/file.txt

example curl

curl -F [email protected] http://0x0.st
link to file here
curl --upload-file file.txt https://transfer.sh/file.txt
link to file here 

Support invalid TLS/SSL

This currently fails, especially in the case of a Man-in-the-Middle corporate certificates.

RUSTSEC-2023-0052: webpki: CPU denial of service in certificate path building

webpki: CPU denial of service in certificate path building

Details
Package webpki
Version 0.22.0
Date 2023-08-22

When this crate is given a pathological certificate chain to validate, it will
spend CPU time exponential with the number of candidate certificates at each
step of path building.

Both TLS clients and TLS servers that accept client certificate are affected.

This was previously reported in
<briansmith/webpki#69> and re-reported recently
by Luke Malinowski.

rustls-webpki is a fork of this crate which contains a fix for this issue
and is actively maintained.

See advisory page for additional details.

RUSTSEC-2023-0028: buf_redux is Unmaintained

buf_redux is Unmaintained

Details
Status unmaintained
Package buf_redux
Version 0.8.4
URL https://github.com/abonander/buf_redux/issues
Date 2023-01-24

Last release was over three years ago.

The maintainer(s) have been unreachable to respond to any issues that may or may not include security issues.

The repository is now archived and there is no security policy in place to contact the maintainer(s) otherwise.

The safety-undocumented unsafe in the crate may or may not be safe to use.

The crate also has a current future incompatibility warning buf_redux/23.

Possible Alternatives

The below may or may not provide alternative(s)

See advisory page for additional details.

Use Sha2 crate instead of Sha256

This enables hashing the file without copying it into memory.
From here:

use sha2::{Sha256, Digest};
use std::{io, fs};

let mut hasher = Sha256::new();
let mut file = fs::File::open("file.tar.gz")?;

let bytes_written = io::copy(&mut file, &mut hasher)?;
let hash_bytes = hasher.finalize();

Interactive mode

Use / for diving into folders, Enter to download file or whole folder.
Possible solutions via fzf/skim augmented navigation.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

cargo
Cargo.toml
  • async-ssh2-lite 0.4
  • async-std 1.12.0
  • async-stream 0.3.4
  • async_ftp 6.0.0
  • autoclap 0.3.15
  • clap 4.1.6
  • crossbeam-utils 0.8.14
  • custom_error 1.9.2
  • dotenvy 0.15.6
  • futures 0.3
  • futures-util 0.3.26
  • http 0.2.9
  • indicatif 0.17.3
  • lazy_static 1.4.0
  • log 0.4.17
  • melt 0.1.6
  • native-tls 0.2
  • netrc 0.4.1
  • openssl 0.10.45
  • question 0.2.2
  • regex 1.7.1
  • reqwest 0.11.14
  • rust-s3 0.31.0
  • self_update 0.36.0
  • sha2 0.10.6
  • skim-navi 0.1.7
  • ssh2 0.9.3
  • strfmt 0.2.4
  • tokio 1.25.0
  • tokio-util 0.7.7
  • untildify 0.1.1
  • url-parse 1.0.5
  • uuid 1.3
  • warpy 0.3.5
  • serial_test 1.0.0
dockerfile
Dockerfile
  • alpine 3.17
github-actions
.github/workflows/audit.yaml
.github/workflows/cd.yaml
  • actions/checkout v3
.github/workflows/ci.yaml

  • Check this box to trigger a request for Renovate to run again on this repository

Fix non-resumable FTP PUT

Currently, transferred bytes is hard-coded to zero.
A restart from a specific byte is necessary. The already transferred number of bytes should be fetched from the remote here.

aim_1.1.1_amd64.deb has odd description

Description: Syntax highlighter for git.
Delta provides language syntax-highlighting, within-line insertion/deletion
detection, and restructured diff output for git on the command line.

SSH-Copy Support

See this.

extern crate ssh2;

use std::net::TcpStream;
use ssh2::Session;
use std::path::Path;
use std::fs::File;
use indicatif::ProgressBar;

fn main() -> Result<(), Box<std::error::Error>> {
    let ssh_host_port = "prokerala.com:22";
    let ssh_user = "prokeral";
    let remote_temp_file = "/tmp/dbimport_Rk6Iwwm5.sql.bz2";

    let tcp = TcpStream::connect(&ssh_host_port).unwrap();
    let mut sess = Session::new().unwrap();
    sess.handshake(&tcp).expect("SSH handshake failed");
    let _ = sess.userauth_agent(ssh_user);

    let path = Path::new(&remote_temp_file);
    let (mut remote_file, stat) = sess.scp_recv(path).unwrap();

    let stream:ssh2::Stream = remote_file.stream(1);

    // Update: solved by using io::copy as suggested by @apemanzilla below
    // let mut target = File::create("/tmp/done.txt").unwrap();
    // let pb = ProgressBar::new(stat.size());
    // std::io::copy(&mut pb.wrap_read(remote_file), &mut target)?;
    Ok(())
}

Executable name overlap

Where does the name come from? Maybe not a big issue, but ABINIT package has aim executable, too. See the doc. (abinit package is available in the universe/science repository of Ubuntu.)

Async SSH support

#52 will introduce async sftp support.
The complexity of offering async ssh support (including resumable streams) is then low.

Multi-arch docker images

See this.

---
name: 'build images'

on:
  push:
    branches:
      - master

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Prepare
        id: prep
        run: |
          DOCKER_IMAGE=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPOSITORY#*/}
          VERSION=latest
          SHORTREF=${GITHUB_SHA::8}

          # If this is git tag, use the tag name as a docker tag
          if [[ $GITHUB_REF == refs/tags/* ]]; then
            VERSION=${GITHUB_REF#refs/tags/v}
          fi
          TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}"

          # If the VERSION looks like a version number, assume that
          # this is the most recent version of the image and also
          # tag it 'latest'.
          if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
            TAGS="$TAGS,${DOCKER_IMAGE}:latest"
          fi

          # Set output parameters.
          echo ::set-output name=tags::${TAGS}
          echo ::set-output name=docker_image::${DOCKER_IMAGE}

      - name: Set up QEMU
        uses: docker/setup-qemu-action@master
        with:
          platforms: all

      - name: Set up Docker Buildx
        id: buildx
        uses: docker/setup-buildx-action@master

      - name: Login to DockerHub
        if: github.event_name != 'pull_request'
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}

      - name: Build
        uses: docker/build-push-action@v2
        with:
          builder: ${{ steps.buildx.outputs.name }}
          context: .
          file: ./Dockerfile
          platforms: linux/amd64,linux/arm64,linux/ppc64le
          push: true
          tags: ${{ steps.prep.outputs.tags }}

RUSTSEC-2021-0139: ansi_term is Unmaintained

ansi_term is Unmaintained

Details
Status unmaintained
Package ansi_term
Version 0.12.1
URL ogham/rust-ansi-term#72
Date 2021-08-18

The maintainer has adviced this crate is deprecated and will not
receive any maintenance.

The crate does not seem to have much dependencies and may or may not be ok to use as-is.

Last release seems to have been three years ago.

Possible Alternative(s)

The below list has not been vetted in any way and may or may not contain alternatives;

See advisory page for additional details.

RUSTSEC-2021-0141: dotenv is Unmaintained

dotenv is Unmaintained

Details
Status unmaintained
Package dotenv
Version 0.15.0
URL dotenv-rs/dotenv#74
Date 2021-12-24

dotenv by description is meant to be used in development or testing only.

Using this in production may or may not be advisable.

Alternatives

The below may or may not be feasible alternative(s):

See advisory page for additional details.

Fix CD

Because of a missing schema definition (sftp), aim is currently using a hard fork of rust-url.
This means cargo publish will fail in the CD pipeline, because we cannot publish a crate that relies on git deps.

This PR tried to contribute changes upstream but got closed.

url-parse, once reaching maturity, will be able to unblock the blocked pipeline.

performance comparison

In order to ease the evaluation process, is it suggested to compare aim with other products, such as aria2 and wget.

Particularly, I am interested if aim handles multi source downloads, metalinks and torrents.

Also, I like to congratulate you to what looks like an awesome piece of software ☺️

RUSTSEC-2022-0048: xml-rs is Unmaintained

xml-rs is Unmaintained

Details
Status unmaintained
Package xml-rs
Version 0.8.4
URL https://github.com/netvl/xml-rs/issues
Date 2022-01-26

xml-rs is a XML parser has open issues around parsing including integer
overflows / panics that may or may not be an issue with untrusted data.

Together with these open issues with Unmaintained status xml-rs
may or may not be suited to parse untrusted data.

Alternatives

See advisory page for additional details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.