GithubHelp home page GithubHelp logo

cschwede / django-swiftbrowser Goto Github PK

View Code? Open in Web Editor NEW
67.0 67.0 50.0 288 KB

Simple web app build with Django and Twitter Bootstrap to access Openstack Swift.

License: Apache License 2.0

Python 55.61% HTML 44.02% Dockerfile 0.37%

django-swiftbrowser's People

Contributors

cschwede avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-swiftbrowser's Issues

Return 'Unauthorized' after uploading object

When I uploaded an object, it returns "Unauthorized, this server could not verify that you are authorized to access the document you requested.'. But actually the object has been successfully uploaded to Swift.

Centos Installation

Hello,

I have installed this bundle on centos machine.

  1. Do i need to install swift client before installing this package
  2. What should be content of swiftbrowser.settings?

Step-wise installation procedure.

Hello,

I have a Openstack swift installed with keystone.

I have installed this swift browser but getting some error after the login page. Are there any credentials for testing?

Can you please share step by step installation procedure?

Thank you.

May I inquire about Formpost & ACLS from you?

May I inquire about Formpost & ACLS from you?

As I know, Formpost requires a key (X-Account-Meta-Temp-URL-Key) to run and it works together with ACLS.

When I started working on ACLS and tried to assign a user to each Container, I could not get any key.
It always denied me and popped up Access Denied message.

Would you pls guide me how to get the key on ACLS, in order to use it on Formpost?
Or how both can work together?

Make swiftbrowser usable without account ownership

swiftbrowser is not really usable if a user has no permission on the account level (ie list containers).
A user could manually add a known containername to the URL, but the user has to know this.

Possible workaround: return a useful error message, and display an input field in case the user knows a containername. swiftbrowser could use this container then.

Supply username and password in settings

We'd like to run django-swiftbrowser with a different authentication mechanism, so to avoid the user having to log in twice (once to our SSO, then to the user accessing swift), we'd like to store a username and password in the settings. If the login view finds these settings, it would log in automatically using them.

Is that a feature you'd accept? We're happy to do the work if so :)

not able to share container to another user

have two users:
User A
User B.

I have created container-A and uploaded file-A as user A. modified Container's ACL and granted read rights to user B. Yet, user B is not able to see container-A

500 on Upload and Download

Hi,
I have configured swift browser on my proxy server. I can authenticate users and can create/delete containers. However when I try to upload or download a file I get 500.

Strangely I am also able to delete a file in container.

formpost and tempurl middleware are enabled.

Would you be able to assist, what is causing this?

I don't see any error related to this in the proxy.error file. Also SE Linux is set to permissive.
Thanks,
Jahan

I ran swift browser with debug switched on and was able to get the traceback:

Environment:

Request Method: GET
Request URL: http://xx.xx.xx.xx:8000/upload/JAHANSCONTAINER/

Django Version: 1.9.1
Python Version: 2.7.5
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.staticfiles',
 'swiftbrowser')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.http.ConditionalGetMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware')



Traceback:

File "/usr/lib64/python2.7/site-packages/django/core/handlers/base.py" in get_response
  149.                     response = self.process_exception_by_middleware(e, request)

File "/usr/lib64/python2.7/site-packages/django/core/handlers/base.py" in get_response
  147.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/lib/python2.7/site-packages/django_swiftbrowser-0.21-py2.7.egg/swiftbrowser/views.py" in upload
  190.     signature = hmac.new(key, hmac_body, sha1).hexdigest()

File "/usr/lib64/python2.7/hmac.py" in new
  136.     return HMAC(key, msg, digestmod)

File "/usr/lib64/python2.7/hmac.py" in __init__
  75.         self.outer.update(key.translate(trans_5C))

Exception Type: TypeError at /upload/JAHANSCONTAINER/
Exception Value: character mapping must return integer, None or unicode

INSTALLED_APPS and django.contrib.admin

At launch, the web interface displayed an error saying that i should add :
django.contrib.admin in my INSTALLED_APPS configuration

After doing that, the server doesn't work anymore :
python manage.py runserver 192.168.3.231:80
Validating models...

Unhandled exception in thread started by <function wrapper at 0x2145e60>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.2-py2.7.egg/django/utils/autoreload.py", line 93, in wrapper
fn(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.2-py2.7.egg/django/core/management/commands/runserver.py", line 101, in inner_run
self.validate(display_num_errors=True)
File "/usr/local/lib/python2.7/dist-packages/Django-1.6.2-py2.7.egg/django/core/management/base.py", line 314, in validate
raise CommandError("One or more models did not validate:\n%s" % error_text)
django.core.management.base.CommandError: One or more models did not validate:
admin.logentry: 'user' has a relation with model <class 'django.contrib.auth.models.User'>, which has either not been installed or is abstract.
admin.logentry: 'content_type' has a relation with model <class 'django.contrib.contenttypes.models.ContentType'>, which has either not been installed or is abstract.

TypeError while pressinf the (+) upload button on any container

TypeError at /upload/pippo/
character mapping must return integer, None or unicode
Request Method: GET
Request URL: http://swift:8000/upload/pippo/
Django Version: 1.8.6
Exception Type: TypeError
Exception Value:
character mapping must return integer, None or unicode
Exception Location: /usr/lib/python2.7/hmac.py in init, line 75
Python Executable: /usr/bin/python
Python Version: 2.7.12
Python Path:
['/home/luca/.local/bin',
'/home/luca/python-swiftclient',
'/usr/local/lib/python2.7/dist-packages/futures-3.0.5-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/requests-2.13.0-py2.7.egg',
'/home/luca/swift',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/home/luca/.local/lib/python2.7/site-packages',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages']
Server time: Di, 21 Feb 2017 11:26:45 +0100

Cant upload file through django browser in container

Im trying to upload a file from the host which is my laptop through django, an authorization issue pop up on the web stated that the server could not verify whether i am authorized to access the document on my laptop. however im able to upload the file by swift CLI. Which part do i need to do some changes?

Cannot connect from host machine

I'm not sure this is a bug, perhaps it's a problem with my configuration.
BTW, I've installed django-swiftbrowser on a headless ubuntu server virtual machine with vmware.
My settings.py looks like this:

ALLOWED_HOSTS = ['127.0.0.1', '192.168.1.6']

where 192.168.1.6 is my virtual machine host ip.
and 192.168.1.2 is my guest vm ip.

If, on my host machine, open the web browser at http://192.168.1.2:8000 get ERR_CONNECTION_REFUSED

If on my guest I issue curl -v http://127.0.0.1:8000 I successfully get a redirection to http://127.0.0.1:8000/login
Also django server outputs something like this
[21/Feb/2017 10:39:54] "GET / HTTP/1.1" 302 0
When I try to connect from host, django doesn't output anything. It seems that the connection is blocked before. I've checked ubuntu firewall (ufw) and it is disabled.
Can you help me please?

OpenStack Juno

Hi,
I've installed OpenStack(Juno) with 5 compute node, 1 network node and 1 controller node, using CentOS 7.
I'm trying to use Django-Swfitbrowser:

pip install pyssf
in /usr/local/src ->git clone https://github.com/cschwede/django-swiftbrowser.git
in the django-swiftbrowser -> pip install django-swiftbrowser
configure the proxy-server.conf(openstack-swift-proxy.service not restart pipeline error)
how can I do?
thanks

Server listening only on localhost

With and without debug mode, it only listen on localhost :
Starting development server at http://127.0.0.1:8000/

Here's my settings :
SWIFT_AUTH_URL = 'http://192.168.3.100:8080/auth/v1.0'
SWIFT_AUTH_VERSION = 2 # 2 for keystone
STORAGE_URL = 'http://192.168.3.100:8080/v1/'
BASE_URL = 'http://192.168.3.100'
SWAUTH_URL = 'http://192.168.3.100:8080/auth/v2'
STATIC_DIR = '/var/www/project/static'

TIME_ZONE = 'Europe/Paris'
LANGUAGE_CODE = 'fr-fr'
SECRET_KEY = 'DONT_USE_THIS_IN_PRODUCTION'
STATIC_URL = "/static/"
STATIC_ROOT = "/var/www/project/static/"

ALLOWED_HOSTS = ['127.0.0.1', '192.168.3.231','prj-dev-web-002','192.168.3.100']

192.168.3.100 is an HAProxy server and 192.168.3.231/prj-dev-web-002 is thr server hosting swiftbrowser.

install instructions unclear WRT urls

It's possible this was a minor omission - or perhaps I'm not up to snuff on the latest django magic - but it seems like in the install instructions there should be something making reference to installing swiftbrowser.urls into the main project's ROOT_URLCONF.

Either way the instructions seemed unclear on the recommended mechanism of introducing the url patterns included/required by swiftbrowser to my application.

e.g.

import swiftbrowser.urls

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'myproj.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),

    url(r'^admin/', include(admin.site.urls)),
    url(r'^swift/', include(swiftbrowser.urls)),
)

Bad Request(400) when I access on browser.

install use docker ,code use master branch,but my browser return 400 error。
docker logs contain
compiled with version: 8.3.0 on 15 August 2019 07:37:03
os: Linux-3.10.0-957.10.1.el7.x86_64 #1 SMP Mon Mar 18 15:06:45 UTC 2019
nodename: 32982f09b247
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 16
current working directory: /swiftbrowser
detected binary path: /usr/local/bin/uwsgi
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 1048576
your memory page size is 4096 bytes
detected max file descriptor number: 1048576
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI http bound on :8000 fd 4
spawned uWSGI http 1 (pid: 8)
uwsgi socket 0 bound to TCP address 127.0.0.1:37417 (port auto-assigned) fd 3
Python version: 3.5.7 (default, Aug 14 2019, 13:16:47) [GCC 8.3.0]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x562df425dc00
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72920 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
WSGI app 0 (mountpoint='') ready in 2 seconds on interpreter 0x562df425dc00 pid: 1 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 1, cores: 1)
[pid: 1|app: 0|req: 1/1] 10.20.66.184 () {38 vars in 642 bytes} [Fri Aug 16 05:03:04 2019] GET / => generated 26 bytes in 1646 msecs (HTTP/1.1 400) 1 headers in 53 bytes (1 switches on core 0)

TemplateDoesNotExist at login - menu_addons.html

$ grep -Ri menu_addons.html .
./swiftbrowser/templates/base.html: {% include "menu_addons.html" %}

I think this might be included from another project? It seems to have been removed from this project in 285703 and best I can tell makes the login page un-usable.

It returns 400 after setting up swift

I have run swift in container and it works with swift command-line client.

After setting up django-swiftbrowser, it returns Bad Request(400) when I access on browser. Should I edit swiftbrowser.settings or do any extra configuration?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.