pull/109/head
Mr Chen 6 years ago
parent 43581c52aa
commit d4aa9fa825
  1. 7
      plugins/rsyncd/conf/rsyncd.conf
  2. 3
      plugins/rsyncd/index.html
  3. 35
      plugins/rsyncd/index.py
  4. 7
      plugins/rsyncd/js/rsyncd.js

@ -0,0 +1,7 @@
uid = www
gid = www
use chroot = no
max connections = 100
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
list = false

@ -4,8 +4,9 @@
<p class="bgw" onclick="pluginService('rsyncd');">服务</p> <p class="bgw" onclick="pluginService('rsyncd');">服务</p>
<p onclick="pluginInitD('rsyncd');">自启动</p> <p onclick="pluginInitD('rsyncd');">自启动</p>
<p onclick="pluginConfig('rsyncd');">配置修改</p> <p onclick="pluginConfig('rsyncd');">配置修改</p>
<p onclick="rsyncdReceive();">接收配置</p>
<p onclick="pluginLogs('rsyncd','','run_log');">日志</p> <p onclick="pluginLogs('rsyncd','','run_log');">日志</p>
<p onclick="smbRead()">说明</p> <!-- <p onclick="rsRead()">说明</p> -->
</div> </div>
<div class="bt-w-con pd15"> <div class="bt-w-con pd15">
<div class="soft-man-con"></div> <div class="soft-man-con"></div>

@ -65,7 +65,36 @@ def status():
return 'start' return 'start'
def appConf():
if public.isAppleSystem():
return getServerDir() + '/rsyncd.conf'
return '/etc/rsyncd.conf'
def getLog():
conf_path = appConf()
conf = public.readFile(conf_path)
rep = 'log file\s*=\s*(.*)'
tmp = re.search(rep, conf)
if not tmp:
return ''
return tmp.groups()[0]
def initConf():
import re
conf_path = appConf()
conf = public.readFile(conf_path)
conf = re.sub('#*(.*)', '', conf)
conf_tpl_path = getPluginDir() + '/conf/rsyncd.conf'
if conf.strip() == '':
content = public.readFile(conf_tpl_path)
public.writeFile(conf_path, content)
def start(): def start():
initConf()
if public.isAppleSystem(): if public.isAppleSystem():
return "Apple Computer does not support" return "Apple Computer does not support"
@ -132,9 +161,7 @@ def initdUinstall():
return 'ok' return 'ok'
def appConf(): # rsyncdReceive
return '/etc/rsyncd.conf'
if __name__ == "__main__": if __name__ == "__main__":
func = sys.argv[1] func = sys.argv[1]
if func == 'status': if func == 'status':
@ -155,5 +182,7 @@ if __name__ == "__main__":
print initdUinstall() print initdUinstall()
elif func == 'conf': elif func == 'conf':
print appConf() print appConf()
elif func == 'run_log':
print getLog()
else: else:
print 'error' print 'error'

@ -1,11 +1,8 @@
function smbRead(){ function rsRead(){
var readme = '<ul class="help-info-text c7">'; var readme = '<ul class="help-info-text c7">';
readme += '<li>mac上连接`cmd+k`</li>'; readme += '<li></li>';
readme += '<li>不产生.DS_Store文件: defaults write com.apple.desktopservices DSDontWriteNetworkStores true</li>';
readme += '<li>windows上连接例子: \\192.168.1.194</li>';
readme += '</ul>'; readme += '</ul>';
$('.soft-man-con').html(readme); $('.soft-man-con').html(readme);

Loading…
Cancel
Save