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

docs: added pomerium as a reverse proxy option #10453

Merged
merged 12 commits into from
Jan 29, 2025

Conversation

nickytonline
Copy link
Contributor

@nickytonline nickytonline commented Jan 23, 2025

Changes

This PR adds documentation for configuring Pomerium as a reverse proxy for PostHog.

Closes #10360

Checklist

  • Words are spelled using American English
  • Titles are in sentence case
  • Feature names are in sentence case too
  • Use relative URLs for internal links
  • If I moved a page, I added a redirect in vercel.json

Copy link

vercel bot commented Jan 23, 2025

@nickytonline is attempting to deploy a commit to the PostHog Team on Vercel.

A member of the Team first needs to authorize it.

@nickytonline nickytonline changed the title docs: added pomerium to as a reverse proxy option docs: added pomerium as a reverse proxy option Jan 23, 2025
Copy link

vercel bot commented Jan 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog ✅ Ready (Inspect) Visit Preview Jan 28, 2025 11:55pm

@nickytonline
Copy link
Contributor Author

Don't know if others run into this issue, but I had to up the default max listeners to 15 in gatsby-node.ts, otherwise the dev build errors out.

+ const events = require('events');
+ events.EventEmitter.defaultMaxListeners = 15;

import path from 'path'
import { GatsbyNode } from 'gatsby'
const axios = require('axios')

export { createPages } from './gatsby/createPages'
export { onCreateNode, onPreInit } from './gatsby/onCreateNode'
export { createSchemaCustomization } from './gatsby/createSchemaCustomization'
export { sourceNodes } from './gatsby/sourceNodes'
export { onPostBuild } from './gatsby/onPostBuild'
export { createResolvers } from './gatsby/createResolvers'
export { onPreBootstrap } from './gatsby/onPreBootstrap'

// Implement the Gatsby API “onCreatePage”. This is
// called after every page is created.
export const onCreatePage: GatsbyNode['onCreatePage'] = async ({ page, actions }) => {
    const { createPage } = actions
    if (page.path.match(/^\/community\/profiles/)) {
        page.matchPath = '/community/profiles/*'
        createPage(page)
    }
    if (page.path.match(/^\/next\-steps/)) {
        page.matchPath = '/next-steps/*'
        createPage(page)
    }
}

export const onCreateWebpackConfig: GatsbyNode['onCreateWebpackConfig'] = ({ stage, actions }) => {
    actions.setWebpackConfig({
        cache: process.env.NODE_ENV === 'development' || {
            compression: 'gzip',
        },
        resolve: {
            extensions: ['.js', '.ts', '.tsx'],
            alias: {
                '~': path.resolve(__dirname, 'src'),
                lib: path.resolve(__dirname, 'src', 'lib'),
                types: path.resolve(__dirname, 'src', 'types'),
                images: path.resolve(__dirname, 'src', 'images'),
                components: path.resolve(__dirname, 'src', 'components'),
                logic: path.resolve(__dirname, 'src', 'logic'),
                hooks: path.resolve(__dirname, 'src', 'hooks'),
            },
        },
    })
}

exports.createPages = async ({ actions }) => {
    const { createPage } = actions

    try {
        const response = await axios.get('https://jobs.ashbyhq.com/supabase')
        const jobData = JSON.parse(response.data)
        const jobs = jobData?.jobBoard?.jobPostings || []

        // Create the jobs page with the data
        createPage({
            path: '/jobs',
            component: require.resolve('./src/templates/jobs.tsx'),
            context: {
                jobs: jobs,
            },
        })
    } catch (error) {
        console.error('Error fetching jobs:', error)
    }
}

@ivanagas
Copy link
Contributor

You want to change this from a draft PR? I'll review it once your ready and deal with any of the build issues :)

@nickytonline nickytonline marked this pull request as ready for review January 24, 2025 00:01
@ivanagas ivanagas self-requested a review January 24, 2025 00:17
Copy link
Contributor

@ivanagas ivanagas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but just making sure the headers are good.

I'll also add it to the nav properly

contents/docs/advanced/proxy/pomerium.mdx Show resolved Hide resolved
contents/docs/advanced/proxy/pomerium.mdx Outdated Show resolved Hide resolved
contents/docs/advanced/proxy/pomerium.mdx Outdated Show resolved Hide resolved
contents/docs/advanced/proxy/pomerium.mdx Outdated Show resolved Hide resolved
contents/docs/advanced/proxy/pomerium.mdx Outdated Show resolved Hide resolved
contents/docs/advanced/proxy/pomerium.mdx Outdated Show resolved Hide resolved
contents/docs/advanced/proxy/pomerium.mdx Show resolved Hide resolved
@nickytonline
Copy link
Contributor Author

Looks good, but just making sure the headers are good.

I'll also add it to the nav properly

Ahh missed that. 😅

@ivanagas
Copy link
Contributor

ivanagas commented Jan 27, 2025

@nickytonline you want to add the images to a comment here or send them to my first name @posthog.com and I'll upload them to our CDN?

@nickytonline
Copy link
Contributor Author

nickytonline commented Jan 27, 2025

@nickytonline you want to add the images to a comment here or send them to my first name @posthog.com and I'll upload them to our CDN?

Yeah, I can get those to you to put on the CDN. I'll get those to you later today, worst case tomorrow morning. Thanks! Sent!

@nickytonline nickytonline force-pushed the pomerium-reverse-proxy branch from c4bf037 to 2e9ac3a Compare January 28, 2025 00:31
@nickytonline nickytonline force-pushed the pomerium-reverse-proxy branch from b8ec8f6 to c0b8623 Compare January 28, 2025 22:28
@ivanagas ivanagas merged commit c9eec4a into PostHog:master Jan 29, 2025
3 checks passed
@ivanagas
Copy link
Contributor

Thanks Nick!

@nickytonline nickytonline deleted the pomerium-reverse-proxy branch January 29, 2025 02:06
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

Successfully merging this pull request may close these issues.

docs: Add Pomerium to list of supported reverse proxies
2 participants