Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mschneider82/sharecmd
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.0.105
Choose a base ref
...
head repository: mschneider82/sharecmd
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on May 5, 2020

  1. Copy the full SHA
    0a102f9 View commit details

Commits on May 20, 2020

  1. Update goreleaser syntax

    jsoref authored May 20, 2020
    Copy the full SHA
    8bf2d27 View commit details

Commits on Jun 3, 2020

  1. Merge pull request #8 from jsoref/goreleaser-deprecation

    Update goreleaser syntax
    mschneider82 authored Jun 3, 2020
    Copy the full SHA
    76ffd0e View commit details

Commits on Jul 2, 2020

  1. biturl api change: fixes #9

    mschneider82 committed Jul 2, 2020
    Copy the full SHA
    e2e55a5 View commit details
  2. Copy the full SHA
    ba22aec View commit details
  3. removed snap

    mschneider82 committed Jul 2, 2020
    Copy the full SHA
    80828c7 View commit details
  4. Copy the full SHA
    971c8c5 View commit details
  5. Copy the full SHA
    267fa99 View commit details

Commits on May 12, 2022

  1. fixed length

    mschneider82 committed May 12, 2022
    Copy the full SHA
    5021ee7 View commit details

Commits on Jan 4, 2023

  1. updated goreleaser

    mschneider82 committed Jan 4, 2023
    Copy the full SHA
    0a68ccc View commit details
  2. Copy the full SHA
    82c2803 View commit details
  3. Copy the full SHA
    8771b7b View commit details
  4. fixed biturl api

    mschneider82 committed Jan 4, 2023
    Copy the full SHA
    e0e239f View commit details
  5. Copy the full SHA
    c830543 View commit details
  6. Copy the full SHA
    cb8130d View commit details
  7. Copy the full SHA
    d3ec783 View commit details
  8. go mod tidy

    mschneider82 committed Jan 4, 2023
    Copy the full SHA
    cbb35db View commit details

Commits on Jun 20, 2024

  1. Copy the full SHA
    c717a24 View commit details
  2. go modules update

    mschneider82 committed Jun 20, 2024
    Copy the full SHA
    3b08fb8 View commit details
  3. update goreleaser

    mschneider82 committed Jun 20, 2024
    Copy the full SHA
    bee6ffe View commit details
  4. changed bin name

    mschneider82 committed Jun 20, 2024
    Copy the full SHA
    cefdf81 View commit details
Showing with 704 additions and 401 deletions.
  1. +38 −0 .github/workflows/goreleaser.yml
  2. +72 −0 .goreleaser.yaml
  3. +0 −73 .goreleaser.yml
  4. +48 −5 Formula/sharecmd.rb
  5. +5 −1 README.md
  6. +26 −2 config/config.go
  7. +45 −22 go.mod
  8. +116 −286 go.sum
  9. +5 −4 main.go
  10. +5 −1 provider/dropbox/dropbox.go
  11. +10 −5 provider/googledrive/googledrive.go
  12. +327 −0 provider/opendrive/opendrive.go
  13. +7 −2 urlshortener/biturl/biturl.go
38 changes: 38 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: goreleaser

on:
push:
# run only against tags
tags:
- '*'

permissions:
contents: write
# packages: write
# issues: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
go-version: '>=1.19.4'
cache: true
# More assembly might be required: Docker logins, GPG, etc. It all depends
# on your needs.
- uses: goreleaser/goreleaser-action@v4
with:
# either 'goreleaser' (default) or 'goreleaser-pro':
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro'
# distribution:
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
72 changes: 72 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com

# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 2

before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
binary: "share"
archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip
nfpms:
- file_name_template: "{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
homepage: https://github.com/mschneider82/sharecmd
description: Share your files with your friends using Cloudproviders with just one command.
maintainer: Matthias Schneider <ms@wck.biz>
license: Apache
formats:
- deb
- rpm

snapcrafts:
- name_template: 'share_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
summary: Share your files using Cloudproviders with just one command
description: |
Share uploads the file to the configured cloud provider and does a
public share of the file for anyone who has the link. The link will be
copyed to system clipboard (windows/linux/macos)
https://github.com/mschneider82/sharecmd
grade: stable
confinement: strict
publish: true
#true
name: share
apps:
share:
plugs: ["home", "network", "x11"]

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
73 changes: 0 additions & 73 deletions .goreleaser.yml

This file was deleted.

53 changes: 48 additions & 5 deletions Formula/sharecmd.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,56 @@
# typed: false
# frozen_string_literal: true

# This file was generated by GoReleaser. DO NOT EDIT.
class Sharecmd < Formula
desc "Share your files using Cloudproviders with just one command"
homepage "https://github.com/mschneider82/sharecmd"
url "https://github.com/mschneider82/sharecmd/releases/download/v0.0.96/sharecmd_0.0.96_Darwin_x86_64.tar.gz"
version "0.0.96"
sha256 "98a485835935766c528913d6c77a14e4a6ae5c62dfc6a50af84a600cb7bbeff1"
version "0.0.111"

on_macos do
if Hardware::CPU.intel?
url "https://github.com/mschneider82/sharecmd/releases/download/v0.0.111/sharecmd_0.0.111_Darwin_x86_64.tar.gz"
sha256 "fe46fc11a8f3e51537bc483a123c63884f40c8129d754bd94689415a73494465"

def install
bin.install "share"
end
end
if Hardware::CPU.arm?
url "https://github.com/mschneider82/sharecmd/releases/download/v0.0.111/sharecmd_0.0.111_Darwin_arm64.tar.gz"
sha256 "67a24897354df4a9e5a816777f0e50da5ef5d453440526b4e5ce1f971e5ad53a"

def install
bin.install "share"
end
end
end

on_linux do
if Hardware::CPU.intel?
url "https://github.com/mschneider82/sharecmd/releases/download/v0.0.111/sharecmd_0.0.111_Linux_x86_64.tar.gz"
sha256 "95f49e0139142c6289032fec932fae1b9cb7474d8f34ad21ed2c8cd8f6adaac4"

def install
bin.install "share"
end
end
if Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
url "https://github.com/mschneider82/sharecmd/releases/download/v0.0.111/sharecmd_0.0.111_Linux_armv6.tar.gz"
sha256 "a077da294d0ca4e15be44d1bfed182cc1670ed7c1e382446c658ee6939e051a6"

def install
bin.install "share"
end
end
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
url "https://github.com/mschneider82/sharecmd/releases/download/v0.0.111/sharecmd_0.0.111_Linux_arm64.tar.gz"
sha256 "873252edeeb5d070e2b874d6a724b982126be5509323642e4c21fa886b8e7277"

def install
bin.install "share"
def install
bin.install "share"
end
end
end

test do
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -9,7 +9,8 @@ Share your files with your friends using Cloudproviders with just one command.
# Supported Cloud Providers:

* Dropbox
* Google Drive
* Google Drive (currently not working)
* OpenDrive
* Seafile (also private hosted)
* Nextcloud / Owncloud
* Any missing? Create an Issue or PR!
@@ -66,6 +67,9 @@ It uploads all files to /Apps/sharecmd (folder auto generated)
## Googledrive:
It uploads all files to /sharecmd (folder auto generated)

## Opendrive
It uploads all files to /sharecmd (folder auto generated)

## Seafile:
It creates a new Library called sharecmd on setup

28 changes: 26 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ import (
"schneider.vip/share/urlshortener"
)

var providers = []string{"dropbox", "googledrive", "seafile", "nextcloud"}
var providers = []string{"dropbox", "opendrive", "seafile", "nextcloud"}

// Config File Structure
type Config struct {
@@ -45,7 +45,7 @@ func UserHomeDir() string {

// Write config to disk
func (c Config) Write() error {
err := os.MkdirAll(path.Dir(UserHomeDir()+"/.config/sharecmd/config.json"), 0700)
err := os.MkdirAll(path.Dir(UserHomeDir()+"/.config/sharecmd/config.json"), 0o700)
if err != nil {
return err
}
@@ -287,6 +287,30 @@ func Setup(configfilepath string) error {
return err
}
config.ProviderSettings["token"] = token.AccessToken
case "opendrive":
var user, password string
userPrompt := promptui.Prompt{
Label: "Username",
Default: "",
}
user, err = userPrompt.Run()
if err != nil {
fmt.Printf("Prompt failed %v\n", err)
return err
}

passwordPrompt := promptui.Prompt{
Label: "Password",
Default: "",
Mask: '*',
}
password, err = passwordPrompt.Run()
if err != nil {
fmt.Printf("Prompt failed %v\n", err)
return err
}
config.ProviderSettings["user"] = user
config.ProviderSettings["pass"] = password
}
u, settings := urlshortener.Questions()
config.URLShortenerProvider = u
67 changes: 45 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,31 +1,54 @@
module schneider.vip/share

go 1.13
go 1.22

toolchain go1.22.2

require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/atotto/clipboard v0.1.2
github.com/cespare/xxhash v1.1.0 // indirect
github.com/alecthomas/kingpin/v2 v2.4.0
github.com/atotto/clipboard v0.1.4
github.com/coreos/ioprogress v0.0.0-20151023204047-4637e494fd9b
github.com/dropbox/dropbox-sdk-go-unofficial v5.6.0+incompatible
github.com/dustin/go-humanize v1.0.0
github.com/golang/protobuf v1.4.1 // indirect
github.com/lunixbochs/vtclean v1.0.0 // indirect
github.com/manifoldco/promptui v0.7.0
github.com/mattn/go-colorable v0.1.6 // indirect
github.com/dustin/go-humanize v1.0.1
github.com/manifoldco/promptui v0.9.0
github.com/mdp/qrterminal v1.0.1
github.com/mschneider82/easygo v0.0.0-20180731142950-f2a24982ceed
github.com/sethvargo/go-password v0.1.3
github.com/spf13/cast v1.3.1
golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79 // indirect
golang.org/x/net v0.0.0-20200505041828-1ed23360d12c // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/sys v0.0.0-20200501145240-bc7a7d42d5c3 // indirect
google.golang.org/api v0.23.0
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84 // indirect
google.golang.org/grpc v1.29.1 // indirect
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/yaml.v2 v2.2.8 // indirect
github.com/sethvargo/go-password v0.3.0
github.com/spf13/cast v1.6.0
golang.org/x/oauth2 v0.21.0
google.golang.org/api v0.185.0
)

require (
cloud.google.com/go/auth v0.5.1 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect
cloud.google.com/go/compute/metadata v0.3.0 // indirect
github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.5 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect
go.opentelemetry.io/otel v1.27.0 // indirect
go.opentelemetry.io/otel/metric v1.27.0 // indirect
go.opentelemetry.io/otel/trace v1.27.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 // indirect
google.golang.org/grpc v1.64.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
rsc.io/qr v0.2.0 // indirect
)
Loading