photobackup / client-android Goto Github PK
View Code? Open in Web Editor NEWThe Android PhotoBackup client, made to free your pictures from your device
Home Page: https://photobackup.github.io/
License: GNU General Public License v2.0
The Android PhotoBackup client, made to free your pictures from your device
Home Page: https://photobackup.github.io/
License: GNU General Public License v2.0
You are using the default tcp port 8080 on the photobackup server instance.
Although the use must have the ability to change it to something else through the settings menu.
8080 is the default tcp port for a lot of projects as it is the HTTP Alternate by IANA
Thanks in advance
Hi,
I was wondering if there a way for the app to only try backing up when it's connected to a specific SSID.
My usage scenario is "only backup when at home". Since I connect to other Wifi networks during the day It keeps generating "failed" notifications on the phone.
Thank you for this app (and server)
An option that would delete image after it's been backed up. Otherwise great product, thank you.
I have few web pages and an icon set with few hundred small icons stored on my SD card. I guess you have a good idea what happend during initial backup. Yes, all these irrelevant pictures got copied along with my photos...
The client should backup only selected folders. There is no need to backup everything else. There should be list of the folders in the settings, however, defaults should be easy to detect (the DCIM folders). Also USB-OTG storages should be ignored.
It could be nice if there was an option to specify in which folder should picture files be looked for upload
The app is quite old and was created with Eclipse.
It is not structured as a modern one created through Android Studio and does not contain tests.
Add this would ease adoption of new developers and help us be confident in our code.
Version: 0.11.0 (33)
Server: PhotoBackup/server-go
App settings: Background data enabled; battery use is "unoptimized"
Android: Samsung One UI 4.1 (Android 12)
Selecting an individual image from the journal and doing a "Manual backup" works -- the file is received by the server. However, the "Upload All" function from the hamburger menu does nothing beyond showing the "Started to upload all pictures" message; there's no indication from the server reverse proxy that any request is sent to the server from the client.
Similarly, the app apparently never auto-uploads files, either with "Over Wi-Fi only" or "... or mobile network". Does the app start a service? Android shows an icon for every persistent (service) app, and I don't see one in my bar for PhotoBackup.
When selecting directories to upload the list is not very practical, because there is a lot of stuff on the list and it is hard to find what should be synced. The selection works fine, but the list should preserve directory hierarchy and allow to collapse the subtrees.
When a press on the notification about the uploads I just get empty PhotoBackup app.
When I stopped the service, and the re-enabled it, it start to repush all pictures.... BUt the auditlogs are correct. Would it be possible to skip this re-upload, as sometimes I am on really slow and limited wifi.
let's imagine a "force/check" box, which when enable, act as now. If not enabled, just retry what is not success in the audit-log.
Might also want a full re-checked button.
does that make sense?
Thanks for the Android client, by the way.
From gitter:
@zealot128
I have another question/propasal: From the notification one can stop the service. Is this useful? Maybe then I will forget to renenable the upload later on.
@stephanepechard
I don't know if it's useful, it's true I don't use it, but some people may forget they have the service running in background so I thought they could easily stop it from here
it's just an option, you can open the activity without stopping the service
but I agree it may be misunderstood
@zealot128
the notification is ok - If the user wants to stop, he can click the service and stop then. Stopping is not a very often used action, in my opinion, and only bloats the notification. I think, I even stopped the service accidently
maybe it is misunderstood in the way "Stop the current upload (Because I am not in a good wifi...)"
@stephanepechard
yeah you're right
@zealot128
because the user does not know what a "Service" means in this context
@stephanepechard
true
I open an issue for it
The 0.7 version crashes at start up since the update.
PhotoBackup version 0.11.0 (33)
When I try to activate the service, I receive:
Server test failed, please verify your configuration - Expected ':status' header not present
This issue seems relevant:
https://stackoverflow.com/questions/46807237/protocolexception-expected-status-header-not-present
I am using HTTP/2 on my nginx server. When I disable HTTP/2 (not possible in production), everything works fine.
When configured with a path not ending with a slash , eg: example.com/photobackup , my server response is a redirection to example.com/photobackup/
The expected response from the client should be to resend the request to the redirected url, but it does not.
When everything works there is no need to bother a user with notifications. Show notifications only when something is really wrong.
Examples:
There are two reasons for uploading a file in chunks:
Idea is to send file in chunks of some reasonable size, one chunk per http request. Once all chunks are transfered, the completed file is renamed to original name.
Basically the one thing to add is offset and length of the chunk and seek before writing. A hash of the whole file would be nice to check to be sure no chunk is missing.
According to the API spec, the server should respond with a 409 conflict status code, if an image is already uploaded.
Unfortunately, there is no handling code for that case at the moment, so that images will always stay as "error"
Maybe it is possible to change in https://github.com/PhotoBackup/client-android/blob/master/src/fr/s13d/photobackup/PBMediaSender.java#L168 and check for that error code? In that case, maybe handling the upload as "success" would be a good option.
What do you think?
This is a feature request.
It would be cool, if its possible to use the legend"(green) Backed up (orange) Waiting (rad) Error" to filter the list by pressing those categories. This way it would be easier to inspect, which uploads failed and similarly.
On Android 6 (Marshmallow), the service starts and the test to the server is ok, but the upload journal is not accessible after launch and taking a picture does not trigger the service.
The "newly taken" option only sends pictures that have been taken in the last 60 seconds.
This is nice but clumsy, as it does not retry a bit later, as it was before. In case of poor connectivity or any condition that limit pictures sending, this is probably not what the user wants.
The proposal would be to introduce a new state, say "Archived", which would be set on all pictures when "newly taken" option is selected, but newly taken pictures would get the classical "Waiting" state, hence they would be sent again at retry.
The "Pictures to upload" option would toggle pictures between "Archived" and "Waiting" states.
Checking out the project and looking for something to upload videos and pictures as I take them. Any reason video backup isn't supported? I consider my videos as important as my photos :)
When I do a manual backup of a picture in the upload journal, the sent picture seems to be another than the selected one. At least, the thumbnail in the notification area is not the right one and the log indicates the wrong image path.
It seems that the index of the picture taken is not refreshed after a state selection...
I put an nginx in front of the server with a self signed certificate. I'm getting the following message in the android client:
Server test failed, please verify your configuration. - (java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.)
I'm running a local server on an internal IP, not exposed to the internet, so can't get a LetsEncrypt cert.
ping @svetlemodry
There is only one missing string at the moment, probably more in the future...
Thanks!
Strangely, when the screen of my phone fade to black, the current upload fails.
It just requires to manually force the upload of the failed attempt to resume the upload queue, until the next fade to black.
The server does not spit any specific insult, just the usual 200
I just pulled the changes, and now the AsyncTask for the uploadJournal doesn not seem to run.
After git bisecting the error, I've found that f0f8508 introduced the bug.
As of version 0.8, PB shows an error for any 409 status received. This status code indicates that the picture has already been uploaded on the server, and therefore the server will not save it again.
It should then not be considered as an error in the client, but as a retry of picture successfully uploaded already.
First, thanks for the (OpenSource) work so far on that app!
I tried using the https version of my server (I times of Letsencrypt also a common thing, IMO), but that fails. Seems to be a issue of android-async-http.
android-async-http/android-async-http#224
For what it's worth, some people in the issue recommend another library, okhttp.
Finally got time to give this a go. I have setup both the go and python version of the sever and having issues communicating with the client.
I have a setup like so:
Client -> LAN -> Nginx -> Python or Go Server
Since I have a background in python I decided to starting debugging it. I decided to use Werkzeug debugging middleware and start following the different calls to the server. So far the only calls that the Android client is sending is just the POST to /test. Which the app says "Server configuration is valid, great!".
From there I can confirm the client attempts to upload an image but fails giving no error. I do not see any traffic on the server. I can manually post to the server with success
$ http -f post http://starbuck/ password='REDACTED' filesize=18709 upfile@/tmp/blah.png
This results in a 200 and image being written to disk. When I try again with the client I get this this
127.0.0.1 - - [31/Dec/2015 00:32:25] "POST / HTTP/1.0" 200 0 <--- My manual post via httpie
127.0.0.1 - - [31/Dec/2015 00:38:23] "POST /test HTTP/1.0" 200 0 <--- Turning on the client service
And no more requests when I take another image via the client.
I have also tried the python-client and it works great:
$ ./photobackup.py upload http://starbuck/ /tmp/blah.png
The server password:
Request was successful!
On the Android client I have the server set to http://starbuck/
, entered my server password and do not have HTTP Auth enabled. Is there something I am missing?
Right now, the http request does not use a UserAgent.
Maybe we can add a UserAgent header like "PhotoBackup Android VERSION" to the HTTP request? That would make it easier to distinguish the requests from stuff like bots/crawler or (in my case) manual uploads with the browser.
Async-http seems to have a Method on AsyncHttpClient:
So somewhere in the PBMediaSender constructor a client.setUserAgent()
.
Maybe photos (and videos in the future?) could be uploaded to an owncloud host or an sftp server?
While it was fixed in 0.8, http auth fails again since 0.9 as reported in #15
Without http auth, everything runs fine.
Maybe unrelated, but I noticed in the logcat that a method can not be found:
I/ActivityManager( 1783): Start proc fr.s13d.photobackup.debug for activity fr.s13d.photobackup.debug/fr.s13d.photobackup.PBActivity: pid=25942 uid=10073 gids={50073, 3003, 1028}
W/XPrivacy(25942): Hooking package=fr.s13d.photobackup.debug
D/PBApplication(25942): PREF_SERVER_URL<String> = https://example.com/photobackup/index.php
I/dalvikvm(25942): Could not find method android.app.Activity.onRequestPermissionsResult, referenced from method fr.s13d.photobackup.PBActivity.onRequestPermissionsResult
I/dalvikvm(25942): Could not find method fr.s13d.photobackup.preferences.PBPreferenceFragment.getContext, referenced from method fr.s13d.photobackup.preferences.PBPreferenceFragment.checkPermissions
W/dalvikvm(25942): VFY: unable to resolve virtual method 18070: Lfr/s13d/photobackup/preferences/PBPreferenceFragment;.getContext ()Landroid/content/Context;
I/ActivityManager( 1783): Displayed fr.s13d.photobackup.debug/fr.s13d.photobackup.PBActivity: +1s886ms
I/PBMediaSender(25942): Initiating test call to https://example.com/photobackup/index.php/test
Thanks for looking into this issue
“Used network” doesn’t make sense as a checkbox label, I feel. I had to toggle it a view times to actually understand what it was meant to do. Maybe calling it “Back-up on Wi-Fi only” would make more sense and instantly describes what the checkbox does?
I took a look at some other apps on my phone and saw that most of them handle this is different ways. But never with a checkbox, as a checkbox represents an on/off state and not a choice. WhatsApp lets me configure what it downloads per connection (separate settings for mobile, Wi-Fi, and roaming), Flickr’s Auto-Uploadr (not a typo) displays radio buttons to make it clear my choice is between “Wi-Fi only” and “Mobile/Wi-Fi”.
Would love to see this part of the interface become more self explanatory!
If I enable the service before limiting the folders to sync, all images get enqueued and uploaded anyway. The list must be accessible before enabling the sync and once the list is changed, the queue should be repopulated and filtered using the new rules.
I have to select/unselect one of the Saved/Waiting/Error buttons in order to refresh the journal. Is that OK?
I always protect my self hosted services behind an HTTP auth.
While the server does not support HTTP authentication for now, that would be nice if the android client could add support for HTTP auth.
thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.