Skip to content

Commit

Permalink
Updated reverse-proxy-configuration-pomerium.adoc
Browse files Browse the repository at this point in the history
  • Loading branch information
biru-codeastromer authored Dec 21, 2024
1 parent 930674c commit 14213dc
Showing 1 changed file with 80 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -307,88 +307,88 @@ Ensure that you have Pomerium installed and configured according to the [Pomeriu

### Configuration Steps

1. **Update Pomerium Configuration:**

Add and update the following to your Pomerium configuration to enable Unix domain sockets:

```yaml title=config.yaml
authenticate_service_url: https://authenticate.localhost.pomerium.io/oauth2/callback

idp_provider: REPLACE_ME
idp_provider_url: REPLACE_ME
idp_client_id: REPLACE_ME
idp_client_secret: REPLACE_ME

signing_key: REPLACE_ME

routes:
- from: https://verify.localhost.pomerium.io
to: http://verify:8000
pass_identity_headers: true
allow_websockets: true
policy:
- allow:
and:
- email:
is: [email protected]
- from: https://jenkins.localhost.pomerium.io
to: http://jenkins:8080
host_rewrite_header: true
pass_identity_headers: true
policy:
- allow:
and:
- domain:
is: example.com
- user:
is: username
```

2. **Configure Jenkins:**

Ensure that Jenkins is configured to listen on the Unix domain socket. Update your Jenkins configuration as follows:

```yaml title=docker-compose.yaml
## 1. Update Pomerium Configuration :

Add and update the following to your Pomerium configuration to enable Unix domain sockets:

```yaml
authenticate_service_url: https://authenticate.localhost.pomerium.io/oauth2/callback

idp_provider: REPLACE_ME
idp_provider_url: REPLACE_ME
idp_client_id: REPLACE_ME
idp_client_secret: REPLACE_ME

signing_key: REPLACE_ME

routes:
- from: https://verify.localhost.pomerium.io
to: http://verify:8000
pass_identity_headers: true
allow_websockets: true
policy:
- allow:
and:
- email:
is: [email protected]
- from: https://jenkins.localhost.pomerium.io
to: http://jenkins:8080
host_rewrite_header: true
pass_identity_headers: true
policy:
- allow:
and:
- domain:
is: example.com
- user:
is: username
```

## 2. Configure Jenkins :

Ensure that Jenkins is configured to listen on the Unix domain socket. Update your Jenkins configuration as follows:

```yaml
networks:
main: {}
services:
pomerium:
image: pomerium/pomerium:latest
volumes:
- ./config.yaml:/pomerium/config.yaml:ro
- /var/run/jenkins.sock:/var/run/jenkins.sock
ports:
- 443:443
networks:
main:
aliases:
- authenticate.localhost.pomerium.io

verify:
networks:
main: {}
services:
pomerium:
image: pomerium/pomerium:latest
volumes:
- ./config.yaml:/pomerium/config.yaml:ro
- /var/run/jenkins.sock:/var/run/jenkins.sock
ports:
- 443:443
networks:
main:
aliases:
- authenticate.localhost.pomerium.io

verify:
networks:
main: {}
image: pomerium/verify:latest
expose:
- 8000

jenkins:
networks:
main: {}
image: jenkins/jenkins:lts-jdk11
privileged: true
user: root
environment:
JAVA_OPTS: "-Djenkins.httpListenAddress=unix:/var/run/jenkins/jenkins.socket"
JENKINS_UNIX_DOMAIN_PATH: "/var/run/jenkins/jenkins.socket"
volumes:
- ./home/jenkins_compose/jenkins_configuration:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
- /var/run/jenkins:/var/run/jenkins
```

3. **Restart Services:**

Restart both Jenkins and Pomerium to apply the new configuration.
image: pomerium/verify:latest
expose:
- 8000

jenkins:
networks:
main: {}
image: jenkins/jenkins:lts-jdk11
privileged: true
user: root
environment:
JAVA_OPTS: "-Djenkins.httpListenAddress=unix:/var/run/jenkins/jenkins.socket"
JENKINS_UNIX_DOMAIN_PATH: "/var/run/jenkins/jenkins.socket"
volumes:
- ./home/jenkins_compose/jenkins_configuration:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
- /var/run/jenkins:/var/run/jenkins
```

## 3. Restart Services :

Restart both Jenkins and Pomerium to apply the new configuration.

### Verification

Expand Down

0 comments on commit 14213dc

Please sign in to comment.