seafadm - Seafile command line admin tool

1,273 views
Skip to first unread message

henri...@googlemail.com

unread,
Sep 25, 2013, 3:01:10 AM9/25/13
to sea...@googlegroups.com
For easier management I wrote a little admin tool for Seafile. Using BeautifulSoup it allows to access the webinterface via the command line. If anyone is interested look at https://github.com/HenriWahl/seafadm.

Regards

Rafa Pardiñas

unread,
Sep 25, 2013, 6:37:53 AM9/25/13
to sea...@googlegroups.com
wow! pretty cool! Thank you. I am giving it a try right now.

Netflix Boundaries

unread,
Oct 22, 2013, 1:56:35 AM10/22/13
to sea...@googlegroups.com

Henry, very nice work and tool.

Wondering if a copy (cp) or move (mv , as for renaming) could be added in order to work with libraries.

For example:

Lib-A

Would like to copy it's content to a new library called Lib-B.

create Lib-B
cp Lib-A Lib-B
ls Lib-B (lists Lib-B content to verify copy was successful)
du (may be used to verify sizes too)
rm Lib-A/* (remove its content first)
del Lib-A (delete tbe library)
mv Lib-A Lib-B (rename B to A)

Hope I explained myself. Let me know your thoughts.

On Sep 25, 2013 2:01 AM, <henri...@googlemail.com> wrote:
For easier management I wrote a little admin tool for Seafile. Using BeautifulSoup it allows to access the webinterface via the command line. If anyone is interested look at https://github.com/HenriWahl/seafadm.

Regards

--
You received this message because you are subscribed to the Google Groups "seafile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seafile+u...@googlegroups.com.
To post to this group, send email to sea...@googlegroups.com.
Visit this group at http://groups.google.com/group/seafile.
For more options, visit https://groups.google.com/groups/opt_out.

Henri Wahl

unread,
Oct 22, 2013, 5:18:52 AM10/22/13
to sea...@googlegroups.com
Hi Netflix Boundaries:
>
> Henry, very nice work and tool.
>
> Wondering if a copy (cp) or move (mv , as for renaming) could be added
> in order to work with libraries.
>
> For example:
>
> Lib-A
>
> Would like to copy it's content to a new library called Lib-B.
>
> create Lib-B
> cp Lib-A Lib-B
> ls Lib-B (lists Lib-B content to verify copy was successful)
> du (may be used to verify sizes too)
> rm Lib-A/* (remove its content first)
> del Lib-A (delete tbe library)
> mv Lib-A Lib-B (rename B to A)
>
> Hope I explained myself. Let me know your thoughts.
>
>
As seafadm only uses the webinterface of seahub it allows only to do
stuff that is possible there. So if there is no way to copy this will
not be available in seafadm :-(

Regards


Netflix Boundaries

unread,
Oct 22, 2013, 12:13:06 PM10/22/13
to sea...@googlegroups.com

Well, seahub allows moving files between non-encrypted libraries.

It should work after creating a new one.

The stressed part here could be moving all files one by one or by doing a bulk job.

--
You received this message because you are subscribed to the Google Groups "seafile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seafile+unsubscribe@googlegroups.com.

henri...@googlemail.com

unread,
Oct 24, 2013, 6:01:35 PM10/24/13
to sea...@googlegroups.com

Well, seahub allows moving files between non-encrypted libraries.

OK, this is correct.
 

It should work after creating a new one.


Yes.
 

The stressed part here could be moving all files one by one or by doing a bulk job.


Yes. If there are only some files and folders in the root of the library this might be OK, but with many of them there it will be somehow messy.

Worse is that one could only copy libraries one has access to - I guess this will not be the case for any admin which does not share libraries with the users of its Seafile server. Anybody else will have it more easy copying files and directories directly locally on a synced library as canges wil be synced into server.

Regards

Netflix Boundaries

unread,
Oct 24, 2013, 10:28:58 PM10/24/13
to sea...@googlegroups.com

The general idea is to make a user totally unavailable from his/her data.

The way to accomplish that is by:

1. Denying accessibility
2. Command execution

1. Accessibility can be granted to the admin by the admin. As this partly defeats the purpose of the software of giving own private privacy if the libraries aren't encrypted,  mostly,  admins are considered 'trusted persons'. But this is another issue needed to be cleared by internal policies.

The implications are totally different if you are offering cloud service as seacloud.cc does. But can we really make sure admins doesn't have access to the data in any cloud services?  That's another issue.

2. The command execution I exposed initially,  if its well structured,   could drive to the deletion of users files content where the seafile client is installed. In other words: remote wiping. Confirmation of this could be found on the logs.

Afterwards,  would be no need of unsyncing the client as the library name would have changed, even though it will keep trying to connect.

Anyway, I hope you get my point to start with this.

Im open to any other suggestions.

--
You received this message because you are subscribed to the Google Groups "seafile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seafile+u...@googlegroups.com.

Henri Wahl

unread,
Oct 22, 2013, 3:06:37 PM10/22/13
to sea...@googlegroups.com
Hi,
>
> Well, seahub allows moving files between non-encrypted libraries.
>
Ah, OK, you are right.
>
> It should work after creating a new one.
>
Yes.
>
> The stressed part here could be moving all files one by one or by
> doing a bulk job.
>
>
At least all files and folders in the root of the library have to be
done one by one. This is only possible with libraries where the admin
user used by seafadm has at least read rights for so I doubt this would
be of much use for admin jobs.

Regards

henri...@googlemail.com

unread,
Oct 25, 2013, 6:28:09 PM10/25/13
to sea...@googlegroups.com
Sorry, my last post was is doubled because the first one did not seem to get here... well.


The general idea is to make a user totally unavailable from his/her data.

Why?
 

The way to accomplish that is by:

1. Denying accessibility
2. Command execution

1. Accessibility can be granted to the admin by the admin. As this partly defeats the purpose of the software of giving own private privacy if the libraries aren't encrypted,  mostly,  admins are considered 'trusted persons'. But this is another issue needed to be cleared by internal policies.

Changing ownership seems to be a new feature in server 2.0 - would make this easy.
 

The implications are totally different if you are offering cloud service as seacloud.cc does. But can we really make sure admins doesn't have access to the data in any cloud services?  That's another issue.

2. The command execution I exposed initially,  if its well structured,   could drive to the deletion of users files content where the seafile client is installed. In other words: remote wiping. Confirmation of this could be found on the logs.

Why? What usecase?
 

Afterwards,  would be no need of unsyncing the client as the library name would have changed, even though it will keep trying to connect.

Anyway, I hope you get my point to start with this.

To be honest - not really. This tools' intend is just simplification of some admin tasks using CLI instead of Web GUI (or temporarily solution for https://github.com/haiwen/seafile/issues/342).

Im open to any other suggestions.

Looks like you need something more powerful. Maybe just check the source of the certain portions of the Seahub GUI and add something fitting to your needs to seafadm? Could be easier with server 2.0 which I did not have a look at.

Regards
 

toor

unread,
Sep 10, 2014, 3:19:28 AM9/10/14
to sea...@googlegroups.com
Hello

I'm interested in using the seafadm tool.
Unfortunately errors arise when I try to use seafadm.

 seafadm-master]# ./seafadm  -c /opt/seafadm.conf  show all
Traceback (most recent call last):
  File "./seafadm", line 694, in <module>
    users = GetUsers()
  File "./seafadm", line 497, in GetUsers
    used_space = used_space.strip()
TypeError: 'NoneType' object is not callable

Does anyone gets this error too? Anyone an idee why it doesn't work - is the tool compatible with version 3.1.5 ?

Thank you

Roman Ironmaiden

unread,
Jan 5, 2015, 8:50:29 AM1/5/15
to sea...@googlegroups.com
Hi,

I also get this error, but I thought it was because I use seafile version 4 and the tool ist only for versions 2 and 3.
@Henri: Can you please fix this? I don't know anything about the libs you used and it would probably take me ages to fix.

Best Regards.

Henri Wahl

unread,
Jan 5, 2015, 10:39:21 AM1/5/15
to sea...@googlegroups.com
Hi,

I did not yet test with server version 4 but the latest version on
Github'should work with 3 at least. What commands exactly are you trying
to execute?

Regards
Henri

Henri Wahl

unread,
Jan 5, 2015, 11:33:19 AM1/5/15
to sea...@googlegroups.com
Hi there,
please check latest relase
https://github.com/HenriWahl/seafadm/releases/tag/v4.0 which works for
me with server 4.0.3.
Regards
Henri
Reply all
Reply to author
Forward
0 new messages