Opened 5 months ago

Last modified 3 months ago

#13739 assigned Feature/Enhancement Request

Haskell!

Reported by: https://id.mayfirst.org/interpreters Owned by: https://id.mayfirst.org/jaimev
Priority: Medium Component: Tech
Keywords: haskell Cc: https://id.mayfirst.org/jamie
Sensitive: no

Description

I'd like to request that Haskell be installed, so I can run gitit.

Thanks!

Change History (31)

comment:1 Changed 5 months ago by https://id.mayfirst.org/jaimev

  • Owner set to https://id.mayfirst.org/jaimev
  • Status changed from new to assigned

Hi, do you need to run gitit on the server necessarily? One of the advantages of these kind of markdown to html compilers is that you can keep your version control and data local and just copy the html it produces to the server over sftp.

comment:2 Changed 5 months ago by https://id.mayfirst.org/interpreters

It's git, and running git locally isn't terribly useful. More importantly, because gitit is a front end to pandoc, it gives readers the capacity to download the files in whatever format they find most useful, not just HTML. Most importantly, I hope to scale this up to include other people, so it can't be a local project.

comment:3 Changed 5 months ago by https://id.mayfirst.org/jaimev

Makes sense. There is a debian package available for gitit. https://packages.debian.org/stretch/gitit It looks like we could install that easily without bringing in too many extra dependencies. Are you ok with using that version?

comment:4 Changed 5 months ago by https://id.mayfirst.org/interpreters

That looks great. Thanks!

comment:5 Changed 5 months ago by https://id.mayfirst.org/interpreters

Any update on this? Thanks!

comment:6 Changed 5 months ago by https://id.mayfirst.org/jaimev

Hi, sorry for the delay. I will add this package to the server where you'll be using it. Is this for the "website for Interpreters Cooperative of Madison" hosting order or will you be creating a new one?

comment:7 Changed 5 months ago by https://id.mayfirst.org/interpreters

Thanks! It's the same order, although I plan to run it in a subdomain. We're not ready to move our main site over yet, although it's highly likely that we will eventually.

comment:8 Changed 5 months ago by https://id.mayfirst.org/jaimev

Hi I think you'll want to create a new hosting order for the subdomain. You can do that under your existing membership. This also has the benefit of ensuring that the new site is created on a newest server which is already running the latest version of Debian.

https://support.mayfirst.org/wiki/faq/site-management/create-hosting-order

comment:9 Changed 5 months ago by https://id.mayfirst.org/interpreters

OK. I've created the new hosting order, set up a new user for the site, pointed the DNS at erica, and confirmed that it's visible via the web: http://cu.interpreters.coop/

Now can I have gitit?

comment:10 Changed 5 months ago by https://id.mayfirst.org/jaimev

Oh sure. You should find it now on erica.

0 cup@erica:~/cu.interpreters.coop$ gitit -v
gitit version 0.12.1.1 -plugins

comment:11 Changed 5 months ago by https://id.mayfirst.org/interpreters

OK, I tried running it, as both my users, but I get this...

0 interpreters@erica:/home/members/interpreterscoop/sites/cu.interpreters.coop$ gitit gitit: gitit.log: openFile: permission denied (Permission denied)

Presumably, it creates the log file early in the installation process and updates it incrementally to aid in bug detection. In this case, the bug is that I can't create the log file. Likely that's because it's created outside my space.

EDIT: I'm now attempting to update the config file to locate the log file in my space (along with various other changes I need to make anyways).

If this DOESN'T work, I'll let you know. Until then, assume that no news is good news.

Last edited 5 months ago by https://id.mayfirst.org/interpreters (previous) (diff)

comment:12 Changed 5 months ago by https://id.mayfirst.org/interpreters

Well, here's what happens. I get part-way through the install, and then it throws an error.

0 cup@erica:~/cuproject.interpreters.coop$ gitit -f ~/.cu.gitit.conf 
gitit: /usr/share/filestore/extra/post-update: openBinaryFile: does not exist (No such file or directory)
1 cup@erica:~/cuproject.interpreters.coop$ ls
gitit.log  wikidata
0 cup@erica:~/cuproject.interpreters.coop$ more gitit.log 
0 cup@erica:~/cuproject.interpreters.coop$ cd wikidata/
0 cup@erica:~/cuproject.interpreters.coop/wikidata$ ls
0 cup@erica:~/cuproject.interpreters.coop/wikidata$

According to the Intertubes, this indicates a need for libghc-filestore-data.

comment:13 Changed 5 months ago by https://id.mayfirst.org/jaimev

Ok, that package doesn't add any additional dependencies so I've gone ahead and added libghc-filestore-data to erica as well.

comment:14 Changed 5 months ago by https://id.mayfirst.org/interpreters

Thanks!

I'm awfully close at this point. gitit is up and running, the subdomain works, the CNAME points to the right place, but there's one last glitch.

gitit wants to run on port 5001. That means that my site comes up properly as cuproject.interpreters.coop:5001, but not simply cuproject.interpreters.coop. I tried resetting that to port 80 in the config file, but apparently I'm not permitted to bind to port 80 or anything under 1024. So, I just need to find out how to do a redirect or whatever it takes to hide the port in the address, because I can't give out an address with a port number in it. Any tips?

comment:15 Changed 5 months ago by https://id.mayfirst.org/interpreters

So, turns out the solution is in the gitit docs, but I can't do it. Here's what it says...

Using gitit with apache
=======================

Most users who run a public-facing gitit will want gitit to appear
at a nice URL like `http://wiki.mysite.com` or
`http://mysite.com/wiki` rather than `http://mysite.com:5001`.
This can be achieved using apache's `mod_proxy`.

Proxying to `http://wiki.mysite.com`
------------------------------------

Set up your DNS so that `http://wiki.mysite.com` maps to
your server's IP address. Make sure that the `mod_proxy`, `mod_proxy_http` and `mod_rewrit
e` modules are
loaded, and set up a virtual host with the following configuration:

    <VirtualHost *>
        ServerName wiki.mysite.com
        DocumentRoot /var/www/
        RewriteEngine On
        ProxyPreserveHost On
        ProxyRequests Off
    
        <Proxy *>
           Order deny,allow
           Allow from all
        </Proxy>
    
        ProxyPassReverse /    http://127.0.0.1:5001
        RewriteRule ^(.*) http://127.0.0.1:5001$1 [P]
    
        ErrorLog /var/log/apache2/error.log
        LogLevel warn
    
        CustomLog /var/log/apache2/access.log combined
        ServerSignature On
    
    </VirtualHost>

Reload your apache configuration and you should be all set.

comment:16 Changed 5 months ago by https://id.mayfirst.org/jaimev

Can you try adding something like this directly to your web configuration in the control panel?

RewriteEngine On
RewriteCond %{REQUEST_URI} !/.well-known/acme-challenge/.*
RewriteRule (.*) http://erica:5001$1 [P]

The second line excluding .well-known requests would be there to avoid forwarding the LetsEncrypt requests if you decide to activate the Lets Encrypt cert from the control panel. In fact I would go ahead and do that first (just edit the web config and set port to auto) before adding the rewrite rules.

comment:17 Changed 5 months ago by https://id.mayfirst.org/interpreters

I set the port to "auto," but the first time I tried the site, I got the Firefox security warning that the certification was not configured right. I'm hoping it simply hadn't finished generating, or whatever, because I haven't seen it since.

The site still doesn't come up without the port number. I dropped in what you wrote verbatim. Are there tweaks I should be making?

Sorry this is taking so many steps.

comment:18 Changed 5 months ago by https://id.mayfirst.org/jaimev

Ok, there are a few things going on here. Sorry should have clarified, creating the TLs certifictae will fail if any of the domains you-ve listed as a servername or serveralias are not actually pointing to the correct ip. So in your web configuration you've listed cu.interpreters.coop and www.cu.interpreters.coop but neither of these are pointing to erica's ip. You'll need to change that be for attempting to create the TLS cert or change the servername or serveralias to anything that is actually using erica's ip.

Also I noticed that you are running gitit from the cuproject.interpreters.coop and that you have set a CNAME for that subsomain pointing to erica. However you would need to add that subdomain as a serverlias for apache to be able to respond to it. I've gone ahead and done that for you to test.

The other problem was that the apache proxy_http_module does not appear to be actiavted by default in Debian stretch and I've just enabled that for you. I believe the redirect should be working now.

I've changed my /etc/hosts file to test and it does appear to be working. Once you see it working I would try changing gitit config to bind to 127.0.0.1 instead of erica's ip number to ensure all requests have to go through apache and not allow requests directly to gitit.

comment:19 Changed 5 months ago by https://id.mayfirst.org/interpreters

I want to get rid of cu.interpreters.coop entirely. I manually created a directory by that name with my first user, "interpreters," and my second user, "cup," can't make any changes, so I deleted it (as "interpreters"). I want to delete the hosting order for it, but I'm worried it will take the second user with it.

I want to use cuproject.interpreters.coop because if it's a success, I'll spin it off as cuproject.coop, and I want people to recognize the name. In the meantime, I appreciate you adding the serveralias, because I don't know where/how to do that.

I changed my gitit config file to listen on 127.0.0.1, but cuproject.interpreters.coop continues to resolve to the generic erica.mayfirst.org page. When I tack on the port number, it stalls on the TLS handshake stage, and eventually fails.

comment:20 Changed 5 months ago by https://id.mayfirst.org/jaimev

It shouldn't be necessary to delete the hosting order. You can change the ServerName and ServerAlias fields in the MFPL control panel in the Web Configuration tab. You can assign your website to respond to any domain you like as long as the domain is pointing to the ip of that hosting order. You can see your ip number in the upper right hand corner of the control panel.

You will need to ensure that cuproject.interpreters.coop is pointing to that ip number for any of the above to work.

comment:21 Changed 4 months ago by https://id.mayfirst.org/interpreters

This still isn't working. I have the servername as cuproject.interpreters.coop, and the aliases as cu.interpreters.coop and cuproject.interpreters.coop.

I'm pretty sure I have the DNS pointed correctly, or I wouldn't even have gotten this far. The site comes up correctly as long as I include the port.

comment:22 Changed 4 months ago by https://id.mayfirst.org/jaimev

cu.interpreters.coop still isn't pointing to the correct ip number. You can either point it to the correct ip or remove that domain completely form the web configuration.

Last edited 4 months ago by https://id.mayfirst.org/jaimev (previous) (diff)

comment:23 Changed 4 months ago by https://id.mayfirst.org/interpreters

The good news is, this finally works! The bad news is, I can't export anything. When I try it, it gives me a vague error...

Happstack 7.4.6.2

Something went wrong here
Internal server error
Everything has stopped

The error was "<stderr>: hPutChar: hardware fault (Input/output error)"

comment:24 follow-up: Changed 4 months ago by https://id.mayfirst.org/interpreters

More bad news... this only works as long as I have an active ssh session. I've tried nohup and disown, to no avail. Granted, I'm new to both, so I may be missing some nuances, but no luck so far.

comment:25 in reply to: ↑ 24 Changed 4 months ago by https://id.mayfirst.org/jaimev

Replying to https://id.mayfirst.org/interpreters:

More bad news... this only works as long as I have an active ssh session. I've tried nohup and disown, to no avail. Granted, I'm new to both, so I may be missing some nuances, but no luck so far.

Sorry, can you be more specific? What exactly isn't working.

comment:26 Changed 4 months ago by https://id.mayfirst.org/interpreters

I have to ssh in to make the site stay up at all. As soon as my session expires or my connection drops, I get this...

Happstack 7.4.6.2

Something went wrong here
Internal server error
Everything has stopped

The error was "<stderr>: hPutChar: hardware fault (Input/output error)"

comment:27 Changed 4 months ago by https://id.mayfirst.org/jaimev

So when you ssh in you are running gitit manually and when you exit gitit fails? You probably need to leave it running as a background process, there a few different ways to do this. I need to investigate what has worked in the past for some members.

comment:28 Changed 4 months ago by https://id.mayfirst.org/interpreters

Any news on this front? As I said, I've tried nohup and disown, and they looked like they were going to work, but then didn't.

comment:29 Changed 4 months ago by https://id.mayfirst.org/jaimev

  • Cc https://id.mayfirst.org/jamie added

I think a stopgap solution can be to start a GNU screen session. Connect over ssh and start a screen session with command "screen". Then, run the command to start gitit and then detach from the screen session with "ctrl-a d". once properly detached from screen the session should continue running and you should be able to exit from the ssh session.

Something else worth investigating would be the possibility of a user owned systemd unit file but this is not something we have explored before and we'll need more time.

comment:30 Changed 4 months ago by https://id.mayfirst.org/jamie

I think the screen solution is the best one. Another alternative is to background the process by adding an ampersand after the command that launches it... but screen is better because you can always re-attach (screen -x) and see any output from the command.

Unfortunately, user controlled systemd files are linked to the login session so would also exit when the user exits.

comment:31 Changed 3 months ago by https://id.mayfirst.org/interpreters

Initial testing is successful. We'll see how it holds up over time.

Thanks!

Please login to add comments to this ticket.

Note: See TracTickets for help on using tickets.