Python script FTP-Server
#1
lo,

i am trying to get xbox media centre to run and ftp in the previous release (01-10-03) there was a filezilla ftp but this appears to have gone in the latest release (18-10-03) is it possible to run an ftp on the latest realese? (do i need to use the python scripts, if so how?) any help would be a preciated as i'm trying to get it so as i can use it as a dashboard but if i cannot upload files to it its not of much us in that function.

thanks

mark

xbox v.1.3 /w xecuter 2.2, 120gig samsung, evox m7 bios, evox 3921
xbox v.1.3 /w xecuter 2.2, 160gig samsung, ind bios, evox 3935
#2
xbmc don't have a build-in ftp server yet
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
#3
i am aware it doesn'y have a built in one but the python scripting allows an ftp server to be run but i cannot work out how to get it to link into the xbox folders (if this is posible at all)
xbox v.1.3 /w xecuter 2.2, 160gig samsung, ind bios, evox 3935
#4
Question 
ok after a bit of mucking about with the supplied start_medusa.py i came up with the following which creates an ftp server on separate ports for c,e and f (c=8021, e=8022, f=8023) using the anon account which has full write rights for some reason. does anyone know how to get it to link to the root of the xbox so that it can have one ftp serve for the whole box?

oh and does anyone know if i can remove any of the bits that the start medusa starts (i can't be aresed to try removing them in turn until it fails)

# -*- mode: python; tab-width: 4 -*-

#
# sample/template medusa startup script.
#
# this file acts as a configuration file and startup script for medusa.
#
# you should make a copy of this file, then add, change or comment out
# appropriately.  then you can start up the server by simply typing
#
# $ python myscript.py
#

import os
import sys

import ftp_server
import monitor
import filesys
import default_handler
import status_handler
import resolver
import logger
import asyncore

#if len(sys.argv) > 1:
# process a few convenient arguments
#[hostname, ip_address, publishing_root] = sys.argv[1:]
#else:
hostname = 'xbox'
# this is the ip address of the network interface you want
# your servers to be visible from.  this can be changed to ''
# to listen on all interfaces.
ip_address = ''

# root of the http and ftp server's published filesystems.
publishing_root = 'q:\\'
c_root = 'c:\\'
e_root = 'e:\\'
f_root = 'f:\\'

ftp_port_c = 8021 # the standard port is 21
ftp_port_e = 8022 # the standard port is 21
ftp_port_f = 8023 # the standard port is 21

# ===========================================================================
# caching dns resolver
# ===========================================================================
# the resolver is used to resolve incoming ip address (for logging),
# and also to resolve hostnames for http proxy requests.  i recommend
# using a nameserver running on the local machine, but you can also
# use a remote nameserver.

rs = resolver.caching_resolver ('192.168.0.1')

# ===========================================================================
# logging.
# ===========================================================================

# there are several types of logging objects. multiple loggers may be combined,
# see 'logger.py' for more details.

# this will log to stdout:
lg = logger.file_logger (sys.stdout)

# this will log to syslog:
#lg = logger.syslog_logger ('/dev/log')

# this will wrap the logger so that it will
#  1) keep track of the last 500 entries
#  2) display an entry in the status report with a hyperlink
#     to view these log entries.
#
#  if you decide to comment this out, be sure to remove the
#  logger object from the list of status objects below.
#

lg = status_handler.logger_for_status (lg)

# ===========================================================================
# filesystem object.
# ===========================================================================
# an abstraction for the file system.  filesystem objects can be
# combined and implemented in interesting ways.  the default type
# simply remaps a directory to root.

fs = filesys.os_filesystem (publishing_root)

# ===========================================================================
# unix user `public_html' directory support
# ===========================================================================
if os.name == 'posix':
import unix_user_handler
uh = unix_user_handler.unix_user_handler ('public_html')
hs.install_handler (uh)

# ===========================================================================
# ftp server
# ===========================================================================

# here we create an 'anonymous' ftp server.
# note: the ftp server is read-only by default. [in this mode, all
# 'write-capable' commands are unavailable]

#c partition
ftp = ftp_server.ftp_server (
ftp_server.anon_authorizer (
c_root
),
ip=ip_address,
port=ftp_port_c,
resolver=rs,
logger_object=lg
)

#e partition
ftp = ftp_server.ftp_server (
ftp_server.anon_authorizer (
e_root
),
ip=ip_address,
port=ftp_port_e,
resolver=rs,
logger_object=lg
)

#f partition
ftp = ftp_server.ftp_server (
ftp_server.anon_authorizer (
f_root
),
ip=ip_address,
port=ftp_port_f,
resolver=rs,
logger_object=lg
)


# finally, start up the server loop!  this loop will not exit until
# all clients and servers are closed.  you may cleanly shut the system
# down by sending sigint (a.k.a. keyboardinterrupt).
asyncore.loop()
xbox v.1.3 /w xecuter 2.2, 160gig samsung, ind bios, evox 3935
#5
Quote:does anyone know how to get it to link to the root of the xbox so that it can have one ftp serve for the whole box?
you will have to create something like a virtual directory, which contains all the xbox drive letters. but i don't know if that will work with medusa.

about the anonymouse account. it's a modification i made just for testing. wanted to see if it was possible to upload a file to the xbox.
you could open up ftp_server.py and have a look at line 961
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
#6
why didn't you ay it was a python ftp-server Image then i wouldn't have moved it to suggestions forum, now chaning topic to be clear & moving back
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Logout Mark Read Team Forum Stats Members Help
Python script FTP-Server0