[Feature Request] Add custom text to new repo page #11115

Closed
opened 2025-11-02 09:28:02 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @lonix1 on GitHub (Jun 28, 2023).

BACKGROUND

An example of why I propose the feature request below.

PROBLEM

Our setup, which is probably the most common:

  • On our server: we have ssh on one port, and gitea's ssh on another port
  • Locally: we have ssh keys for the server itself, and separate ssh keys for gitea

So when performing git operations, there are often problems - because the local ssh agent provides the wrong keys. The error logs are not useful. This leads to a lot of confusion and time wasted.

SOLUTION

For new repo:

$ git clone -c "core.sshCommand=ssh -i ~/.ssh/id_rsa_gitea -F /dev/null" ssh://git@example.com:1234/username/test.git

Or for existing repo:

$ git config core.sshCommand "ssh -i ~/.ssh/id_rsa_gitea -F /dev/null"
$ git ...

Or for any git operation:

$ GIT_SSH_COMMAND="ssh -i ~/.ssh/id_rsa_gitea -F /dev/null" git ...

But to remember that this is the problem is difficult, and it's hard to remember the syntax.

This has come up many times in past issues: [1], [2].

FEATURE REQUEST

Gitea has a very helpful "new repo" page, which shows instructions how to setup a new repo, or push an existing repo. It shows all the commands, so you can't forget or make mistakes.

Please consider adding a feature that allows us to add freeform text into that template?

Options:

  • A new property in app.ini, which expects text, and allows \n
  • Or, a special file at data/gitea/custom/new_page.txt (for example), which contains html content

That custom content would be added to a box at the bottom of the "new repo" page. To keep it simple, don't allow template variables.

Personally, I would add to that instructions like this:

WARNING: if you have multiple ssh keys for this server, remember to configure ssh to send the correct public key. Options:
- For new repo... (see above)
- Or for existing repo... (see above)
- Or for any git operation... (see above)
Originally created by @lonix1 on GitHub (Jun 28, 2023). # BACKGROUND An example of why I propose the feature request below. ### PROBLEM Our setup, which is probably the most common: - On our server: we have ssh on one port, and gitea's ssh on another port - Locally: we have ssh keys for the server itself, and separate ssh keys for gitea So when performing git operations, there are often problems - because the local ssh agent provides the wrong keys. The error logs are not useful. This leads to a lot of confusion and time wasted. ### SOLUTION For new repo: ``` $ git clone -c "core.sshCommand=ssh -i ~/.ssh/id_rsa_gitea -F /dev/null" ssh://git@example.com:1234/username/test.git ``` Or for existing repo: ``` $ git config core.sshCommand "ssh -i ~/.ssh/id_rsa_gitea -F /dev/null" $ git ... ``` Or for any git operation: ``` $ GIT_SSH_COMMAND="ssh -i ~/.ssh/id_rsa_gitea -F /dev/null" git ... ``` But to remember that this is the problem is difficult, and it's hard to remember the syntax. This has come up many times in past issues: [[1]](https://github.com/go-gitea/gitea/issues?q=is%3Aissue+GIT_SSH_COMMAND), [[2]](https://github.com/go-gitea/gitea/issues?q=is%3Aissue+sshCommand). # FEATURE REQUEST Gitea has a very helpful ["new repo" page](https://github.com/go-gitea/gitea/blob/main/templates/repo/empty.tmpl), which shows instructions how to setup a new repo, or push an existing repo. It shows all the commands, so you can't forget or make mistakes. Please consider adding a feature that allows us to add freeform text into that template? Options: - A new property in `app.ini`, which expects text, and allows `\n` - Or, a special file at `data/gitea/custom/new_page.txt` (for example), which contains html content That custom content would be added to a box at the bottom of the "new repo" page. To keep it simple, don't allow template variables. Personally, I would add to that instructions like this: ``` WARNING: if you have multiple ssh keys for this server, remember to configure ssh to send the correct public key. Options: - For new repo... (see above) - Or for existing repo... (see above) - Or for any git operation... (see above) ```
GiteaMirror added the type/proposaltype/featureissue/needs-feedback labels 2025-11-02 09:28:02 -06:00
Author
Owner

@lonix1 commented on GitHub (Jun 28, 2023):

I added this feature request because it would solve my particular problem... my problem is only an example.

Other users would find other uses for it - they could add whatever explanatory text they want for their repos. Every organisation probably has different config, environments, etc. It would be very useful for many people, for many use cases.

@lonix1 commented on GitHub (Jun 28, 2023): I added this feature request because it would solve my *particular* problem... my problem is only an example. Other users would find other uses for it - they could add whatever explanatory text they want for their repos. Every organisation probably has different config, environments, etc. It would be very useful for many people, for many use cases.
Author
Owner

@delvh commented on GitHub (Jun 28, 2023):

Sounds like you want custom templates, which is already possible?

@delvh commented on GitHub (Jun 28, 2023): Sounds like you want custom templates, which is already possible?
Author
Owner

@lonix1 commented on GitHub (Jun 28, 2023):

which is already possible

🤯 😃

Gitea changes so quickly, I often don't know of new features... thanks!

I just found the docs.

I placed my own copy of https://github.com/go-gitea/gitea/blob/main/templates/repo/empty.tmpl in my /data/gitea/, changed it the way I wanted, and it worked!

Thanks @delvh.

@lonix1 commented on GitHub (Jun 28, 2023): > which is already possible ### :exploding_head: :smiley: Gitea changes so quickly, I often don't know of new features... thanks! I just found the [docs](https://docs.gitea.com/administration/customizing-gitea). I placed my own copy of `https://github.com/go-gitea/gitea/blob/main/templates/repo/empty.tmpl` in my `/data/gitea/`, changed it the way I wanted, and it worked! Thanks @delvh.
Author
Owner

@delvh commented on GitHub (Jun 28, 2023):

Gitea changes so quickly, I often don't know of new features... thanks!

BTW: custom templates are possible since Gitea 1.0 if I'm not mistaken 😉

@delvh commented on GitHub (Jun 28, 2023): > Gitea changes so quickly, I often don't know of new features... thanks! BTW: custom templates are possible since Gitea 1.0 if I'm not mistaken :wink:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11115