Posts: 8,898
Threads: 542
Joined: Feb 2014
Reputation:
5
Posts: 857
Threads: 47
Joined: Feb 2014
Reputation:
0
Hi Jerry,
What a creative idea. I'm not sure I need it but would be willing to give it a try. I'm interested in starting at the budget level. Happy to send the money, let me know. ~Scott
Posts: 1,484
Threads: 96
Joined: Mar 2014
Reputation:
0
Hi Jerry,
I maybe interested, I have a SugarSync Account that I used to use with Windows.
Which was great, just right click any file/folder, add to Sugarsync for it to Synch to the Cloud.
Then Files?Folders auto sync'd as soon as you did a save or change.
I need to see if the Linux OwnCloud app does the same.?
Upgrades WIP 2.6 to 2.8 - (6 X 2.6 to 2.8 completed on: 20/02/16 All O.K )
Linux Lite 3.0 Humming on a ASRock N3070 Mobo ~ btrfs RAID 10 Install on 4 Disks
Computers Early days:
ZX Spectrum(1982) , HP-150 MS-DOS(1983) , Amstrad CPC464(1984) , BBC Micro B+64(1985) , My First PC HP-Vectra(1987)
Posts: 8,898
Threads: 542
Joined: Feb 2014
Reputation:
5
(02-03-2015, 06:22 PM)Wirezfree link Wrote: Hi Jerry,
I maybe interested, I have a SugarSync Account that I used to use with Windows.
Which was great, just right click any file/folder, add to Sugarsync for it to Synch to the Cloud.
Then Files?Folders auto sync'd as soon as you did a save or change.
I need to see if the Linux OwnCloud app does the same.?
Yup, I can provide a simple to use script, credit - https://github.com/schiesbn/shareLinkCreator
First do: sudo apt-get install xclip
Create a new file, call it litecloudupload, place the following inside:
Code: #!/bin/bash
#
# Public Link Creator Version 1.0
#
# (c) Copyright 2013 Bjoern Schiessle <[email protected]>
# Modified for LiteCloud by Jerry Bezencon
#
# This program is free software released under the MIT License, for more details
# see LICENSE.txt or http://opensource.org/licenses/MIT
#
# Description:
#
# The program was developed for the Thunar file manager but it should also
# works with other file managers which provide similar possibilities to
# integrate shell scripts. For example I got some feedback that it also works
# nicely with Dolphin and Nautilus.
#
# This script can be integrated in the Thunar file manager as a "custom
# action". If you configure the "custom action" in Thunar, make sure to pass
# the paths of all selected files to the program using the "%F" parameter. The
# program expects the absolute path to the files. Once the custom action is
# configured you can execute the program from the right-click context menu. The
# program works for all file types and also for directories. Once the script
# gets executed it will first upload the files/directories to your ownCloud and
# afterwards it will generate a public link to access them. The link will be
# copied directly to your clipboard and a dialog will inform you about the
# URL. If you uploaded a single file or directory than the file/directory will
# be created directly below your "uploadTarget" as defined below. If you
# selected multiple files, than the programm will group them together in a
# directory named with the current timestamp.
#
# Before you can use the program you need to adjust at least the "baseURL",
# "username" and "password" config parameter below. If you keep "username"
# and/or "password" empty a dialog will show up and ask for the credentials.
#
# Requirements:
#
# - curl
# - xclip
# - zenity
# config parameters
baseURL="http://hostsiteaddress/owncloud"
uploadTarget=""
username="bob"
password="bobspassword"
# if you use a self signed ssl cert you can specify here the path to your root
# certificate
cacert=""
# constants
TRUE=0
FALSE=1
webdavURL="$baseURL/remote.php/webdav"
url=$(echo "$webdavURL/$uploadTarget" | sed 's/\ /%20/g')
shareAPI="$baseURL/ocs/v1.php/apps/files_sharing/api/v1/shares"
curlOpts=""
if [ -n "$cacert" ]; then
curlOpts="$curlOpts --cacert $cacert"
fi
# check if base dir for file upload exists
baseDirExists() {
if curl -u "$username":"$password" --output /dev/null $curlOpts --silent --head --fail "$url"; then
return $FALSE
fi
return $TRUE
}
checkCredentials() {
curl -u "$username":"$password" $curlOpts --output /dev/null --silent --fail "$webdavURL"
if [ $? != 0 ]; then
zenity --error --title="LiteCloud Upload" --text="Username or password does not match"
exit 1
fi
}
# upload files, first parameter will be the upload target from the second
# parameter on we have the list of files
uploadFiles() {
for filePath in "${@:2}"
do
basename=$(basename "$filePath")
basename=$(echo "$basename" | sed 's/\ /%20/g')
if [ -f "$filePath" ]; then
curl -u "$username":"$password" $curlOpts -T "$filePath" "$1/$basename"
count=$(($count+1))
echo $(($count*100/$numOfFiles)) >&3;
else
curl -u "$username":"$password" $curlOpts -X MKCOL "$1/$basename"
uploadDirectory "$1/$basename" "$filePath"
fi
done
return $TRUE
}
# upload a directory recursively, first parameter contains the upload target
# and the second parameter contains the path to the local directory
uploadDirectory() {
while read filePath; do
filePath=$(basename "$filePath")
urlencodedFilePath=$(echo "$filePath" | sed 's/\ /%20/g')
if [ -d "$2/$filePath" ]; then
curl -u "$username":"$password" $curlOpts -X MKCOL "$1/$urlencodedFilePath"
uploadDirectory "$1/$urlencodedFilePath" "$2/$filePath"
else
curl -u "$username":"$password" $curlOpts -T "$2/$filePath" "$1/$urlencodedFilePath"
count=$(($count+1))
echo $(($count*100/$numOfFiles)) >&3;
fi
done < <(find "$2" -mindepth 1 -maxdepth 1)
}
# create public link share, first parameter contains the path of the shared file/folder
createShare() {
result=$(curl -u "$username":"$password" $curlOpts --silent "$shareAPI" -d path="$1" -d shareType=3)
shareLink=$(echo $result | sed -e 's/.*<url>\(.*\)<\/url>.*/\1/')
shareLink=$(echo $shareLink | sed 's/\&/\&/')
echo $shareLink | xclip -sel clip
return $TRUE
}
# if no username/password is set in the script we ask the user to enter them
askForPassword() {
ENTRY=`zenity --password --username --title="LiteCloud Upload"`
case $? in
0)
username=`echo $ENTRY | cut -d'|' -f1`
password=`echo $ENTRY | cut -d'|' -f2`
;;
1)
exit 0;;
-1)
exit 1;;
esac
}
if [ -z $password ] || [ -z $username ]; then
askForPassword
fi
checkCredentials
exec 3> >(zenity --progress --title="LiteCloud Upload" --text="Uploading files and generating a public link" --auto-kill --auto-close --percentage=0 --width=400)
numOfFiles=$(find "$@" -type f | wc -l)
count=0
if baseDirExists; then
curl -u "$username":"$password" $curlOpts -X MKCOL "$url"
fi
# if we have more than one file selected we create a folder with
# the current timestamp
if [ $# -gt 1 ]; then
share=$(date +%s)
url="$url/$share"
curl -u "$username":"$password" $curlOpts -X MKCOL "$url"
elif [ $# -eq 1 ]; then
share=$(basename "$1")
else
zenity --error --title="LiteCloud Upload" --text="no file was selected!"
exit 1
fi
if uploadFiles $url "$@"; then
createShare "/$uploadTarget/$share"
fi
output="File uploaded successfully. Following public link was generated and copied to your clipboard: $shareLink"
zenity --info --title="LiteCloud Upload" --text="$output" --no-markup
Explanations of the config parameters:
# config parameters
baseURL=" http://hostsiteaddress/owncloud" // website address
uploadTarget="" // leave as is and all files will go into your main LiteCloud directory, or you can specify a folder like 'photos'
username="bob" // leave the username and password blank to be prompted for it each time
password="bobspassword" // see username description
Right click on it, make it executable.
Then create a custom Thunar action with the following:
Point to your script eg. /home/bob/scripts/litecloudupload %F, choose an icon you like:
(For added Security, I'd recommend you put this script in /root on your pc, and set the Command to: gksudo /root/litecloudupload %F)
Tick all boxes on Appearance conditions:
Bingo
Client in the tray on Linux Lite:
Posts: 1,484
Threads: 96
Joined: Mar 2014
Reputation:
0
Hi Jerry,
Can I clarify a few things.?
Let's assume I do this on the PC I'm on now, my main pc, call it PC-A
I then right click on my "Documents" folder and select "lightcloud upload"
Everything currently in "Documents" get's uploaded.
I now open Libre Office, create a new document, and save it in /Documents/Writer
Will this file now automatically get uploaded to my owncloud.?
Now, I want to do the install on another of my PC's, PC-B
What would I need to do for it to recognise that "Documents" need to be kept in sync.
Do I just repeat what I have done on PC-A on my PC-B..??
With Sugarsync it was very easy, do first install, select some folders/files to sync, then on
subsequent pc's install Sugarsync, and any folder/files already defined would auto-sync.
Then going forward,
Any files added/changed on any PC would replicate up to Sugarsync cloud,
and then out to any PC(s) currently running Sugarsync.
If it works this way, I would sign up now, and start with the 10GB Plan.
Upgrades WIP 2.6 to 2.8 - (6 X 2.6 to 2.8 completed on: 20/02/16 All O.K )
Linux Lite 3.0 Humming on a ASRock N3070 Mobo ~ btrfs RAID 10 Install on 4 Disks
Computers Early days:
ZX Spectrum(1982) , HP-150 MS-DOS(1983) , Amstrad CPC464(1984) , BBC Micro B+64(1985) , My First PC HP-Vectra(1987)
Posts: 8,898
Threads: 542
Joined: Feb 2014
Reputation:
5
(02-03-2015, 11:02 PM)Wirezfree link Wrote: Hi Jerry,
Can I clarify a few things.?
Let's assume I do this on the PC I'm on now, my main pc, call it PC-A
I then right click on my "Documents" folder and select "lightcloud upload"
Everything currently in "Documents" get's uploaded.
Yes, the folder Documents will get uploaded too.
(02-03-2015, 11:02 PM)Wirezfree link Wrote: I now open Libre Office, create a new document, and save it in /Documents/Writer
Will this file now automatically get uploaded to my owncloud.?
It will if you have it selected as a sync folder.
(02-03-2015, 11:02 PM)Wirezfree link Wrote: Now, I want to do the install on another of my PC's, PC-B
What would I need to do for it to recognise that "Documents" need to be kept in sync.
Do I just repeat what I have done on PC-A on my PC-B..??
Yes, repeat what you did on PC-A and it will sync.
(02-03-2015, 11:02 PM)Wirezfree link Wrote: With Sugarsync it was very easy, do first install, select some folders/files to sync, then on
subsequent pc's install Sugarsync, and any folder/files already defined would auto-sync.
Then going forward,
Any files added/changed on any PC would replicate up to Sugarsync cloud,
and then out to any PC(s) currently running Sugarsync.
If it works this way, I would sign up now, and start with the 10GB Plan.
Nice to hear, if we can get enough to cover at least the costs, I'll launch LiteCloud
Posts: 1,484
Threads: 96
Joined: Mar 2014
Reputation:
0
Great, keep us posted...
Upgrades WIP 2.6 to 2.8 - (6 X 2.6 to 2.8 completed on: 20/02/16 All O.K )
Linux Lite 3.0 Humming on a ASRock N3070 Mobo ~ btrfs RAID 10 Install on 4 Disks
Computers Early days:
ZX Spectrum(1982) , HP-150 MS-DOS(1983) , Amstrad CPC464(1984) , BBC Micro B+64(1985) , My First PC HP-Vectra(1987)
Posts: 1,149
Threads: 22
Joined: Feb 2014
Reputation:
0
02-05-2015, 01:19 PM
(This post was last modified: 02-05-2015, 01:25 PM by N4RPS.)
Hello!
Jerry, I wish you every success in this endeavour.
I have little to no use for cloud storage myself, but if I ever did, I'd feel more comfortable about using a cloud that helped to fund this OS - FWTW.
With tax refund season upon us once again, perhaps folks might consider supporting LL with some of the proceeds? I'm not getting one this year, but I think I can hit Paypal nonetheless...
73 DE N4RPS
Rob
A gun in your hand is worth more than a whole police force on the phone.
Posts: 1
Threads: 0
Joined: Feb 2014
Reputation:
0
Nice idea Val, I would be more than happy to put support into anything that will support the LinuxLite project.
preecher
I will not be commanded, I will not be controlled
Posts: 8,898
Threads: 542
Joined: Feb 2014
Reputation:
5
I appreciate your support, thank you preecher.
|