Code Monkey home page Code Monkey logo

sharecmd's Introduction

Go Report Card GoDoc

gopher

Go Share files!

Share your files with your friends using Cloudproviders with just one command.

Supported Cloud Providers:

  • Dropbox
  • Google Drive (currently not working)
  • OpenDrive
  • Seafile (also private hosted)
  • Nextcloud / Owncloud
  • Any missing? Create an Issue or PR!

Optional Support for URL Shortener:

  • Biturl.top
  • ...

Howto share?

user@srv# share somedocument.pdf
Uploading 361 B/361 B
URL: https://drive.google.com/open?id=1C77TZBMT0PESUvsIPetGzrK36LqGFqza
Short URL: https://biturl.top/67vE32
URL copied to clipboard!

Howto setup?

user@srv# share --setup

Select a provider and connect the app to your account. The token will be saved to your disk.

Howto install?

Download precompiled binarys for your OS or compile it from source.

On Linux/Mac/Windows you can use this curl command to always get the latest version:

curl -sfL https://install.goreleaser.com/github.com/mschneider82/sharecmd.sh | sh

Or if you use MacOSX you can also use brew:

brew install https://github.com/mschneider82/sharecmd/raw/master/Formula/sharecmd.rb

Notes:

Sharecmd 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)

Provider Notes:

Dropbox:

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

Own/Nextcloud:

The folder /sharecmd will be auto generated.

sharecmd's People

Contributors

goreleaserbot avatar jsoref avatar mschneider82 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

sharecmd's Issues

share --setup panic: crypto/aes: invalid key size 29

$ share --setup
✔ googledrive
You choose "googledrive"
panic: crypto/aes: invalid key size 29

goroutine 1 [running]:
schneider.vip/share/provider/googledrive.(*obf).de(0xc00035f770, 0xb9a763, 0x38, 0xc00035f730, 0x1d)
/home/runner/work/sharecmd/sharecmd/provider/googledrive/googledrive.go:212 +0x1f4
schneider.vip/share/provider/googledrive.OAuth2GoogleDriveConfig(0xc610a0)
/home/runner/work/sharecmd/sharecmd/provider/googledrive/googledrive.go:65 +0xbc
schneider.vip/share/config.Setup(0xc000168840, 0x2b, 0x203000, 0xc00035fd60)
/home/runner/work/sharecmd/sharecmd/config/config.go:240 +0x1fa3
main.main()
/home/runner/work/sharecmd/sharecmd/main.go:47 +0xea1

short url not working ?

command log

~/Downloads: share ~/.config/sharecmd/config.json 
Uploading 261 B/261 B

URL: http://n.abc.com/s/gq78sgL7xp6Z3xa
URL copied to clipboard!

config.json , already enable biturl

{"provider":"nextcloud","providersettings":{"linkShareWithPassword":"false","password":"abc123","randomPasswordChars":"32","url":"https://n.abc.com","username":"abc"},"Path":"/sharecmd","URLShortenerProvider":"biturl","URLShortenerSettings":{}}

any suggestions ?

dropbox/google drive not working ?

OS: ubuntu 22.04
sharecmd version: 0.0.106
error log

~/git$ share --setup
✔ googledrive
You choose "googledrive"
panic: crypto/aes: invalid key size 29

goroutine 1 [running]:
schneider.vip/share/provider/googledrive.(*obf).de(0xc00035f770, 0xb9a763, 0x38, 0xc00035f730, 0x1d)
	/home/runner/work/sharecmd/sharecmd/provider/googledrive/googledrive.go:212 +0x1f4
schneider.vip/share/provider/googledrive.OAuth2GoogleDriveConfig(0xc610a0)
	/home/runner/work/sharecmd/sharecmd/provider/googledrive/googledrive.go:65 +0xbc
schneider.vip/share/config.Setup(0xc0000387e0, 0x2a, 0x203000, 0xc00035fd60)
	/home/runner/work/sharecmd/sharecmd/config/config.go:240 +0x1fa3
main.main()
	/home/runner/work/sharecmd/sharecmd/main.go:47 +0xea1

drobox

$ share --setup
✔ dropbox
You choose "dropbox"
panic: crypto/aes: invalid key size 29

goroutine 1 [running]:
schneider.vip/share/provider/dropbox.(*obf).de(0xc00035f748, 0xb95c81, 0x2c, 0xc00035f710, 0x1d)
	/home/runner/work/sharecmd/sharecmd/provider/dropbox/dropbox.go:216 +0x1f4
schneider.vip/share/provider/dropbox.OAuth2DropboxConfig(0xc610a0)
	/home/runner/work/sharecmd/sharecmd/provider/dropbox/dropbox.go:39 +0xb9
schneider.vip/share/config.Setup(0xc0000387e0, 0x2a, 0x203000, 0xc00035fd60)
	/home/runner/work/sharecmd/sharecmd/config/config.go:268 +0xf13
main.main()
	/home/runner/work/sharecmd/sharecmd/main.go:47 +0xea1

share --setup doesn't create the ~/.config/sharecmd directory

I used the binary sharecmd_0.0.35_Linux_x86_64.tar.gz on my Arch system. While setting up the auth using share --setup it exited successfully with the following message,

Saving config to /home/iliyas/.config/sharecmd/config.json

But the config isn't getting written as the parent directory sharecmd/ is missing. It'd be better to handle this in the code.

macOS 10.14.6 No URL

I installed sharecmd through HomeBrew and configured it to point to my NextCloud server. When I share a file, eg. 'share Desktop/Misc/Co-opBank.png' the file is correctly copied to my NextCloud sharecmd folder and everything seems to work except that the URL field is empty and nothing is copied to the clipboard. I have tried with and without the URL shortener to no avail. Am I doing something wrong?

Screenshot 2019-09-05 at 12 37 55

Nextcloud: sharecmd stops upload at 1024KB and produces 0 byte files

sharecmd looks like a great tool, thank you for it! unfortunately, i can't get it to work with nextcloud. it shows the correct size on the command line, but seems to stop at 1024KB and the resulting shared file on the server side is 0 bytes, no matter what i do.

ShareCmd Version: 0.0.106
tmp ❯ cat ~/.config/sharecmd/config.json | json_pp                                                                                         ⏎
{
   "Path" : "/sharecmd",
   "URLShortenerProvider" : "",
   "URLShortenerSettings" : {},
   "provider" : "nextcloud",
   "providersettings" : {
      "password" : "XXX",
      "url" : "https://subdomain.example.com/",
      "username" : "YYY"
   }
}
tmp ❯ share FILE
Uploading 1024 KiB/7.0 MiB
[....]
URL: https://subdomain.example.com/s/jtBi34LSskmSCND
URL copied to clipboard!

i use nextcloud-docker on the server, PHP upload limits are way beyond 1024 KB, and uploading the same files via nextcloud web interface works just fine. i don't know how to debug this properly, maybe you can give me some pointers?

thanks!

Support for link share passwords on Nextcloud

Some Nextcloud instances are enforcing settings a password for link sharing now, which means whenever you try to use share with such an instance you'll get the following error:

$ share some-file
Uploading [...]
2020/05/03 13:38:20 Can't get link for file: Status: failure, Message: Passwords are enforced for link shares

I would be cool to have share generate a reasonably secure, random password and post it to the command line along with the URL, so this use-case is supported.

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.