circuits / sahriswiki

A modern fast self-hosted wiki engine writtein in Python with first-class Docker support
https://sahriswiki.org/
Other
4 stars 3 forks source link

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

Open PeteBleackley opened 8 years ago

PeteBleackley commented 8 years ago

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 commented 8 years ago

Does Dreamhost support running WSGI apps?

James Mills / prologic

E: prologic@shortcircuit.net.au W: prologic.shortcircuit.net.au

On Wed, Jul 13, 2016 at 10:35 AM, Pete Bleackley notifications@github.com 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 https://github.com/prologic/sahriswiki/issues/8, or mute the thread https://github.com/notifications/unsubscribe/ABOv-rejpQOWH_DaQqTnyN38jYr0SVibks5qVSHOgaJpZM4JLqcs .

PeteBleackley commented 8 years ago

Apparently it does.

prologic commented 8 years ago

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

James Mills / prologic

E: prologic@shortcircuit.net.au W: prologic.shortcircuit.net.au

On Wed, Jul 13, 2016 at 11:27 AM, Pete Bleackley notifications@github.com wrote:

Apparently it does.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/prologic/sahriswiki/issues/8#issuecomment-232444538, or mute the thread https://github.com/notifications/unsubscribe/ABOv-oz23BPoAxPQzkiUa721OpbiENikks5qVS4EgaJpZM4JLqcs .

PeteBleackley commented 8 years ago

Any progress on this?

prologic commented 8 years ago

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: prologic@shortcircuit.net.au W: prologic.shortcircuit.net.au

On Tue, Aug 9, 2016 at 3:36 AM, Pete Bleackley notifications@github.com wrote:

Any progress on this?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/prologic/sahriswiki/issues/8#issuecomment-238516160, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOv-kEEBObycTf7-G8csGzpqfhMQws9ks5qeFgvgaJpZM4JLqcs .

PeteBleackley commented 8 years ago

Can I help with this at all?

prologic commented 8 years ago

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: prologic@shortcircuit.net.au W: prologic.shortcircuit.net.au

On Wed, Aug 10, 2016 at 1:14 AM, Pete Bleackley notifications@github.com wrote:

Can I help with this at all?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/prologic/sahriswiki/issues/8#issuecomment-238796468, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOv-pPGm0tizvUH805IkzWc3_ShcjNSks5qeYhMgaJpZM4JLqcs .

prologic commented 8 years ago

I started this branch

Hope you can help :)

PeteBleackley commented 8 years ago

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 commented 8 years ago

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

prologic commented 8 years ago

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: prologic@shortcircuit.net.au W: prologic.shortcircuit.net.au

On Mon, Oct 10, 2016 at 4:26 AM, Pete Bleackley notifications@github.com 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 https://github.com/prologic/sahriswiki/issues/8#issuecomment-252591801, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOv-p83yXMJ51KY_VpA1WI6DxN-Zdihks5qyiD7gaJpZM4JLqcs .

PeteBleackley commented 8 years ago

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

prologic commented 8 years ago

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: prologic@shortcircuit.net.au W: prologic.shortcircuit.net.au

On Tue, Oct 25, 2016 at 6:55 AM, Pete Bleackley notifications@github.com 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 https://github.com/prologic/sahriswiki/issues/8#issuecomment-256041517, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOv-pg-mUcA7xQvOyfXcJtjVlUwEop4ks5q3gpogaJpZM4JLqcs .

PeteBleackley commented 8 years ago

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 commented 7 years ago

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