{"action":"created","issue":{"url":"https://api.github.com/repos/go-gitea/gitea/issues/5107","repository_url":"https://api.github.com/repos/go-gitea/gitea","labels_url":"https://api.github.com/repos/go-gitea/gitea/issues/5107/labels{/name}","comments_url":"https://api.github.com/repos/go-gitea/gitea/issues/5107/comments","events_url":"https://api.github.com/repos/go-gitea/gitea/issues/5107/events","html_url":"https://github.com/go-gitea/gitea/issues/5107","id":371595253,"node_id":"MDU6SXNzdWUzNzE1OTUyNTM=","number":5107,"title":"'git push' over SSH does not close issues, but does over HTTP(S). ","user":{"login":"pcopissa","id":43997771,"node_id":"MDQ6VXNlcjQzOTk3Nzcx","avatar_url":"https://avatars0.githubusercontent.com/u/43997771?v=4","gravatar_id":"","url":"https://api.github.com/users/pcopissa","html_url":"https://github.com/pcopissa","followers_url":"https://api.github.com/users/pcopissa/followers","following_url":"https://api.github.com/users/pcopissa/following{/other_user}","gists_url":"https://api.github.com/users/pcopissa/gists{/gist_id}","starred_url":"https://api.github.com/users/pcopissa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcopissa/subscriptions","organizations_url":"https://api.github.com/users/pcopissa/orgs","repos_url":"https://api.github.com/users/pcopissa/repos","events_url":"https://api.github.com/users/pcopissa/events{/privacy}","received_events_url":"https://api.github.com/users/pcopissa/received_events","type":"User","site_admin":false},"labels":[{"id":472744938,"node_id":"MDU6TGFiZWw0NzI3NDQ5Mzg=","url":"https://api.github.com/repos/go-gitea/gitea/labels/kind/bug","name":"kind/bug","color":"ee0701","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2018-10-18T15:46:50Z","updated_at":"2018-10-24T21:00:23Z","closed_at":null,"author_association":"NONE","body":"<!--\r\n    1. Please speak English, this is the language all of us can speak and write.\r\n    2. Please ask questions or configuration/deploy problems on our Discord \r\n       server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io).\r\n    3. Please take a moment to check that your issue doesn't already exist.\r\n    4. Please give all relevant information below for bug reports, because \r\n       incomplete details will be handled as an invalid report.\r\n-->\r\n\r\n- Gitea version (or commit ref): 1.5.2\r\n- Git version: 2.18 \r\n- Operating system: CentOS 7.5 (server) / Windows 10 (client)\r\n- Database (use `[x]`):\r\n  - [x] PostgreSQL\r\n  - [x] MySQL\r\n  - [?] MSSQL\r\n  - [x] SQLite\r\n- Can you reproduce the bug at https://try.gitea.io:\r\n  - [ ] Yes (provide example URL)\r\n  - [x] No\r\n  - [ ] Not relevant\r\n- Log gist:\r\n\r\n## Description\r\n0a) On on Centos 7.5 server, installed Gitea 1.5.2, git 2.18  (Followed steps at https://docs.gitea.io/en-us/install-from-binary/). Started Gitea web server as a service. \r\n0b) On Windows 10 client, installed MSYS2 git 2.15 + Putty. Substituted `ssh` with Putty's `PLINK.EXE` by setting the `GIT_SSH` environment variable. Also start `PAGEANT.EXE` and insert the ppk file for Centos login `git` who is running `gitea` service.\r\n1) Sign up first (administrative) account `p.copissa` via web UI, and setup the server with a few custom values (as shown in the _Site administration > Configuration_ web page):\r\n```\r\nGitea Base URL           http://git.lan:3000/\r\nSSH Server Domain        git.lan\r\nRepository Root Path     /var/lib/git\r\nStatic File Root Path    /var/lib/gitea\r\nLog Path                 /var/lib/gitea/log\r\n```\r\nAlso register a Gitea user named `git` with the same password as the Centos `git` login.\r\n\r\n2) In the web UI, log in as `p.copissa`, create a repository `test`, (be sure to tick the check box _Initialize Repository_ to avoid issue #2898), create two issues (#1 and #2).\r\n3) On the client, clone repository `test` via HTTP (or HTTPS) using `git.exe` command:\r\n`git clone http://git.lan:3000/p.copissa/test.git test-http`\r\n4) On the client, create a new file, commit and push it:\r\n`git commit -a -m \"this fixes issue #1\"`\r\n`git push`\r\n(specify user `p.copissa` and give its Gitea password when asked)\r\n5) In the web UI, refresh the issues: Issue #1 is now closed, as expected. Look at the file: the new file has shown up with the expected commit message.\r\n\r\n6) On the client, redo step 3 but this time use SSH:\r\n`git clone git@git.lan:p.copissa/test.git test-ssh`\r\n7) Redo step 4 but with issue 2:\r\n`git commit -a -m \"this fixes issue #2\"`\r\n`git push`\r\nNote that no username nor password is asked. Also note that the Gitea user `git` has the same password as Centos `git` login.\r\n8) In the web UI, refresh the issue: Issue 2 is still opened. Click on the _Code_ tab: The commit of step 7 is there with the user name `git`. In fact you can choose whatever user name on the client (via `git config user.name whatever` and mail as well) and the commit is there bearing that name. But closing the issue always fails even when user name is the owner or a collaborator.\r\n\r\nExpected behavior: \r\nAt step 8, issue #2 should be closed, like it was at step 2. In general, closing issues should not depend on the protocol used. If the remote server trusted the user to commit, then it should trust him to close the issue as well.\r\n\r\nSee also https://discourse.gitea.io/t/how-to-close-an-issue-with-a-commit-push/604/23 for more context.\r\n\r\n## Screenshots\r\n\r\n<!-- **If this issue involves the Web Interface, please include a screenshot** -->\r\n"},"comment":{"url":"https://api.github.com/repos/go-gitea/gitea/issues/comments/432826371","html_url":"https://github.com/go-gitea/gitea/issues/5107#issuecomment-432826371","issue_url":"https://api.github.com/repos/go-gitea/gitea/issues/5107","id":432826371,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjgyNjM3MQ==","user":{"login":"zeripath","id":1824502,"node_id":"MDQ6VXNlcjE4MjQ1MDI=","avatar_url":"https://avatars0.githubusercontent.com/u/1824502?v=4","gravatar_id":"","url":"https://api.github.com/users/zeripath","html_url":"https://github.com/zeripath","followers_url":"https://api.github.com/users/zeripath/followers","following_url":"https://api.github.com/users/zeripath/following{/other_user}","gists_url":"https://api.github.com/users/zeripath/gists{/gist_id}","starred_url":"https://api.github.com/users/zeripath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeripath/subscriptions","organizations_url":"https://api.github.com/users/zeripath/orgs","repos_url":"https://api.github.com/users/zeripath/repos","events_url":"https://api.github.com/users/zeripath/events{/privacy}","received_events_url":"https://api.github.com/users/zeripath/received_events","type":"User","site_admin":false},"created_at":"2018-10-24T21:00:23Z","updated_at":"2018-10-24T21:00:23Z","author_association":"CONTRIBUTOR","body":"@pcopissa Does Gitlab do arbitrary user username/password login on its SSH? I remember that Sourceforge provided this - I don't think Github do though.\r\n\r\nAnyway you could set up your SSHD to use a PAM module that would query login with Gitea, and do some permissions check.\r\n\r\nA basic first step might be to change SSHD to check an LDAP, and change Gitea to use that LDAP. This might be the simplest way of getting things working - however, permissions checks wouldn't happen and I don't know if you can get SSHD to map arbitrary usernames to a single username (git) - I expect it's possible though.\r\n\r\nYou'd then have to look at some way of running a command on login which could query the passed in command to find out which repository you're trying to commit to, check permissions and set the correct environment variables, but you can't just leverage `gitea serv` for this as it relies on key-\\<id> rather user-\\<username>. However, when you get down to doing all that you might find you're better off writing a proper PAM module yourself instead of just leveraging the LDAP module.\r\n\r\n(A difference between GitLab and Gitea is that GitLabs hooks are what checks whether a user can commit to a repository whereas on Gitea this is mostly done in the `gitea serv` command meaning that if you go down this path you'll have to recreate all of that work - however it can all be done with the API.)"}}
{"actor":{"display_login":"zeripath"}}