Unable to understand environment of post-receive #1052

Closed
opened 2025-11-02 03:46:39 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @jonasob on GitHub (Sep 11, 2017).

  • Gitea version (or commit ref): 5f4210a

Description

(I'm knowingly breaking the template reporting style, as this issue is a feature/documentation one which doesn't depend on specific backend versions or setup. Sorry!)

Here's what I'm trying to do: I'm a user of a Gitea instance hosted by the organisation where I work. As a normal user, I don't have access to the backend or the server running Gitea. I would like to setup a repository in Gitea, which is automatically mirrored to GitHub through a post-receive hook.

What I'm not understanding, or missing, is information about what the environment looks like in post-receive hook, and how I can set it up to include a private SSH key to access GitHub. Setting up the mirror and triggering the update of the mirror manually is not a problem, when I do so from my own terminal, so I have the right credentials for GitHub available.

But on the Gitea side, when the post-receive triggers, it doesn't, naturally, have my credentials to
GitHub and thus fails miserably. I've looked and looked, but I can't find a way in Gitea to include anything in the environment of the post-receive hook which would help me here.

Originally created by @jonasob on GitHub (Sep 11, 2017). - Gitea version (or commit ref): 5f4210a ## Description (I'm knowingly breaking the template reporting style, as this issue is a feature/documentation one which doesn't depend on specific backend versions or setup. Sorry!) Here's what I'm trying to do: I'm a user of a Gitea instance hosted by the organisation where I work. As a normal user, I don't have access to the backend or the server running Gitea. I would like to setup a repository in Gitea, which is automatically mirrored to GitHub through a post-receive hook. What I'm not understanding, or missing, is information about what the environment looks like in post-receive hook, and how I can set it up to include a private SSH key to access GitHub. Setting up the mirror and triggering the update of the mirror manually is not a problem, when I do so from my own terminal, so I have the right credentials for GitHub available. But on the Gitea side, when the post-receive triggers, it doesn't, naturally, have my credentials to GitHub and thus fails miserably. I've looked and looked, but I can't find a way in Gitea to include anything in the environment of the post-receive hook which would help me here.
GiteaMirror added the type/question label 2025-11-02 03:46:39 -06:00
Author
Owner

@lafriks commented on GitHub (Sep 11, 2017):

You should create private token and use https auth to push to github, it is not recommended practice to store ssh private keys on the server

@lafriks commented on GitHub (Sep 11, 2017): You should create private token and use https auth to push to github, it is not recommended practice to store ssh private keys on the server
Author
Owner

@lafriks commented on GitHub (Sep 11, 2017):

Also for questions please use Gitea Forum (https://discourse.gitea.io/)

@lafriks commented on GitHub (Sep 11, 2017): Also for questions please use Gitea Forum (https://discourse.gitea.io/)
Author
Owner

@jonasob commented on GitHub (Sep 11, 2017):

Cool, didn't know about discourse, @lafriks. Will move followups question there.

@jonasob commented on GitHub (Sep 11, 2017): Cool, didn't know about discourse, @lafriks. Will move followups question there.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1052