GithubHelp home page GithubHelp logo

timvisee / ffsend Goto Github PK

View Code? Open in Web Editor NEW
6.9K 48.0 181.0 13.81 MB

:mailbox_with_mail: Easily and securely share files from the command line. A fully featured Firefox Send client.

Home Page: https://gitlab.com/timvisee/ffsend

License: GNU General Public License v3.0

Rust 94.83% Shell 5.10% Dockerfile 0.06%
firefox-send cli file-sharing file-upload encryption rust hacktoberfest

ffsend's Introduction

Build status on GitLab CI Newest release on crates.io Project license

Notice: the default Send host is provided by @timvisee (info). Please consider to donate and help keep it running.

ffsend

Easily and securely share files from the command line. A Send client.

Easily and securely share files and directories from the command line through a safe, private and encrypted link using a single simple command. Files are shared using the Send service and may be up to 1GB. Others are able to download these files with this tool, or through their web browser.

ffsend usage demo
No demo visible here? View it on asciinema.

All files are always encrypted on the client, and secrets are never shared with the remote host. An optional password may be specified, and a default file lifetime of 1 (up to 20) download or 24 hours is enforced to ensure your stuff does not remain online forever. This provides a secure platform to share your files. Find out more about security here.

The public Send service that is used as default host is provided by @timvisee (info).
This application is not affiliated with Firefox or Mozilla in any way.

Note: this tool is currently in beta, as some extra desired features are yet to be implemented

Features

  • Fully featured and friendly command line tool
  • Upload and download files and directories securely, always encrypted on the client
  • Additional password protection, generation and configurable download limits
  • File and directory archiving and extraction
  • Built-in share URL shortener and QR code generator
  • Supports Send v3 (current) and v2
  • History tracking your files for easy management
  • Ability to use your own Send hosts
  • Inspect or delete shared files
  • Accurate error reporting
  • Streaming encryption and uploading/downloading, very low memory footprint
  • Intended for use in scripts without interaction

For a list of upcoming features and ideas, take a look at the current open issues over on GitLab.

Usage

Easily upload and download:

# Simple upload
$ ffsend upload my-file.txt
https://send.vis.ee/#sample-share-url

# Advanced upload
# - Specify a download limit of 1
# - Specify upload expiry time of 5 minutes
# - Enter a password to encrypt the file
# - Archive the file before uploading
# - Copy the shareable link to your clipboard
# - Open the shareable link in your browser
$ ffsend upload --downloads 1 --expiry-time 5m --password --archive --copy --open my-file.txt
Password: ******
https://send.vis.ee/#sample-share-url

# Upload to your own host
$ ffsend u -h https://example.com/ my-file.txt
https://example.com/#sample-share-url

# Simple download
$ ffsend download https://send.vis.ee/#sample-share-url

Inspect remote files:

# Check if a file exists
$ ffsend exists https://send.vis.ee/#sample-share-url
Exists: yes

# Fetch remote file info
$ ffsend info https://send.vis.ee/#sample-share-url
ID:         b087066715
Name:       my-file.txt
Size:       12 KiB
MIME:       text/plain
Downloads:  0 of 10
Expiry:     18h2m (64928s)

Other commands include:

# View your file history
$ ffsend history
#  LINK                                        EXPIRE
1  https://send.vis.ee/#sample-share-url  23h57m
2  https://send.vis.ee/#other-sample-url  17h38m
3  https://example.com/#sample-share-url       37m30s

# Change the password after uploading
$ ffsend password https://send.vis.ee/#sample-share-url
Password: ******

# Delete a file
$ ffsend delete https://send.vis.ee/#sample-share-url

Use the --help flag, help subcommand, or see the help section for all available subcommands.

Requirements

  • Linux, macOS, Windows, FreeBSD, Android (other BSDs might work)
  • A terminal 😎
  • Internet connection
  • Linux:
    • OpenSSL & CA certificates:
      • Ubuntu, Debian and derivatives: apt install openssl ca-certificates
    • Optional: xclip or xsel for clipboard support
      • Ubuntu, Debian and derivatives: apt install xclip
      • CentOS/Red Hat/openSUSE/Fedora: yum install xclip
      • Arch: pacman -S xclip
  • Windows specific:
    • Optional OpenSSL with crypto-openssl feature: » Installer (v1.1.0j or above)
  • macOS specific:
  • FreeBSD specific:
    • OpenSSL: pkg install openssl
    • CA certificates: pkg install ca_root_nss
    • Optional xclip & xsel for clipboard support: pkg install xclip xsel-conrad
  • Android specific:

Install

Because ffsend is still in early stages, only limited installation options are available right now. Feel free to contribute additional packages.

Make sure you meet and install the requirements.

See the operating system specific instructions below:

Linux (all distributions)

Using the snap package is recommended if supported.
Alternatively you may install it manually using the prebuilt binaries.

Only 64-bit (x86_64) packages and binaries are provided. For other architectures and configurations you may compile from source.

More packages options will be coming soon.

Linux: snap package

Note: The ffsend snap package is isolated, and can only access files in your home directory. Choose a different installation option if you don't want this limitation.

Note: due to how snap is configured by default, you won't be able to use the package from some contexts such as through SSH without manual modifications. If you're experiencing problems, please refer to a different installation method such as the prebuilt binaries, or open an issue.

» ffsend

snap install ffsend
ffsend --help

Linux: Arch AUR packages

» ffsend-bin (precompiled binary, latest release, recommended)
» ffsend (compiles from source, latest release)
» ffsend-git (compiles from source, latest master commit)

yay -S ffsend
# or
aurto add ffsend-bin
sudo pacman -S ffsend-bin
# or using any other AUR helper

ffsend --help

Linux: Nix package

Note: The Nix package is currently not automatically updated, and might be slightly outdated.

» ffsend

nix-channel --update
nix-env --install ffsend

ffsend --help

Linux: Fedora package

Note: The Fedora package is maintained by contributors, and might be slightly outdated.

» ffsend

sudo dnf install ffsend

ffsend --help

Linux: Alpine package

Note: The Alpine package is maintained by contributors, it might be outdated. Choose a different installation method if an important update is missing.

» ffsend

apk add ffsend --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing

ffsend --help

Linux: Prebuilt binaries

Check out the latest release assets for Linux binaries.
Use the ffsend-v*-linux-x64-static binary, to minimize the chance for issues. If it isn't available yet, you may use an artifact from a previous version instead, until it is available.

Make sure you meet and install the requirements before you continue.

You must make the binary executable, and may want to move it into /usr/bin to make it easily executable:

# Rename binary to ffsend
mv ./ffsend-* ./ffsend

# Mark binary as executable
chmod a+x ./ffsend

# Move binary into path, to make it easily usable
sudo mv ./ffsend /usr/local/bin/

ffsend --help

macOS

Using the homebrew package is recommended.
Alternatively you may install it via MacPorts, or manually using the prebuilt binaries.

macOS: homebrew package

Make sure you've homebrew installed, and run:

brew install ffsend
ffsend --help

macOS: MacPorts

Note: ffsend in MacPorts is currently not automatically updated, and might be slightly outdated.

Once you have MacPorts installed, you can run:

sudo port selfupdate
sudo port install ffsend

macOS: Nix package

Note: The Nix package is currently not automatically updated, and might be slightly outdated.

nix-channel --update
nix-env --install ffsend

ffsend --help

macOS: Prebuilt binaries

Check out the latest release assets for a macOS binary. If it isn't available yet, you may use an artifact from a previous version instead, until it is available.

Then, mark the downloaded binary as an executable. You then may want to move it into /usr/local/bin/ to make the ffsend command globally available:

# Rename file to ffsend
mv ./ffsend-* ./ffsend

# Mark binary as executable
chmod a+x ./ffsend

# Move binary into path, to make it easily usable
sudo mv ./ffsend /usr/local/bin/

ffsend

Windows

Using the scoop package is recommended.
Alternatively you may install it manually using the prebuilt binaries.

If you're using the Windows Subsystem for Linux, it's highly recommended to install the prebuilt Linux binary instead.

Only 64-bit (x86_64) binaries are provided. For other architectures and configurations you may compile from source.

A chocolatey package along with an .msi installer will be coming soon.

Windows: scoop package

Make sure you've scoop installed, and run:

scoop install ffsend
ffsend --help

Windows: Prebuilt binaries

Check out the latest release assets for Windows binaries. Use the ffsend-v*-windows-x64-static binary, to minimize the chance for issues. If it isn't available yet, you may use an artifact from a previous version instead, until it is available.

You can use ffsend from the command line in the same directory:

.\ffsend.exe --help

To make it globally invocable as ffsend, you must make the binary available in your systems PATH. The easiest solution is to move it into System32:

move .\ffsend.exe C:\Windows\System32\ffsend.exe

FreeBSD

» ffsend

Note: The FreeBSD package is currently maintained by FreeBSD contributors, and might be slightly outdated.

# Precompiled binary.
pkg install ffsend

# Compiles and installs from source.
cd /usr/ports/www/ffsend && make install

Android

ffsend can be used on Android through Termux, install it first: » Termux

Note: The Android package is currently maintained by Termux contributors, and might be slightly outdated.

# Install package.
pkg install ffsend

ffsend help

Other OS or architecture

If your system runs Docker, you can use the docker image. There are currently no other binaries or packages available.

You can build the project from source instead.

Docker image

A Docker image is available for using ffsend running in a container. Mount a directory to /data, so it's accessible for ffsend in the container, and use the command as you normally would.

» timvisee/ffsend

# Invoke without arguments
docker run --rm -it -v $(pwd):/data timvisee/ffsend

# Upload my-file.txt
docker run --rm -it -v $(pwd):/data timvisee/ffsend upload my-file.txt

# Download from specified link
docker run --rm -it -v $(pwd):/data timvisee/ffsend download https://send.vis.ee/#sample-share-url

# Show help
docker run --rm -it -v $(pwd):/data timvisee/ffsend help

# To update the used image
docker pull timvisee/ffsend

On Linux or macOS you might define a alias in your shell configuration, to make it invocable as ffsend:

alias ffsend='docker run --rm -it -v "$(pwd):/data" timvisee/ffsend'

Note: This implementation is limited to accessing the paths you make available through the specified mount.

Build

To build and install ffsend yourself, you meet the following requirements before proceeding:

Build requirements

  • Runtime requirements
  • git
  • rust v1.63 (MSRV) or higher (install using rustup)
  • OpenSSL or LibreSSL libraries/headers:
    • Linux:
      • Ubuntu, Debian and derivatives: apt install build-essential cmake pkg-config libssl-dev
      • CentOS/Red Hat/openSUSE: yum install gcc gcc-c++ make cmake openssl-devel
      • Arch: pacman -S openssl base-devel
      • Gentoo: emerge -a dev-util/pkgconfig dev-util/cmake dev-libs/openssl
      • Fedora: dnf install gcc gcc-c++ make cmake openssl-devel
      • Or see instructions here
    • Windows:
      • Optional with crypto-openssl feature: See instructions here here
    • macOS:
      • Optional with crypto-openssl feature: brew install cmake pkg-config openssl or see instructions here
    • FreeBSD:
      • pkg install rust gmake pkgconf python36 libxcb xclip ca_root_nss xsel-conrad
      • It is a better idea to use & modify the existing ffsend port, which manages dependencies for you.

Compile and install

Then, walk through one of the following steps to compile and install ffsend:

  • Compile and install it directly from cargo:

    # Compile and install from cargo
    cargo install ffsend -f
    
    # Start using ffsend
    ffsend --help
  • Or clone the repository and install it with cargo:

    # Clone the project
    git clone https://github.com/timvisee/ffsend.git
    cd ffsend
    
    # Compile and install
    cargo install --path . -f
    
    # Start using ffsend
    ffsend --help
    
    # or run it directly from cargo
    cargo run --release -- --help
  • Or clone the repository and invoke the binary directly (Linux/macOS):

    # Clone the project
    git clone https://github.com/timvisee/ffsend.git
    cd ffsend
    
    # Build the project (release version)
    cargo build --release
    
    # Start using ffsend
    ./target/release/ffsend --help

Compile features / use flags

Different use flags are available for ffsend to toggle whether to include various features. The following features are available, some of which are enabled by default:

Feature Enabled Description
send2 Default Support for Send v2 servers
send3 Default Support for Send v3 servers
crypto-ring Default Use ring as cryptography backend
crypto-openssl Use OpenSSL as cryptography backend
clipboard Default Support for copying links to the clipboard
history Default Support for tracking files in history
archive Default Support for archiving and extracting uploads and downloads
qrcode Default Support for rendering a QR code for a share URL
urlshorten Default Support for shortening share URLs
infer-command Default Support for inferring subcommand based on binary name
no-color Compile without color support in error and help messages

To enable features during building or installation, specify them with --features <features...> when using cargo. You may want to disable default features first using --no-default-features. Here are some examples:

# Defaults set of features with no-color, one of
cargo install --features no-color
cargo build --release --features no-color

# No default features, except required
cargo install --no-default-features --features send3,crypto-ring

# With history and clipboard support
cargo install --no-default--features --features send3,crypto-ring,history,clipboard

For Windows systems it is recommended to provide the no-color flag, as color support in Windows terminals is flaky.

Configuration and environment

The following environment variables may be used to configure the following defaults. The CLI flag is shown along with it, to better describe the relation to command line arguments:

Variable CLI flag Description
FFSEND_HISTORY --history <FILE> History file path
FFSEND_HOST --host <URL> Upload host
FFSEND_TIMEOUT --timeout <SECONDS> Request timeout (0 to disable)
FFSEND_TRANSFER_TIMEOUT --transfer-timeout <SECONDS> Transfer timeout (0 to disable)
FFSEND_EXPIRY_TIME --expiry-time <SECONDS> Default upload expiry time
FFSEND_DOWNLOAD_LIMIT --download-limit <DOWNLOADS> Default download limit
FFSEND_API --api <VERSION> Server API version, - to lookup
FFSEND_BASIC_AUTH --basic-auth <USER:PASSWORD> Basic HTTP authentication credentials to use.

These environment variables may be used to toggle a flag, simply by making them available. The actual value of these variables is ignored, and variables may be empty.

Variable CLI flag Description
FFSEND_FORCE --force Force operations
FFSEND_NO_INTERACT --no-interact No interaction for prompts
FFSEND_YES --yes Assume yes for prompts
FFSEND_INCOGNITO --incognito Incognito mode, don't use history
FFSEND_OPEN --open Open share link of uploaded file
FFSEND_ARCHIVE --archive Archive files uploaded
FFSEND_EXTRACT --extract Extract files downloaded
FFSEND_COPY --copy Copy share link to clipboard
FFSEND_COPY_CMD --copy-cmd Copy download command to clipboard
FFSEND_QUIET --quiet Log quiet information
FFSEND_VERBOSE --verbose Log verbose information

Some environment variables may be set at compile time to tweak some defaults.

Variable Description
XCLIP_PATH Set fixed xclip binary path when using clipboard-bin (Linux, *BSD)
XSEL_PATH Set fixed xsel binary path when using clipboard-bin (Linux, *BSD)

At this time, no configuration or dotfile file support is available. This will be something added in a later release.

Binary for each subcommand: ffput, ffget

ffsend supports having a separate binaries for single subcommands, such as having ffput and ffget just for to upload and download using ffsend. This allows simple and direct commands like:

ffput my-file.txt
ffget https://send.vis.ee/#sample-share-url

This works for a predefined list of binary names:

  • ffputffsend upload ...
  • ffgetffsend download ...
  • ffdelffsend delete ...
  • This list is defined in src/config.rs as INFER_COMMANDS

You can use the following methods to set up these single-command binaries:

  • Create a properly named symbolic link (recommended)
  • Create a properly named hard link
  • Clone the ffsend binary, and rename it

On Linux and macOS you can use the following command to set up symbolic links in the current directory:

ln -s $(which ffsend) ./ffput
ln -s $(which ffsend) ./ffget

Support for this feature is only available when ffsend is compiled with the infer-command feature flag. This is usually enabled by default. To verify support is available with an existing installation, make sure the feature is listed when invoking ffsend debug.

Note that the snap package does currently not support this due to how this package format works.

Scriptability

ffsend is optimized for use in automated scripts. It provides some specialized arguments to control ffsend without user interaction.

  • --no-interact (-I): do not allow user interaction. For prompts not having a default value, the application will quit with an error, unless --yes or --force is provided. This should always be given when using automated scripting.
    Example: when uploading a directory, providing this flag will stop the archive question prompt form popping up, and will archive the directory as default option.
  • --yes (-y): assume the yes option for yes/no prompt by default.
    Example: when downloading a file that already exists, providing this flag will assume yes when asking to overwrite a file.
  • --force (-f): force to continue with the action, skips any warnings that would otherwise quit the application.
    Example: when uploading a file that is too big, providing this flag will ignore the file size warning and forcefully continues.
  • --quiet (-q): be quiet, print as little information as possible.
    Example: when uploading a file, providing this flag will only output the final share URL.

Generally speaking, use the following rules when automating:

  • Always provide --no-interact (-I).
  • Provide any combination of --yes (-y) and --force (-f) for actions you want to complete no matter what.
  • When passing share URLs along, provide the --quiet (-q) flag, when uploading for example.

These flags can also automatically be set by defining environment variables as specified here:
» Configuration and environment

Here are some examples commands in bash:

# Stop on error
set -e

# Upload a file
# -I: no interaction
# -y: assume yes
# -q: quiet output, just return the share link
URL=$(ffsend -Iy upload -q my-file.txt)

# Render file information
# -I: no interaction
# -f: force, just show the info
ffsend -If info $URL

# Set a password for the uploaded file
ffsend -I password $URL --password="secret"

# Use the following flags automatically from now on
# -I: no interaction
# -f: force
# -y: yes
export FFSEND_NO_INTERACT=1 FFSEND_FORCE=1 FFSEND_YES=1

# Download the uploaded file, overwriting the local variant due to variables
ffsend download $URL --password="secret"

For more information on these arguments, invoke ffsend help and check out: » Configuration and environment

For other questions regarding automation or feature requests, be sure to open an issue.

Security

In short; the ffsend tool and the Send service can be considered secure, and may be used to share sensitive files. Note though that the created share link for an upload will allow anyone to download the file. Make sure you don't share this link with unauthorized people.

For more detailed information on encryption, please read the rest of the paragraphs in this security section.

Note: even though the encryption method is considered secure, this ffsend tool does not provide any warranty in any way, shape or form for files that somehow got decrypted without proper authorization.

Client side encryption

ffsend uses client side encryption, to ensure your files are securely encrypted before they are uploaded to the remote host. This makes it impossible for third parties to decrypt your file without having the secret (encryption key). The file and its metadata are encrypted using 128-bit AES-GCM, and a HMAC SHA-256 signing key is used for request authentication. This is consistent with the encryption documentation provided by the Send service, ffsend is a tool for.

A detailed list on the encryption/decryption steps, and on what encryption is exactly used can be found here in the official service documentation.

Note on share link security

The encryption secret, that is used to decrypt the file when downloading, is included in the share URL behind the # (hash). This secret is never sent the remote server directly when using the share link in your browser. It would be possible however for a webpage to load some malicious JavaScript snippet that eventually steals the secret from the link once the page is loaded. Although this scenario is extremely unlikely, there are some options to prevent this from happening:

  • Only use this ffsend tool, do not use the share link in your browser.
  • Add additional protection by specifying a password using --password while uploading, or using the password subcommand afterwards.
  • Host a secure Send service instance yourself.

A complete overview on encryption can be found in the official service documentation here.

Help

$ ffsend help

ffsend 0.2.72
Tim Visee <[email protected]>
Easily and securely share files from the command line.
A fully featured Send client.

The default public Send host is provided by Tim Visee, @timvisee.
Please consider to donate and help keep it running: https://vis.ee/donate

USAGE:
    ffsend [FLAGS] [OPTIONS] [SUBCOMMAND]

FLAGS:
    -f, --force          Force the action, ignore warnings
    -h, --help           Prints help information
    -i, --incognito      Don't update local history for actions
    -I, --no-interact    Not interactive, do not prompt
    -q, --quiet          Produce output suitable for logging and automation
    -V, --version        Prints version information
    -v, --verbose        Enable verbose information and logging
    -y, --yes            Assume yes for prompts

OPTIONS:
    -A, --api <VERSION>                 Server API version to use, '-' to lookup [env: FFSEND_API]
        --basic-auth <USER:PASSWORD>    Protected proxy HTTP basic authentication credentials (not FxA) [env: FFSEND_BASIC_AUTH]
    -H, --history <FILE>                Use the specified history file [env: FFSEND_HISTORY]
    -t, --timeout <SECONDS>             Request timeout (0 to disable) [env: FFSEND_TIMEOUT]
    -T, --transfer-timeout <SECONDS>    Transfer timeout (0 to disable) [env: FFSEND_TRANSFER_TIMEOUT]

SUBCOMMANDS:
    upload        Upload files [aliases: u, up]
    download      Download files [aliases: d, down]
    debug         View debug information [aliases: dbg]
    delete        Delete a shared file [aliases: del, rm]
    exists        Check whether a remote file exists [aliases: e]
    generate      Generate assets [aliases: gen]
    help          Prints this message or the help of the given subcommand(s)
    history       View file history [aliases: h]
    info          Fetch info about a shared file [aliases: i]
    parameters    Change parameters of a shared file [aliases: params]
    password      Change the password of a shared file [aliases: pass, p]
    version       Determine the Send server version [aliases: v]

This application is not affiliated with Firefox or Mozilla.

Special thanks

  • to all ffsend source/package contributors
  • to Mozilla for building the amazing Firefox Send service (fork)
  • to everyone involved with asciinema and svg-term for providing tools to make great visual demos
  • to everyone involved in all crate dependencies used

License

This project is released under the GNU GPL-3.0 license. Check out the LICENSE file for more information.

ffsend's People

Contributors

0mp avatar 0xflotus avatar a1346054 avatar alichtman avatar axionl avatar cuviper avatar dependabot[bot] avatar getzze avatar geweldig avatar herbygillot avatar ignatenkobrain avatar jirutka avatar kianmeng avatar kslr avatar lilyball avatar magicfab avatar murlakatamenka avatar nagyf avatar ogarcia avatar robotmachine avatar sarrchri avatar timvisee avatar vlcinsky avatar voider1 avatar wilmardo 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  avatar  avatar  avatar  avatar

Watchers

 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

ffsend's Issues

CLI and doc shall clarify, Firefox Authentication is not available yet

There are currently 8 closed issues (#110, #100, #77, #67, #22, #20, #17) related to the fact, Firefox Authentication (FxA) is not implemented yet and that --basic-auth option is related to protected reverse proxy and not to FxA.

TOC

  • Current status
    • Firefox Authentication is not available yet
    • Option --basic-auth has nothing to do with FxA
    • There is currently no way to upload file as authenticated user
    • Documentation of --basic-auth does not clarify, it is not FxA related feature
  • Proposed solution
    • Extended CLI help doc for --basic-auth
    • README.md
      • Intruductory text
      • Places talking about --basic-auth
    • Open issue, related to missing Firefox Authentication

Current status

From these issues it is clear that:

Firefox Authentication is not available yet

There are technical problems with using Firefox Authentication and they are well covered in https://gitlab.com/timvisee/ffsend/-/issues/58

It seems, that until Firefox does not change their mind in regards to allowing other registered application to take advantage of it, it is not possible to interact with Firefox Send web service using FxA.

Option --basic-auth has nothing to do with FxA

Seeing username and passoword in an option, it is easy to get confused and think, this relates to FxA.

In fact, this is not related at all as it allows to specify username and password for protected reverse proxy.

There is currently no way to upload file as authenticated user

There are many options, which are relevant only when interacting with the service as authenticated user.

Unfortunately, as there is no way to authenticate via FxA, these options are mostly irrelevant.

Note: Statememnts above are related to https://send.firefox.com and are subject to limits (max number of downloads and expiration time for annonymous users) set to this service by Mozilla. I think, even running it's own Firefox Send instance only allows intereaction as annonymous user.

Documentation of --basic-auth does not clarify, it is not FxA related feature

Current CLI documentation states in the OPTIONS section:

--basic-auth <USER:PASSWORD>
    HTTP basic authentication credentials [env: FFSEND_BASIC_AUTH]

Proposed solution

The fact, FxA is not available yet, shall be clearly stated in every context, it seems relevant. This shall prevent confusion and also minize number of issues, which are repeatedly resulting from (currently) false expectations.

Following forms are proposed:

  • extend CLI help doc for --basic-auth
  • README
  • issue, which will stay open, until FxA is available

Extended CLI help doc for --basic-auth

E.g.:

--basic-auth <USER:PASSWORD>
    Protected proxy HTTP basic authentication credentials (not FxA) [env: FFSEND_BASIC_AUTH]

README.md

Intruductory text

Current introductory text is overstatement:

# ffsend

> Easily and securely share files from the command line.
> A fully featured [Firefox Send][send] client.

Easily and securely share files and directories from the command line through a
safe, private and encrypted link using a single simple command.
Files are shared using the [Send][send] service and may be up
to 1GB (2.5GB authenticated). Others are able to download these files with this tool, or through
their web browser.

It shall better read:

# ffsend

> Easily and securely share files from the command line.
> [Firefox Send][send] client (not authenticated only at the moment).

Easily and securely share files and directories from the command line through a
safe, private and encrypted link using a single simple command.
Files are shared using the [Send][send] service and may be up
to 1GB. Others are able to download these files with this tool, or through
their web browser.

It may even link to relevant issue, explaining current status of FxA implementation.

Places talking about --basic-auth

All places talking about --basic-auth shall use the

Protected proxy HTTP basic authentication credentials (not FxA)

wording.

Open issue, related to missing Firefox Authentication

There shall exist one issue (this one or another one), explaining the problem with FxA and allowing to track it's development.

The issue shall stay open until it is resolved.

HTTP Authentication

Dear Tim Visée,

thank you very much for developing ffsend!

I use it with send.firefox.com and now want to use it with my own server.

My server is behind a reverse proxy. All services behind that are protected from abuse by HTTP basic authentication (plus TLS).

I would be really grateful if ffsend could send/use HTTP basic auth credentials.

Probably the underlying rust library already implements this, it would be really nice if this could be exposed to the command line (and perhaps some ENVIRONMENT variable).

Hopefully not coming across as some lazy freeloader i would be grateful if this feature could be implemented, i might not be the only user of this :)

kind regards.

Upload file from stdin

Hello, I'm wondering if you have considered support for reading from stdin or a named pipe to avoid having to write a file to disk. For example, all of the following fail with various errors:

echo foo | ffsend upload --name foo.txt
echo foo | ffsend upload --name foo.txt -
ffsend upload --name foo.txt <(echo foo)

Thanks!
Noah

Feature: Automatically generate random password/passphrase

Hi, great project!

I would love to see a feature added, that gives the user the option of either specifying a password for the file, or having ffsend generate one automatically. I think a 32 byte long random password would be nice for this. It could also be a passphrase instead, which would make them easier to share if this cannot be done per copy-paste and the receiving user has to manually type the password.

How to install - IPKG package

I'm trying to install ffsend on an old NAS (My Book Live) that supports IPKG; how can I install this, I haven't seen an IPKG prebuilt option to download

Windows: Failing with missing libssl and libcrypto

I installed ffsend with scoop and the installation was successful. Trying to use the ffsend u command though is failing with this error:

The code execution cannot proceed because libssl-1_1-x64.dll was not found. Reinstalling the program may fix this problem.

Followed by,

The code execution cannot proceed because libcrypto-1_1-x64.dll was not found. Reinstalling the program may fix this problem.

I tried removing ffsend and installing it afresh, but that did not help. Should I install these packages/libraries manually, or is it something that ffsend installation should take care of?

Install with Homebrew

Hello,

It would be really great if macOS users can install it via Homebrew.

Will it be added in the nearest future?

Thank you.

Multiple binaries for easier usage?

This may be a personal thing, but I would prefer:

ffsend [OPTIONS] FILE # Uploads a given file
ffget [OPTIONS] URL # Downloads from a URL

to the current interface. Is this something the project would be open to?

Remove Compiler Warnings

warning: unused import: `std::io::ErrorKind as IoErrorKind`
  --> src/util.rs:13:5
   |
13 | use std::io::ErrorKind as IoErrorKind;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: #[warn(unused_imports)] on by default

warning: use of deprecated item 'failure::Fail::causes': please use the 'iter_chain()' method instead
  --> src/util.rs:51:10
   |
51 |         .causes()
   |          ^^^^^^
   |
   = note: #[warn(deprecated)] on by default

Saw these on my machine and think they should be fixed (seems to be easy though)

How can I upload more than one file?

Hi Tim I try to send two [or more] files into the command ffsend upload but I can't, if you can help to know what is the command for uploading two or more files, please?

Exmpl; ffsend upload /home/usuari/Desktop/all-in-one.png /home/usuari/Desktop/all-in-one.sh

failed to upload the specified file

Kubuntu 18.04 amd64.
ffsend-v0.2.30-linux-x64-static

$ ffsend.sh upload 1MB --download-limit 2 --timeout 3600 --copy --verbose

Upload complete error: failed to upload the specified file
caused by: failed to change file parameters
caused by: failed to send the parameter change request
caused by: bad response from server while changing parameters
caused by: bad HTTP response: 400 Bad Request

Release Debian/Ubuntu package through PPA

An apt repository for those using a Debian-base distribution who don't use snap would be great.

Since packages are already been generated for other platforms, perhaps a tool like fpm could be used to convert 1 to the other?

Guides exist to walk through the setting up of an apt repo too, though of course the apache server doesn't have to be used - another or a pre-existing server can be used instead.

new release with updated deps?

Would be cool if you could release a new version with latest dependencies, that would help me in updating bunch of things in Fedora.

I have trouble with authentication

ffsend upload --downloads 20 --api - --basic-auth "user:password"  README.md

Doesn't work for me - it asks me to authenticate:

The downloads limit must be one of: 1
Use '--force' to force, authenticate for higher limits

Is this the right way to authenticate or is this only for proxies?

Bash Completion

Hello,

Will you add a bash completion script to help using it?

I can try to help you with this if you want.

Thank you for your answer.

Maximum password length is 32 characters

Hi, thanks for the great utility.

The automatically generated password with -P on my system is 5 words and often is longer than the maximum allowed password length of 32 characters. This means that the download is unavailable.

--downloads parameter results in 400 Bad Request error, due to non-authenticated download limit

When I try to upload a file and I specify the --downloads parameter, the upload fails

$ ffsend upload --downloads 2 IMG_20190310_223542.jpg
Upload complete                                                                                                                                                                                                                                                                                                               error: failed to upload the specified file
caused by: failed to change file parameters
caused by: failed to send the parameter change request
caused by: bad response from server while changing parameters
caused by: bad HTTP response: 400 Bad Request

When I omit the parameter, it works.
This is on version 0.2.29.

WebSocketError: I/O failure

I am getting this error while trying to upload a file.
PS: I was using the -f flag

Encrypt & Upload 1.23 GB / 1.32 GB [=======================================================================================================================>--------] 93.45 % 13.38 MB/s 7s error: failed to upload the specified file
caused by: failed to upload the file
caused by: failed to stream file for upload over websocket
caused by: WebSocketError: I/O failure

Request for web REST API

Awesome project !

Well done mate!

If i can ask you something, would be possible to wrap it all up in a Web API ?

Cheers

Compressed file compatibility

Solid Explorer (Android) can't handle the .zip files created by Firefox Send.

.zip files created by 7-Zip are fine.

Turns out Solid Explorer can't handle .rar or .7z files either.

Support config files

It would be great to support config files along side environment variables, in
Unix this files could be placed in the "standard" XDG_DATA_HOME config directory,
meanwhile in Windows %LOCALAPPDATA% could be used.

Bug: thread 'main' panicked at 'failed to read header' on Ubuntu 16.04 Xenial

hello thanks for you jobs, i got on ubuntu1604 xenial :

./ffsend upload dummy.png

thread 'main' panicked at 'failed to read header from reader: Custom { kind: UnexpectedEof, error: StringError("failed to fill whole buffer") }', src/libcore/result.rs:997:5
note: Run with RUST_BACKTRACE=1 environment variable to display a backtrace.

Shorten URLs and render QR codes

Currently, the download file link generated by this utility is very big and it is very hard to share the link verbally with the person sitting right beside.

The idea is to add an URL shortener with this utility which can generate a temporary shortened link of the original link based on user input. The shortened link may be flushed after a certain time interval so that it can be reused to share another file later by somebody else.

ffsend does not respect http_proxy settings

Thank you for your effort on this amazing tool.

However, ffsend is not working behind HTTP proxy environment

D:\>ffsend -V
ffsend 0.2.44

D:\>set http_proxy=http://localhost:8888

D:\>set https_proxy=http://localhost:8888

D:\>echo %http_proxy%
http://localhost:8888

D:\>echo %https_proxy%
http://localhost:8888

D:\>ffsend download https://send.firefox.com/download/e964034c63ea4200/#eDr-No69mmDs_QCk3Ui5MA
error: failed to follow share URL, ignoring
error: failed to download the requested file
caused by: failed to select API version to use
caused by: failed to send request to fetch server version

For detailed errors try '--verbose'
For more information try '--help'

D:\>curl  https://send.firefox.com/download/e964034c63ea4200/#eDr-No69mmDs_QCk3Ui5MA

    <!DOCTYPE html>
    <html lang="en-US">
      <head>
        <title>Firefox Send</title>
        <base href="/" />
        <meta name="robots" content="none,noarchive" />
        <meta name="google" content="nositelinkssearchbox" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
		........

curl has no problem connect to https://send.firefox.com, but ffsend does not even send request to fiddler.

image

Configuration options

I'm considering spinning up a local Send instance internally for filedrops and was hoping to use ffsend as the cli. One thing I'm wondering is how difficult it'd be to use environment vars or a config file for things that would be tuned in an enterprise scenario, such as the target Send host.

explicit command line options would override inherited config options.

While we could recompile the source with our host hardcoded in, i was hoping to not have to maintain an internal fork and continually rebase on top of your work.

Clear the history

Hi again Tim, how I can clear all my history?

I tried: ffsend delete --history, but I can't cause it need a URL.

Can't upload file in /tmp/ ?

I can upload files located in my home directory. However, if they are in /tmp it fails. See below:

marc@marc-i7 ~ {master} 16:01:52$ ls -l /tmp/car*
-rw-r--r-- 1 marc marc 305144 Jun 22 11:01 /tmp/car.jpg
marc@marc-i7 ~ {master} 16:02:32$ ffsend u /tmp/car.jpg 
error: the path '/tmp/car.jpg' does not exist

For detailed errors try '--verbose'
For more information try '--help'
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.2 LTS
Release:	18.04
Codename:	bionic

[Feature request] ffsend default to upload

My usage of ffsend is to quickly send archives from the CLI. To that end would it be possible to make ffsend upload the default action, so that we can just write ffsend <file> to upload the file ?

Archive in .zip format instead

When creating an archive from the Mac version of ffsend, the file is created in a .tar format. Is there an option to archive the file in .zip format instead? As it's commonly supported across multiple platforms and can be easily downloaded by recipients.

ability to specify download expiration time

on the website, you can choose how long before an upload expires, defaulting to one day:
screenshot of the expiration time picker
It would be nice if we could choose another expiry, perhaps in seconds or minutes, or whatever the API allows. It should be a flag for both ffsend upload and ffsend params.

"path is not an existing file" when using snap package

I installed the snap on the current Ubuntu LTS and get the following error message when I try uploading a file:

$ ffsend upload test.org
error: failed to check the file size, ignoring
error: failed to upload the specified file
caused by: the given path is not an existing file

For detailed errors try '--verbose'
For more information try '--help'

The file definitely exists. Also, adding --verbose doesn't produce additional information. I'm probably missing something obvious?

How to login?

Hello, i try login in send.firefox.com via basic-auth. Writing in windows console:
ffsend.exe upload text.txt --basic-auth [email protected]:123abc
and i get a problem with downloads limit( if write --downloads over 1) and in my account in send.firefox.com dont show last downloads.

I try with quotation marks --basic-auth "[email protected]:123abc", but it doesn't work

Uploading multiple files at once fails if an archive name is not specified

When trying to upload several files in one command, ffsend offers to archive them and upload the resulting archive. However, this will fail if --name is not specified:

$ ffsend upload file1 file2
You've selected multiple files, only a single file may be uploaded.
Archive the files into a single file? [Y/n]: y
Archiving...
error: you must specify a file name for the archive

Use '--name ' to specify a file name
For more information try '--help'

Compile and instal Fails on Raspberry Pi - 'urlshorten'

OS Details:

pi@raspberrypi:~/ffsend $ neofetch
  `.::///+:/-.        --///+//-:``    pi@raspberrypi
 `+oooooooooooo:   `+oooooooooooo:    --------------
  /oooo++//ooooo:  ooooo+//+ooooo.    OS: Raspbian GNU/Linux 10 (buster) armv7l
  `+ooooooo:-:oo-  +o+::/ooooooo:     Host: Raspberry Pi 3 Model B Rev 1.2
   `:oooooooo+``    `.oooooooo+-      Kernel: 4.19.75-v7+
     `:++ooo/.        :+ooo+/.`       Uptime: 23 hours, 20 mins
        ...`  `.----.` ``..           Packages: 1427 (dpkg)
     .::::-``:::::::::.`-:::-`        Shell: bash 5.0.3
    -:::-`   .:::::::-`  `-:::-
   `::.  `.--.`  `` `.---.``.::`
       .::::::::`  -::::::::` `
 .::` .:::::::::- `::::::::::``::.
-:::` ::::::::::.  ::::::::::.`:::-
::::  -::::::::.   `-::::::::  ::::
-::-   .-:::-.``....``.-::-.   -::-
 .. ``       .::::::::.     `..`..
   -:::-`   -::::::::::`  .:::::`
   :::::::` -::::::::::` :::::::.
   .:::::::  -::::::::. ::::::::
    `-:::::`   ..--.`   ::::::.
      `...`  `...--..`  `...`
            .::::::::::
             `.-::::-`

Kernel: Linux raspberrypi 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l GNU/Linux
Release:
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster

Cargo Version: cargo 1.40.0 (bc8e4c8be 2019-11-22)

Compile features

Cargo.toml : https://privatebin.net/?8775edb5db7e3fe8#2SPcmNKYfMPFhWKvisjSgXKJAMw9eXE3CDefARKiuSz2

Build Error : https://privatebin.net/?2c93f2c7e6c3edf6#AZqMwovbeRPumBstRAWwcobbiD3nMzyfKZYbRsFQRnW3

Build is completed if I disable "urlshorten".

Log: : https://privatebin.net/?2aa044af1267b246#GbaVU4EbrspT5MT8c3Lki8KUDbeF78UZ5KMzZbjZUvBL

Cargo.toml File :
https://privatebin.net/?17af23d990a411ce#H1jmYDu27LPcJDUgQ64FcGkm8WQ3aNXioF4XL3kFq2qi

How to contribute via GitLab

Current documentation is proposing to contribute via GitLab.

I tried that but failed. Using feature branch my push to GitLab project repo was rejected with "You are not allowed to push code to this project".

Shall I clone the repo to my own account? Will the merge request work then?

I am also confused by the fact, issues and code lives on two places. It is very likely it generates extra syncing effort and is error prone.

Proposal:

  • either decide to use only GitHub (simpler for getting contributions)
  • or explain in CONTRIBUTING.md how shall be the Merge request done on GitLab.

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.