Compare commits

...

40 commits

Author SHA1 Message Date
timvisee
238f1f54d7
Bump MSRV to 1.63.0 2023-08-20 17:48:39 +02:00
timvisee
5df8463b74
Bump dependencies 2023-08-20 17:37:36 +02:00
timvisee
8d8ad7fdb3
Revert "Upgrade to libssl3/openssl3."
This reverts commit 5fd2eac6eb.
2023-05-18 23:12:06 +02:00
timvisee
f06b639542
Merge branch 'sarrchri-linux-libssl3' into master
See https://github.com/timvisee/ffsend/pull/156
2023-05-18 23:00:57 +02:00
Christian Sarre
5fd2eac6eb Upgrade to libssl3/openssl3. 2023-04-12 13:59:56 +03:00
timvisee
e0821c751d
Merge branch 'alichtman-master' into master
See https://github.com/timvisee/ffsend/pull/154
2023-04-07 08:25:20 +02:00
Aaron Lichtman
3c1c2dc28c
Fix segfault
close  #153
2023-04-06 23:14:09 -07:00
timvisee
13f9edd2ea
Bump MSRV to 1.60 2023-02-20 11:16:30 +01:00
timvisee
fd5b38f9ab
Update dependencies 2023-02-14 14:00:41 +01:00
timvisee
6661a58770
Revert "Use shorter passphrase words, make them less than 32-characters long"
This reverts commit fdf8ae9201.

This is reverted because the password length limit is now set much
higher, see: https://github.com/timvisee/send/pull/147
2023-02-14 13:59:44 +01:00
Tim Visée
b2b287e34f Merge branch 'prettytable-rs-features' into 'master'
Disable unused features in prettytable-rs crate

See merge request timvisee/ffsend!41
2022-11-14 17:49:35 +00:00
Jakub Jirutka
9b8dee12ea Disable unused features in prettytable-rs crate
ffsend doesn't use csv.
2022-10-09 21:57:19 +02:00
timvisee
a98c9d1ce4
Merge branch 'kianmeng-fix-typos' into master
See https://github.com/timvisee/ffsend/pull/144
2022-10-05 16:07:03 +02:00
Kian-Meng Ang
f77f9f116a Fix typos
Found via `codespell -S *.svg -L crate,ser`
2022-10-05 21:52:50 +08:00
timvisee
afb004680b
Update dependencies 2022-08-18 16:51:01 +02:00
timvisee
6edc0b1eac
Merge branch 'master' of gitlab.com:timvisee/ffsend 2022-07-04 18:38:44 +02:00
timvisee
7c94f265e2
Update Send link in README, point to repository instead 2022-07-04 18:38:35 +02:00
Tim Visée
d33c03cd2c Merge branch 'nautilus-script' into 'master'
Add script for Nautilus

See merge request timvisee/ffsend!39
2022-06-27 13:22:36 +00:00
getzze
ecc6bcf736 add script for Nautilus 2022-06-27 13:46:50 +01:00
timvisee
3e9a4d67f2
Bump version to 0.2.76 2022-06-20 10:09:01 +02:00
timvisee
ea87a778b3
Update dependencies 2022-06-20 10:08:45 +02:00
timvisee
91cf01ec75
Fix Snapcraft CI release, use new authentication method 2022-06-20 10:04:37 +02:00
timvisee
7598063e36
Bump version to 0.2.75 2022-06-19 02:01:33 +02:00
timvisee
6672891490
Update dependencies 2022-06-19 02:01:12 +02:00
timvisee
8139e3be01
Bump MSRV to 1.56.1 2022-06-19 01:42:32 +02:00
timvisee
ac9f56945b
Update dependencies 2022-06-19 01:41:03 +02:00
timvisee
b42225be76
Update dependencies 2022-06-07 10:29:32 +02:00
dependabot[bot]
1a5ec2de79
Bump regex from 1.5.4 to 1.5.5
Bumps [regex](https://github.com/rust-lang/regex) from 1.5.4 to 1.5.5.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.5.4...1.5.5)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-06 21:18:06 +00:00
timvisee
216772361a
Remove deprecated badges from Cargo.toml 2021-10-15 12:36:05 +02:00
timvisee
55c243a007
Update dependencies 2021-10-14 22:52:02 +02:00
timvisee
ccd489ce2e
Bump version to 0.2.74 2021-10-07 13:32:06 +02:00
timvisee
8026a79478
Update dependencies 2021-10-07 13:31:30 +02:00
Tim Visée
92ab75f837 Merge branch '113-update-static-openssl' into 'master'
Resolve "Update static OpenSSL"

Closes #113

See merge request timvisee/ffsend!38
2021-10-07 11:29:13 +00:00
timvisee
011d97f843
Compile OpenSSL with no-async 2021-10-07 13:09:39 +02:00
timvisee
3782996376
Update static OpenSSL version to 1.1.1k 2021-10-07 13:09:38 +02:00
timvisee
8f909b805b
Revert "Use latest ca-certificates for ffsend binary test against public instance"
This reverts commit 4c55145a07.
2021-10-07 13:09:24 +02:00
timvisee
178b73f210
Update dependencies 2021-10-06 13:51:38 +02:00
timvisee
4c55145a07
Use latest ca-certificates for ffsend binary test against public instance 2021-10-04 12:45:11 +02:00
timvisee
faa1141a2b
Further improve Arch AUR packages
Based on comments at:
10977f056d

Thanks @alerque
2021-08-31 16:03:38 +02:00
timvisee
10977f056d
Update Arch AUR packages to latest standards
Suggested by https://aur.archlinux.org/packages/ffsend/#comment-824438
2021-08-31 15:32:58 +02:00
13 changed files with 973 additions and 988 deletions

View file

@ -64,10 +64,10 @@ check-nightly:
<<: *check-base
variables:
RUST_VERSION: nightly
check-old:
check-msrv:
<<: *check-base
variables:
RUST_VERSION: "1.46.0"
RUST_VERSION: "1.63.0"
# Build using Rust stable
build-x86_64-linux-gnu:
@ -95,10 +95,10 @@ build-x86_64-linux-musl:
# Build OpenSSL statically
- apt-get install -y build-essential wget musl-tools
- wget https://www.openssl.org/source/old/1.0.2/openssl-1.0.2o.tar.gz
- tar xzvf openssl-1.0.2o.tar.gz
- cd openssl-1.0.2o
- ./config -fPIC --openssldir=/usr/local/ssl --prefix=/usr/local
- 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
- cd ..
@ -188,7 +188,7 @@ release-snap:
# Publish snap package
- echo "Publishing snap package..."
- echo "$SNAPCRAFT_LOGIN" | base64 -d > snapcraft.login
- snapcraft login --with snapcraft.login
- snapcraft whoami
- snapcraft push --release=stable ffsend_*_amd64.snap
artifacts:
name: ffsend-snap-x86_64
@ -301,7 +301,7 @@ package-aur:
- sed "s/^pkgver=.*\$/pkgver=$VERSION/" -i ffsend/PKGBUILD
- sed "s/^pkgver=.*\$/pkgver=$VERSION/" -i ffsend-bin/PKGBUILD
- sed "s/^pkgver=.*\$/pkgver=$VERSION.$CI_COMMIT_SHORT_SHA/" -i ffsend-git/PKGBUILD
- sed "s/^source=(\"\(.*\)::.*\").*\$/source=(\"\1::$(echo $URL_SOURCE | sed 's/\//\\\//g')\")/" -i ffsend/PKGBUILD
- sed "s/^source=(\".*\").*\$/source=(\"$(echo $URL_SOURCE | sed 's/\//\\\//g')\")/" -i ffsend/PKGBUILD
- sed "s/\(\"ffsend-v\$pkgver::\).*\"/\1$(echo $URL_BIN | sed 's/\//\\\//g')\"/" -i ffsend-bin/PKGBUILD
- sed "s/\(\"ffsend-v\$pkgver.bash::\).*\"/\1$(echo $URL_BASH_COMPLETION | sed 's/\//\\\//g')\"/" -i ffsend-bin/PKGBUILD
- sed "s/\(\"ffsend-v\$pkgver.zsh::\).*\"/\1$(echo $URL_ZSH_COMPLETION | sed 's/\//\\\//g')\"/" -i ffsend-bin/PKGBUILD

1769
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,7 @@
[package]
name = "ffsend"
version = "0.2.73"
version = "0.2.76"
rust-version = "1.63.0"
authors = ["Tim Visee <3a4fb3964f@sinenomine.email>"]
license = "GPL-3.0"
readme = "README.md"
@ -49,24 +50,12 @@ 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"]
@ -113,7 +102,7 @@ chrono = "0.4"
clap = "2.33"
colored = "2.0"
derive_builder = "0.10"
directories = "3.0"
directories = "4.0"
failure = "0.1"
ffsend-api = { version = "0.7.3", default-features = false }
fs2 = "0.4"
@ -122,10 +111,10 @@ open = "2"
openssl-probe = "0.1"
pathdiff = "0.2"
pbr = "1"
prettytable-rs = "0.8"
prettytable-rs = { version = "0.10.0", default-features = false }
qr2term = { version = "0.2", optional = true }
rand = "0.8"
regex = "1.3"
regex = "1.5"
rpassword = "5"
serde = "1"
serde_derive = "1"
@ -133,7 +122,7 @@ tar = { version = "0.4", optional = true }
tempfile = "3"
toml = "0.5"
urlshortener = { version = "3", optional = true }
version-compare = "0.0.11"
version-compare = "0.1"
[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

@ -362,7 +362,7 @@ You can use `ffsend` from the command line in the same directory:
.\ffsend.exe --help
```
To make it globally invokable as `ffsend`, you must make the binary available in
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`:
```cmd
move .\ffsend.exe C:\Windows\System32\ffsend.exe
@ -428,7 +428,7 @@ docker pull timvisee/ffsend
```
On Linux or macOS you might define a alias in your shell configuration, to make
it invokable as `ffsend`:
it invocable as `ffsend`:
```bash
alias ffsend='docker run --rm -it -v "$(pwd):/data" timvisee/ffsend'
@ -444,7 +444,7 @@ before proceeding:
### Build requirements
- Runtime [requirements](#requirements)
- [`git`][git]
- [`rust`][rust] `v1.40` or higher (install using [`rustup`][rustup])
- [`rust`][rust] `v1.63` (MSRV) 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`
@ -811,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://send.vis.ee/
[send]: https://github.com/timvisee/send
[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

@ -0,0 +1,6 @@
`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

@ -0,0 +1,46 @@
#!/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

@ -27,10 +27,9 @@ optdepends=('xclip: clipboard support'
package() {
cd "$srcdir"
# Install Binary
install -Dm755 "ffsend-v$pkgver" "$pkgdir/usr/bin/ffsend"
# Install shell completions and LICENSE file
# Shell completions and LICENSE file
install -Dm644 "ffsend-v$pkgver.bash" "$pkgdir/usr/share/bash-completion/completions/ffsend"
install -Dm644 "ffsend-v$pkgver.zsh" "$pkgdir/usr/share/zsh/site-functions/_ffsend"
install -Dm644 "ffsend-v$pkgver.fish" "$pkgdir/usr/share/fish/vendor_completions.d/ffsend.fish"

View file

@ -10,28 +10,42 @@ pkgrel=1
pkgdesc="Easily and securely share files from the command line. A Send client."
url="https://gitlab.com/timvisee/ffsend"
license=('GPL3')
source=("ffsend::git+$url.git")
source=("git+${url}")
sha256sums=('SKIP')
arch=('x86_64' 'i686')
provides=('ffsend')
conflicts=('ffsend')
depends=('ca-certificates')
makedepends=('openssl>=1.0' 'rust>=1.39' 'cargo' 'cmake')
optdepends=('xclip: clipboard support'
'bash-completion: support auto completion for bash')
makedepends=('cargo' 'cmake' 'openssl>=1.0')
optdepends=('xclip: clipboard support')
prepare() {
cd "${pkgname%-git}"
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}
build() {
cd ffsend
env CARGO_INCREMENTAL=0 cargo build --release
cd "${pkgname%-git}"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
cargo build --frozen --release
}
check() {
cd "${pkgname%-git}"
export RUSTUP_TOOLCHAIN=stable
cargo test --frozen
}
package() {
cd "$srcdir/ffsend"
cd "${pkgname%-git}"
# Install Binary
install -Dm755 "./target/release/ffsend" "$pkgdir/usr/bin/ffsend"
install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/ffsend"
# Install shell completions and LICENSE file
# Shell completions and LICENSE file
install -Dm644 "contrib/completions/ffsend.bash" \
"$pkgdir/etc/bash_completion.d/ffsend"
install -Dm644 "contrib/completions/_ffsend" \

View file

@ -10,27 +10,40 @@ pkgrel=1
pkgdesc="Easily and securely share files from the command line. A Send client."
url="https://gitlab.com/timvisee/ffsend"
license=('GPL3')
source=("ffsend-v$pkgver.tar.gz::$url/-/archive/v$pkgver/ffsend-v$pkgver.tar.gz") # automatically set in CI, see: /.gitlab-ci.yml
source=("$url/-/archive/v$pkgver/ffsend-v$pkgver.tar.gz") # automatically set in CI, see: /.gitlab-ci.yml
sha256sums=('SKIP') # automatically set in CI, see: /.gitlab-ci.yml
arch=('x86_64' 'i686')
provides=('ffsend')
depends=('ca-certificates')
makedepends=('openssl>=1.0' 'rust>=1.39' 'cargo' 'cmake')
optdepends=('xclip: clipboard support'
'bash-completion: support auto completion for bash')
makedepends=('cargo' 'cmake' 'openssl>=1.0')
optdepends=('xclip: clipboard support')
prepare() {
cd "$pkgname-v$pkgver"
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}
build() {
cd "ffsend-v$pkgver"
env CARGO_INCREMENTAL=0 cargo build --release
cd "$pkgname-v$pkgver"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
cargo build --frozen --release
}
check() {
cd "$pkgname-v$pkgver"
export RUSTUP_TOOLCHAIN=stable
cargo test --frozen
}
package() {
cd "$srcdir/ffsend-v$pkgver"
cd "$pkgname-v$pkgver"
# Install Binary
install -Dm755 "./target/release/ffsend" "$pkgdir/usr/bin/ffsend"
install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
# Install shell completions and LICENSE file
# Shell completions and LICENSE file
install -Dm644 "contrib/completions/ffsend.bash" \
"$pkgdir/etc/bash_completion.d/ffsend"
install -Dm644 "contrib/completions/_ffsend" \

View file

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

1
snapcraft.login Normal file
View file

@ -0,0 +1 @@
eyJyIjogIk1EQXlPV3h2WTJGMGFXOXVJRzE1WVhCd2N5NWtaWFpsYkc5d1pYSXVkV0oxYm5SMUxtTnZiUW93TURFMmFXUmxiblJwWm1sbGNpQk5lVUZ3Y0hNS01EQTBZbU5wWkNCdGVXRndjSE11WkdWMlpXeHZjR1Z5TG5WaWRXNTBkUzVqYjIxOGRtRnNhV1JmYzJsdVkyVjhNakF5TWkwd05pMHlNRlF3T0Rvd016b3hNaTQwTlRreU9EUUtNREUzWkdOcFpDQjdJblpsY25OcGIyNGlPaUF4TENBaWMyVmpjbVYwSWpvZ0ltOWFVRzlpVG1vdlJYTmhkazlYUVZoRmNIQlRNM1JNY0RGak1tdFZaVU5NYzFaWlNUQmFaa1JFZERkcVozaHhTVlI2VEhselFtOVZjV3N5VURad1JXdFFRblpNUkhOMFkwTTNSRlU1VUVFMGFXVlpPV0U0WWxGU2VtNHJNbTQxVEVsRWMwY3ZTVEphVEM4eU1uSTBjakZDYmlzM1VqRnhUVWt2WjNoR1kzVnVVV05pUlZkeVVWQXdZV3BrUTBrd1pWRmxOVEZsVmpWSVJrbzNjMlZGU0c5WVpFRlZTVVZ1Vm1GNU5sRnFVMDQzTW1SSFpWSlVabVZvYVVacmFWbFFaVVJJZVN0d1VqbHVjMXBNZW5aMFNYbHNPRnBYYVhkSVdIcFpRVTl2T0Rob1VXdFhZakZ6UzNGSGFYWjZWRFZEWlZoV1IyaElaalJSUVdRNVIwOWxLMjUxUmpWM2JHMWtaRlIwY1U1YWNWQnNjVkZHYjBoelprUk9jRFpvVFd4dWFHbDVMMGxvY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dWREE0T2pBek9qRXpMakk0TWpBNU13b3dNREptYzJsbmJtRjBkWEpsSVBtdzV2aGZjWXhjRVFzX1RHV2VHWUFrQWhxdkJONVJjOFpHTEpnVFZ2eGxDZyJ9

View file

@ -1,11 +1,8 @@
use chbs::{config::BasicConfig, prelude::*, word::WordList};
use chbs;
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 {}
@ -13,10 +10,7 @@ impl ArgGenPassphrase {
/// Generate a cryptographically secure passphrase that is easily
/// remembered using diceware.
pub fn gen_passphrase() -> String {
let mut config = BasicConfig::default();
config.words = PASSPHRASE_WORDS;
config.word_provider = WordList::builtin_eff_general_short().sampler();
config.to_scheme().generate()
chbs::passphrase()
}
}

View file

@ -8,7 +8,7 @@ use ffsend_api::{
url::Url,
};
use toml::{de::Error as DeError, ser::Error as SerError};
use version_compare::{CompOp, VersionCompare};
use version_compare::Cmp;
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) = VersionCompare::compare_to(version, VERSION_MIN, &CompOp::Lt) {
if let Ok(true) = version_compare::compare_to(version, VERSION_MIN, Cmp::Lt) {
print_warning("history file version is too old, ignoring");
} else if let Ok(true) = VersionCompare::compare_to(version, VERSION_MAX, &CompOp::Gt) {
} else if let Ok(true) = version_compare::compare_to(version, VERSION_MAX, Cmp::Gt) {
print_warning("history file has an unknown version, ignoring");
}
}