James Moger
2011-09-26 2179fb76bbbd2021c350a7c28d6901389ed50b2b
Fixed broken urls for WAR builds.
13 files modified
70 ■■■■■ changed files
docs/00_index.mkd 11 ●●●● patch | view | raw | blame | history
docs/04_releases.mkd 6 ●●●● patch | view | raw | blame | history
src/com/gitblit/AccessRestrictionFilter.java 3 ●●●● patch | view | raw | blame | history
src/com/gitblit/FederationServlet.java 7 ●●●●● patch | view | raw | blame | history
src/com/gitblit/SyndicationServlet.java 6 ●●●● patch | view | raw | blame | history
src/com/gitblit/utils/HttpUtils.java 5 ●●●●● patch | view | raw | blame | history
src/com/gitblit/wicket/WicketUtils.java 4 ●●●● patch | view | raw | blame | history
src/com/gitblit/wicket/pages/CommitPage.java 6 ●●●● patch | view | raw | blame | history
src/com/gitblit/wicket/pages/SendProposalPage.java 2 ●●● patch | view | raw | blame | history
src/com/gitblit/wicket/pages/SummaryPage.java 2 ●●● patch | view | raw | blame | history
src/com/gitblit/wicket/pages/TreePage.java 9 ●●●●● patch | view | raw | blame | history
src/com/gitblit/wicket/panels/FederationTokensPanel.java 2 ●●● patch | view | raw | blame | history
src/com/gitblit/wicket/panels/RepositoriesPanel.java 7 ●●●●● patch | view | raw | blame | history
docs/00_index.mkd
@@ -15,16 +15,20 @@
    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 @@
- 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]
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 @@
- updated: MarkdownPapers 1.1.1
- updated: Wicket 1.4.18
- updated: JGit 1.1.0
- fixed: syndication urls for WAR builds
### Older Releases
src/com/gitblit/AccessRestrictionFilter.java
@@ -130,7 +130,8 @@
        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);
src/com/gitblit/FederationServlet.java
@@ -159,9 +159,8 @@
                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 @@
        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)) {
src/com/gitblit/SyndicationServlet.java
@@ -116,8 +116,8 @@
            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 @@
        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);
src/com/gitblit/utils/HttpUtils.java
@@ -26,12 +26,12 @@
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 @@
                || (request.getScheme().equals("https") && request.getServerPort() != 443)) {
            sb.append(":" + request.getServerPort());
        }
        sb.append(request.getContextPath());
        return sb.toString();
    }
}
src/com/gitblit/wicket/WicketUtils.java
@@ -217,9 +217,9 @@
        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,
src/com/gitblit/wicket/pages/CommitPage.java
@@ -92,9 +92,9 @@
        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);
src/com/gitblit/wicket/pages/SendProposalPage.java
@@ -52,7 +52,7 @@
        final String token = WicketUtils.getToken(params);
        myUrl = WicketUtils.getHostURL(getRequest());
        myUrl = WicketUtils.getGitblitURL(getRequest());
        destinationUrl = "https://";
        // temporary proposal
src/com/gitblit/wicket/pages/SummaryPage.java
@@ -114,7 +114,7 @@
                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());
src/com/gitblit/wicket/pages/TreePage.java
@@ -78,6 +78,8 @@
        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 @@
                        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
src/com/gitblit/wicket/panels/FederationTokensPanel.java
@@ -41,7 +41,7 @@
    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)));
src/com/gitblit/wicket/panels/RepositoriesPanel.java
@@ -125,6 +125,8 @@
        } 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 @@
                } 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++;
            }