Closed obnys closed 4 years ago
Try removing imagepath
Thanks you for the suggestion. I commented the line but unfortunately the error remains. :-(
/cc @blacksenator
@obnys try enable the stuff - fritzbox should have internal memory, as well.
It looks like, that the FTP is required for a Attributes.csv
Well f*ck. I talked to AVM support. There's no FTP at all on the 7412. Maybe I have to talk with the other guys here to get another FB like 7530. I'd reallyreally love to have that feature. ;-)
Anyways, thank you so much for the fast responses. Keep up the good work! =)
We will check what can be done without ftp.
@obnys I understand correctly, it's not about uploading an image without FTP, but about skipping all FTP functions - right?
Yes, we use FTP for two function blocks: backup of special attributes in attributes.csv
and contact pictures upload. Of course we can code some "FTP-Skip" switch via config.php.
The only disadvantage would then be - if you do not use caller pictures anyway - that internal numbers, quickdial and vanity numbers are written back to the upload before uploading the phone book - but are not saved separately.
@andig If agree we shall implement such switch I will code a PR at the weekend.
@blacksenator I'm sorry, I don't get this "internal numbers, quickdial and vanity numbers are written back to the upload" Would that mean, the current FB phonebook would be downloaded, numbers extracted and added to the new upload-file(s)?
If so, I personally wouldn't mind. But tbh I'd feel a little bit remorse, since that sounds like lots of work and I seem to be the only guy with such a request.
@obnys I tried to research. Apparently there is hardly any FRITZ!Box models that do not support FTP. In this respect, it may be more appropriate if you create your own fork and adjust it accordingly (it is not much). This way you could benefit from changes/extensions in the future and still keep your customized solution. If you need support to deal with Git and andig´s master, I will be happy to help you (I also learned it!)
As a quick workaround try this: in functions.php comment the following lines:
function uploadAttributes($phonebook, $config)
{
$restore = new Restorer;
if (!count($specialAttributes = $restore->getPhonebookData($phonebook, $config))) {
return [];
}
/*
$fritzbox= $config['fritzbox'];
error_log('Save internal data from recent FRITZ!Box phonebook!');
// Prepare FTP connection
$secure = @$fritzbox['plainFTP'] ? $fritzbox['plainFTP'] : false;
...
fclose($memstream);
@ftp_close($ftp_conn);
*/
return $specialAttributes;
}
...
function downloadAttributes($config)
{
/*
// Prepare FTP connection
$secure = @$config['plainFTP'] ? $config['plainFTP'] : false;
...
@ftp_close($ftp_conn);
return $specialAttributes;
*/
return [];
}
root@xu3:/opt/scripts/carddav2fb# ./carddav2fb run
Downloading recent FRITZ!Box phonebook
Downloading vCard(s) from account DeiMudda
54 [============================]
Downloaded 54 vCard(s)
Downloading vCard(s) from account DeiMudda
23 [============================]
Downloaded 23 vCard(s)
Downloaded 77 vCard(s) in total
Dissolving groups (e.g. iCloud)
Dissolved 0 group(s)
Filtering 77 vCard(s)
Filtered 0 vCard(s)
Contact without phone numbers will be skipped
Contact without phone numbers will be skipped
Contact without phone numbers will be skipped
Contact without phone numbers will be skipped
Contact without phone numbers will be skipped
Contact without phone numbers will be skipped
Contact without phone numbers will be skipped
Contact without phone numbers will be skipped
Contact without phone numbers will be skipped
Contact without phone numbers will be skipped
Converted 77 vCard(s)
Uploading new phonebook to FRITZ!Box
Successful uploaded new FRITZ!Box phonebook
Awesome!! Thank you so much. Had to install my CA, but after that it worked like a charm. Even several numbers per entry have been added. Also I had to manually add the last return [];
. I'm not sure, wether you added it manually or if that was missing in my downloaded files for some reason.
As for the fork, that would be really cool. An option in the config.php would be even more cool but on the other hand most ppl using an owncloud are experienced and might rarely have the default FTP-less 1&1 FritzBox. ;-)
Cool,
I added the return [];
manually. Sorry, I hadn't made that clear.
Don´t have too much fun! ;)
Apparently there is hardly any FRITZ!Box models that do not support FTP. In this respect, it may be more appropriate if you create your own fork and adjust it accordingly (it is not much).
I don't really like this. We should make the FTP dependency and configuration optional. Even if my FB supports FTP there shouldn't be a need to be forced to allow FTP if I don't want to use phone pix or attributes.
Would be great to make FTP optional!
@obnys In order to fulfill andig's request ("...make FTP optional!"), I ask you the following favor: Could you please install my sandbox program "boxer"? I use it to test various accesses and queries to the FRITZ!Box. It is currently programmed to make a GetInfo query for the x_storage service using a SOAP request.
Since we have no SOAP queries or corresponding classes in carddav2fb yet, I would like to test in advance whether we can use it to install a suitable ftp switch.
With my box, the following result appears in the console:
php boxer run
Starting FRITZ!Box access...
Array
(
[NewFTPEnable] => 1
[NewFTPStatus] => Enabled
[NewSMBEnable] => 1
[NewFTPWANEnable] => 0
[NewFTPWANSSLOnly] => 0
[NewFTPWANPort] => 48556
)
My expectation is that your FRITZ! Box will provide the following information:
Array
(
[NewFTPEnable] => 0
[NewFTPStatus] => Error
...
It would be great if you could support my research!
yeah please make FTP optional, I have the same problem and I want to use the docker variant, so its not easy possible to do this coding-workaround fin my case :(
@andig - The question is whether we set ftp access via a flag in the config or determined dynamically using the SOAP query suggested above. But I am missing a test with a box that definitely does not support ftp. @nicx - which FRITZ!Box model do you use? Furthermore: can you please run my suggested testing programm boxer - I just uploaded a fixed version. Fresh test on my RasbPi:
Keep it simple- add —ftp-disable flag and/or option?
Am 06.03.2020 um 16:17 schrieb Black Senator notifications@github.com:
@andig - The question is whether we set ftp access via a flag in the config or determined dynamically using the SOAP query suggested above
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
Greetings,
maybe I'm wrong but as far as I understood, the FTP is only necessary for uploading phonebook images, right? If not, I might be screwed. ;-)
I've got a simple 1&1 FB 7412, which has no USB- and thus no FTP-functionality. Of course, launching the tool brings me the error
[Exception] Could not connect to ftp server 192.168.178.1 for upload
At the config.php I modified the sections:
Is there any way to get around this? I'd really hate to get a new FritzBox.
Oh, and btw: If I would really need this, would it be possible to make a volume on my Synology NAS and somehow mount that to the FritzBox in order to avoid attaching a USB-Stick? I've seen too many USB-Sticks breaking when writing frequently for trusting flash storage. ;-)