swiftp
swiftp copied to clipboard
Added an automatic ftp starting switch after the device boots
- The english to other translations are pending
did you see this @ppareit ?
@kaweesi Yes, and your implementation looks good. I can't see a problem with it.
I think this is the most requested feature. Multiple forks have added something likewise. But I always wonder, why add this, as the ftp server can monitor wifi networks and automatic start on certain networks. Is this not doing the same thing? Is opening the device on bootup a smart idea, what is we are on a different network?
Maybe I'm seeing this wrong, but the functionality is already there (using automatic connect to wifi network) and just automatic starting a ftp server seems less secure.
@ppareit, thanks for your response.
I rather use this feature to start the ftp server once android starts, i run this on a box/hardware for tv programs scheduling & switching. I am not sure if listening for a certain network connectivity is enough! i don't want worry which network it is and thus don't want to specify a network since we use ethernet or wifi and the network sometimes is switched to another. So the only way i can be assured to remotely starting the ftp server to allow me remote access the box/device to keep updating programs alternative to folder synchronisation is running ftp service after booting.
In my case, I need it added (though I don't care if you do or not as I can change it myself) to start on boot for using with automatic backups. The current way is definitely not the same as I have to manually start the app after boot and my device does automatic reboots so that's a major issue to not start the app on boot. Backups not running is not good.
The app can also be set to whitelist wifi ssid or whatever and just block anything but the original or a list of acceptable networks for better security. Etc.
Yes, but even after a reboot, when the device connects to the wifi, swiftp should start the ftp connection.
Oh! I thought it didn't as I tested the connection to a failed state but I discounted it too fast lol.
Sweet. Just seeing a bug then. Will debug that and let you know soon in an issue report.
Thanks :)
Yes, but even after a reboot, when the device connects to the wifi, swiftp should start the ftp connection.
I need to confirm (so just adding to here) you're starting only via use of Tasker's "com.twofortyfouram.locale.intent.action.FIRE_SETTING" ?
That's the only place I see FsService.start() being called from automatically. I don't use or own Tasker and the receiver doesn't start any other way on 3 devices with different Android versions.
I made a quick little hack as a test and can start on reboot by adding it to updateTileState()'s else block.
This is all I get otherwise: BroadcastReceiverUtils BroadcastReceiver... FsTileService onStartListening... FsTileService updateTileState... Server is not running (null serverThread)
And its not started. From what I can see, you have nothing else to start it.
Edit: Or maybe its locale. I don't want these apps so no idea lol.
Never mind. I see on Android store you have " Can be started/stopped by Tasker or Locale, is thus also a Tasker/Locale plug-in".
And you removed the wifi auto connect code sometime back which looks like it may have had an in app ability.
This is also different as you really don't need for users to install another app to do this. That's also a security thing as the other app will have its own security flaws that can reach the app, privacy terms, etc.
Indeed. The other .start() was removed.
- Cat.d("We are connected to " + wifiInfo.getSSID());
- if (newList.contains(wifiInfo.getSSID())) {
- FsService.start();
- }
:)
This should have the same issue I've seen on my repo with start on boot. Where if wifi is toggled off (or away from wifi when) and phone is shutdown/rebooted... the app would manually have to be started since it would exit during start on boot due to wifi being off.
Start on boot imo should start the app in this situation and automatically try to start the server eg hourly for x amount of time like 24 hours and then quit to avoid wasting battery. I coded a test for this that testing shows as working fine https://github.com/Xavron/swiftp/tree/forBackups_noWifi_bootOnStartFail_fix where I use a handler as a timer. Should work in all cases where the app isn't killed by the OS which would be an issue anyway if the OS is doing that as it interrupts use during connections.
Just a FYI. I feel like some people will feel its fine to manually start in that situation. That isn't something I want in my situation however.
If security is a concern then start on boot can be further enhanced by asking to remember wifi ssids where connection is wanted and then only starting the server when wifi is connected to those ssids.