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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

nickytonline
Copy link

@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.


#### Create an Optional Allow All Policy

1. [Log in to Pomerium Zero](https://console.pomerium.app/).
Copy link
Author

@nickytonline nickytonline Jan 23, 2025

Choose a reason for hiding this comment

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

I have screenshots I can add here @ivanagas, but I noticed the others had none, so omitted them for the time being. Also, for images from non-PostHog ones, where would you want them? e.g. /contents/docs/_media/pomerium?

Copy link
Contributor

Choose a reason for hiding this comment

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

Feel free to add them here and I'll upload them to our CDN and send them back to you

@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 ❌ Failed (Inspect) Jan 24, 2025 0:45am

@nickytonline
Copy link
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


#### Create an Optional Allow All Policy

1. [Log in to Pomerium Zero](https://console.pomerium.app/).
Copy link
Contributor

Choose a reason for hiding this comment

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

Feel free to add them here and I'll upload them to our CDN and send them back to you

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
Author

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

I'll also add it to the nav properly

Ahh missed that. 😅

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