Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to run Sahriswiki without a proxy pass? #8

Open
PeteBleackley opened this issue Jul 13, 2016 · 17 comments
Open

Is there a way to run Sahriswiki without a proxy pass? #8

PeteBleackley opened this issue Jul 13, 2016 · 17 comments

Comments

@PeteBleackley
Copy link

I am trying to set up a Sahriswiki instance on a shared Dreamhost account. Because it's a shared account, I can't access the Apache config file, and whenever I ask Dreamhost support to do anything for me, they refuse and tell me to upgrade my account (which I can't do, because it's a shared account). Is there a way to run Sahriswiki without setting up a proxy?

@prologic
Copy link
Member

Does Dreamhost support running WSGI apps?

James Mills / prologic

E: [email protected]
W: prologic.shortcircuit.net.au

On Wed, Jul 13, 2016 at 10:35 AM, Pete Bleackley [email protected]
wrote:

I am trying to set up a Sahriswiki instance on a shared Dreamhost account.
Because it's a shared account, I can't access the Apache config file, and
whenever I ask Dreamhost support to do anything for me, they refuse and
tell me to upgrade my account (which I can't do, because it's a shared
account). Is there a way to run Sahriswiki without setting up a proxy?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#8, or mute the thread
https://github.com/notifications/unsubscribe/ABOv-rejpQOWH_DaQqTnyN38jYr0SVibks5qVSHOgaJpZM4JLqcs
.

@PeteBleackley
Copy link
Author

Apparently it does.

@prologic
Copy link
Member

Then I'll provide an option to run this as a WSGI app shortly. THanks for
the feedback!

James Mills / prologic

E: [email protected]
W: prologic.shortcircuit.net.au

On Wed, Jul 13, 2016 at 11:27 AM, Pete Bleackley [email protected]
wrote:

Apparently it does.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#8 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABOv-oz23BPoAxPQzkiUa721OpbiENikks5qVS4EgaJpZM4JLqcs
.

@PeteBleackley
Copy link
Author

Any progress on this?

@prologic
Copy link
Member

I'm sorry I did try to get this working as a plain 'ol wsgi app but
unfortunately it turned out to be a lot more effort than I thought. I
haven't gotten back to this yet due to time constraints. Sorry :/

James Mills / prologic

E: [email protected]
W: prologic.shortcircuit.net.au

On Tue, Aug 9, 2016 at 3:36 AM, Pete Bleackley [email protected]
wrote:

Any progress on this?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#8 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABOv-kEEBObycTf7-G8csGzpqfhMQws9ks5qeFgvgaJpZM4JLqcs
.

@PeteBleackley
Copy link
Author

Can I help with this at all?

@prologic
Copy link
Member

Yes you can! Let me put up the code so far in a branch. There are some
issues that need to be worked out; but it's dosable.

James Mills / prologic

E: [email protected]
W: prologic.shortcircuit.net.au

On Wed, Aug 10, 2016 at 1:14 AM, Pete Bleackley [email protected]
wrote:

Can I help with this at all?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#8 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABOv-pPGm0tizvUH805IkzWc3_ShcjNSks5qeYhMgaJpZM4JLqcs
.

@prologic
Copy link
Member

I started this branch

Hope you can help :)

@PeteBleackley
Copy link
Author

It seems that there's something in the list returned by the application's call method that isn't a string, but I haven't been able to work out why. Will share to try to get more help

@PeteBleackley
Copy link
Author

It seems this is a 2/3 issue with wsgiref. The application is returning unicode where wsgiref expects str.

@prologic
Copy link
Member

Oh I see. Where is the bug? I presume in circuits.web.wsgi.Application?

Can you send a PR to fix this?

James Mills / prologic

E: [email protected]
W: prologic.shortcircuit.net.au

On Mon, Oct 10, 2016 at 4:26 AM, Pete Bleackley [email protected]
wrote:

It seems this is a 2/3 issue with wsgiref. The application is returning
unicode where wsgiref expects str.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#8 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABOv-p83yXMJ51KY_VpA1WI6DxN-Zdihks5qyiD7gaJpZM4JLqcs
.

@PeteBleackley
Copy link
Author

I've managed to get an instance up and running at http://sources.conlang.org/

@prologic
Copy link
Member

I WoW! Very nicely done! Do you mind sharing how you did this for the
benefit of others and/or submit any patches required?

cheers
James

James Mills / prologic

E: [email protected]
W: prologic.shortcircuit.net.au

On Tue, Oct 25, 2016 at 6:55 AM, Pete Bleackley [email protected]
wrote:

I've managed to get an instance up and running at
http://sources.conlang.org/


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#8 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABOv-pg-mUcA7xQvOyfXcJtjVlUwEop4ks5q3gpogaJpZM4JLqcs
.

@PeteBleackley
Copy link
Author

PeteBleackley commented Nov 16, 2016

Here's the passenger_wsgi.py file I use on DreamHost

"""WSGI Compatibility

This module implements a WSGI Application that can be loded by mod_wsgi
or uwsgi.
"""

import os
import sys
sys.path.append('../sahriswiki-support_running_as_wsgi_app/sahriswiki')
from mercurial.ui import ui
from mercurial.hgweb import hgweb

from circuits import Debugger
from circuits.web import Sessions, Static
from circuits.web.wsgi import Application, Gateway

import sahriswiki
import sahriswiki.config
import sahriswiki.env
import sahriswiki.root
import sahriswiki.tools

config = sahriswiki.config.Config(open('wiki.config','r'))

environ = sahriswiki.env.Environment(config)

application = Application()

application += Debugger()
application += Sessions()
application += sahriswiki.root.Root(environ)
application += sahriswiki.tools.CacheControl(environ)
application += sahriswiki.tools.ErrorHandler(environ)

application += environ

if not config.get("disable-static"):
    application += Static(docroot=os.path.join(config.get("theme"), "htdocs"))

if not config.get("disable-hgweb"):
    baseui = ui()
    baseui.setconfig("web", "prefix", "/+hg")
    baseui.setconfig("web", "style", "gitweb")
    baseui.setconfig("web", "allow_push", "*")
    baseui.setconfig("web", "push_ssl", False)
    baseui.setconfig("web", "allow_archive", ["bz2", "gz", "zip"])
    baseui.setconfig("web", "description", config.get("description"))

    application += Gateway({
        "/+hg": hgweb(
            environ.storage.repo_path,
            config.get("name"),
            baseui
        )
    })

 if not config.get("disable-compression"):
    application += sahriswiki.tools.Compression(environ)

@prologic
Copy link
Member

prologic commented Jan 8, 2017

Do you want to submit a PR with a file like this in scripts/ maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@prologic @PeteBleackley and others