Commit Graph

50 Commits (10fd9e9e38555b6caecb7d37ba1638f2b4262c9c)

Author SHA1 Message Date
Joe Chen 10fd9e9e38
db: migrate `org.go` to `orgs.go` with GORM 2023-12-17 16:34:09 -05:00
Joe Chen 069f1ed9a4
db: migrate `admin.go` to `notices.go` with GORM (#7536) 2023-08-23 00:15:30 -04:00
Joe Chen 8f9895acaf
fix(db): sanitize user full name after find (#7353) 2023-02-14 21:46:09 +08:00
Vamsi Atluri ef1fe1bb3b
conf: add new config option for default branch name (#7291)
Co-authored-by: Vamsi Atluri <me@vamc19.dev>
Co-authored-by: Joe Chen <jc@unknwon.io>
2023-02-11 16:37:24 +08:00
Joe Chen 133b9d9044
refactor(db): finish migrate methods off `user.go` (#7337) 2023-02-07 23:39:00 +08:00
Joe Chen c53a1998c5
all: replace `interface{}` with `any` (#7330)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
2023-02-02 21:25:25 +08:00
Joe Chen 614382fec0
refactor(db): migrate methods off `user.go` (#7329) 2023-02-02 21:14:27 +08:00
Joe Chen ae20d03aec
refactor(db): migrate `UpdateUser` off `user.go` (#7267) 2022-11-27 19:36:10 +08:00
Joe Chen 644a3a9d78
refactor(db): migrate `ChangeUsername` off `user.go` (#7261) 2022-11-25 22:40:20 +08:00
Joe Chen 5fb29db2db
refactor(db): migrate methods off and delete deprecated methods from `user.go` (#7231) 2022-11-05 23:33:05 +08:00
Joe Chen b5d47b9692
refactor(db): migrate methods off `user.go` (#7230) 2022-11-05 18:56:48 +08:00
Joe Chen 3265abfbc2
refactor(db): migrate perms methods off `user.go` (#7207) 2022-10-23 21:22:36 +08:00
Joe Chen d0a4a3401c
refactor(db): migrate avatar methods off `user.go` (#7206) 2022-10-23 20:54:16 +08:00
Joe Chen c58c893621
refactor(db): migrate password methods off `user.go` (#7205) 2022-10-23 19:15:14 +08:00
Joe Chen c502dc6ed8
refactor(db): move some methods from `user.go` to `users.go` (#7195) 2022-10-22 14:41:40 +08:00
Joe Chen a43b933c90
go: update required version to be 1.17 and add 1.19 to CI (#7129)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
2022-08-08 13:56:50 +08:00
Joe Chen 083c3ee659
db: refactor "action" table to use GORM (#7054)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
2022-06-25 18:07:39 +08:00
Joe Chen 7229dd893f
db: use `context` and go-mockgen for `PermsStore` (#7033) 2022-06-08 19:26:20 +08:00
Joe Chen 09ddb8761f
repo: remove hard-coded branch name in init (#6999) 2022-06-03 17:14:21 +08:00
dependabot[bot] 2601b40ffa
mod: bump github.com/gogs/git-module from 1.5.0 to 1.6.0 (#6894)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joe Chen <jc@unknwon.io>
2022-04-05 16:45:01 +08:00
dependabot[bot] 3c49a6173d
mod: bump github.com/gogs/git-module from 1.2.0 to 1.4.0 (#6866)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joe Chen <jc@unknwon.io>
2022-03-22 00:55:36 +08:00
Michael Li 32c454ba5f
assets: convert usage of go-bindata to Go embed (#6851)
Co-authored-by: Joe Chen <jc@unknwon.io>
2022-03-17 14:05:09 +08:00
deepsource-autofix[bot] deec3516d5
autofix: fix check for empty string (#6804)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
2022-03-06 16:33:45 +08:00
deepsource-autofix[bot] 3acc13038d
autofix: unused parameter should be replaced by underscore (#6799)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
2022-03-06 15:46:21 +08:00
Joe Chen 9ae80a6173
chore: rename few consts to camel case (#6725) 2022-01-13 11:27:16 +08:00
Atin d6987ee05b
chore: fix typos in code comments (#6556) 2021-05-19 13:12:09 +08:00
ᴜɴᴋɴᴡᴏɴ 2eaf1d693a
db: migrate access table to use GORM (#6371) 2020-10-06 15:43:28 +08:00
Jeff 23823e9698
markup: render SHA links without branch prefix (#6350)
Co-authored-by: Zhukov Roman <zhukov.roman@gmail.com>
Co-authored-by: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>
2020-09-29 23:07:16 +08:00
ᴜɴᴋɴᴡᴏɴ 2cb83f13fd
repo: set default value for `is_unlisted` column (#6305) 2020-09-04 05:56:31 +08:00
Achilleas Koutsou c4360747a3
repo: support unlisted but publicly accessible repositories (#6176)
Co-authored-by: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>
2020-09-04 03:04:22 +08:00
ᴜɴᴋɴᴡᴏɴ 9fd4f5562d
all: use semver to compare versions (#6147) 2020-05-04 18:48:23 +08:00
ᴜɴᴋɴᴡᴏɴ fa497b1633
db: add tests for repos (#6112)
* Add Repos.create method

* Fix repo name error handling

* Fix all compile errors

* Update github.com/go-macaron/captcha to fix http issue

* Add repos tests
2020-04-17 10:14:18 +08:00
ᴜɴᴋɴᴡᴏɴ ca2f7a7e16
repo: delete rows in `lfs_object` table when delete repo (#6072) 2020-04-06 18:44:06 +08:00
ᴜɴᴋɴᴡᴏɴ 34145c990d
lfs: implement HTTP routes (#6035)
* Bootstrap with GORM

* Fix lint error

* Set conn max lifetime to one minute

* Fallback to use gorm v1

* Define HTTP routes

* Finish authentication

* Save token updated

* Add docstring

* Finish authorization

* serveBatch rundown

* Define types in lfsutil

* Finish Batch

* authutil

* Finish basic

* Formalize response error

* Fix lint errors

* authutil: add tests

* dbutil: add tests

* lfsutil: add tests

* strutil: add tests

* Formalize 401 response
2020-04-04 21:14:15 +08:00
Philidor Green 87053c5369
cmd: backup support exclude mirror repositories (#6003)
* cmd: backup support exclude mirror repositories

* Apply suggestions from code review

Co-authored-by: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>
2020-03-24 22:03:05 +08:00
ᴜɴᴋɴᴡᴏɴ 5843038a08
workflows: enable golangci-lint (#5998)
* Create golint.yml

* Update golint.yml

* Update golint.yml

* Fix errcheck

* Fix gosimple

* Fix staticcheck
2020-03-21 13:39:32 +08:00
ᴜɴᴋɴᴡᴏɴ 9e9ca66467
refactor: unify error handling in routing layer 2020-03-16 01:22:27 +08:00
ᴜɴᴋɴᴡᴏɴ 6437d0180b
git: migrate to github.com/gogs/git-module@v1.0.0 (#5958)
* WIP

* Finish `internal/db/git_diff.go`

* FInish internal/db/mirror.go

* Finish internal/db/pull.go

* Finish internal/db/release.go

* Finish internal/db/repo.go

* Finish internal/db/repo_branch.go

* Finish internal/db/repo_editor.go

* Finish internal/db/update.go

* Save my work

* Add license header

* Compile!

* Merge master

* Finish internal/cmd/hook.go

* Finish internal/conf/static.go

* Finish internal/context/repo.go

* Finish internal/db/action.go

* Finish internal/db/git_diff.go

* Fix submodule URL inferring

* Finish internal/db/mirror.go

* Updat to beta.4

* css: update fonts

* Finish internal/db/pull.go

* Finish internal/db/release.go

* Finish internal/db/repo_branch.go

* Finish internal/db/wiki.go

* gitutil: enhance infer submodule UR

* Finish internal/route/api/v1/repo/commits.go

* mirror: only collect branch commits after sync

* mirror: fix tag support

* Finish internal/db/repo.go

* Finish internal/db/repo_editor.go

* Finish internal/db/update.go

* Finish internal/gitutil/pull_request.go

* Make it compile

* Finish internal/route/repo/setting.go

* Finish internal/route/repo/branch.go

* Finish internal/route/api/v1/repo/file.go

* Finish internal/route/repo/download.go

* Finish internal/route/repo/editor.go

* Use helper

* Finish internal/route/repo/issue.go

* Finish internal/route/repo/pull.go

* Finish internal/route/repo/release.go

* Finish internal/route/repo/repo.go

* Finish internal/route/repo/wiki.go

* Finish internal/route/repo/commit.go

* Finish internal/route/repo/view.go

* Finish internal/gitutil/tag.go

* go.sum
2020-03-08 19:09:31 +08:00
ᴜɴᴋɴᴡᴏɴ f04b2d4350
lint: fix some Golang CI lint issues (#5955) 2020-03-01 14:55:03 +08:00
ᴜɴᴋɴᴡᴏɴ 17ae0ed3ee
conf: overhaul settings (#5953)
* Overhaul cache settings

* Overhaul HTTP settings

* conf: overhaul more settings

* log: make LGTM happy

* travis: upload report to Codecov

* Add codecov.yml
2020-02-29 16:29:17 +08:00
ᴜɴᴋɴᴡᴏɴ c4a0a40473
conf: overhaul repository settings (#5932) 2020-02-22 15:22:32 +08:00
ᴜɴᴋɴᴡᴏɴ 648d9e253c
conf: overhaul server settings (#5928)
* conf: rename package

* Requires Go 1.12

* Fix lint

* Fix lint

* Overhaul

* db: fix tests

* Save my work

* Fix tests

* Server.UnixSocketPermission

* Server.LocalRootURL

* SSH settings

* Server.OfflineMode

* Save my work

* App.Version

* Remove [server] STATIC_ROOT_PATH

* Server.LandingURL
2020-02-22 09:05:26 +08:00
ᴜɴᴋɴᴡᴏɴ 1c09373b4f
log: migrate to unknwon.dev/clog/v2 (#5927)
* Add unknwon.dev/clog/v2

* Update all places
2020-02-20 02:25:02 +08:00
ᴜɴᴋɴᴡᴏɴ e82c96dab1
log: use trace level for some logs 2020-02-19 17:33:45 +08:00
ᴜɴᴋɴᴡᴏɴ 3797a4839d
README: update Features list
[CI SKIP]
2020-02-18 19:24:39 +08:00
Michael Li 4d83fd4238
Use go-bindata to embed `public` and `templates` files into binary (#5920)
* fixed private repositories are hidden in the organization's view

* use go-bindata integrate public and templates files to gogs binary

* optimize Dockerfile don't COPY public and templates files

* use kevinburke's go-bindata to generate assets code

* reset develepment as default run mode in configure file

* optimize generated assets code relayout and help function

* fixed code format

* Update conf/app.ini

* assets: add LICENSE headers

* Some housekeeping

* assets/public: simplify code logic

* assets/templates: simplify code logic

* cmd/web: more concise variable names

* Minor changes

* Add custom public and templates support back

Co-authored-by: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>
2020-02-17 22:48:24 +08:00
Unknwon 85281d8efa
db/repo: fix Git version check to 1.8.3 2020-02-04 20:50:37 +08:00
Unknwon 83b480761f
db/repo: print more error info 2019-11-05 11:01:11 -08:00
Guy Smoilov b40b85e006 repo: delete local copies on owner name change (#5843)
* Protect local repo copy deletion with repoWorkingPool, and delete the local
copy on owner name change.

* Update internal/db/user.go

Co-Authored-By: Unknwon <u@gogs.io>

* Error format on local repo and wiki deletion
2019-11-03 11:07:40 -08:00
Unknwon 01c8df01ec
internal: move packages under this directory (#5836)
* Rename pkg -> internal

* Rename routes -> route

* Move route -> internal/route

* Rename models -> db

* Move db -> internal/db

* Fix route2 -> route

* Move cmd -> internal/cmd

* Bump version
2019-10-24 01:51:46 -07:00