{ "info": { "author": "Michal Knapik", "author_email": "Michael.Knapik@stfc.ac.uk", "bugtrack_url": null, "classifiers": [], "description": "## Uploader\n\n[![Build Status](https://travis-ci.org/mknapik/uploader.png)](https://travis-ci.org/mknapik/uploader)\n\nProvides interface for uploading and distributing software through cvmfs repositories.\n\nUses Certificate Authentication provided by Apache `httpd` web server (or others).\n\n## Prerequisites\n\n+ **Python** 2.7.3\n+ **[virtualenv](http://www.virtualenv.org/en/latest/)** 1.7.1.2 -\n Install it with pip or from distribution packages.\n\n ```bash\n sudo pip install virtualenv\n ```\n\n+ **PostgreSQL** 9.1.9\n+ Apache **httpd** 2.2.22\n\n\nFor convenience export the application directory as an environmental variable:\n\n```bash\nexport APP_DIR=/var/www/t1student0.esc.rl.ac.uk\n```\n\n## Database\n\n### sqlite3\n\n1. Create empty database file with proper `chmod`:\n\n ```bash\n touch $APP_DIR/db/uploader.sqlite3\n chmod 600 $APP_DIR/db/uploader.sqlite3\n ```\n2. Set `db` directory security:\n ```bash\n chmod 770 $APP_DIR/db\n chgrp www-data $APP_DIR/db\n ```\n\n### PostgreSQL\n\n1. Login to `psql`:\n\n ```bash\n su postgres -c psql\n ```\n2. Create a new database user `django` (you can also use an existing one):\n\n ```sql\n CREATE USER django WITH PASSWORD 'password';\n ```\n3. Create a new database `uploader` with created owner:\n\n ```sql\n CREATE DATABASE uploader WITH OWNER=django;\n ```\n\n## VirtualEnv\n\n1. Create new `VirtualEnv` for the project. You can choose any location from which `httpd` can read from. Add `--system-site-packages` option if using PostgreSQL.\n\n ```bash\n virtualenv /opt/venv/uploader\n ```\n2. Activate created `VirtualEnv` (you have to do that for each terminal window you are going to use any Python commands)\n\n ```bash\n source /opt/venv/uploader/bin/activate\n ```\n\n## Web Application\n\n1. Get the application. The app can be placed anywhere but we will use `/var/www/t1student0.esc.rl.ac.uk`.\n + unpack the `uploader.tar.gz`:\n\n ```bash\n mkdir $APP_DIR\n tar xvf uploader.tar.gz --strip-components 1 -C $APP_DIR\n ```\n + or clone it with `git`:\n\n ```bash\n git clone https://github.com/mknapik/uploader.git $APP_DIR\n ```\n3. Install application dependencies using `pip`.\n 1. Make sure you activated just created `VirtualEnv`.\n 2. Install dependencies using either:\n + provided bundle\n\n ```bash\n pip install production.pybundle\n ```\n + or by downloading packages from the internet\n\n ```bash\n pip install -r requirements.txt\n ```\n\n## Configure the Uploader\n\n1. Open `archer/settings/production.py` and set the database connection credentials\n + sqlite3:\n\n ```python\n DATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3',\n 'NAME': '%s/db/uploader.sqlite3' % Common.PROJECT_ROOT,\n 'USER': '',\n 'PASSWORD': '',\n 'HOST': '',\n 'PORT': '',\n },\n }\n ```\n + PostgreSQL:\n\n ```python\n DATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postgresql_psycopg2',\n 'NAME': 'uploader',\n 'USER': 'django',\n 'PASSWORD': 'password',\n 'HOST': 'localhost', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.\n 'PORT': '', # Set to empty string for default.\n },\n }\n ```\n\n2. Open `archer/settings/common.py` and set paths to directories.\n 2. Change `SECRET_KEY` (production only):\n\n ```python\n SECRET_KEY = 'apksigo!uh4gth@7nco7y2biavj=0fxd0b3@2!ax6*rb29fq=w'\n ```\n 9. Customize if needed:\n 1. Set `PROJECT_ROOT` to application directory (`$APP_DIR`):\n\n ```python\n PROJECT_ROOT = '/var/www/t1student0.esc.rl.ac.uk/'\n ```\n 1. Set `HOSTNAME`:\n \n ```python\n HOSTNAME = get_host_name()\n ```\n 1. modify `MEDIA_ROOT` to set location of uploaded files on the filesystem:\n\n ```python\n # Absolute filesystem path to the directory that will hold user-uploaded files.\n # Example: \"/var/www/example.com/media/\"\n MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'uploads/')\n ```\n 2. modify `MEDIA_ROOT` to set url to uploaded files:\n\n ```python\n # URL that handles the media served from MEDIA_ROOT. Make sure to use a\n # trailing slash.\n # Examples: \"http://example.com/media/\", \"http://media.example.com/\"\n MEDIA_URL = 'http://t1student0.esc.rl.ac.uk/uploads/'\n ```\n 3. modify `STATIC_ROOT` to ...\n\n ```python\n # Absolute path to the directory static files should be collected to.\n # Don't put anything in this directory yourself; store your static files\n # in apps' \"static/\" subdirectories and in STATICFILES_DIRS.\n # Example: \"/var/www/example.com/static/\"\n STATIC_ROOT = os.path.join(PROJECT_ROOT, 'collectstatic/')\n ```\n 4. modify `STATIC_URL` to ...\n\n ```python\n # URL prefix for static files.\n # Example: \"http://example.com/static/\", \"http://static.example.com/\"\n STATIC_URL = '/static/'\n ```\n\n9. ...\n\n## httpd\n\n1. Make sure `mod_wsgi` is installed and enabled.\n + check if `mod_wsgi` is available:\n\n ```bash\n apache2ctl -M | grep wsgi\n ```\n + if `mod_wsgi` is not present, install it from distribution packages\n + make sure `mod_wsgi` is enabled:\n + use `a2enmod`:\n\n ```bash\n a2enmod wsgi\n ```\n + or if `a2enmod` is not available simply create symbolic links:\n\n ```bash\n cd /etc/apache2/mods-enabled\n ln -s ../mods-available/wsgi.load\n ln -s ../mods-available/wsgi.conf\n ```\n\n2. Link `httpd.uploader.conf` to `sites-available` of `httpd`\n\n ```bash\n ln -s $APP_DIR/httpd.uploader.conf /etc/apache2/sites-available/uploader.conf\n ```\n3. Set the paths to the certificates:\n 1. set host certificate\n 2. set host private key\n 3. set path to certificates directory\n\n ```apache\n SSLCertificateFile /path/hostcert.pem\n SSLCertificateKeyFile /path/hostkey.pem\n SSLCACertificatePath /path/certificates\n ```\n3. Set the correct `WSGIPythonPath`. It should look like `$APP_DIR:$VENV_DIR/lib/$PYTHON_VERSION/site-package`.\n4. Adjust the configuration for this site by changing the paths if you used different ones than in this guide.\n 1. ...\n5. Enable the site\n + use `a2ensite`:\n\n ```bash\n a2ensite uploader.conf\n ```\n + or ir `a2ensite` is not available simply create symbolic link:\n\n ```bash\n cd /etc/apache2/sites-enabled\n ln -s ../sites-available/uploader.conf\n ```\n6. Set correct `chmod`/`chown` for `media`, `uploads` and `cvmfs` directories.\n...\n\n## Uploader initial data\n\n1. The database can be initialized with `manage.py`:\n 1. Create database structure:\n \n ```bash\n DJANGO_CONFIGURATION=Production python manage.py syncdb\n DJANGO_CONFIGURATION=Production python manage.py migrate\n ```\n 2. Load example data:\n \n ```bash\n DJANGO_CONFIGURATION=Production python manage.py loaddata fixtures/auth.json\n DJANGO_CONFIGURATION=Production python manage.py loaddata fixtures/custom_auth.json\n DJANGO_CONFIGURATION=Production python manage.py loaddata fixtures/guardian.json\n DJANGO_CONFIGURATION=Production python manage.py loaddata fixtures/projects.json\n DJANGO_CONFIGURATION=Production python manage.py sync_perms\n ```\n\n# Development\n\n## Create a bundle\n\n```bash\npip bundle dev.pybundle -r requirements.txt\n```\n\n## About\n\nThe application is developed by [Micha\u0142 Knapik](http://github.com/mknapik) for [SCD STFC](http://www.stfc.ac.uk/SCD)\n\n## License\n\n Copyright 2013 Micha\u0142 Knapik\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "git://github.com/mknapik/uploader.git", "keywords": "cvmfs,django,uploader,vo,cern,stfc,ral", "license": "Apache License", "maintainer": null, "maintainer_email": null, "name": "stfc_stratum_uploader", "package_url": "https://pypi.org/project/stfc_stratum_uploader/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/stfc_stratum_uploader/", "project_urls": { "Download": "UNKNOWN", "Homepage": "git://github.com/mknapik/uploader.git" }, "release_url": "https://pypi.org/project/stfc_stratum_uploader/0.1.4/", "requires_dist": null, "requires_python": null, "summary": "Provides interface for uploading and distributing software through cvmfs repositories.", "version": "0.1.4" }, "last_serial": 844183, "releases": { "0.1.2": [ { "comment_text": "built for Linux-3.2.0-51-generic-x86_64-with-glibc2.7", "digests": { "md5": "e3442305c3d682725b08516ccf809eb7", "sha256": "3aafa55e06313ccdfd435767e587f5b716992897e677baa87701a8cd01cbefb3" }, "downloads": -1, "filename": "stfc_stratum_uploader-0.1.2.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "e3442305c3d682725b08516ccf809eb7", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 355949, "upload_time": "2013-08-19T11:58:48", "url": "https://files.pythonhosted.org/packages/47/8a/807c93b474c39b031aaf520e824c01cf8322523fe931558d553b9eafbaaa/stfc_stratum_uploader-0.1.2.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "529fc915abf85373cd524dcd3f6418db", "sha256": "f83ea57420ae67a763133a42a4266465e78cce7b285c074d3f2eb05f733feaae" }, "downloads": -1, "filename": "stfc_stratum_uploader-0.1.2.tar.gz", "has_sig": false, "md5_digest": "529fc915abf85373cd524dcd3f6418db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 368948, "upload_time": "2013-08-19T12:00:12", "url": "https://files.pythonhosted.org/packages/92/79/f9a6905932bfd5f59ef248b7308522c67f81856790337d0ba25d13628d8f/stfc_stratum_uploader-0.1.2.tar.gz" } ], "0.1.4": [ { "comment_text": "built for Linux-3.2.0-51-generic-x86_64-with-glibc2.7", "digests": { "md5": "64653d2d23cbc21a5e92ebfca4b16aca", "sha256": "e6ea935498044ed2f244e91221b050fa3af95c75c38ed93652c6f3d843a75136" }, "downloads": -1, "filename": "stfc_stratum_uploader-0.1.4.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "64653d2d23cbc21a5e92ebfca4b16aca", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 356766, "upload_time": "2013-08-20T14:05:32", "url": "https://files.pythonhosted.org/packages/15/fa/a0e9964639ae35599390c7f658ed1fd9da08643ed1b6db0e5177c59e6697/stfc_stratum_uploader-0.1.4.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "84101a9dd919c5c9158a1068cb8290dc", "sha256": "2b1b3cd2d230e868c90595fd31d1731dc7dd0e9cbed80e6287cd196db0fad99c" }, "downloads": -1, "filename": "stfc_stratum_uploader-0.1.4.tar.gz", "has_sig": false, "md5_digest": "84101a9dd919c5c9158a1068cb8290dc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 369951, "upload_time": "2013-08-20T14:09:27", "url": "https://files.pythonhosted.org/packages/84/c4/6f6cacc125893ca24df88911574955109d0954bf4a27b81edbf7ea19720c/stfc_stratum_uploader-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "built for Linux-3.2.0-51-generic-x86_64-with-glibc2.7", "digests": { "md5": "64653d2d23cbc21a5e92ebfca4b16aca", "sha256": "e6ea935498044ed2f244e91221b050fa3af95c75c38ed93652c6f3d843a75136" }, "downloads": -1, "filename": "stfc_stratum_uploader-0.1.4.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "64653d2d23cbc21a5e92ebfca4b16aca", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 356766, "upload_time": "2013-08-20T14:05:32", "url": "https://files.pythonhosted.org/packages/15/fa/a0e9964639ae35599390c7f658ed1fd9da08643ed1b6db0e5177c59e6697/stfc_stratum_uploader-0.1.4.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "84101a9dd919c5c9158a1068cb8290dc", "sha256": "2b1b3cd2d230e868c90595fd31d1731dc7dd0e9cbed80e6287cd196db0fad99c" }, "downloads": -1, "filename": "stfc_stratum_uploader-0.1.4.tar.gz", "has_sig": false, "md5_digest": "84101a9dd919c5c9158a1068cb8290dc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 369951, "upload_time": "2013-08-20T14:09:27", "url": "https://files.pythonhosted.org/packages/84/c4/6f6cacc125893ca24df88911574955109d0954bf4a27b81edbf7ea19720c/stfc_stratum_uploader-0.1.4.tar.gz" } ] }