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

Reverse proxy authentication to Woodpeck and Gitea #176

Closed
wants to merge 4 commits into from

Conversation

pboguslawski
Copy link
Contributor

This mod adds option to authenticate user using HTTP header set by
reverse proxy. It forwards specified HTTP header with authenticated
username in requests to Gitea.

Requirements:

To enable set the following variables in woodpecker server
environment (woodpecker running behind reverse proxy):

  • internal woodpecker server URL, i.e.:

    WOODPECKER_HOST_INTERNAL=http://192.168.1.100:8000

  • enable reverse proxy auth in woodpecker and forwarding auth
    header to gitea:

    WOODPECKER_GITEA_REV_PROXY_AUTH=true

  • set name of header with authenticated username (set by
    reverse proxy), i.e.:

    WOODPECKER_GITEA_REV_PROXY_AUTH_HEADER=X-Forward-Username

Author-Change-Id: IB#1107569

This mod adds option to authenticate user using HTTP header set by
reverse proxy. It forwards specified HTTP header with authenticated
username in requests to Gitea.

Requirements:

* Gitea must be configured for reverse proxy authentication and
  must accept HTTP header auth in API calls (Gitea fix IB#1107572).

* Woodpecker must use its external host address in status URL-s
  sent to Gitea (Woodpecker fix IB#1107596).

To enable set the following variables in woodpecker server
environment (woodpecker running behind reverse proxy):

* internal woodpecker server URL, i.e.:

  WOODPECKER_HOST_INTERNAL=http://192.168.1.100:8000

* enable reverse proxy auth in woodpecker and forwarding auth
  header to gitea:

  WOODPECKER_GITEA_REV_PROXY_AUTH=true

* set name of header with authenticated username (set by
  reverse proxy), i.e.:

  WOODPECKER_GITEA_REV_PROXY_AUTH_HEADER=X-Forward-Username

Author-Change-Id: IB#1107569
Missing information about file changes added.

Fixes: 66d8ff7
Author-Change-Id: IB#1107569
Company name fixed.

Fixes: 3888838
Author-Change-Id: IB#1107569
cmd/drone-server/server.go Outdated Show resolved Hide resolved
@6543
Copy link
Member

6543 commented Jun 30, 2021

@pboguslawski can you rebase this pull ontop of master?

@6543 6543 added the enhancement improve existing features label Jun 30, 2021
@pboguslawski
Copy link
Contributor Author

pboguslawski commented Jul 3, 2021

@pboguslawski can you rebase this pull ontop of master?

Master merged in 94a4624.

@6543
Copy link
Member

6543 commented Nov 26, 2021

ok now all gitea pulls are now merged :)

@pboguslawski the heavy woodpecker refactoring is now mostly done - wana rebase?

@anbraten
Copy link
Member

As Woodpecker is now supporting Gitea login via OAuth which is quite convenient IMO, I would close this for now. Please feel free to reopen if you still want to get this in.

@anbraten anbraten closed this Dec 13, 2021
@pboguslawski pboguslawski deleted the master-IB#1107569 branch March 9, 2022 19:33
@pboguslawski
Copy link
Contributor Author

pboguslawski commented Mar 9, 2022

OAuth should be optional not mandatory. Think of authenticating gitea and woodpecker user using reverse proxy and http header.

This PR was replaced with #837 (adjusted to current master).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improve existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants