summaryrefslogtreecommitdiffstats
path: root/src/main/java/com
Commit message (Collapse)AuthorAgeFilesLines
...
* | Add test for loading russian propertiesFlorian Zschocke2021-11-031-0/+3
| |
* | Adding Russian Translate Добавлен русский языкVladimir A2021-11-033-0/+848
| |
* | raw: URL encode the links to raw view of filesFlorian Zschocke2021-10-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far links to raw view were not encoded. The browser did some encoding of spaces on its own, which the servlet would unescape, since it uses the `HttpServletRequest.getPathInfo` method. That decodes the path before returning it. A problem arises when a bracket is in the file (or folder) name. The brackets are the characters that are not allowed in the path, according to the `URI.parse` method. (Which is a bit harsh, because brackets actually are only reserved for the host part since IPv6.) That means that the decoding fails when a bracket character is encountered. This went unnoticed since the failed decoding will return the path as it got it. But once there is a space in the file name, which the browser helpfully encoded for us, the failed decoding will now leave the encoded space in there. And that will result in a path that does not exist, e.g. `file%20[a]`. To be on the safe side, we simply encode the path in the links that we generate, so that it complies with the rules that are used in `getPathInfo`. This fixes #1375.
* | TimeUtils: Change daysAgo to calculate difference in calendar daysFlorian Zschocke2021-10-241-1/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | The `daysAgo` method seemed to want to normalize on a calendar day? I can't really tell what it was trying to do, but the problem is that it does not take into account any time shift due to time zones so it never really worked outside of GMT. So instead a new `calendarDaysAgo` method is added (because I am unsure on what the `daysAgo` method is trying to do. It can probably be removed). The new method cleanly calculates difference in calendar days because it normalizes the two given time stamps on the same time zone. The `timeAgo` method now used the new method. This fixes #1248.
* | TimeUtils: Move unit test to same package as TimeUtils isFlorian Zschocke2021-10-231-5/+5
| | | | | | | | | | | | | | | | | | | | For some reason the `TimeUtilsTest` class is, like almost all tests, in the `com.gitblit.tests` package. But this way all methods in classes which we might predominately need for tests have to be public. So move the unit test class `TimeUtilsTest` to the same package as the class it is testing, i.e. `com.gitblit.utils.TimeUtils`. This way we ca set the new added methods which get the current time passed in to be at least not public.
* | TimeUtils: Increase testability and add testsFlorian Zschocke2021-10-231-8/+32
| | | | | | | | | | | | | | | | | | Add tests for `timeAgo` to analyse issue #1248. The tests are dependent on when they run as they time functions use the current date and time. To make them testable in a reproducible way, we need the ability to pass in what we think is "now". So add overloaded methods that take a `now` parameter so that we can pass in the current time.
* | Merge pull request #1381 from edram/masterFlorian Zschocke2021-10-221-1/+9
|\ \ | | | | | | Fix mirrored http(s) with a username and password
| * | Fix mirrored http(s) with a username and passwordedram2021-10-221-1/+9
| | | | | | | | | | | | This fixes #1059
* | | Property bundle: Fix typo in "nl" language fileFlorian Zschocke2021-10-211-1/+1
| | |
* | | Property bundle: Fix various errors with escapesFlorian Zschocke2021-10-213-21/+21
| | | | | | | | | | | | | | | Double escaped backslashes, wrongly escaped unicode codes, broken escaped newlines.
* | | Property bundle: Fix incorrect property keysFlorian Zschocke2021-10-218-12/+10
| | | | | | | | | | | | | | | | | | | | | Some property keys had typos. There is a `gb.ticketStatus` and a `gb.ticketState`. Neither is used anywhere in the code, but only the former is defined in the default file. So only use `gb.ticketStatus`.
* | | Escape non-ASCII characters in the GitBlitWebApp_pt_BR.properties fileFlorian Zschocke2021-10-211-220/+219
| | | | | | | | | | | | If keeps acting up when trying to stage parts of it. I hope this fixes that.
* | | fix: Remove trailing spaces from property bundle filesFlorian Zschocke2021-10-2114-83/+83
| | |
* | | fix: Remove duplicate property keys from properties filesFlorian Zschocke2021-10-2114-27/+12
|/ / | | | | | | | | | | | | | | | | | | Some property keys were duplicated, mostly `status`, `permission` and `comment`. The problem with `gb.comment` is, that it is used in two different locations in two different meanings. One as a verb, the second as a noun. Which makes no difference in English, but other languages. The solution is that the second key is renamed to `gb.sshKeyComment`. The code is adjusted accordingly.
* | Add a unit test to check if the resource bundle can be loadedFlorian Zschocke2021-10-2014-6/+50
| | | | | | | | | | | | | | | | | | To prevent that we have a resource file in a resource bundle broken and not loading undiscovered for years, add a unit test that will load the resource properties file for each of the languages. In order to check if the file was loaded and the bundle mechanism didn't fall back on the default, a new property key is added to each language file, solely for the purpose to be checked in the unit test.
* | Fix a wrong unicode escape in the Norsk language properties fileFlorian Zschocke2021-10-201-1/+1
| | | | | | | | This fixes #834
* | Fix: Make CPU hog fix Java 7 compatibleFlorian Zschocke2021-07-141-7/+22
| | | | | | | | | | | | | | | | The last fix for the stored config merged from Curly060 used Java8-isms. In order to be able to include this fix in the next release, which will be for 1.9, I have converted this to be compatible with Java 7. Also, a file header was added to place it under APL.
* | bugfix: fix CPU hog bug in config saveIngo Lafrenz2021-07-052-1/+173
| |
* | Update zh_CN translationYMNNs2021-05-031-269/+310
| | | | | | Updated simplified Chinese translation and added missing entries. This translation is now 100% completed.
* | fix: Also parse exp links in MD pagesFlorian Zschocke2020-11-161-0/+8
| | | | | | | | | | | | Add a link parser also for `ExpLinks` because we need to escape paths to files in subfolders. This closes #1358
* | raw: Fix raw links to branches with a slash in their nameFlorian Zschocke2020-11-101-6/+11
| | | | | | | | | | | | | | | | | | When a branch has a slash in the name, the raw servlet was not able to find the path under that branch. This is due to the replacement of the forward slash character for URLs. It was not taken into account when comparing the branch name later. This fixes #1290 and its duplicates #1234 and #813.
* | raw: Fix getPath with trailing slash that was escapedFlorian Zschocke2020-11-101-3/+7
| | | | | | | | | | | | | | | | | | While this may be an unlikely scenario, let's still prevent this. When a link was created for a path that ends in a trailing slash, that trailing slash would be replaced with the `forwardSlashCharacter`. But in getPath that final slash would be transformed back *after* the check to chop off trailing slashes. This is now switched so that such a trailing slash is also chopped off.
* | raw: Fix getPath with lead-ins or missing trailing slashes after the branch.Florian Zschocke2020-11-091-1/+14
| |
* | raw: Refactor RawServlet:getBranch and :getPath parametersFlorian Zschocke2020-11-092-15/+42
| | | | | | | | | | | | | | | | | | | | | | Refactor the `getBranch` and `getPath` methods to take a String as second parameter, which is the already sanitised path info. Don't get the path info from a passed in request anymore. The methods are only ever called from within `processRequest`, which already does some checks on the path info, like removing a leading slash character. So no need to do that every time again the methods and passing a request for that.
* | raw: Fix exceptions when no path info is given to raw servletFlorian Zschocke2020-11-091-1/+4
| |
* | raw: Strip leading and trailing slash from repo and path names for linkFlorian Zschocke2020-11-091-0/+9
| | | | | | | | | | | | When creating a link for raw display, a trailing slash is stripped from the end of the base URL. Also do this for the repository, as well as stripping leading slashes from the repository and the path values.
* | Delete password from memory in AuthenticationManagerFlorian Zschocke2020-04-052-19/+38
| | | | | | | | | | | | Zero out the password to remove it from memory after use. This is only a first step, implementing it for one method: `AuthenticationManager.authenticate(String, char[], String)`.
* | 🦟 fix: Password hash upgrade kills existing passwordsFlorian Zschocke2020-04-051-17/+26
| | | | | | | | | | | | | | | | | | | | The upgrade of a MD5 stored password hash to a PBKDF password hash destroys the stored password. The has check zeroes out the password that is tested, so that the new hash is built over the zeroed out value. This fix prevents that an also adds a check to the test. Fixes #1335
* | Fix user preferences selecting the wrong preferred locale.Florian Zschocke2019-11-112-46/+28
| | | | | | | | | | | | | | | | | | | | | | Due to a wrong comparison, when loading the preferred locale in the user preferences page, in cases like `zh_CN` or `de_DE` the wrong locale would be chosen. As with too many things, the code is duplicated on the `UserPage` and the `EditUserPage`. And they differ. So extract the choosing of the preferred language for display into a method in the (more up-to-date) `UserPage` and call that from the `EditUserPage`.
* | Guard docs pages against bad URLsFlorian Zschocke2019-11-112-0/+9
| | | | | | | | | | | | | | | | If, for example, an external site links to a docs page or a specific doc page, and the branch that link points to is no longer existing, an internal error happens due to a NPE. The NPE is guarded against and a No Docs page is returned.
* | Add `clone.bundle` as known command, but reject it as not implemented.Florian Zschocke2019-11-112-2/+19
| |
* | Fix NPE when no action can be parsed from the URLFlorian Zschocke2019-11-112-30/+45
| | | | | | | | | | | | | | | | | | | | | | | | Renames `static final` variables according to convention to be in all upper case. That makes it easier to see that in an `equals` comparison the final variable should come first as it will not trigger a NPE. Also strip parameters from the URL when extracting the repository name from it. Parameters can not be part of a repository name, and this way an empty repository name can be detected. Fixes #1092
* | Update SSHD dependency to version 1.2.0.Florian Zschocke2019-11-103-3/+3
| |
* | Update SSHD dependency to version 1.1.0.Florian Zschocke2019-11-103-7/+9
| |
* | Remove Launcher from Manager and Federation Client.Florian Zschocke2019-11-081-165/+0
| | | | | | | | | | They will need to be called with the classpath and main class now, instead of simply using the Jar.
* | Fix NullpointerException when stopping GitBlit Server.Florian Zschocke2019-11-071-5/+7
| | | | | | | | | | | | | | | | When GitBlit server did not start properly, is running but couldn't start the `PluginManager`, then stopping the server via the `--stop` argument on the command line resulted in a NullpointerException. Which left the server running. Now this is prevented and the server will actually shut down.
* | For Java 9+ define the classpath instead of using a Launcher.Florian Zschocke2019-11-075-317/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The (moxie and other) Launcher do not work with Java 9 and later anymore. It used to dynamically extend the classpath, misusing an internal interface of the `URLClassLoader`. This is no longer possible since Java 9, which closed that path and does not offer any way to dynamically extend the classpath during runtime. So the choice is between providing one large Jar with everything in it, providing a Jar that has the Jars in `ext` listed explicitly in its manifest, and specifying the classpath on the command line where the `ext` directory can be added and all contained jar files will be put on the classpath. The motivation for the Launcher class was to be able to simply drop new jar files into a directory and they will be picked up at the application start, without having to specify a classpath. We opt for solution three here. This way jar files can still be dropped into the ext directory, albeit the directory needs to be added to the classpath on the command line. Unfortunately using a wildcard is not possible in the manifest file. We change the calls in the script files accordingly. This seems like a good compromise, since no one will run the application manually typing the whole commandline anyway. This also does away with the splash screen, by the way. Again, doesn't seem like a big loss, as I don't think it was ever shown for the Authority. Personally, I am not convinced that it is the best way, because I don't really think that the use case of dropping whatever jar files into the `ext` directory is a valid one that happened a lot. This does not yet fix the client programs, which still use a Launcher. Maybe for them a all-in-one Jar is a better solution. Fixes #1262 Fixes #1294
* | Report Java versions used during build and server start.Florian Zschocke2019-11-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With three versions about to be supported right now it is getting more important to know which Java version is used when building and testing Gitblit, and which Java version is used to run Gitblit. So have the Moxie build report the javac version, and the JVM version that Moxie is running on. These might be different. The `GitBlitServer` will print the Java version and vendor, so that it gets visible if a user would paste a log output for analysis.
* | Merge branch 'pingunaut-1166_more_secure_password_hashes' into master.Florian Zschocke2019-11-067-53/+636
|\ \
| * | Use the new PasswordHash classes.Florian Zschocke2019-11-057-300/+108
| | | | | | | | | | | | | | | | | | Integrate the `PasswordHash` class and subclass in the user and password editing and authentication. Replaces the old code and the previous `SecurePasswordHashingUtils` class.
| * | Add support for PBKDF2 to PasswordHashFlorian Zschocke2019-11-052-10/+326
| | | | | | | | | | | | | | | | | | | | | | | | Integrate the work of pingunaut to add support for PBKDF2 password hashing. A new class `PasswordHashPbkdf2` is added, which builds on his `SecurePasswordHashUtils` class, but makes it a subclass of `PasswordHash`. This will replace the original class when integrating the new PasswordHash way into GitBlit.
| * | Add a PasswordHash class as a central place to deal with password hashes.Florian Zschocke2019-11-051-0/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of having to deal with the implementation details of hashing and verifying passwords in multiple places, have a central unit be responsible for it. Otherwise we need to edit three different places when adding a new hashing scheme. With this class adding a new hashing scheme just requires creating a new subclass of `PasswordHash` and registering its type in the enum `PasswordHash.Type`. The rest of the code will use a common interface for all hashing schemes and doesn't need to be changed when a new one is added.
| * | fix commentMartin Spielmann2017-01-071-1/+1
| | |
| * | Replaced duplicated strings by using constantMartin Spielmann2017-01-072-4/+4
| | |
| * | Update AuthenticationManager to update weakly stored passwords on loginMartin Spielmann2017-01-072-10/+55
| | |
| * | Added possibility to use secure hashes to store passwordsMartin Spielmann2017-01-014-3/+197
| | | | | | | | | | | | Addresses #1166
* | | encoded email's sender name with utf-8.william2019-06-161-1/+1
| | |
* | | Remove "folding outlines" and sort repositories before subfolders.Florian Zschocke2019-06-152-19/+21
| | | | | | | | | | | | | | | | | | | | | | | | Remove guard rails at the left to get a cleaner look. To make it easier to determine which repositories belong to which folder, display the repositories first, then the subfolder. Decreased indentation a little.
* | | Add support nested groups on the Repositories pageFlorian Zschocke2019-06-155-5/+546
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix for #725. Also covers #527. This is a squashed commit of the following commits, merging and closing pull request #1267: commit 55fee41769ffab1aff59344fe117d481687aa743 Author: Martin Spielmann <mail@martinspielmann.de> Date: Mon Nov 6 17:19:53 2017 +0100 declared local variable final to fix travis build commit 131e4d14a48c2a3fdce621fa54637de50684d040 Author: Martin Spielmann <mail@martinspielmann.de> Date: Mon Nov 6 14:11:55 2017 +0100 fix formatting (use tab for identation) commit 8da5f6d5967894f157251c320928acdab3a451e7 Author: Martin Spielmann <mail@martinspielmann.de> Date: Mon Nov 6 13:45:39 2017 +0100 Add repositoryListType tree. Addresses #725, 527 and includes #1224 commit 6c061651fb95212ae242dbca06c8d9ef80146201 Merge: f365daa3 40ee9653 Author: Martin Spielmann <mail@martinspielmann.de> Date: Sat Nov 4 13:19:08 2017 +0100 Merge remote-tracking branch 'collapsible/ticket/527' into 725_nested_repos commit f365daa3b1d6be135365f9b11bdece320beabf4e Author: Martin Spielmann <mail@martinspielmann.de> Date: Sat Nov 4 13:10:24 2017 +0100 first working version of tree model
* | | collapsible group repositoriesybosy2019-06-153-3/+60
| | |