Announcement: .NET API for automated creation of Users

Need help with FileZilla Server? Something does not work as expected? In this forum you may find an answer.

Moderator: Project members

Post Reply
Message
Author
User avatar
PolarbearDK
500 Syntax error
Posts: 12
Joined: 2014-09-16 13:30
First name: Philip
Last name: Hoppe
Location: Copenhagen, Denmark
Contact:

Announcement: .NET API for automated creation of Users

#1 Post by PolarbearDK » 2014-09-16 13:45

We needed to automate the creation of FileZilla users/groups.
We looked at modifying FileZilla Server.xml directly, but rejected the idea because /reload-config kicks all active connections.

What we really needed was an API to FileZilla, but we could'nt find one.
So I wrote an API that mimics the FileZilla Server Interface using .NET.

It is available as a nuget package for Visual Studio https://www.nuget.org/packages/Miracle.FileZilla.Api/
Source/documentation is available on: https://github.com/PolarbearDK/Miracle.FileZilla.Api

User avatar
botg
Site Admin
Posts: 31605
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: Announcement: .NET API for automated creation of Users

#2 Post by botg » 2014-09-16 14:28

We looked at modifying FileZilla Server.xml directly, but rejected the idea because /reload-config kicks all active connections.
It's not supposed to do that and I cannot reproduce it either. Do you have more information on this?
It is available as a nuget package for Visual Studio https://www.nuget.org/packages/Miracle.FileZilla.Api/
Source/documentation is available on: https://github.com/PolarbearDK/Miracle.FileZilla.Api
Cool. Would it be possible to rename it to make it more clear that it's for FileZilla Server instead of FileZilla? E.g. Miracle.FileZillaServer.Api

I'm surprised you managed to figure out the overly arcane protocol.

User avatar
PolarbearDK
500 Syntax error
Posts: 12
Joined: 2014-09-16 13:30
First name: Philip
Last name: Hoppe
Location: Copenhagen, Denmark
Contact:

Re: Announcement: .NET API for automated creation of Users

#3 Post by PolarbearDK » 2014-09-16 17:40

botg wrote:
We looked at modifying FileZilla Server.xml directly, but rejected the idea because /reload-config kicks all active connections.
It's not supposed to do that and I cannot reproduce it either. Do you have more information on this?
Sorry, that was a bit vague.

On my develop machine (Windows 7) with FileZilla Server 0.9.46 installed on port 14242 as a service:
When my college copied a large file to my machine using FTP, and I did a /reload-config, the FTP transfer was aborted. I have heard that we have seen that in production too, but I don't have the version details
Would it be possible to rename it to make it more clear that it's for FileZilla Server instead of FileZilla?
It is not possible to rename a NuGet package. Besides that, I think it is 100% clear what the package does from the name and description.
I'm surprised you managed to figure out the overly arcane protocol.
I've done a lot of similar implementations like Z-modem protocol, and obscure protocols to various devices. I guess I'm as arcane as the protocol...

User avatar
PolarbearDK
500 Syntax error
Posts: 12
Joined: 2014-09-16 13:30
First name: Philip
Last name: Hoppe
Location: Copenhagen, Denmark
Contact:

Re: Announcement: .NET API for automated creation of Users

#4 Post by PolarbearDK » 2014-09-17 12:31

Question: Is there a limit to how many users FileZilla can handle?

During load test of my API I noticed that when creating 10.000 groups and 100.000 users (excessive I know) only ~35.000 users were created.

User avatar
botg
Site Admin
Posts: 31605
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: Announcement: .NET API for automated creation of Users

#5 Post by botg » 2014-09-17 19:46

Only two bytes available for number of users (or groups) via the protocol. Once it's bigger than 65535, it starts over from zero.

100000-65536=34464

I'm not happy with that protocol at all.

User avatar
PolarbearDK
500 Syntax error
Posts: 12
Joined: 2014-09-16 13:30
First name: Philip
Last name: Hoppe
Location: Copenhagen, Denmark
Contact:

Re: Announcement: .NET API for automated creation of Users

#6 Post by PolarbearDK » 2014-09-18 06:58

botg wrote:100000-65536=34464
Right! I'll better throw an exception in that case :P

User avatar
botg
Site Admin
Posts: 31605
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: Announcement: .NET API for automated creation of Users

#7 Post by botg » 2014-09-18 08:56

Next version will allow up to 16M users/groups in the protocol.

I'm sure it'll blow up elsewhere though :)

User avatar
PolarbearDK
500 Syntax error
Posts: 12
Joined: 2014-09-16 13:30
First name: Philip
Last name: Hoppe
Location: Copenhagen, Denmark
Contact:

Re: Announcement: .NET API for automated creation of Users

#8 Post by PolarbearDK » 2014-09-18 09:20

botg wrote:Next version will allow up to 16M users/groups in the protocol.
Keep me in the loop. I will update the API when this happens.
I guess I need to check for ProtocolVersion here and there...
botg wrote:I'm sure it'll blow up elsewhere though :)
:D

User avatar
boco
Contributor
Posts: 24156
Joined: 2006-05-01 03:28
Location: Germany

Re: Announcement: .NET API for automated creation of Users

#9 Post by boco » 2014-09-18 19:58

I just called my friend Murphy and he told me it will blow up somewhere. 8)
### BEGIN SIGNATURE BLOCK ###
No support requests per PM! You will NOT get any reply!!!
FTP connection problems? Do yourself a favor and read Network Configuration.
All FileZilla products fully support IPv6. http://worldipv6launch.org
### END SIGNATURE BLOCK ###

User avatar
PolarbearDK
500 Syntax error
Posts: 12
Joined: 2014-09-16 13:30
First name: Philip
Last name: Hoppe
Location: Copenhagen, Denmark
Contact:

Re: Announcement: .NET API for automated creation of Users

#10 Post by PolarbearDK » 2014-09-22 12:43

FYI: I have updated nuget package and source code.
The managed API now supports all operations supported by the FileZilla Server interface.

User avatar
PolarbearDK
500 Syntax error
Posts: 12
Joined: 2014-09-16 13:30
First name: Philip
Last name: Hoppe
Location: Copenhagen, Denmark
Contact:

Re: Announcement: .NET API for automated creation of Users

#11 Post by PolarbearDK » 2015-02-14 20:40

API has now been verified to work with FileZilla server versions: 0.9.46-0.9.49

gregnk

Re: Announcement: .NET API for automated creation of Users

#12 Post by gregnk » 2015-02-27 22:06

Very interesting, this post should be made sticky.

vrm42
500 Command not understood
Posts: 1
Joined: 2015-06-03 10:32
First name: Vr
Last name: M42

Re: Announcement: .NET API for automated creation of Users

#13 Post by vrm42 » 2015-06-03 10:40

Hi PolarbearDK!

I read through your description on github and I think I can use your program. I only want to get the content of the active transfers window.
Output line by line to a text file would be great. Can you explain to me how can I achieve that?

Thanks,
vrm

User avatar
PolarbearDK
500 Syntax error
Posts: 12
Joined: 2014-09-16 13:30
First name: Philip
Last name: Hoppe
Location: Copenhagen, Denmark
Contact:

Re: Announcement: .NET API for automated creation of Users

#14 Post by PolarbearDK » 2015-06-04 06:41

vrm42 wrote:Hi PolarbearDK!

I read through your description on github and I think I can use your program. I only want to get the content of the active transfers window.
Output line by line to a text file would be great. Can you explain to me how can I achieve that?

Thanks,
vrm
The GetMessagesLoop() sample in https://github.com/PolarbearDK/Miracle. ... Program.cs should suit your needs.

Use

Code: Select all

var messages = serverProtocol.ReceiveMessages(MessageType.Transfer);
to only get messages about transfers.

Post Reply