Compare commits

..

No commits in common. "master" and "v0.2.74" have entirely different histories.

11 changed files with 906 additions and 917 deletions

1
.gitignore vendored
View file

@ -2,4 +2,3 @@
target/
**/*.rs.bk
.idea/
snapcraft.login

View file

@ -5,7 +5,7 @@
# - export a build artifact from the new job
# - manually upload artifact to GitHub in the 'github-release' job
image: "rust:slim-bookworm"
image: "rust:slim"
stages:
- check
@ -64,10 +64,10 @@ check-nightly:
<<: *check-base
variables:
RUST_VERSION: nightly
check-msrv:
check-old:
<<: *check-base
variables:
RUST_VERSION: "1.63.0"
RUST_VERSION: "1.46.0"
# Build using Rust stable
build-x86_64-linux-gnu:
@ -95,9 +95,9 @@ build-x86_64-linux-musl:
# Build OpenSSL statically
- apt-get install -y build-essential wget musl-tools
- wget https://github.com/openssl/openssl/releases/download/openssl-3.0.15/openssl-3.0.15.tar.gz
- tar xzvf openssl-3.0.15.tar.gz
- cd openssl-3.0.15
- wget https://www.openssl.org/source/old/1.1.1/openssl-1.1.1k.tar.gz
- tar xzvf openssl-1.1.1k.tar.gz
- cd openssl-1.1.1k
- ./config no-async -fPIC --openssldir=/usr/local/ssl --prefix=/usr/local
- make
- make install
@ -105,7 +105,7 @@ build-x86_64-linux-musl:
# Statically build ffsend
- export OPENSSL_STATIC=1
- export OPENSSL_LIB_DIR=/usr/local/lib64
- export OPENSSL_LIB_DIR=/usr/local/lib
- export OPENSSL_INCLUDE_DIR=/usr/local/include
- cargo build --target=$RUST_TARGET --release --verbose
@ -187,7 +187,8 @@ release-snap:
# Publish snap package
- echo "Publishing snap package..."
- snapcraft whoami
- echo "$SNAPCRAFT_LOGIN" | base64 -d > snapcraft.login
- snapcraft login --with snapcraft.login
- snapcraft push --release=stable ffsend_*_amd64.snap
artifacts:
name: ffsend-snap-x86_64

1699
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,6 @@
[package]
name = "ffsend"
version = "0.2.77"
rust-version = "1.63.0"
version = "0.2.74"
authors = ["Tim Visee <3a4fb3964f@sinenomine.email>"]
license = "GPL-3.0"
readme = "README.md"
@ -50,12 +49,24 @@ license-file = ["LICENSE", "3"]
depends = "$auto, libssl1.1, ca-certificates, xclip"
maintainer-scripts = "pkg/deb"
[badges]
gitlab = { repository = "timvisee/ffsend", branch = "master" }
[[bin]]
name = "ffsend"
path = "src/main.rs"
[features]
default = ["archive", "clipboard", "crypto-ring", "history", "infer-command", "qrcode", "send3", "urlshorten"]
default = [
"archive",
"clipboard",
"crypto-ring",
"history",
"infer-command",
"qrcode",
"send3",
"urlshorten",
]
# Compile with file archiving support
archive = ["tar"]
@ -111,10 +122,10 @@ open = "2"
openssl-probe = "0.1"
pathdiff = "0.2"
pbr = "1"
prettytable-rs = { version = "0.10.0", default-features = false }
prettytable-rs = "0.8"
qr2term = { version = "0.2", optional = true }
rand = "0.8"
regex = "1.5"
regex = "1.3"
rpassword = "5"
serde = "1"
serde_derive = "1"
@ -122,7 +133,7 @@ tar = { version = "0.4", optional = true }
tempfile = "3"
toml = "0.5"
urlshortener = { version = "3", optional = true }
version-compare = "0.1"
version-compare = "0.0.13"
[target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "openbsd", target_os = "netbsd"))'.dependencies]
which = { version = "4.0", optional = true }

View file

@ -36,7 +36,7 @@ Find out more about security [here](#security).
- [Features](#features)
- [Usage](#usage)
- [Requirements](#requirements)
- [Install](#install) ([Linux](#linux-all-distributions), [macOS](#macos), [Windows](#windows), [FreeBSD](#freebsd), [Android](#android), [_Other OS/architecture_](#other-os-or-architecture))
- [Install](#install) ([Linux](#linux-all-distributions), [macOS](#macos), [Windows](#windows), [FreeBSD](#freebsd), [Android](#android), [_Other OS/arch_](#other-os-or-architecture))
- [Build](#build)
- [Configuration and environment](#configuration-and-environment)
- [Security](#security)
@ -188,7 +188,6 @@ _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](#linux-prebuilt-binaries), or open an issue._
_Note: if you want to read/write to a flash drive run `snap connect ffsend:removable-media`
`ffsend`][snapcraft-ffsend]
@ -363,7 +362,7 @@ 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
To make it globally invokable as `ffsend`, you must make the binary available in
your systems `PATH`. The easiest solution is to move it into `System32`:
```cmd
move .\ffsend.exe C:\Windows\System32\ffsend.exe
@ -429,7 +428,7 @@ docker pull timvisee/ffsend
```
On Linux or macOS you might define a alias in your shell configuration, to make
it invocable as `ffsend`:
it invokable as `ffsend`:
```bash
alias ffsend='docker run --rm -it -v "$(pwd):/data" timvisee/ffsend'
@ -445,7 +444,7 @@ before proceeding:
### Build requirements
- Runtime [requirements](#requirements)
- [`git`][git]
- [`rust`][rust] `v1.63` (MSRV) or higher (install using [`rustup`][rustup])
- [`rust`][rust] `v1.40` or higher (install using [`rustup`][rustup])
- [OpenSSL][openssl] or [LibreSSL][libressl] libraries/headers:
- Linux:
- Ubuntu, Debian and derivatives: `apt install build-essential cmake pkg-config libssl-dev`
@ -812,7 +811,7 @@ Check out the [LICENSE](LICENSE) file for more information.
[termux]: https://termux.com/
[rust]: https://rust-lang.org/
[rustup]: https://rustup.rs/
[send]: https://github.com/timvisee/send
[send]: https://send.vis.ee/
[mozilla-send]: https://github.com/mozilla/send
[timvisee-send]: https://github.com/timvisee/send
[send-encryption]: https://github.com/timvisee/send/blob/master/docs/encryption.md

View file

@ -1,6 +0,0 @@
`firefox-send` is a script for Nautilus/Nemo/Caja (maybe it needs some adaptation for Caja) to send files directly from the file browser, using the contextual menu.
* Copy the `firefox-send` file to ~/.local/share/nautilus/scripts/firefox-send
* Modify the default options to your use case: host server, download number, retention time.
* Make the file executable (`chmod +x firefox-send`).
* Restart Nautilus/Nemo/Caja.

View file

@ -1,46 +0,0 @@
#!/bin/bash
#CONSTANTS
#FILEPATH=`echo $NAUTILUS_SCRIPT_SELECTED_URIS | sed 's@file://@@g'`
# Quote the paths
IFS=$'\n' read -d '' -r -a FILEPATH <<< "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
FFSEND_BIN='/usr/bin/ffsend'
FFSEND_BIN_OPTS="upload --open --copy"
ZENITY='/usr/bin/zenity '
ZENITY_PROGRESS_OPTIONS='--auto-close --auto-kill' #you can remove this if you like
#sanity checks
for sanity_check in $FFSEND_BIN "${FILEPATH[@]}"
do
ZENITY_ERROR_SANITY="There is an error, it involved $sanity_check.\n Probably binary or file missing"
if [ ! -e $sanity_check ]
then
#zenity --error --text="$(eval "echo \"$ZENITY_ERROR_SANITY\"")"
zenity --error --text="$ZENITY_ERROR_SANITY"
exit
fi
done
# Use the following flags automatically from now on
# -I: no interaction
# -f: force
# -y: yes
# -q: quiet
export FFSEND_NO_INTERACT=1 FFSEND_FORCE=1 FFSEND_YES=1 FFSEND_QUIET=1
export FFSEND_HOST=https://send.boblorange.net
export FFSEND_EXPIRY_TIME=604800
export FFSEND_DOWNLOAD_LIMIT=5
#check whether copying file or directory
if [ ! -f "${FILEPATH[@]}" ]; then
FFSEND_BIN_OPTS="$FFSEND_BIN_OPTS --archive"
fi
# Upload a file
#zenity --info --text="Ready to send: $FFSEND_BIN $FFSEND_BIN_OPTS ${FILEPATH[@]}"
$FFSEND_BIN $FFSEND_BIN_OPTS "${FILEPATH[@]}" | $($ZENITY --progress --text="sending $(basename $FILEPATH)" --pulsate $ZENITY_PROGRESS_OPTIONS)
#echo -e "$FILEPATH" | xargs -i $FFSEND_BIN $FFSEND_BIN_OPTS {} | $($ZENITY --progress --text="sending $(basename $FILEPATH)" --pulsate $ZENITY_PROGRESS_OPTIONS)
# Upload a file
#echo -e "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | xargs -i ffsend upload --open --copy {}

View file

@ -28,7 +28,7 @@ fi
mkdir -p "$DIR/ffsend-$VERSION"
cp -- "$DIR/../ffsend" "$DIR/ffsend-$VERSION/ffsend"
# Create an application tarball
# Create an application tarbal
cd -- "$DIR/.."
git archive --format tar.gz -o "$DIR/ffsend-$VERSION/ffsend-$VERSION.tar.gz" "$TRAVIS_TAG"

View file

@ -1,8 +1,11 @@
use chbs;
use chbs::{config::BasicConfig, prelude::*, word::WordList};
use clap::Arg;
use super::{CmdArg, CmdArgFlag};
/// How many words the passphrase should consist of.
const PASSPHRASE_WORDS: usize = 5;
/// The passphrase generation argument.
pub struct ArgGenPassphrase {}
@ -10,7 +13,10 @@ impl ArgGenPassphrase {
/// Generate a cryptographically secure passphrase that is easily
/// remembered using diceware.
pub fn gen_passphrase() -> String {
chbs::passphrase()
let mut config = BasicConfig::default();
config.words = PASSPHRASE_WORDS;
config.word_provider = WordList::builtin_eff_general_short().sampler();
config.to_scheme().generate()
}
}

View file

@ -61,7 +61,7 @@ impl<'a: 'b, 'b> Handler<'a> {
let app = App::new(crate_name!())
.version(crate_version!())
.author(crate_authors!())
.about(APP_ABOUT.as_str())
.about(APP_ABOUT.as_ref())
.after_help("This application is not affiliated with Firefox or Mozilla.")
.global_setting(AppSettings::GlobalVersion)
.global_setting(AppSettings::VersionlessSubcommands)

View file

@ -8,7 +8,7 @@ use ffsend_api::{
url::Url,
};
use toml::{de::Error as DeError, ser::Error as SerError};
use version_compare::Cmp;
use version_compare::{CompOp, VersionCompare};
use crate::util::{print_error, print_warning};
@ -62,9 +62,9 @@ impl History {
// Get the version number from the file
let version = history.version.as_ref().unwrap();
if let Ok(true) = version_compare::compare_to(version, VERSION_MIN, Cmp::Lt) {
if let Ok(true) = VersionCompare::compare_to(version, VERSION_MIN, &CompOp::Lt) {
print_warning("history file version is too old, ignoring");
} else if let Ok(true) = version_compare::compare_to(version, VERSION_MAX, Cmp::Gt) {
} else if let Ok(true) = VersionCompare::compare_to(version, VERSION_MAX, &CompOp::Gt) {
print_warning("history file has an unknown version, ignoring");
}
}