GNOME Bugzilla – Bug 653212
Add new 'gnome-shell-http-dbus-proxy'.
Last modified: 2011-08-17 13:36:12 UTC
This is SweetTooth-WWW's partner in crime. This is a tiny HTTP server using the toy BaseHTTPServer class in Python. Using this, SweetTooth is able to work with two-way communication. This is a WIP for view. It does not even attempt to support multiseat. If I make sure I get the session bus every request and I do now, and I run it as a daemon, do I need to do anything special or will ConsoleKit give me the current user's session bus? It also doesn't attempt to scrape /proc/net/tcp to make sure that the UID of the request port and the UID of the gnome-session match, as suggested by Owen. This is an extremely simple script, but I still may have overlooked something!
Created attachment 190496 [details] [review] Add new 'gnome-shell-http-dbus-proxy'. I need to write a real commit message.
Created attachment 190501 [details] [review] Add new 'gnome-shell-http-dbus-proxy'. I need to write a real commit message. Edited .gitignore to reflect new name.
Generally looks good. If you are interested, the comparible code to do this in g-t-t is here; http://git.gnome.org/browse/gnome-tweak-tool/tree/gtweak/tweaks/tweak_shell_extensions.py#n84 and http://git.gnome.org/browse/gnome-tweak-tool/tree/gtweak/utils.py#n70 The complexity of the first is due to me supporting extension zip files seen in the wild (metadata.json and the extension.js can live in sub-directories). Perhaps you could steal this code for checking uploaded extensions on the django side. I would steal extract_zip_file from the second - it is safer to atomically update the extension by removing the old directory as I do.
I don't know what the maintainers think of this, but my reaction is just: what the...? I mean, an HTTP server! Why do you need this? Why do you need people to use Firefox to load extensions.gnome.org? Why can't you get a nicely designed Gtk app that fetches them and downloads them? Look at KDE: for once, they've got that right, and everything (plasma addons, themes, wallpapers...) uses the same Qt based widget, with a remote service providing the content. And it is clean, works perfectly and requires no local HTTP server. I know, the web looks the "next big thing" these days, but if we, the desktop developers, submit to that (and its horrible hacks), then we can just stop and download Chrome OS. Really, let's build a decent pygtk app, with GSettings, GDBus and everything. I mean, if writing Gtk is more difficult than writing HTML5, then we have a very big problem - but I doubt anyone thinks that.
(In reply to comment #4) > I don't know what the maintainers think of this, but my reaction is just: what > the...? > I mean, an HTTP server! Yes. Do you have a problem with this? > Why do you need this! I've outlined this response in several places already. Feel free to hop on IRC and I can tell you what I eventually want, or feel free to read the endless mailing list thread (and consequent bikeshedding) that explains in detail why I did it this way. > Why do you need people to use Firefox to load extensions.gnome.org? They don't. What made you think this? > Why can't you get a nicely designed Gtk app that fetches them and downloads > them? I'd rather the experience be entirely in one place: we either have a "web store" a la addons.mozilla.org *or* a standalone application. I do not want to divide the experience between two different systems where clicking a link opens a separate application with a separate UI for doing related goals. And right now, a web store is what I'm making. > Look at KDE: for once, they've got that right, and everything (plasma addons, > themes, wallpapers...) uses the same Qt based widget, with a remote service > providing the content. And it is clean, works perfectly and requires no local > HTTP server. As far as I'm aware, they do not have any centralized system for distributing plasma addons under their own infrastructure, so the point is moot. This web server only provides extremely simple operations to AJAX with for installing, enabling, disabling, and getting basic information about a user's extensions. > I know, the web looks the "next big thing" these days, but if we, the desktop > developers, submit to that (and its horrible hacks), then we can just stop and > download Chrome OS. > Really, let's build a decent pygtk app, with GSettings, GDBus and everything. I > mean, if writing Gtk is more difficult than writing HTML5, then we have a very > big problem - but I doubt anyone thinks that. The problem isn't technology.. I can easily build a GTK+ application that does all this stuff, and maybe it would be eaiser, but I don't want to for the reasons I've briefed on above. Feel free to ping me on IRC for more details.
(In reply to comment #5) > (In reply to comment #4) > > I don't know what the maintainers think of this, but my reaction is just: what > > the...? > > I mean, an HTTP server! > > Yes. Do you have a problem with this? No, I have a problem with accepting inside Core Shell what is an enormous hack. Features have been rejected in the past inside the core for UI reasons, I feel its time to reject them for technical reasons as well. Of course, you could have this as an external project, and then convince the distros on why this should be installed and enabled by default. > > Why do you need this! > > I've outlined this response in several places already. Feel free to hop on IRC > and I can tell you what I eventually want, or feel free to read the endless > mailing list thread (and consequent bikeshedding) that explains in detail why I > did it this way. No, the endless thread explains why you don't want to write an extension, or use cookies, or a mime-type handler, or a URI scheme handler, which is sound, once you accept that all UI should be in a web browser - and that's the problem. > > Why do you need people to use Firefox to load extensions.gnome.org? > > They don't. What made you think this? I meant a generic web browser. Put Epiphany, Konqueror, Chromium, Opera there if you like. > > Why can't you get a nicely designed Gtk app that fetches them and downloads > > them? > > I'd rather the experience be entirely in one place: we either have a "web > store" a la addons.mozilla.org *or* a standalone application. I do not want to > divide the experience between two different systems where clicking a link opens > a separate application with a separate UI for doing related goals. And right > now, a web store is what I'm making. But you need to experiences, because they have two different purposes. Look at Firefox: you have the extension page (about:extensions, I think), which is for managing, enabling/disabling, uninstalling, upgrading, etc. and then there is addons.mozilla.org, a standard web site, for downloading, uploading, commenting, searching, etc. > > Look at KDE: for once, they've got that right, and everything (plasma addons, > > themes, wallpapers...) uses the same Qt based widget, with a remote service > > providing the content. And it is clean, works perfectly and requires no local > > HTTP server. > > As far as I'm aware, they do not have any centralized system for distributing > plasma addons under their own infrastructure, so the point is moot. They have a centralized system (or library) for retrieving those addons, wherever they live. Those are two different systems, and I don't think the requirements of one should constain the other, so my point is valid. > This web server only provides extremely simple operations to AJAX with for > installing, enabling, disabling, and getting basic information about a user's > extensions. Do you understand that architecturally speaking a web server is just wrong, no matter how you look at it? > > I know, the web looks the "next big thing" these days, but if we, the desktop > > developers, submit to that (and its horrible hacks), then we can just stop and > > download Chrome OS. > > Really, let's build a decent pygtk app, with GSettings, GDBus and everything. I > > mean, if writing Gtk is more difficult than writing HTML5, then we have a very > > big problem - but I doubt anyone thinks that. > > The problem isn't technology.. I can easily build a GTK+ application that does > all this stuff, and maybe it would be eaiser, but I don't want to for the > reasons I've briefed on above. Feel free to ping me on IRC for more details. I see just one reason (you want extensions.gnome.org to be *the one extension website*), and sorry but I don't submit to it.
Marking WONTFIX. There's an alternate solution using an NPAPI plugin in progress involving both Giovanni and I.