swftp是用于openstack对象存储(swift)的ftp和sftp接口。

swftp的Python项目详细描述


swftp是用于openstack对象存储(swift)的ftp和sftp接口。它将充当ftp/sftp协议和openstack对象存储之间的代理。

对于到后端openstack对象存储集群的https通信
*简单安装'pip install swftp`
*statsd支持
*stats web接口
*厨师食谱:https://github.com/softlayer/chef swftp

*openssl/pycrypto
*twisted/twisted conch
*pyasn1


入门
---------
(http://www.pip-installer.org/en/latest/installing.html/installing.html/http://www.pip-install.http://www.pip-install




>使用git/pip进行安装:bash/bash:
``bash-install-u git+git+git://gitub.com/softlayer/swftp.git
```






`` bash
``bash/bash
>$py python setup.py install
````````



`` bash
$swftp ftp-a http://127.0.0.1:8080/auth/v1.0
2013-02-18 16:28:50-0600[-]日志打开。
2013-02-18 16:28:50-0600[-]ftp factory从5021开始
2013-02-18 16:28:50-0600[-]starting factory<;twisted.protocols.ftp.ftpfactory instance at 0x1103fcf80>;
```

2048-n"-t rsa-f/etc/swftp/id_rsa
````

启动服务器的命令类似于ftp命令。
``bash
$swftp sftp-a http://127.0.0.1:8080/auth/v1.0
2013-02-18 16:29:14-0600[-]日志已打开。
2013-02-18 22:29:14+0000[-]sshfactory从5022开始行
命令行配置允许您指定自定义openstack swift auth url以及配置文件的位置(稍后详细说明)。

ftp命令行选项:
``bash
$swftp ftp--help
用法:swftp ftp[options]
options:
-c,--config_file=swftp配置文件的位置。[默认值:
/etc/swftp/swftp.conf]
-a,--auth_url=auth url以供使用。如果存在配置文件值,则默认为该值。[默认值:http://127.0.0.1:8080/auth/v1.0]
-p,--port=要绑定到的端口。
-h,--主机=要绑定到的IP。
--版本显示扭曲版本并退出。
--帮助显示此帮助并退出。
`````

sftp命令行选项:
``bash
$swftp sftp--帮助
用法:swftp sftp[选项]
选项:
-c,--config_file=swftp配置文件的位置。[默认值:
/etc/swftp/swftp.conf]
-a,--auth_url=auth url以供使用。如果存在配置文件值,则默认为该值。[默认值:http://127.0.0.1:8080/auth/v1.0]
-p,--port=要绑定到的端口。
-h,--host=要绑定到的IP。
--priv-key=私钥位置。
--pub-key=公钥位置。
--版本显示Twisted版本并退出。
--帮助显示此帮助并退出。
```


默认值:
```
[sftp]
auth_url=http://127.0.0.1:8080/auth/v1.0
host=0.0.0
port=5022
priv_key=/etc/swftp/id_rsa
pub_key=/etc/swftp/id_rsa.pub
num_persistent_connections=20
num_connections_per_session=10
connection_timeout=240
extra_headers=x-swftp:true,x-forward-proto:sftp

log-stattsd\u host=
log-stattsd\u port=8125
log-stattsd\u sample\u sample\u采样率=10
log-stattsd\u metmetric\u prefix=sftp


stats\u host=
stats\u host=38022

[ftp]
auth\u url=http://127.0.0.0.0.1:8080/auth/v1.0

host=host=http://http://127.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0
端口=5021
num_persistent_connections=20
num_connections_per_session=10
connection_timeout=240
welcome_message=welcome to swftp-openstack swift的ftp/sftp接口
extra_headers=x-swftp:true,x-forwarded-proto:sftp

log_statsd_host=
log_statsd_port=8125
log_statsd_sample_rate=10
log_statsd_metric_prefix=ftp

stats_host=
stats_port=38021
``````

注意事项
----
*不能创建顶级文件,只有目录(因为顶层是容器)。
*不能重命名任何非空目录。
*不能递归删除。大多数客户端无论如何都会递归地显式删除每个文件/目录。
*伪目录和同名的真实对象只会显示目录。很多ftp/sftp客户端[实际上会爆炸](http://gifsoup.com/webroot/animatedgifs2/1095919_o.gif)如果目录列表有重复项。


project organization
----
*etc/:示例配置文件
*swftp/:核心/共享代码
*ftp/:ftp服务器
*sftp/:sftp服务器
*test/:单元和功能测试
*twisted/:对于twisted插件系统

它们都位于源中的/etc/目录中。

*upstart
*/etc/init/swftp ftp.conf
*/etc/init/swftp sftp.conf
*init.d
*/etc/init/swftp ftp
*/etc/init/swftp sftp
*supervisor
*/etc/supervisor/conf.d/swftp.conf
*示例swftp.conf file
*/etc/swftp/swftp.conf.sample

----
web interface是一个http接口,提供了获取更多特定于应用程序的度量的方法。目前唯一支持的格式是json。如果设置了"stats\u host"配置值,服务器将监听该接口。

**http://{stats\u host}:{stats\u port}/stats.json**

``bash
$curl http://127.0.0.1:38022/stats.json_python-mjson.tool
{
"rates":{
"auth.fail":0,
"auth.succeed":0,
"command.getattrs":0,
"command.login":0,
"command.logout":9,
"command.makedirectory":0,
"command.opendirectory":0,
"command.openfile":0,
"command.removedirectory":0,
"command.removefile":0,
"command.renamefile":0,
"num-clients":-9,
"transfer.egresss-bytes":0,
"transfer.ingres-bytes":47662
},
"totals":{
"auth.fail":0,
"auth.succeed":91,
"command.getattrs":15,
"command.login":91,
"command.logout":91,
"command.makedirectory":0,
"command.opendirectory":7,
"command.openfile":8,
"command.removedirectory":3,
"command.removefile":0,
"command.renameFile":7,
"num_clients":0,
"transfer.egresss_bytes":11567105,
"transfer.ingres_bytes":11567105
}
}
}
````

statsd支持
----
statsd支持依赖于[txstatsd](https://pypi.python.org/pypi/txstatsd)。如果设置了"log_statsd_host"配置值,则以下路径将发送到statsd中。


clients <
>* stats.gauges.[prefix].proc.threadthreadthreads * stats.gauges.[prefprefprefprefprefix].proc proc proc proc proc proc proc proc proc.gr...[prefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefprefunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpunpused used used used used used used used use use use use use use use use use use use use use use use use use use used used used used used used by by by by by by by />*state.gauges.[prefPrefPrefix……….[prefix……….[prefix……….[prefix].command.makedirectory
*stats.[prefix].command.opendirectory
*stats.[prefix].command.openfile
*stats.[prefix].command.removefile
[prefix].command.renamefile



*stats.[prefix].command.access
*stats.[prefix].*stats.[prefix].command.list
*stats.[prefix].command.login
*stats.[prefix].command.logout
*stats.[prefix].command.makedirectory
*stats.[prefix].command.openforreading
*stats.[prefix].command.removedirectory
*stats.[prefix].command.command.removedirectory*stats.[prefix].command.removefile
*stats.[prefix].command.rename
*stats.[prefix].command.stat


development
--
development使用fork-and-pull请求过程。请随意提交请求。

要运行测试,请运行
``bash
$trial swftp



要对实时swftp服务器(ftp和sftp)运行测试,需要测试配置。默认位置是`/etc/swftp/test.conf',但可以使用swftp test/config环境变量进行设置。这是一个样本测试配置


````
[func\u test]
auth\u host=127.0.0.1
auth\u port=8080
auth\u ssl=no
auth\u prefix=/auth/



account=test
username=tester
password=testing


sftp.u host=127.0.0.1
sftp-sftp-port=5022


ftp-ftp-ftp-ftp-host=127.0.0.0.0.0.U主机=127.0.1
ftp port=5021

```


----
版权所有(c)2013 Softlayer Technologies,Inc.


特此免费向任何获得本软件和相关文档文件副本的人授予许可,不受限制地使用
本软件,包括但不限于使用、复制、修改、合并、发布、分发、再授权和/或出售
本软件副本的权利,并允许向其提供本软件的人员这样做,受限于以下条件:

对于适销性的保证,
适用于特定目的和不侵权。在任何情况下,
作者或版权持有人均不对任何索赔、损害或其他
责任负责,无论是在合同诉讼、侵权诉讼或其他诉讼中,由软件或
软件的使用或其他交易引起的或与之相关的。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java为什么@DELETE REST不起作用?   带有JPA2的java表值参数。1和Hibernate,Sql Server   如何将Java类添加到Xamarin VS2017项目   绘制多边形时出现java空指针异常   java Apache WebClient 303状态未重定向   java如何用一组字符串数组从数据库中获取数据   java是否可以使用Google Drive API向文件中添加脚本?   java组织。阿帕奇。贾斯珀。JspC jar文件下载   java在整个JSON映射中将单个值作为JSON流   通过命令行将文件输入到java   java rs.next()总是返回false   java标记异常,通知调用方利用异常消息   java Spring YML数组属性为空