138 Commits (eabbddcd98717ef20d8475e819f403c50f4a9787)

Author SHA1 Message Date
Jonas Franz 5ccecb44ad Feature: Timetracking (#2211)
* Added comment's hashtag to url for mail notifications.
* Added explanation to return statement + documentation.
* Replacing in-line link generation with HTMLURL. (+gofmt)
* Replaced action-based model with nil-based model. (+gofmt)
* Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants.
* Updating comment for mailIssueCommentToParticipants
* Added link to comment in "Dashboard"
* Deleting feed entry if a comment is going to be deleted
* Added migration
* Added improved migration to add a CommentID column to action.
* Added improved links to comments in feed entries.
* Fixes #1956 by filtering for deleted comments that are referenced in actions.
* Introducing "IsDeleted" column to action.
* Adding design draft (not functional)
* Adding database models for stopwatches and trackedtimes
* See go-gitea/gitea#967
* Adding design draft (not functional)
* Adding translations and improving design
* Implementing stopwatch (for timetracking)
* Make UI functional
* Add hints in timeline for time tracking events
* Implementing timetracking feature
* Adding "Add time manual" option
* Improved stopwatch
* Created report of total spent time by user
* Only showing total time spent if theire is something to show.
* Adding license headers.
* Improved error handling for "Add Time Manual"
* Adding @sapks 's changes, refactoring
* Adding API for feature tracking
* Adding unit test
* Adding DISABLE/ENABLE option to Repository settings page
* Improving translations
* Applying @sapk 's changes
* Removing repo_unit and using IssuesSetting for disabling/enabling timetracker
* Adding DEFAULT_ENABLE_TIMETRACKER to config, installation and admin menu
* Improving documentation
* Fixing vendor/ folder
* Changing timtracking routes by adding subgroups /times and /times/stopwatch (Proposed by @lafriks )
* Restricting write access to timetracking based on the repo settings (Proposed by @lafriks )
* Fixed minor permissions bug.
* Adding CanUseTimetracker and IsTimetrackerEnabled in ctx.Repo
* Allow assignees and authors to track there time too.
* Fixed some build-time-errors + logical errors.
* Removing unused Get...ByID functions
* Moving IsTimetrackerEnabled from context.Repository to models.Repository
* Adding a seperate file for issue related repo functions
* Adding license headers
* Fixed GetUserByParams return 404
* Moving /users/:username/times to /repos/:username/:reponame/times/:username for security reasons
* Adding /repos/:username/times to get all tracked times of the repo
* Updating sdk-dependency
* Updating swagger.v1.json
* Adding warning if user has already a running stopwatch (auto-timetracker)
* Replacing GetTrackedTimesBy... with GetTrackedTimes(options FindTrackedTimesOptions)
* Changing code.gitea.io/sdk back to code.gitea.io/sdk
* Correcting spelling mistake
* Updating vendor.json
* Changing GET stopwatch/toggle to POST stopwatch/toggle
* Changing GET stopwatch/cancel to POST stopwatch/cancel
* Added migration for stopwatches/timetracking
* Fixed some access bugs for read-only users
* Added default allow only contributors to track time value to config
* Fixed migration by chaging x.Iterate to x.Find
* Resorted imports
* Moved Add Time Manually form to repo_form.go
* Removed "Seconds" field from Add Time Manually
* Resorted imports
* Improved permission checking
* Fixed some bugs
* Added integration test
* gofmt
* Adding integration test by @lafriks
* Added created_unix to comment fixtures
* Using last event instead of a fixed event
* Adding another integration test by @lafriks
* Fixing bug Timetracker enabled causing error 500 at sidebar.tpl
* Fixed a refactoring bug that resulted in hiding "HasUserStopwatch" warning.
* Returning TrackedTime instead of AddTimeOption at AddTime.
* Updating SDK from go-gitea/go-sdk#69
* Resetting Go-SDK back to default repository
* Fixing test-vendor by changing ini back to original repository
* Adding "tags" to swagger spec
* govendor sync
* Removed duplicate
* Formatting templates
* Adding IsTimetrackingEnabled checks to API
* Improving translations / english texts
* Improving documentation
* Updating swagger spec
* Fixing integration test caused be translation-changes
* Removed encoding issues in local_en-US.ini.
* "Added" copyright line
* Moved unit.IssuesConfig().EnableTimetracker into a != nil check
* Removed some other encoding issues in local_en-US.ini
* Improved javascript by checking if data-context exists
* Replaced manual comment creation with CreateComment
* Removed unnecessary code
* Improved error checking
* Small cosmetic changes
* Replaced int>string>duration parsing with int>duration parsing
* Fixed encoding issues
* Removed unused imports

Signed-off-by: Jonas Franz <info@jonasfranz.software>
7 years ago
Lauris BH a569d3dedc Fix migration from pre-v15 to 1.2.0 (#2460) 7 years ago
G 34df9deff1 Convert xorm literal queries to method calls (#2253) 7 years ago
Lauris BH f33e6ae09e Remove unit types commits and settings (#2161)
* Remove unit types commits and settings

* Can not limit units in administrator teams

* Limit changing units only to teams with read and write access mode

* Small code optimization
7 years ago
Ethan Koenig 858324c21a Fix username rendering bug (#2122)
* Fix username rendering bug

* XSS integration test

* Migration to unescape user full names
7 years ago
Lauris BH f189ccd2d6 Fix git hooks update to receive required arguments. Fixes #2090 (#2095)
* Changed migration calling so that migrations can use models package
7 years ago
Jonas Franz 441986a473 Fix "Dashboard shows deleted comments" (#1995) 7 years ago
Lauris BH 6db387a21e Refactor session close as xorm already does everything needed internally (#2020) 7 years ago
Ethan Koenig ca9169fbe9 Migration to fix existing owner team units (#1873) 7 years ago
Ethan Koenig 3e74b5cf51 Rename misnamed migration (#1867) 7 years ago
Ethan Koenig 0c332f0480 Fix activity feed (#1779)
* Fix activity feed

Preserve actions after user/repo name change

* Add missing comment

* Fix migration, and remove fields completely

* Tests
7 years ago
Lunny Xiao fd6034aaf2 Add units to team (#947)
* add units to team

* fix lint

* finish team setting backend

* finished permission controll on routes

* fix import blank line

* add unit check on ssh/http pull and push and fix test failed

* fix fixtures data

* remove unused code
7 years ago
Lunny Xiao bc299b8317 fix avatar update bug (#1729) 7 years ago
Lauris BH 524885dd65 LDAP user synchronization (#1478) 7 years ago
Lauris BH 98548c83d3 Add primary key and index to external login user table (#1656) 7 years ago
Jonas Östanbäck 9a8ca3e877 Fix broken migration v27 (#1504)
Mirror.interval column type needed to be changed to bigint.
Correct interval where the interval set is < MinInterval.
7 years ago
Kim "BKC" Carlbäcker 4bea219128 Status-API (#1332) 7 years ago
Jonas be6edaddcb Repo size in admin panel (#1482)
* Implementation of the feature to view repository size in admin panel
 * Move GetRepoSize to git module
 * Repository.RepoSize -> Repository.Size
 * RepoSize -> Size in template
 * Redo a few bits and pieces
 * Update size when syncing mirror or forking
 * Remove GetRepoSize
 * Changed fatal errors to error message

* Copy migration code from Gogs

* make fmt
7 years ago
Jonas 54f0293f0a Mirror sync interval specified as duration string (#1407)
* Sync interval specifed as duration string

* Changed mirror interval text

* make fmt

* Add MinInterval for mirror sync

* Use duration internally

* Changed min default to 10m

* make fmt

* Incorrect default

* Removed defaults in MustDuration()

* Add Mirror interval migration

* Default values corrected

* Use transaction during migration

* Change http 500 to page with error message

* Cleanup session.commit()
7 years ago
Philippe Kueck fe94032f74 rewrite pre-commit, post-commit and options hooks (fixes #1250) (#1257)
* issue #1250, replace {pre,post}-receive and update hooks with a single shell script that does not require custom hooks to be a sh-script

* issue #1250, make script posix compilant

* v23, add migration script to update {pre,post}-receive and update hooks

* migration: use a more common name and rename v23 to v26 to avoid conflicts

* gofmt'ed and added copyright header

* fix SyncRepositoryHooks to also sync wiki repos
7 years ago
Lunny Xiao d330a23ce1 fix migration failed when authorized_keys is not exist (#1180) 7 years ago
Sandro Santilli f73e734411 Run "make fmt" with go-1.6 (#1333) 7 years ago
Sandro Santilli 9182a35f18 Show user OpenID URIs in their profile (#1314) 7 years ago
Lunny Xiao 608cd54a68 fix gpg wrong column types 7 years ago
Sandro Santilli 71d16f69ff Login via OpenID-2.0 (#618) 7 years ago
Ethan Koenig 021904e4e6 Fix typos in models/ and modules/ (#1248) 7 years ago
Sandro Santilli 8746fb3385 Fix migration comment (#1241) 7 years ago
Lunny Xiao 1ccdf19fae fix forget migration for wiki hooks (#1227) 7 years ago
Lunny Xiao 74cde12677 Fix upgrade failed after ever rollback (#1194)
* fix upgrade failed after rollback

* fix upgrade failed after rollback

* fix possible upgrade twice fail after rollback
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
Sandro Santilli bf24099114 Allow migrating installations with no local avatars (#1056) 7 years ago
Lunny Xiao 80f900ebae Fix avatar enumable (#1049)
* fix avatar enumable

* fix import style
7 years ago
Lunny Xiao 0e6b9ea786 Take back control of hooks (#1006)
* git: delegate all server-side Git hooks (#1623)

* create hooks directories

* take control hooks back

* fix lint

* bug fixed and minor changes

* fix imports style

* fix migration scripts
7 years ago
Willem van Dreumel 01d957677f Oauth2 consumer (#679)
* initial stuff for oauth2 login, fails on:
* login button on the signIn page to start the OAuth2 flow and a callback for each provider
Only GitHub is implemented for now
* show login button only when the OAuth2 consumer is configured (and activated)
* create macaron group for oauth2 urls
* prevent net/http in modules (other then oauth2)
* use a new data sessions oauth2 folder for storing the oauth2 session data
* add missing 2FA when this is enabled on the user
* add password option for OAuth2 user , for use with git over http and login to the GUI
* add tip for registering a GitHub OAuth application
* at startup of Gitea register all configured providers and also on adding/deleting of new providers
* custom handling of errors in oauth2 request init + show better tip
* add ExternalLoginUser model and migration script to add it to database
* link a external account to an existing account (still need to handle wrong login and signup) and remove if user is removed
* remove the linked external account from the user his settings
* if user is unknown we allow him to register a new account or link it to some existing account
* sign up with button on signin page (als change OAuth2Provider structure so we can store basic stuff about providers)

* from gorilla/sessions docs:
"Important Note: If you aren't using gorilla/mux, you need to wrap your handlers with context.ClearHandler as or else you will leak memory!"
(we're using gorilla/sessions for storing oauth2 sessions)

* use updated goth lib that now supports getting the OAuth2 user if the AccessToken is still valid instead of re-authenticating (prevent flooding the OAuth2 provider)
7 years ago
Denis Denisov fd941db246 Protected branches system (#339)
* Protected branches system

* Moved default branch to branches section (`:org/:reponame/settings/branches`).
* Initial support Protected Branch.
  - Admin does not restrict
  - Owner not to limit
  - To write permission restrictions

* reformat tmpl

* finished the UI and add/delete protected branch response

* remove unused comment

* indent all the template files and remove ru translations since we use crowdin

* fix the push bug
7 years ago
Willem van Dreumel 5f234ce2a5 add missing copyright header (#992) 7 years ago
Lunny Xiao 837d346090 fix some older Gogs upgrade to Gitea (#929) 7 years ago
Lunny Xiao 8a421b1fd7 Add units concept for modulable functions of a repository (#742)
* Add units concept for modulable functions of a repository

* remove unused comment codes & fix lints and tests

* remove unused comment codes

* use struct config instead of map

* fix lint

* rm wrong files

* fix tests
8 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
Schwobaland c0904f1942 Restrict creating organisations by user (#193)
* restrict creating organizations based on right on user

* revert bindata.go

* reverse vendor lib

* revert goimports change

* set AllowCreateOrganization default value to true

* revert locale

* added default value for AllowCreateOrganization

* fix typo in migration-comment

* fix comment

* add coments in migration
8 years ago
Bwko 331316894e Replace Gogs with Gitea (#520) 8 years ago
btrepp 25b5ffb6af Enables mssql support (#383)
* Enables mssql support

Port of dlobs work in gogs.
Enables options in index.js
Enables MSSQL as a database option in go.
Sets ID to 0 on initial migration. Required for
MSSQL insert statements.

Signed-off-by: Beau Trepp <beautrepp@gmail.com>

* Vendors in denisenkom/go-mssqldb

Includes golang.org/x/crypto/md4
as this is required by go-msssqldb

Signed-off-by: Beau Trepp <beautrepp@gmail.com>
8 years ago
Denis Denisov 380e32e129 Fix random string generator (#384)
* Remove unused custom-alphabet feature of random string generator

Fix random string generator

Random string generator should return error if it fails to read random data via crypto/rand

* Fixes variable (un)initialization mixed assign
Update test GetRandomString
8 years ago
Lunny Xiao 27d66855eb golint fixed for models/migrations (#291) 8 years ago
Andrey Nering 739f07c98e Remember diff view style (#163) 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
Lunny Xiao 7dcc3bc3d7 use x.SQL instead of x.Sql 8 years ago
Rémy Boulanouar 2d68bd1ef9 Change import reference to match gitea instead of gogs (#37) 8 years ago
Unknwon c2afdf2192 Minor code fix [CI SKIP] 8 years ago
Unknwon 37305a59ca migrations: sync table first 8 years ago
Unknwon bb359a74f1 migrations: set comment updated as created 8 years ago
Unknwon 250be011c7 Remove redundant Unix timestamp method call
Unix() already uses UTC as timezone
8 years ago
Unknwon 52322ef624 models/user_mail: refactor EmailAddress 8 years ago
Unknwon 401bf944ef Use SecurityProtocol to replace UseSSL in LDAP config
Initially proposed by #2376 and fixes #3068 as well.
8 years ago
Unknwon ad513a20e9 #2302 Replace time.Time with Unix Timestamp (int64) 8 years ago
Unknwon ac78bae7b5 Replace uuid module with original package 8 years ago
Unknwon 3362b3a44f fix possible disclosure 9 years ago
Unknwon 7a3eccc709 Drop 0.5.x support 9 years ago
Unknwon eb30cbab81 add unsupported migration prompt 9 years ago
Unknwon b55499d039 go vet and fix #1890 9 years ago
Unknwon 67ced4aaca safe check 9 years ago
Unknwon cb100c7781 work #1705 9 years ago
Unknwon fc7959d3bc New/reopen PR checks if there is any unmerged and open PR 9 years ago
Unknwon 1453e91f41 minor fix on API response 9 years ago
Unknwon 34f6cbfc2a finish attachments when create issue 9 years ago
Unknwon 887bc1b594 Merge branch 'develop' of github.com:gogits/gogs into feature/pull_request2
# Conflicts:
#	modules/bindata/bindata.go
#	public/css/gogs.min.css
9 years ago
Unknwon 2aea247208 minor fix on #1460 9 years ago
Unknwon 17de3ab0a3 add migrate from issue.label_ids to issue_label 9 years ago
Unknwon 39a3b768bc #334: Add Deployment Key Support 9 years ago
Unknwon 686dd59916 fix #864 with migration and update locale 9 years ago
Unknwon 99b774e741 auto fix locale file name change 9 years ago
Unknwon 2bb982dada #1080: Remove footer ads/branding from default template 9 years ago
Unknwon 6b70a0c0d9 #1032: legacy code can have duplicated IDs for same repository 9 years ago
Unknwon 63a73b43b4 models/migrations: fix update error 9 years ago
Unknwon ee68a826a5 v4 migration, merge 'dev', clean code and mirror fix 9 years ago
Peter Smit ddf7014b9b Rewrite of access migration
The old migration had a few issues:
 - It left old column names around
 - It did not give the right access levels for owners and admins

Also, this includes a migration that fixes the authorization of owner teams, which was previously ORG_ADMIN (instead of ORG_OWNER)
10 years ago
Unknwon b99c4baab2 models/migrations: finish accessRefactor 10 years ago
无闻 7fda0cdb93 Merge pull request #941 from phsmit/access_refactor
Access refactor
10 years ago
Unknwon 0b3722c359 models/migrations: fix little logic error 10 years ago
Peter Smit 0a4cda0dd4 Refactoring of the Access Table
This commit does a lot of the work of refactoring the access table in a table with id's instead of strings.

The result does compile, but has not been tested. It may eat your kittens.
10 years ago
Peter Smit 2804784df9 Some comments and improvements for migrations 10 years ago
Unknwon 876a856759 models/migartions: make Migration as interface and use session 10 years ago
Unknwon 7e7160eefd first pass work on migration #925 10 years ago
Peter Smit bef38d9d3f Fix collaboration migration code 10 years ago
Peter Smit 76f8904718 Introducing Collaboration Struct 10 years ago
Peter Smit 4ef3245413 Migration code: errors are not to be forgotten 10 years ago
Peter Smit 2a70d6b723 Clean up migrations code 10 years ago
Peter Smit bb103e8723 Create db migrations framework 10 years ago