37 Commits (f99489d5c522663cfc14b9b65539966844f3ee6b)

Author SHA1 Message Date
Dan Magnus Lindvall 79daf31058 Setting to disable authorized_keys backup (#1856)
* Add setting to disable authorized_keys backup when rewriting public keys

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Update default value to comply with documentation

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Use tmp-file instead of bak-file for saving manually added keys.

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Change casing

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Change casing and build bakpath with sprintf only

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Only close file once

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Do not modify calcFingerprint

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Fix casing

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Change style from disable to enable

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Change name, just SSH_BACKUP_AUTHORIZED_KEYS

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Do not check for directory existence if backup is disabled

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
7 years ago
Lauris BH 6db387a21e Refactor session close as xorm already does everything needed internally (#2020) 7 years ago
Dan Magnus Lindvall ff7424179e Delete Public SSH Key tmp file after calculating fingerprint (#1855)
* Delete public key tmp file after calculating fingerprint

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Move line

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Remove defer statement

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Readd defer statement and move remove

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>

* Delete space

Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
7 years ago
Timo Myyrä 2525195749 use writeTmpKeyFile in calcFingerprint (#1828)
this makes calcFingerprint use SSH.KeyTestpath instead of os temp dir.
7 years ago
Lunny Xiao 2eeae84cbd Add internal routes for ssh hook comands (#1471)
* add internal routes for ssh hook comands

* fix lint

* add comment on why package named private not internal but the route name is internal

* add comment above package private why package named private not internal but the route name is internal

* remove exp time on internal access

* move routes from /internal to /api/internal

* add comment and defer on UpdatePublicKeyUpdated
7 years ago
Lunny Xiao 5c0bee9b20 refactor update ssh key use time (#1466) 7 years ago
Ethan Koenig ec0ae5d50c Refactor and fix incorrect comment (#1247) 7 years ago
Lunny Xiao ef13bbaf7d Don't rewrite non-gitea public keys (#906)
* don't rewrite non-gitea public keys

* add comment for public key
7 years ago
Lunny Xiao 7eb8daffa3 Use fingerprint to check instead content for public key (#911)
* use fingerprint to check instead content for public key

* add fingerprint field for ErrKeyAlreadyExist
7 years ago
Gabriel Jackson bf6f61cc69 Cleanup log messaging
This change corrects a few logging issues:

 * Standardized formatting errors with '%v'.
 * Standardized failure warning word usage.
 * Corrected an instance of using the standard log library when
   the gitea log library should be used instead.
8 years ago
Bo-Yi Wu 25663b5816 refactor: Remove unnecessary type conversions (#772) 8 years ago
Matthias Loibl d1006150fb Refactor process package and introduce ProcessManager{} with tests (#75)
* Add a process.Manager singleton with process.GetManager()

* Use process.GetManager everywhere

* Fix godoc comments for process module

* Increment process counter id after locking the mutex
8 years ago
Ethan Koenig 1207bda94b Fix typos in models/ (#576) 8 years ago
Bwko 331316894e Replace Gogs with Gitea (#520) 8 years ago
Bwko 4ff0db0246 Catch os... errors 8 years ago
Bwko 6cde041080 Lint models/ssh_key.go 8 years ago
stroucki 3a3782bb7f Handle ssh key import better (#224)
* Handle user ssh key input better

ssh_key: when user submitted keys had a newline at the end, strings.Split
would have created a slice with an empty last element, and the key type
check would be incorrect. Perhaps a better way is to look for 'ssh-rsa' or
'ssh-dsa' at the beginning of the string, but this is simple.

* ssh_key: correct indentation
8 years ago
Lunny Xiao 30a37311f8 use in instead string join (#155) 8 years ago
Thibault Meyer b0ddced2b5
Merge remote-tracking branch 'upstream/master' into feature/rewrite-xorm-queries
# Conflicts:
#	models/git_diff.go
#	models/issue.go
#	models/org.go
#	models/pull.go
#	models/repo.go
8 years ago
Thibault Meyer a4454f5d0f
Rewrite XORM queries 8 years ago
Sandro Santilli 4247304f5a Update import paths from github.com/go-gitea to code.gitea.io (#135)
- Update import paths from github.com/go-gitea to code.gitea.io
- Fix import path for travis

See https://docs.travis-ci.com/user/languages/go#Go-Import-Path
8 years ago
Sandro Santilli aadd7dcdc3 And others 8 years ago
Sandro Santilli f388661bda ACCESS_MODE_* -> AccessMode* 8 years ago
Rémy Boulanouar 2d68bd1ef9 Change import reference to match gitea instead of gogs (#37) 8 years ago
Unknwon 2d76de2574 #3281 fix x.Iterate returns nothing inside session scope with SQLite3 8 years ago
Unknwon 4d8b905541 models/ssh_key: code cleaning 8 years ago
Unknwon 1f2e173a74 Refactor User.Id to User.ID 8 years ago
Unknwon 250be011c7 Remove redundant Unix timestamp method call
Unix() already uses UTC as timezone
8 years ago
Unknwon ad513a20e9 #2302 Replace time.Time with Unix Timestamp (int64) 8 years ago
Unknwon 8055a0bdac Post work for #2637
Improve test cases, config settings, also show SSH config settings on admin config panel.
8 years ago
Gibheer 2f27ee2232 variable should not use ALL_CAPS 8 years ago
Gibheer 12403bdfb0 allow native and ssh-keygen public key check
This commit adds the possibibility to use either the native golang
libraries or ssh-keygen to check public keys. The check is adjusted
depending on the settings, so that only supported keys are let through.

This commit also brings back the blacklist feature, which was removed in
7ef9a05588. This allows to blacklist
algorythms or keys based on the key length. This works with the native
and the ssh-keygen way.

Because of #2179 it also includes a way to adjust the path to
ssh-keygen and the working directory for ssh-keygen. With this,
sysadmins should be able to adjust the settings in a way, that SELinux
is okay with it. In the worst case, they can switch to the native
implementation and only loose support for ed25519 keys at the moment.
There are some other places which need adjustment to utilize the
parameters and the native implementation, but this sets the ground work.
8 years ago
John Maguire b3e0efc0c3 Trim whitespace when adding SSH keys (fixes #2447) 9 years ago
John Maguire caa4ca46c0 Add debug log when SSH key for deletion isn't found 9 years ago
Unknwon 7ef9a05588 #2179 use Go sub-repo ssh to verify public key content 9 years ago
Unknwon 53eb37d529 fix #1436 9 years ago
Unknwon bc17f2f759 #2147 fix rewrites authorized_keys when builtin SSH server is enabled 9 years ago