PHFS
This is a Python3 implementation of rejetto's HTTP File Server~
? Features that work:
- Filelist, download
- Sorting files, Archiving
- Some macros,
special:alias
- Upload
- Search
- Translations,
special:strings
? Features that don't work:
- Virtual File System
- File actions
- Accounts, Login, Ban, Limits, ...
? Supported platforms:
-
All x86, x64 platforms that Python 3.7 supports:
- Windows 7 and upper
- GNU/Linux, *nix, *BSD
- ...
-
Some ARM platforms:
- Android, with QPython 3L
- ARM Boards like Raspberry Pi, with PyPy
- ...
-
Maybe more!
Developer Notes
? This project is only half working, it is not yet ready for production use. Testing only.
If you are interested in testing this project, please do the following:
-
Install Werkzeug by either using
pip
or placing the folderWerkzeug-(version)/src/werkzeug
from downloaded archive to cloned repo. -
Install WSGIserver by either using
pip
or placing the fileWSGIserver-(version)/wsgiserver.py
from downloaded archive to cloned repo. -
Pick a HFS template (for HFS 2.4), rename it to
hfs.tpl
and place into cloned repo. -
Configure port, base folder and upload-allowed folders in
hfs.ini
. -
For running a server, open
run.py
; for developing, opentest.py
.
Template choices:
Notes
- To use in QPython 3L on Android:
- Put repo into folder
/sdcard/qpython/projects3
, ensure folder is not nested. - Rename
run.py
tomain.py
. - In QPython 3L app, go to Programs, in Projects tab, select repo name then run.
- Put repo into folder
Files
-
test.py
: Run a server for testing, debugging. It also contains werkzeug's reload feature. -
run.py
: Run a simple server. Has no debug feature, but works on pypy on aarch64 architecture. -
hfs.ini
: Some configs, like port, are here. Currently you can set a base path as the root dir of served pages, also can set upload-allowed paths. -
_test_macro.py
: Run & test a macro, by entering as argv1 in commandline. -
cfgLib.py
: TheConfig
object is inside this file. -
classesLib.py
: Some usefulclass
es are here. -
helpersLib.py
: Some useful functions are here. -
mimeLib.py
: Manages MIME types. Get a defined MIME type with something likemimeLib.getmime('*.html')
. You can define your own MIMEs inmime.ini
. -
scriptLib.py
: When executing a macro/symbol, usually functions in this file will be called. -
serverLib.py
: Defines a WSGI application, which acts like original HFS. -
tplLib.py
: The template is interpreted by this.