{ "info": { "author": "Thomas Gl\u00e4\u00dfle", "author_email": "thomas@coldfix.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Flask", "Intended Audience :: End Users/Desktop", "License :: Public Domain", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Communications :: File Sharing" ], "description": "pycbox\n======\n\nSimple web interface showing a directory-listing or thumbnail-gallery of the\nfiles or images in the ``files/`` subdirectory. Users can upload files if the\nfolder has write-permissions for all.\n\nAn example can be seen at pix.coldfix.eu_.\n\nThis repo is a python rewrite of the picbox_ php app.\n\n.. _pix.coldfix.eu: https://pix.coldfix.eu\n.. _picbox: https://github.com/coldfix/picbox\n\n\nUsage\n-----\n\nYou can quickly install the latest release and locally serve files from your\n``~/Pictures`` directory as follows:\n\n.. code-block:: bash\n\n pip install pycbox --user\n pycbox -w ~/Pictures\n\nIn order to allow network access on all network interfaces you also need to\nadd the ``--host 0.0.0.0`` option, e.g.:\n\n.. code-block:: bash\n\n pycbox -w ~/Pictures -h 0.0.0.0\n\nAlternatively, you can run pycbox without installation from the git checkout.\nThough in this case, you still need to install the dependencies as follows:\n\n.. code-block:: bash\n\n pip install -r requirements.txt --user\n ./bin/pycbox -w ~/Pictures\n\nHowever, running the pycbox from the command line like this is not recommended\nfor deployment! From the `flask documentation`_:\n\n While lightweight and easy to use, Flask\u2019s built-in server is not suitable\n for production as it doesn\u2019t scale well and by default serves only one\n request at a time. Some of the options available for properly running\n Flask in production are documented here.\n\n.. _flask documentation: http://flask.pocoo.org/docs/latest/deploying/\n\nA more sophisticated server can e.g. be run using twisted:\n\n.. code-block:: bash\n\n twistd --nodaemon --logfile=- web --port=tcp:5000 --wsgi=pycbox.app\n\nIn fact, the recommended method is using docker, see Deployment_.\n\n\nConfig\n------\n\nIf it exists, ``config.yml`` will be loaded from the active directory. The\nconfig file may become mandatory, so you should always copy and adjust the\nshipped example config:\n\n.. code-block:: bash\n\n cp config.example.yml config.yml\n\nAn alternate config file name or path can be specified via the\n``PYCBOX_CONFIG`` environment variable, i.e. like this:\n\n.. code-block:: bash\n\n PYCBOX_CONFIG=/path/to/alt_config.yml python pycbox.py \n PYCBOX_CONFIG=/path/to/alt_config.yml twistd web --wsgi=pycbox.app\n\n\nDeployment\n----------\n\nThe recommended method is to run pycbox is via docker. The image can be built\nand run as follows:\n\n.. code-block:: bash\n\n docker build . -t pycbox\n docker run --cap-drop=all \\\n -v `pwd`/files:/pycbox/files \\\n -p 5000:5000 \\\n --name=pycbox pycbox\n\nor simply:\n\n.. code-block:: bash\n\n docker-compose up\n\nAdd ``-d`` to either command line to run in the background.\n\n\nProxy\n-----\n\nIn order to run the application on a subdomain, you will need to setup a proxy\nforward. Example ``nginx`` configuration to show the site on ``pix``\nsubdomain:\n\n.. code-block:: nginx\n\n server {\n listen 80;\n listen [::]:80;\n server_name pix.example.com pix.example.org;\n return 301 https://$host$request_uri;\n }\n\n server {\n listen 443 ssl;\n listen [::]:443 ssl;\n server_name pix.example.com pix.example.org;\n access_log /var/log/nginx/access_pics.log;\n location / {\n proxy_pass http://localhost:5000;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header Host $host;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header Upgrade $http_upgrade;\n proxy_set_header Connection upgrade;\n }\n }\n\n\nUpload\n------\n\nTo enable uploading to a particular subfolder, make it writable by all:\n\n.. code-block:: bash\n\n mkdir -p files/public\n chmod 777 files/public\n\n\nDebug mode\n----------\n\n**DO NOT DO THIS IN PRODUCTION** since it allows the client to execute\narbitrary code.\n\nTo run the application in debug mode on port 5000, type either:\n\n.. code-block:: bash\n\n python pycbox.py --debug\n\nor (recommended):\n\n.. code-block:: bash\n\n FLASK_APP=pycbox.py FLASK_DEBUG=1 flask run\n\nThe second command takes care of reloading the server when the python module\nis changed and is therefore recommended for development.\n\n\nBig TODOs\n---------\n\n- use redis for caching thumbs and highlighted files\n- use asciidoc for markdown\n- use pygments for highlighting\n- configure via YAML file: auth, quota, uploads, deny globs\n\nChanges\n-------\n\n0.0.3\n~~~~~\nDate: 06.09.2017\n\n- fix startup error in debug mode, due to port being a string\n- fix startup error in docker container, due to permissions\n- fix error when trying to upload into root folder\n- fix permission problems in docker container\n\n0.0.2\n~~~~~\nDate: 11.08.2017\n\n- fix install package (if installing using pip)\n\n0.0.1\n~~~~~\nDate: 10.08.2017\n\nFeatures include:\n\n- directory index\n- thumbnail gallery\n- highlighting (``source-highlight`` or ``highlight``)\n- cache thumbnails and highlights relative to current folder\n- configurable root folder\n- dockerfile", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/coldfix/pycbox", "keywords": "", "license": "Unlicense", "maintainer": "", "maintainer_email": "", "name": "pycbox", "package_url": "https://pypi.org/project/pycbox/", "platform": "", "project_url": "https://pypi.org/project/pycbox/", "project_urls": { "Homepage": "https://github.com/coldfix/pycbox" }, "release_url": "https://pypi.org/project/pycbox/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "Web interface for directory listings and picture gallery", "version": "0.0.3" }, "last_serial": 3153605, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "376d6e4affec36746fc8be2883bf1c75", "sha256": "ba2412ca1d20f6619eb8d8d4d47b6cda50f73731073d2367859865f17f954a84" }, "downloads": -1, "filename": "pycbox-0.0.1.tar.gz", "has_sig": false, "md5_digest": "376d6e4affec36746fc8be2883bf1c75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5664, "upload_time": "2017-08-10T19:40:33", "url": "https://files.pythonhosted.org/packages/8e/41/cd464dc82a1634a772a52ff8a142b84a87a2c1069e6c7e03b05a0d0ebce4/pycbox-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "7c4a6d0e6cfb142e94a08d08282f778d", "sha256": "d94a5b6a6b5ca89bd46f46080c8b361f31c635b4eff4e409d0ef515f1dfff7bf" }, "downloads": -1, "filename": "pycbox-0.0.2.tar.gz", "has_sig": false, "md5_digest": "7c4a6d0e6cfb142e94a08d08282f778d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 57298, "upload_time": "2017-08-28T11:10:27", "url": "https://files.pythonhosted.org/packages/c5/05/5408d89c121f47788d2bc243cf7dee87b7e3ac989148ee21dcbc0e91976d/pycbox-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "825ba86a40bbcad206bae3a3af555418", "sha256": "f309a285b7d78df65fa889a10576e2aca84888e2fb892db8945b19681fb5b632" }, "downloads": -1, "filename": "pycbox-0.0.3.tar.gz", "has_sig": false, "md5_digest": "825ba86a40bbcad206bae3a3af555418", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 57457, "upload_time": "2017-09-06T14:02:19", "url": "https://files.pythonhosted.org/packages/ac/ce/c153d5f6f6e9e075a3b895760f88568cf07d45d9fec61550a7faae07a648/pycbox-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "825ba86a40bbcad206bae3a3af555418", "sha256": "f309a285b7d78df65fa889a10576e2aca84888e2fb892db8945b19681fb5b632" }, "downloads": -1, "filename": "pycbox-0.0.3.tar.gz", "has_sig": false, "md5_digest": "825ba86a40bbcad206bae3a3af555418", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 57457, "upload_time": "2017-09-06T14:02:19", "url": "https://files.pythonhosted.org/packages/ac/ce/c153d5f6f6e9e075a3b895760f88568cf07d45d9fec61550a7faae07a648/pycbox-0.0.3.tar.gz" } ] }