summaryrefslogtreecommitdiffstats
path: root/modules/util
Commit message (Collapse)AuthorAgeFilesLines
* Convert EOL to UNIX-style to render MD properly (#8925)guillep2k2019-11-132-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Convert EOL to UNIX-style to render MD properly * Update modules/markup/markdown/markdown.go Co-Authored-By: zeripath <art27@cantab.net> * Fix lint optimization * Check for empty content before conversion * Update modules/util/util.go Co-Authored-By: zeripath <art27@cantab.net> * Improved checks and tests * Add paragraph render test * Improve speed even more, improve tests * Small improvement by @gary-kim * Fix test for DOS * More improvements * Restart CI
* Stop using git count-objects and use raw directory size for repository (#8848)zeripath2019-11-101-1/+18
| | | | | * Migrate from git count-objects to a raw directory size * As per @guillep2k ignore unusual files
* Enable Uploading/Removing Attachments When Editing an Issue/Comment (#8426)blueworrybear2019-10-151-0/+10
|
* Display ui time with customize time location (#7792)Lunny Xiao2019-08-151-66/+0
| | | | | | | | | | | | | | | | | | * display ui time with customize time location * fix lint * rename UILocation to DefaultUILocation * move time related functions to modules/timeutil * fix tests * fix tests * fix build * fix swagger
* Handle insecure and ports in go get (#7041)zeripath2019-05-272-2/+3
| | | | | | * Handle insecure and ports in go get * Fix IsExternalURL for non-standard ports
* Better logging (#6038) (#6095)zeripath2019-04-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Panic don't fatal on create new logger Fixes #5854 Signed-off-by: Andrew Thornton <art27@cantab.net> * partial broken * Update the logging infrastrcture Signed-off-by: Andrew Thornton <art27@cantab.net> * Reset the skip levels for Fatal and Error Signed-off-by: Andrew Thornton <art27@cantab.net> * broken ncsa * More log.Error fixes Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove nal * set log-levels to lowercase * Make console_test test all levels * switch to lowercased levels * OK now working * Fix vetting issues * Fix lint * Fix tests * change default logging to match current gitea * Improve log testing Signed-off-by: Andrew Thornton <art27@cantab.net> * reset error skip levels to 0 * Update documentation and access logger configuration * Redirect the router log back to gitea if redirect macaron log but also allow setting the log level - i.e. TRACE * Fix broken level caching * Refactor the router log * Add Router logger * Add colorizing options * Adjust router colors * Only create logger if they will be used * update app.ini.sample * rename Attribute ColorAttribute * Change from white to green for function * Set fatal/error levels * Restore initial trace logger * Fix Trace arguments in modules/auth/auth.go * Properly handle XORMLogger * Improve admin/config page * fix fmt * Add auto-compression of old logs * Update error log levels * Remove the unnecessary skip argument from Error, Fatal and Critical * Add stacktrace support * Fix tests * Remove x/sync from vendors? * Add stderr option to console logger * Use filepath.ToSlash to protect against Windows in tests * Remove prefixed underscores from names in colors.go * Remove not implemented database logger This was removed from Gogs on 4 Mar 2016 but left in the configuration since then. * Ensure that log paths are relative to ROOT_PATH * use path.Join * rename jsonConfig to logConfig * Rename "config" to "jsonConfig" to make it clearer * Requested changes * Requested changes: XormLogger * Try to color the windows terminal If successful default to colorizing the console logs * fixup * Colorize initially too * update vendor * Colorize logs on default and remove if this is not a colorizing logger * Fix documentation * fix test * Use go-isatty to detect if on windows we are on msys or cygwin * Fix spelling mistake * Add missing vendors * More changes * Rationalise the ANSI writer protection * Adjust colors on advice from @0x5c * Make Flags a comma separated list * Move to use the windows constant for ENABLE_VIRTUAL_TERMINAL_PROCESSING * Ensure matching is done on the non-colored message - to simpify EXPRESSION
* Clean up various use of escape/unescape functions for URL generation (#6334)mrsdizzie2019-03-182-40/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use PathUnescape instead of QueryUnescape when working with branch names Currently branch names with a '+' fail in certain situations because QueryUnescape replaces the + character with a blank space. Using PathUnescape should be better since it is defined as: // PathUnescape is identical to QueryUnescape except that it does not // unescape '+' to ' ' (space). Fixes #6333 * Change error to match new function name * Add new util function PathEscapeSegments This function simply runs PathEscape on each segment of a path without touching the forward slash itself. We want to use this instead of PathEscape/QueryEscape in most cases because a forward slash is a valid name for a branch etc... and we don't want that escaped in a URL. Putting this in new file url.go and also moving a couple similar functions into that file as well. * Use EscapePathSegments where appropriate Replace various uses of EscapePath/EscapeQuery with new EscapePathSegments. Also remove uncessary uses of various escape/unescape functions when the text had already been escaped or was not escaped. * Reformat comment to make drone build happy * Remove no longer used url library * Requested code changes
* Remove util.RemoveAll - should have been removed since go 1.7 (#6299)zeripath2019-03-102-30/+0
|
* Disallow empty titles (#5785)Lanre Adelowo2019-01-212-0/+22
| | | | | | | | | | | | * add util method and tests * make sure the title of an issue cannot be empty * wiki title cannot be empty * pull request title cannot be empty * update to make use of the new util methof
* Fix open redirect vulnerability on login screen (#4312)Jonas Franz2018-06-262-0/+48
| | | | | | | | | | | | | | * Fix open redirect vulnerability on login screen Signed-off-by: Jonas Franz <info@jonasfranz.software> * Reorder imports Signed-off-by: Jonas Franz <info@jonasfranz.software> * Replace www. from Domain too Signed-off-by: Jonas Franz <info@jonasfranz.software>
* Fix #4081 Check for leading / in base before removing it (#4082)Antoine GIRARD2018-05-302-2/+8
|
* Fix relative markdown links with anchors (#4058)Jonas Franz2018-05-282-6/+18
| | | | | | | | | | | * Replace '%28' with '#' Add test case Signed-off-by: Jonas Franz <info@jonasfranz.software> * Use ResolveReference instead of strings.Replace Signed-off-by: Jonas Franz <info@jonasfranz.software>
* LDAP Public SSH Keys synchronization (#1844)Magnus Lindvall2018-05-241-0/+29
| | | | | | | | | | | | | | | | | | | * Add LDAP Key Synchronization feature Signed-off-by: Magnus Lindvall <magnus@dnmgns.com> * Add migration: add login source id column for public_key table * Only update keys if needed * Add function to only list pubkey synchronized from ldap * Only list pub ssh keys synchronized from ldap. Do not sort strings as ExistsInSlice does it. * Only get keys belonging to current login source id * Set default login source id to 0 * Some minor cleanup. Add integration tests (updete dep testify)
* fix gpg expired bug when time is zero (#3584)Lunny Xiao2018-02-261-0/+5
|
* Populate URL field of API commits (#3546)Ethan Koenig2018-02-202-0/+57
| | | | | | * Populate URL field of API commits * fix orgmode_test
* Improvements for supporting UI Location (#3146)Lunny Xiao2017-12-141-3/+7
| | | | | | * improvements for supporting UI Location * improved the comment
* Refactor struct's time to remove unnecessary memory usage (#3142)Lunny Xiao2017-12-111-0/+57
| | | | | | | | | | | | | | * refactor struct's time to remove unnecessary memory usage * use AsTimePtr simple code * fix tests * fix time compare * fix template on gpg * use AddDuration instead of Add
* Fix error message sanitiziation (#3082)Ethan Koenig2017-12-041-0/+48
|
* Code/repo search (#2582)Ethan Koenig2017-10-272-0/+32
| | | Indexed search of repository contents (for default branch only)
* Hide unactive on explore users and some refactors (#2741)Lunny Xiao2017-10-241-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | * hide unactive on explore users and some refactors * fix test for removed Organizations * fix test for removed Organizations * fix imports * fix logic bug * refactor the toConds * Rename TestOrganizations to TestSearchUsers and add tests for users * fix other tests * fix other tests * fix watchers tests * fix comments and remove unused code
* improve protected branch to add whitelist support (#2451)Lunny Xiao2017-09-141-0/+29
| | | | | | | | | | | | | | | | | | | | * improve protected branch to add whitelist support * fix lint * fix style check * fix tests * fix description on UI and import * fix test * bug fixed * fix tests and languages * move isSliceInt64Eq to util pkg; improve function names & typo
* refactor: remove workaround after the golang 1.7 release. (#1349)Bo-Yi Wu2017-03-292-0/+30
| | | | | | | | | | | | | | * refactor: remove workaround after the golang 1.7 release. * remove unused import. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * refactor: Add remove function. * refactor: rename * refactor: update build flag
* Search bar for issues/pulls (#530)Ethan Koenig2017-01-251-0/+25