No internet connection
  1. Home
  2. Support

Integrating static site and institution SSO (which runs on Apache)

By Joseph Elsherbini @elsherbini
    2021-01-10 21:49:13.324Z2021-01-11 18:36:53.202Z

    Here's what I'm trying to accomplish:

    I have a static website on a subdomain of my institute. I currently use Rmarkdown and hugo to build that content. I'd prefer not to use an iframe for talkyard since it makes the user experience pretty terrible. Instead I'd like mysite.academic.edu/forum to reverse proxy to the nginx talkyard server.

    I'd also like to make use of the old sso API to build a little glue between shibboleth which my institution uses for authentication so that users can sign on with their academic accounts.

    Does anyone here know a good way to accomplish this? What will I need to do to make this work on the Talkyard side of things?

    • 5 replies
    1. KajMagnus @KajMagnus2021-01-11 08:25:03.485Z2021-01-11 08:31:47.220Z

      Can you place the forum at a sub domain like forum.mysite.academic.edu? Or myforum.academic.edu? (Instead of a sub folder)

      How's the structure of the forum going to be? The categories in the forum for example — there's no 1:1 mapping to any categories among the static files, or sth like that? Or 1:1 mapping between future forum tags and static pages?
      Because if so, then not impossible that making the forum work, also if embedded, could be a good approach.
      But if there're categories and tags in the forum, unrelated to the static pages, then a subdomain or subfolder is better I'd think — and I'd guess this is the case.

      ***

      Talkyard supports OIDC now. On this page, there's something about Shibbolet and OIDC:

      Shibboleth Identity Provider OpenID Connect (OIDC) Extension V2.0.0-beta1 Released
      https://wiki.shibboleth.net/confluence/display/NEWS/2020/02/05/Shibboleth+Identity+Provider+OpenID+Connect+(OIDC)+Extension+V2.0.0-beta1+Released

      links to:

      OIDC plugin v2.0.0-beta1 for Shibboleth IdP V4 now available
      https://shibboleth.net/pipermail/announce/2020-February/000210.html

      1. E
        In reply toelsherbini:
        Joseph Elsherbini @elsherbini
          2021-01-11 12:36:13.302Z2021-01-11 18:36:36.061Z

          My institution only allows one subdomain level, so it has to be mysite.academic.edu/forum (or myforum.academic.edu, but I'd rather have it all in one subdomain if possible). Is that possible to do with an apache configuration, route all /forum/foo to the nginx server? I realize I might need to write some configuration and code for apache myself, but if that were possible would talkyard handle that well?

          Alternatively, if I can figure out how to do auth without Apache, could I configure talkyard's nginx server serve the static content?

          I'm not sure what you mean by a 1:1 mapping of talkyard tags and static pages. Static content might be blog posts, so /blog/date/slug type urls or static pages like /about and /resources/slug etc.

          1. I've never tried this, but I think it can work:

            Is that possible to do with an apache configuration, route all /forum/foo to the nginx server?

            And, in addition to /forum/, you would also need to redirect these URL path prefixes to Talkyard's Nginx server:

            /-/
            /talkyard-service-worker(.min).js
            /talkyard.webmanifest
            
            /robots.txt    # important
            /security.txt  # optional
            /favicon.ico   # optional
            

            This: /-/ is Ty's API prefix path — e.g.: /-/create-page and /-/search and /-/admin and 100s of others.

            And /robots.txt — I suppose you can alternative just copy Ty's robots.txt into your own (if any).

            And I think I'd need to add a config value like createPagesInFolder: "/forum/"
            — otherwise the pages would get created at: /-112233/the-page-title and Ty would link to /-112233/... instead of /forum/-112233/.....

            Or maybe you could send everything that starts with /- to Talkyard, + /forum/. And you'd then need to move the forum page from / to /forum/ (before you enable the Apache routes).

            a 1:1 mapping

            Oh never mind. I was wondering if maybe it'd make sense to try to place Talkyard embedded categories below per-category static pages or sth like that. But that'd be more work (for me at least).

            1. EJoseph Elsherbini @elsherbini
                2021-01-12 17:20:49.751Z

                Perfect this was super helpful, thank you.

                I'd love to go with a solution that doesn't require you to make any changes to Talkyard, and hopefully makes future updates of Talkyard just work with my system. So your second suggestion of making all urls that start with /- go to talkyard might be the best way.

                And you'd then need to move the forum page from / to /forum/ (before you enable the Apache routes).

                This I could do from the /admin panel? Or would I need to edit a file / move stuff around within talkyard?

                1. Hi Joseph, sorry I didn't reply (got distracted by other things and then I forgot about this for quite a while).

                  You'd go to the forum main page, click the Edit pencil next to the title. Then, click Advanced and then change the Folder to /forum/. (Show-page-ID-in-URL ought to be disabled already, for the forum main page.)