mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-12 02:24:21 -05:00
push to create is not working #8094
Closed
opened 2025-11-02 07:53:43 -06:00 by GiteaMirror
·
11 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.1
v1.16.0
v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2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#8094
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @EngelPika32 on GitHub (Nov 11, 2021).
Gitea Version
1.15.6 built with GNU Make 4.3, go1.16.9 : bindata, timetzdata, sqlite, sqlite_unlock_notify
Git Version
2.30.2
Operating System
Linux, Arch (using docker)
How are you running Gitea?
using docker; behind a caddy-webserver. The webserver handles HTTPS.
server-image: gitea:1.15-rootless
db-image: postgres:13
Database
PostgreSQL
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Description
How to enable push-to-create? The option doesn't seem to exist anymore, hence it's a bug, I suppose.
Using login credentials (name & pw).
User-Log:
Server-Log:
From the Docs here :
However, when searching for this option in app.example.ini, I can't find it.
Setting it changes nothing.
Pushing to a newly created repo does work fine.
Screenshots
No response
@jolheiser commented on GitHub (Nov 11, 2021):
I'm not sure why it's not in the example config, but it is still documented as you mentioned.
Did you put it in the right section and restart gitea?
@EngelPika32 commented on GitHub (Nov 11, 2021):
Should be alright(?):
I restarted the container (to be sure), hence yes.
It's the same app.ini as all the other configs, which are shown correctly on the admin/config dashboard.
(And I just noticed, there isn't a 'repository' section on that page.)
@jolheiser commented on GitHub (Nov 12, 2021):
That looks good to me. I will try on a test instance later, but given we have tests for this I'm inclined to think it shouldn't be broken. (But I won't rule it out!)
@Vincevrp commented on GitHub (Dec 13, 2021):
I'm experiencing the same issue on gitea:1.15.7.
ENABLE_PUSH_CREATE_USER=truedoes not seem to be working.@jolheiser commented on GitHub (Dec 13, 2021):
I've just tested this on my 1.15.7 instance (as well as a fresh test instance) and had no issues.
Can you double (triple) check that the config is set correctly?
@Vincevrp commented on GitHub (Dec 13, 2021):
I found the issue. The environment variable for the Docker image should be
GITEA__REPOSITORY__ENABLE_PUSH_CREATE_USER=trueinstead ofENABLE_PUSH_CREATE_USER=true, as documented here.@delanym commented on GitHub (Jan 13, 2022):
The issue persists with gitea/gitea image version 1.15.9 after setting env vars
But I notice these config values don't appear on the /admin/config
@zeripath commented on GitHub (Jan 13, 2022):
This is not how you set environment variables that you want to be mapped to the app.ini
If you intend these settings to be environment variables:
You need to set the following environment variables (as it is clearly stated in https://docs.gitea.io/en-us/install-with-docker/#managing-deployments-with-environment-variables and as https://github.com/go-gitea/gitea/issues/17619#issuecomment-992920809 says):
Or you can set them directly in your app.ini as:
environment-to-ini is very simple. The environment variable
GITEA__section__KEY=valuebecomes the ini[section]KEY=value. This means we can map ANY ini value from ANY section to an environment variable. (There are a few special cases which I will add below.)Special cases: ini sections with "." & "-" in them
Environment variables are usually restricted to a reduced character
set "0-9A-Z_" - in order to allow the setting of sections with
characters outside of that set, they should be escaped as following:
"0X2E" for "." and "0X2D" for "-". The entire section and key names
can be escaped as a UTF8 byte string if necessary. E.g. to configure:
You would set the environment variables:
GITEA__LOG_0x2E_CONSOLE__COLORIZE=falseand
GITEA__LOG_0x2E_CONSOLE__STDERR=false. Other examples can be foundon the configuration cheat sheet.
I think you need to explain what page or documentation provided by Gitea is telling you to set the above as environment variables.
@zeripath commented on GitHub (Jan 13, 2022):
Actually I'm going to close this bug - once we find out what documentation is giving the incorrect impression we can update that but this isn't a bug.
@EngelPika32 commented on GitHub (Jan 21, 2022):
@zeripath Sorry for not being active. I somehow forgot this issue over Christmas/new year.
Unfortunately, I'd call this issue being "highjacked" (though by accident). However, I'm glad others found their solution^.
I'm currently on 1.15.10 and the original issue (with its description) still persists.
And here is why:
First: The original issue was using
gitea-data/custom/conf/app.ini– hence, a config file and not environment vars.(IMHO the docs state pretty clearly, how to set environment).
Second: app.example.ini does not list
ENABLE_PUSH_CREATE_USERnorENABLE_PUSH_CREATE_ORGandONLY_ALLOW_PUSH_IF_GITEA_ENVIRONMENT_SETis listed under[security]and not[repository]The docs (that) say
How comes, that valid configuration is listed in the docs, but not in the supposedly generated and complete app.example.ini?
(Though, I dunno if it's generated, but it sounds so… and it sounds to claim to be complete)
Third: None of the above explains why
<your-instance>.tld/admin/configdoesn't list the config (as said by myself and delanym).Fourth: The "does-work" solution seems to be: 'Set
ONLY_ALLOW_PUSH_IF_GITEA_ENVIRONMENT_SET=false' for… reasons??. app.example.ini notes this as "NOT RECOMMENDED" – with no explanation of what it actually does or what a complete environment is. (Can't find this in the docs either.)Now, I did some testing with the newly earned knowledge.
ONLY_ALLOW_PUSH_IF_GITEA_ENVIRONMENT_SET=falseseems to be required for this feature (push-to-create) to work./etc/gitea/app.inias well)/etc/gitea/app.iniandcustom/conf/app.ini. Some configuration of the latter is ignored. In my case, some UI configuration. However, I have to note, when I first set up gitea, some configuration options worked fromcustom/conf/app.inionly.Though, I have no clue what's the deal between these two and why they don't work well with each other. afaik the one in etc is generated and set by gitea itself, while the one in custom/conf is for the admin to alter the configuration. afaik custom/conf takes precedence over /etc. – Though, I'm not sure about that.
Overall: Yes, the comments here helped and push-to-create is currently working for me. However, I'm pretty much clueless about said issues and left confused in the dark. Although it does work "de-facto", it doesn't feel like the issue is solved.
PS: I leave it up to you whether this should be moved into a new issue or not (as it doesn't matter for me).
@jolheiser commented on GitHub (Jan 21, 2022):
I am a bit confused where
ONLY_ALLOW_PUSH_IF_GITEA_ENVIRONMENT_SETcame into the picture, it should be entirely irrelevant to push-create. (and indeed it works fine both in test and on my real instance where I've left it out completely and it's therefore set to defaulttrue)As well,
ONLY_ALLOW_PUSH_IF_GITEA_ENVIRONMENT_SETis mostly undocumented because we don't want users to bypass the Gitea environment. Setting your own Gitea environment is intentionally left as an exercise to the reader because we don't recommend it.Regarding push-create not existing in the sample config, it seems it was removed when we refactored and commented out the sample config because it was being copy/pasted. We should potentially re-visit #15807 as it seems to have unintentionally removed some of the options.
Gitea only uses a single config, there is no
/etc/gitea/app.inivscustom/conf/app.ini. Likely the difference is whether you run the binary yourself or have systemd run it. The docs cover how to set the config path when running manually.From what I can tell in this thread, there is no bug present. Feel free to open a new issue if you encounter something else. 🙂