Skip to content

Commit

Permalink
GH-364 Improve base path handling (Fix #364)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzikoysk committed Feb 21, 2021
1 parent 88abab0 commit ef8dad6
Show file tree
Hide file tree
Showing 17 changed files with 13,507 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/docs/docker.html
Expand Up @@ -62,7 +62,7 @@
<h2><a class="anchor" aria-hidden="true" id="installation"></a><a href="#installation" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Installation</h2>
<p>First of all, you have to pull the image from <a href="https://hub.docker.com/r/dzikoysk/reposilite">DockerHub</a>:</p>
<pre><code class="hljs css language-shell-session"><span class="hljs-comment">// released builds, e.g. 2.9.13</span>
$ docker pull dzikoysk/reposilite:<span class="hljs-number">2.9</span><span class="hljs-number">.10</span>
$ docker pull dzikoysk/reposilite:<span class="hljs-number">2.9</span><span class="hljs-number">.13</span>

<span class="hljs-comment">// nightly builds</span>
$ docker pull dzikoysk/reposilite:nightly
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/docker/index.html
Expand Up @@ -62,7 +62,7 @@
<h2><a class="anchor" aria-hidden="true" id="installation"></a><a href="#installation" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Installation</h2>
<p>First of all, you have to pull the image from <a href="https://hub.docker.com/r/dzikoysk/reposilite">DockerHub</a>:</p>
<pre><code class="hljs css language-shell-session"><span class="hljs-comment">// released builds, e.g. 2.9.13</span>
$ docker pull dzikoysk/reposilite:<span class="hljs-number">2.9</span><span class="hljs-number">.10</span>
$ docker pull dzikoysk/reposilite:<span class="hljs-number">2.9</span><span class="hljs-number">.13</span>

<span class="hljs-comment">// nightly builds</span>
$ docker pull dzikoysk/reposilite:nightly
Expand Down
12 changes: 11 additions & 1 deletion docs/docs/reverse-proxy.html
Expand Up @@ -73,7 +73,8 @@ <h2><a class="anchor" aria-hidden="true" id="nginx"></a><a href="#nginx" aria-hi
<span class="hljs-attr">listen</span> <span class="hljs-string">80; </span>
<span class="hljs-attr">listen</span> <span class="hljs-string">[::]:80; </span>
<span class="hljs-attr">access_log</span> <span class="hljs-string">/var/log/nginx/reverse-access.log; </span>
<span class="hljs-attr">error_log</span> <span class="hljs-string">/var/log/nginx/reverse-error.log; </span>
<span class="hljs-attr">error_log</span> <span class="hljs-string">/var/log/nginx/reverse-error.log;</span>

<span class="hljs-attr">location</span> <span class="hljs-string">/ {</span>
<span class="hljs-attr">proxy_pass</span> <span class="hljs-string">http://reposilite;</span>
<span class="hljs-attr">proxy_set_header</span> <span class="hljs-string">Host $host;</span>
Expand All @@ -86,6 +87,15 @@ <h2><a class="anchor" aria-hidden="true" id="nginx"></a><a href="#nginx" aria-hi
<span class="hljs-meta">}</span> <span class="hljs-string"></span>
<span class="hljs-meta">}</span> <span class="hljs-string"></span>
</code></pre>
<p>To use custom base path (e.g. <code>/reposilite</code>), modify the configuration just like this:</p>
<pre><code class="hljs css language-conf"><span class="hljs-attribute">location</span> /reposilite/ {
<span class="hljs-attribute">rewrite</span> /reposilite/(.*) /<span class="hljs-variable">$1</span> <span class="hljs-literal">break</span>;
}
</code></pre>
<p>And update the base path in Reposilite configuration:</p>
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Custom base path</span>
<span class="hljs-attr">basePath:</span> <span class="hljs-string">/reposilite/</span>
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="apache"></a><a href="#apache" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Apache</h2>
<pre><code class="hljs css language-conf"><span class="hljs-comment"># reposilite is listening on 127.0.0.1:8081</span>
<span class="hljs-attribute"><span class="hljs-nomarkup">RewriteEngine</span></span> <span class="hljs-literal">On</span>
Expand Down
12 changes: 11 additions & 1 deletion docs/docs/reverse-proxy/index.html
Expand Up @@ -73,7 +73,8 @@ <h2><a class="anchor" aria-hidden="true" id="nginx"></a><a href="#nginx" aria-hi
<span class="hljs-attr">listen</span> <span class="hljs-string">80; </span>
<span class="hljs-attr">listen</span> <span class="hljs-string">[::]:80; </span>
<span class="hljs-attr">access_log</span> <span class="hljs-string">/var/log/nginx/reverse-access.log; </span>
<span class="hljs-attr">error_log</span> <span class="hljs-string">/var/log/nginx/reverse-error.log; </span>
<span class="hljs-attr">error_log</span> <span class="hljs-string">/var/log/nginx/reverse-error.log;</span>

<span class="hljs-attr">location</span> <span class="hljs-string">/ {</span>
<span class="hljs-attr">proxy_pass</span> <span class="hljs-string">http://reposilite;</span>
<span class="hljs-attr">proxy_set_header</span> <span class="hljs-string">Host $host;</span>
Expand All @@ -86,6 +87,15 @@ <h2><a class="anchor" aria-hidden="true" id="nginx"></a><a href="#nginx" aria-hi
<span class="hljs-meta">}</span> <span class="hljs-string"></span>
<span class="hljs-meta">}</span> <span class="hljs-string"></span>
</code></pre>
<p>To use custom base path (e.g. <code>/reposilite</code>), modify the configuration just like this:</p>
<pre><code class="hljs css language-conf"><span class="hljs-attribute">location</span> /reposilite/ {
<span class="hljs-attribute">rewrite</span> /reposilite/(.*) /<span class="hljs-variable">$1</span> <span class="hljs-literal">break</span>;
}
</code></pre>
<p>And update the base path in Reposilite configuration:</p>
<pre><code class="hljs css language-yaml"><span class="hljs-comment"># Custom base path</span>
<span class="hljs-attr">basePath:</span> <span class="hljs-string">/reposilite/</span>
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="apache"></a><a href="#apache" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Apache</h2>
<pre><code class="hljs css language-conf"><span class="hljs-comment"># reposilite is listening on 127.0.0.1:8081</span>
<span class="hljs-attribute"><span class="hljs-nomarkup">RewriteEngine</span></span> <span class="hljs-literal">On</span>
Expand Down
Binary file modified docs/img/about-feather.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/about-preview.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/cli-preview.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/cloudflare-cache-bypass.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/customization-old.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/dashboard-upload.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/favicon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -45,7 +45,7 @@ public String getApp() {
public static FrontendService load(Configuration configuration) {
Formatter formatter = new Formatter()
.register("{{REPOSILITE.BASE_PATH}}", configuration.basePath)
.register("{{REPOSILITE.VUE_BASE_PATH}}", configuration.basePath.equals("/") ? "" : configuration.basePath)
.register("{{REPOSILITE.VUE_BASE_PATH}}", configuration.basePath.substring(0, configuration.basePath.length() - 1))
.register("{{REPOSILITE.TITLE}}", configuration.title.replace("'", "\\'"))
.register("{{REPOSILITE.DESCRIPTION}}", configuration.description.replace("'", "\\'"))
.register("{{REPOSILITE.ACCENT_COLOR}}", configuration.accentColor);
Expand Down
2 changes: 1 addition & 1 deletion reposilite-backend/src/main/resources/static/js/app.js

Large diffs are not rendered by default.

0 comments on commit ef8dad6

Please sign in to comment.