{ "info": { "author": "Antonio Perez-Aranda Alcaide", "author_email": "ant30tx@gmail.com", "bugtrack_url": null, "classifiers": [ "Framework :: Pyramid", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: WSGI :: Application" ], "description": ".. image:: https://travis-ci.org/ant30/s3authbasic.svg?branch=master\n :target: https://travis-ci.org/ant30/s3authbasic\n\n.. image:: https://coveralls.io/repos/ant30/s3authbasic/badge.png?branch=master\n :target: https://coveralls.io/r/ant30/s3authbasic?branch=master\n\n.. contents::\n\n===========\ns3authbasic\n===========\n\n\ns3authbasic is a Pyramid application aimed to serve a static websites stored\nin Amazon S3 protected by Auth Basic authentication. You need a IAM user with\nits credentials and read access on the bucket which contains the static\nfiles.\n\nAmazon Settings\n===============\n\nI assumed that you have a protected bucket. To create the IAM user with the\ncorrect permissions you need go to the IAM_ app in the AWS Console\n\n.. _IAM: https://console.aws.amazon.com/s3/home\n\nClick **Users** section and click in the **Creare New User** blue button.\n\nEnter the username you want. It can't contains whitespaces. And click on\n**create**\n\nClick on **Download Credential** or write down the credentials info.\n\nNow, we need to add the policy to give read access permissions to the user.\n\nClick in the created user and go to the **permissions** tab below.\n\nClick on the **Attach User Policy**.\n\nClick on **Custom Policy** and in the **Select** button.\n\nGive a policy name, like **s3-reader-policy**.\n\nCopy the follow block in the **Policy Document** box. Please,\nreplace **protected-html** with your bucket name.\n\n.. code-block:: javascript\n\n {\n \"Statement\": [\n {\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:Get*\",\n \"s3:ListBucket\"\n ],\n \"Resource\": [\n \"arn:aws:s3:::protected-html\",\n \"arn:aws:s3:::protected-html/*\"\n ]\n }\n ]\n }\n\n\nApplication deployment\n======================\n\nI suggest you to use a virtualenv but I don't use that in this doc.\n\n.. code-block:: bash\n\n pip install s3authbasic\n\n\nYou need a Pyramid ini settings file. You can find one example_ in the\ngithub reposity in the config-templates directory.\n\n.. _example: https://github.com/ant30/s3authbasic/blob/master/s3authbasic/config-templates/development.ini\n\n\nConfiguration\n=============\n\nYou can config the app by editing the settings file or by using envionment\nvariables.\n\nIf you want to use the file, then the AWS and the user settings are\ndocumented in the file.\n\nThe AWS environment variables are like this:\n\n.. code-block:: bash\n\n export AWS_BUCKET_NAME='bucketname'\n export AWS_SECRET_ACCESS_KEY='12312sdf32'\n export AES_ACCESS_KEY_ID='123123123aaa'\n\nTo define users to access the app, the variable should starts with **USER_**.\nThe user name is the word after the underscore character and shoud be defined\nin the correct capitalization. This is, if you want a user called **admin**,\nyou should create the environment variable USER_admin.\n\nYou can setup many users as you need.\n\nThe password should be hashed by sha256.\n\nYou can get the hash of your password by this command in linux:\n\n.. code-block:: bash\n\n echo -n thepassword | sha256sum\n\nThe environment variable should look like this:\n\n.. code-block:: bash\n\n export USER_admin='123123123123123123123'\n\n**NOTE:** In 0.1.3 version we added encoding utf-8 option to password, so if\nyou want to use non ascii characters, the hash can vary. You can use something\nlike this in a terminal. You need the hashlib package from pypi.\n\n.. code-block:: bash\n\n from hashlib import sha256\n sha256('your password!!'.encode('utf-8')).hexdigest()\n\n\n\nStart the application\n=====================\n\nYou should use the follow command if you have customized the ini file:\n\n.. code-block:: bash\n\n pserve development.ini\n\n\nOtherwise, you can use this command:\n\n.. code-block:: bash\n\n run-s3authbasic\n\nIf you are using the default ini file, the application should be\navailable in the 6543 port. If you have deployed the app in your\nown system, you can access it through http://127.0.0.1:6543/\n\n\n0.1.3\n-----\n\n- Fix UTF8 passwords problems\n\n0.1.2\n-----\n\n- Fix path with whitespaces\n- Fix settings relative location and the default package location detection\n\n0.1.1\n-----\n\n- Fix WebTest error\n- Add files needed by heroku\n\n0.1\n---\n\n- The first published version\n\n0.0\n---\n\n- Initial version", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/ant30/s3authbasic/tarball/0.1.3", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.ant30.es/", "keywords": "web pyramid pylons s3", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "s3authbasic", "package_url": "https://pypi.org/project/s3authbasic/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/s3authbasic/", "project_urls": { "Download": "https://github.com/ant30/s3authbasic/tarball/0.1.3", "Homepage": "http://www.ant30.es/" }, "release_url": "https://pypi.org/project/s3authbasic/0.1.3/", "requires_dist": null, "requires_python": null, "summary": "s3authbasic", "version": "0.1.3" }, "last_serial": 1391639, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "c0244af86323a0680fe3b839aad9736f", "sha256": "7402a71bcb4b4b52acd0975a2c10eabe5d749c7445e088283e3bf99688502b3a" }, "downloads": -1, "filename": "s3authbasic-0.1.1.tar.gz", "has_sig": false, "md5_digest": "c0244af86323a0680fe3b839aad9736f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7902, "upload_time": "2014-04-13T14:36:17", "url": "https://files.pythonhosted.org/packages/45/2e/d008f1701fbdd312ef86e269b47e73d9245df29482a58accfc560d60e192/s3authbasic-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "7f6fcd12fe14017c14035cfa0c9dd2f3", "sha256": "cb6bfae1a523e5e1af0455669fd9b37b991d841c4821ae52d3671ac7397fe9e4" }, "downloads": -1, "filename": "s3authbasic-0.1.2.tar.gz", "has_sig": false, "md5_digest": "7f6fcd12fe14017c14035cfa0c9dd2f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8649, "upload_time": "2014-04-14T22:00:23", "url": "https://files.pythonhosted.org/packages/8d/56/8079cdedaa19cb1f4dee4ee0a3a117c75d9b695ade9e0086258836e0148d/s3authbasic-0.1.2.tar.gz" } ], "0.1.3": [] }, "urls": [] }