瀏覽代碼

Fixed broken urls for WAR builds.

tags/v0.6.0
James Moger 12 年之前
父節點
當前提交
2179fb76bb

+ 8
- 3
docs/00_index.mkd 查看文件

@@ -15,16 +15,20 @@ Gitblit is available in two variations:
All dependencies are bundled.
</ul>
### Tools
<ul class='noBullets'>
<li>*Gitblit Federation Client* - a command line tool to clone/pull groups of repositories and optionally users and settings
</ul>
### Java Runtime Requirement
Gitblit requires a Java 6 Runtime Environment (JRE) or a Java 6 Development Kit (JDK).
### Current Release
**%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] &nbsp; *released %BUILDDATE%*
**%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] &nbsp; *released %BUILDDATE%*
- added: federation feature to allow gitblit instances to pull repositories and, optionally, settings and accounts from other gitblit instances.<br/>
This is something like svn-sync for gitblit.
- 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.
<br/>**New:** *federation.name =*
<br/>**New:** *federation.passphrase =*
<br/>**New:** *federation.allowProposals = false*
@@ -38,6 +42,7 @@ This is something like svn-sync for gitblit.
- updated: MarkdownPapers 1.1.1
- updated: Wicket 1.4.18
- updated: JGit 1.1.0
- fixed: syndication urls for WAR builds
issues, binaries, and sources @ [Google Code][googlecode]<br/>
sources @ [Github][gitbltsrc]

+ 3
- 3
docs/04_releases.mkd 查看文件

@@ -1,10 +1,9 @@
## Release History
### Current Release
**%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] &nbsp; *released %BUILDDATE%*
**%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] &nbsp; *released %BUILDDATE%*
- added: federation feature to allow gitblit instances to pull repositories and, optionally, settings and accounts from other gitblit instances.<br/>
This is something like svn-sync for gitblit.
- 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.
<br/>**New:** *federation.name =*
<br/>**New:** *federation.passphrase =*
<br/>**New:** *federation.allowProposals = false*
@@ -18,6 +17,7 @@ This is something like svn-sync for gitblit.
- updated: MarkdownPapers 1.1.1
- updated: Wicket 1.4.18
- updated: JGit 1.1.0
- fixed: syndication urls for WAR builds
### Older Releases

+ 2
- 1
src/com/gitblit/AccessRestrictionFilter.java 查看文件

@@ -130,7 +130,8 @@ public abstract class AccessRestrictionFilter implements Filter {
AccessRestrictionRequest accessRequest = new AccessRestrictionRequest(httpRequest);
String url = httpRequest.getRequestURI().substring(httpRequest.getServletPath().length());
String servletUrl = httpRequest.getContextPath() + httpRequest.getServletPath();
String url = httpRequest.getRequestURI().substring(servletUrl.length());
String params = httpRequest.getQueryString();
if (url.length() > 0 && url.charAt(0) == '/') {
url = url.substring(1);

+ 3
- 4
src/com/gitblit/FederationServlet.java 查看文件

@@ -159,9 +159,8 @@ public class FederationServlet extends HttpServlet {
return;
}
String hosturl = HttpUtils.getHostURL(request);
String gitblitUrl = hosturl + request.getContextPath();
GitBlit.self().submitFederationProposal(proposal, gitblitUrl);
String url = HttpUtils.getGitblitURL(request);
GitBlit.self().submitFederationProposal(proposal, url);
logger.info(MessageFormat.format(
"Submitted {0} federation proposal to pull {1} repositories from {2}",
proposal.tokenType.name(), proposal.repositories.size(), proposal.url));
@@ -218,7 +217,7 @@ public class FederationServlet extends HttpServlet {
Object result = null;
if (FederationRequest.PULL_REPOSITORIES.equals(reqType)) {
String gitblitUrl = HttpUtils.getHostURL(request);
String gitblitUrl = HttpUtils.getGitblitURL(request);
result = GitBlit.self().getRepositories(gitblitUrl, token);
} else {
if (FederationRequest.PULL_SETTINGS.equals(reqType)) {

+ 3
- 3
src/com/gitblit/SyndicationServlet.java 查看文件

@@ -116,8 +116,8 @@ public class SyndicationServlet extends HttpServlet {
javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException,
java.io.IOException {
String hostURL = HttpUtils.getHostURL(request);
String url = request.getRequestURI().substring(request.getServletPath().length());
String servletUrl = request.getContextPath() + request.getServletPath();
String url = request.getRequestURI().substring(servletUrl.length());
if (url.charAt(0) == '/' && url.length() > 1) {
url = url.substring(1);
}
@@ -139,7 +139,7 @@ public class SyndicationServlet extends HttpServlet {
RepositoryModel model = GitBlit.self().getRepositoryModel(repositoryName);
List<RevCommit> commits = JGitUtils.getRevLog(repository, objectId, 0, length);
try {
SyndicationUtils.toRSS(hostURL, getTitle(model.name, objectId), model.description,
SyndicationUtils.toRSS(HttpUtils.getGitblitURL(request), getTitle(model.name, objectId), model.description,
model.name, commits, response.getOutputStream());
} catch (Exception e) {
logger.error("An error occurred during feed generation", e);

+ 3
- 2
src/com/gitblit/utils/HttpUtils.java 查看文件

@@ -26,12 +26,12 @@ import javax.servlet.http.HttpServletRequest;
public class HttpUtils {
/**
* Returns the host URL based on the request.
* Returns the Gitblit URL based on the request.
*
* @param request
* @return the host url
*/
public static String getHostURL(HttpServletRequest request) {
public static String getGitblitURL(HttpServletRequest request) {
StringBuilder sb = new StringBuilder();
sb.append(request.getScheme());
sb.append("://");
@@ -40,6 +40,7 @@ public class HttpUtils {
|| (request.getScheme().equals("https") && request.getServerPort() != 443)) {
sb.append(":" + request.getServerPort());
}
sb.append(request.getContextPath());
return sb.toString();
}
}

+ 2
- 2
src/com/gitblit/wicket/WicketUtils.java 查看文件

@@ -217,9 +217,9 @@ public class WicketUtils {
return new ContextRelativeResource(file);
}
public static String getHostURL(Request request) {
public static String getGitblitURL(Request request) {
HttpServletRequest req = ((WebRequest) request).getHttpServletRequest();
return HttpUtils.getHostURL(req);
return HttpUtils.getGitblitURL(req);
}
public static HeaderContributor syndicationDiscoveryLink(final String feedTitle,

+ 3
- 3
src/com/gitblit/wicket/pages/CommitPage.java 查看文件

@@ -92,9 +92,9 @@ public class CommitPage extends RepositoryPage {
add(new LinkPanel("commitTree", "list", c.getTree().getName(), TreePage.class,
newCommitParameter()));
add(new BookmarkablePageLink<Void>("treeLink", TreePage.class, newCommitParameter()));
add(new ExternalLink("zipLink", DownloadZipServlet.asLink(getRequest()
.getRelativePathPrefixToContextRoot(), repositoryName, objectId, null))
.setVisible(GitBlit.getBoolean(Keys.web.allowZipDownloads, true)));
final String baseUrl = WicketUtils.getGitblitURL(getRequest());
add(new ExternalLink("zipLink", DownloadZipServlet.asLink(baseUrl, repositoryName,
objectId, null)).setVisible(GitBlit.getBoolean(Keys.web.allowZipDownloads, true)));
// Parent Commits
ListDataProvider<String> parentsDp = new ListDataProvider<String>(parents);

+ 1
- 1
src/com/gitblit/wicket/pages/SendProposalPage.java 查看文件

@@ -52,7 +52,7 @@ public class SendProposalPage extends BasePage {
final String token = WicketUtils.getToken(params);
myUrl = WicketUtils.getHostURL(getRequest());
myUrl = WicketUtils.getGitblitURL(getRequest());
destinationUrl = "https://";
// temporary proposal

+ 1
- 1
src/com/gitblit/wicket/pages/SummaryPage.java 查看文件

@@ -114,7 +114,7 @@ public class SummaryPage extends RepositoryPage {
add(WicketUtils.newClearPixel("accessRestrictionIcon").setVisible(false));
}
StringBuilder sb = new StringBuilder();
sb.append(WicketUtils.getHostURL(getRequestCycle().getRequest()));
sb.append(WicketUtils.getGitblitURL(getRequestCycle().getRequest()));
sb.append(Constants.GIT_PATH);
sb.append(repositoryName);
repositoryUrls.add(sb.toString());

+ 5
- 4
src/com/gitblit/wicket/pages/TreePage.java 查看文件

@@ -78,6 +78,8 @@ public class TreePage extends RepositoryPage {
final ByteFormat byteFormat = new ByteFormat();
final String baseUrl = WicketUtils.getGitblitURL(getRequest());
// changed paths list
ListDataProvider<PathModel> pathsDp = new ListDataProvider<PathModel>(paths);
DataView<PathModel> pathsView = new DataView<PathModel>("changedPath", pathsDp) {
@@ -112,10 +114,9 @@ public class TreePage extends RepositoryPage {
links.add(new BookmarkablePageLink<Void>("history", HistoryPage.class,
WicketUtils.newPathParameter(repositoryName, entry.commitId,
entry.path)));
links.add(new ExternalLink("zip", DownloadZipServlet.asLink(getRequest()
.getRelativePathPrefixToContextRoot(), repositoryName, objectId,
entry.path)).setVisible(GitBlit.getBoolean(
Keys.web.allowZipDownloads, true)));
links.add(new ExternalLink("zip", DownloadZipServlet.asLink(baseUrl,
repositoryName, objectId, entry.path)).setVisible(GitBlit
.getBoolean(Keys.web.allowZipDownloads, true)));
item.add(links);
} else {
// blob link

+ 1
- 1
src/com/gitblit/wicket/panels/FederationTokensPanel.java 查看文件

@@ -41,7 +41,7 @@ public class FederationTokensPanel extends BasePanel {
public FederationTokensPanel(String wicketId, final boolean showFederation) {
super(wicketId);
final String baseUrl = getRequest().getRelativePathPrefixToContextRoot();
final String baseUrl = WicketUtils.getGitblitURL(getRequest());
add(new ExternalLink("federatedUsers", FederationServlet.asFederationLink(baseUrl, GitBlit.self()
.getFederationToken(FederationToken.USERS_AND_REPOSITORIES),
FederationRequest.PULL_USERS)));

+ 4
- 3
src/com/gitblit/wicket/panels/RepositoriesPanel.java 查看文件

@@ -125,6 +125,8 @@ public class RepositoriesPanel extends BasePanel {
} else {
dp = new SortableRepositoriesProvider(models);
}
final String baseUrl = WicketUtils.getGitblitURL(getRequest());
DataView<RepositoryModel> dataView = new DataView<RepositoryModel>("row", dp) {
private static final long serialVersionUID = 1L;
@@ -271,9 +273,8 @@ public class RepositoriesPanel extends BasePanel {
} else {
row.add(new Label("repositoryLinks"));
}
row.add(new ExternalLink("syndication", SyndicationServlet.asLink(getRequest()
.getRelativePathPrefixToContextRoot(), entry.name, null, 0))
.setVisible(linksActive));
row.add(new ExternalLink("syndication", SyndicationServlet.asLink(baseUrl,
entry.name, null, 0)).setVisible(linksActive));
WicketUtils.setAlternatingBackground(item, counter);
counter++;
}

Loading…
取消
儲存