All dependencies are bundled.\r
</ul>\r
\r
+### Tools\r
+<ul class='noBullets'>\r
+<li>*Gitblit Federation Client* - a command line tool to clone/pull groups of repositories and optionally users and settings\r
+</ul>\r
+\r
### Java Runtime Requirement\r
\r
Gitblit requires a Java 6 Runtime Environment (JRE) or a Java 6 Development Kit (JDK).\r
\r
### Current Release\r
\r
-**%VERSION%** ([go](http://code.google.com/p/gitblit/downloads/detail?name=%GO%)|[war](http://code.google.com/p/gitblit/downloads/detail?name=%WAR%)) based on [%JGIT%][jgit] *released %BUILDDATE%*\r
+**%VERSION%** ([go](http://code.google.com/p/gitblit/downloads/detail?name=%GO%)|[war](http://code.google.com/p/gitblit/downloads/detail?name=%WAR%)|[fedclient](http://code.google.com/p/gitblit/downloads/detail?name=%FEDCLIENT%)) based on [%JGIT%][jgit] *released %BUILDDATE%*\r
\r
-- added: federation feature to allow gitblit instances to pull repositories and, optionally, settings and accounts from other gitblit instances.<br/>\r
-This is something like svn-sync for gitblit.\r
+- added: federation feature to allow gitblit instances (or gitblit federation clients) to pull repositories and, optionally, settings and accounts from other gitblit instances. This is something like [svn-sync](http://svnbook.red-bean.com/en/1.5/svn.ref.svnsync.html) for gitblit.\r
<br/>**New:** *federation.name =*\r
<br/>**New:** *federation.passphrase =*\r
<br/>**New:** *federation.allowProposals = false*\r
- updated: MarkdownPapers 1.1.1\r
- updated: Wicket 1.4.18\r
- updated: JGit 1.1.0\r
+- fixed: syndication urls for WAR builds\r
\r
issues, binaries, and sources @ [Google Code][googlecode]<br/>\r
sources @ [Github][gitbltsrc]\r
## Release History\r
\r
### Current Release\r
-**%VERSION%** ([go](http://code.google.com/p/gitblit/downloads/detail?name=%GO%)|[war](http://code.google.com/p/gitblit/downloads/detail?name=%WAR%)) based on [%JGIT%][jgit] *released %BUILDDATE%*\r
+**%VERSION%** ([go](http://code.google.com/p/gitblit/downloads/detail?name=%GO%)|[war](http://code.google.com/p/gitblit/downloads/detail?name=%WAR%)|[fedclient](http://code.google.com/p/gitblit/downloads/detail?name=%FEDCLIENT%)) based on [%JGIT%][jgit] *released %BUILDDATE%*\r
\r
-- added: federation feature to allow gitblit instances to pull repositories and, optionally, settings and accounts from other gitblit instances.<br/>\r
-This is something like svn-sync for gitblit.\r
+- added: federation feature to allow gitblit instances (or gitblit federation clients) to pull repositories and, optionally, settings and accounts from other gitblit instances. This is something like [svn-sync](http://svnbook.red-bean.com/en/1.5/svn.ref.svnsync.html) for gitblit.\r
<br/>**New:** *federation.name =*\r
<br/>**New:** *federation.passphrase =*\r
<br/>**New:** *federation.allowProposals = false*\r
- updated: MarkdownPapers 1.1.1\r
- updated: Wicket 1.4.18\r
- updated: JGit 1.1.0\r
+- fixed: syndication urls for WAR builds\r
\r
### Older Releases\r
\r
\r
AccessRestrictionRequest accessRequest = new AccessRestrictionRequest(httpRequest);\r
\r
- String url = httpRequest.getRequestURI().substring(httpRequest.getServletPath().length());\r
+ String servletUrl = httpRequest.getContextPath() + httpRequest.getServletPath();\r
+ String url = httpRequest.getRequestURI().substring(servletUrl.length());\r
String params = httpRequest.getQueryString();\r
if (url.length() > 0 && url.charAt(0) == '/') {\r
url = url.substring(1);\r
return;\r
}\r
\r
- String hosturl = HttpUtils.getHostURL(request);\r
- String gitblitUrl = hosturl + request.getContextPath();\r
- GitBlit.self().submitFederationProposal(proposal, gitblitUrl);\r
+ String url = HttpUtils.getGitblitURL(request);\r
+ GitBlit.self().submitFederationProposal(proposal, url);\r
logger.info(MessageFormat.format(\r
"Submitted {0} federation proposal to pull {1} repositories from {2}",\r
proposal.tokenType.name(), proposal.repositories.size(), proposal.url));\r
\r
Object result = null;\r
if (FederationRequest.PULL_REPOSITORIES.equals(reqType)) {\r
- String gitblitUrl = HttpUtils.getHostURL(request);\r
+ String gitblitUrl = HttpUtils.getGitblitURL(request);\r
result = GitBlit.self().getRepositories(gitblitUrl, token);\r
} else {\r
if (FederationRequest.PULL_SETTINGS.equals(reqType)) {\r
javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException,\r
java.io.IOException {\r
\r
- String hostURL = HttpUtils.getHostURL(request);\r
- String url = request.getRequestURI().substring(request.getServletPath().length());\r
+ String servletUrl = request.getContextPath() + request.getServletPath();\r
+ String url = request.getRequestURI().substring(servletUrl.length());\r
if (url.charAt(0) == '/' && url.length() > 1) {\r
url = url.substring(1);\r
}\r
RepositoryModel model = GitBlit.self().getRepositoryModel(repositoryName);\r
List<RevCommit> commits = JGitUtils.getRevLog(repository, objectId, 0, length);\r
try {\r
- SyndicationUtils.toRSS(hostURL, getTitle(model.name, objectId), model.description,\r
+ SyndicationUtils.toRSS(HttpUtils.getGitblitURL(request), getTitle(model.name, objectId), model.description,\r
model.name, commits, response.getOutputStream());\r
} catch (Exception e) {\r
logger.error("An error occurred during feed generation", e);\r
public class HttpUtils {\r
\r
/**\r
- * Returns the host URL based on the request.\r
+ * Returns the Gitblit URL based on the request.\r
* \r
* @param request\r
* @return the host url\r
*/\r
- public static String getHostURL(HttpServletRequest request) {\r
+ public static String getGitblitURL(HttpServletRequest request) {\r
StringBuilder sb = new StringBuilder();\r
sb.append(request.getScheme());\r
sb.append("://");\r
|| (request.getScheme().equals("https") && request.getServerPort() != 443)) {\r
sb.append(":" + request.getServerPort());\r
}\r
+ sb.append(request.getContextPath());\r
return sb.toString();\r
}\r
}\r
return new ContextRelativeResource(file);\r
}\r
\r
- public static String getHostURL(Request request) {\r
+ public static String getGitblitURL(Request request) {\r
HttpServletRequest req = ((WebRequest) request).getHttpServletRequest();\r
- return HttpUtils.getHostURL(req);\r
+ return HttpUtils.getGitblitURL(req);\r
}\r
\r
public static HeaderContributor syndicationDiscoveryLink(final String feedTitle,\r
add(new LinkPanel("commitTree", "list", c.getTree().getName(), TreePage.class,\r
newCommitParameter()));\r
add(new BookmarkablePageLink<Void>("treeLink", TreePage.class, newCommitParameter()));\r
- add(new ExternalLink("zipLink", DownloadZipServlet.asLink(getRequest()\r
- .getRelativePathPrefixToContextRoot(), repositoryName, objectId, null))\r
- .setVisible(GitBlit.getBoolean(Keys.web.allowZipDownloads, true)));\r
+ final String baseUrl = WicketUtils.getGitblitURL(getRequest());\r
+ add(new ExternalLink("zipLink", DownloadZipServlet.asLink(baseUrl, repositoryName,\r
+ objectId, null)).setVisible(GitBlit.getBoolean(Keys.web.allowZipDownloads, true)));\r
\r
// Parent Commits\r
ListDataProvider<String> parentsDp = new ListDataProvider<String>(parents);\r
\r
final String token = WicketUtils.getToken(params);\r
\r
- myUrl = WicketUtils.getHostURL(getRequest());\r
+ myUrl = WicketUtils.getGitblitURL(getRequest());\r
destinationUrl = "https://";\r
\r
// temporary proposal\r
add(WicketUtils.newClearPixel("accessRestrictionIcon").setVisible(false));\r
}\r
StringBuilder sb = new StringBuilder();\r
- sb.append(WicketUtils.getHostURL(getRequestCycle().getRequest()));\r
+ sb.append(WicketUtils.getGitblitURL(getRequestCycle().getRequest()));\r
sb.append(Constants.GIT_PATH);\r
sb.append(repositoryName);\r
repositoryUrls.add(sb.toString());\r
\r
final ByteFormat byteFormat = new ByteFormat();\r
\r
+ final String baseUrl = WicketUtils.getGitblitURL(getRequest());\r
+\r
// changed paths list\r
ListDataProvider<PathModel> pathsDp = new ListDataProvider<PathModel>(paths);\r
DataView<PathModel> pathsView = new DataView<PathModel>("changedPath", pathsDp) {\r
links.add(new BookmarkablePageLink<Void>("history", HistoryPage.class,\r
WicketUtils.newPathParameter(repositoryName, entry.commitId,\r
entry.path)));\r
- links.add(new ExternalLink("zip", DownloadZipServlet.asLink(getRequest()\r
- .getRelativePathPrefixToContextRoot(), repositoryName, objectId,\r
- entry.path)).setVisible(GitBlit.getBoolean(\r
- Keys.web.allowZipDownloads, true)));\r
+ links.add(new ExternalLink("zip", DownloadZipServlet.asLink(baseUrl,\r
+ repositoryName, objectId, entry.path)).setVisible(GitBlit\r
+ .getBoolean(Keys.web.allowZipDownloads, true)));\r
item.add(links);\r
} else {\r
// blob link\r
public FederationTokensPanel(String wicketId, final boolean showFederation) {\r
super(wicketId);\r
\r
- final String baseUrl = getRequest().getRelativePathPrefixToContextRoot();\r
+ final String baseUrl = WicketUtils.getGitblitURL(getRequest());\r
add(new ExternalLink("federatedUsers", FederationServlet.asFederationLink(baseUrl, GitBlit.self()\r
.getFederationToken(FederationToken.USERS_AND_REPOSITORIES),\r
FederationRequest.PULL_USERS)));\r
} else {\r
dp = new SortableRepositoriesProvider(models);\r
}\r
+ \r
+ final String baseUrl = WicketUtils.getGitblitURL(getRequest());\r
\r
DataView<RepositoryModel> dataView = new DataView<RepositoryModel>("row", dp) {\r
private static final long serialVersionUID = 1L;\r
} else {\r
row.add(new Label("repositoryLinks"));\r
}\r
- row.add(new ExternalLink("syndication", SyndicationServlet.asLink(getRequest()\r
- .getRelativePathPrefixToContextRoot(), entry.name, null, 0))\r
- .setVisible(linksActive));\r
+ row.add(new ExternalLink("syndication", SyndicationServlet.asLink(baseUrl,\r
+ entry.name, null, 0)).setVisible(linksActive));\r
WicketUtils.setAlternatingBackground(item, counter);\r
counter++;\r
}\r