Skip to content

Commit

Permalink
Merge branch 'master' into 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dzikoysk committed May 1, 2021
2 parents c710dcb + 0c8cc2d commit 213f198
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.9"
services:
reposilite:
image: reposilite:2.9.21-SNAPSHOT
image: reposilite:2.9.22-SNAPSHOT
build:
context: .
dockerfile: Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/docker.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</ul>
<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.21-SNAPSHOT</span>
<pre><code class="hljs css language-shell-session"><span class="hljs-comment">// released builds, e.g. 2.9.22-SNAPSHOT</span>
$ docker pull dzikoysk/reposilite:<span class="hljs-number">2.9</span><span class="hljs-number">.21</span>-SNAPSHOT

<span class="hljs-comment">// nightly builds</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/docker/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</ul>
<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.21-SNAPSHOT</span>
<pre><code class="hljs css language-shell-session"><span class="hljs-comment">// released builds, e.g. 2.9.22-SNAPSHOT</span>
$ docker pull dzikoysk/reposilite:<span class="hljs-number">2.9</span><span class="hljs-number">.21</span>-SNAPSHOT

<span class="hljs-comment">// nightly builds</span>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<groupId>org.panda-lang</groupId>
<artifactId>reposilite-parent</artifactId>
<packaging>pom</packaging>
<version>2.9.21-SNAPSHOT</version>
<version>2.9.22-SNAPSHOT</version>

<modules>
<module>reposilite-backend</module>
Expand Down
2 changes: 1 addition & 1 deletion reposilite-backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<artifactId>reposilite-parent</artifactId>
<groupId>org.panda-lang</groupId>
<version>2.9.21-SNAPSHOT</version>
<version>2.9.22-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public final class ReposiliteConstants {

public static final String NAME = "Reposilite";

public static final String VERSION = "2.9.21-SNAPSHOT";
public static final String VERSION = "2.9.22-SNAPSHOT";

public static final String REMOTE_VERSION = "https://repo.panda-lang.org/org/panda-lang/reposilite/latest";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@

package org.panda_lang.reposilite.error;

import org.jetbrains.annotations.Nullable;
import org.panda_lang.reposilite.Reposilite;
import org.panda_lang.utilities.commons.ArrayUtils;
import org.panda_lang.utilities.commons.StringUtils;

import java.util.Collection;
import java.util.Set;
Expand All @@ -32,9 +34,16 @@ public void throwException(String id, Throwable throwable) {

exceptions.add(String.join(System.lineSeparator(),
"failure " + id,
throwException(throwable)
).trim());
}

private String throwException(@Nullable Throwable throwable) {
return throwable == null ? StringUtils.EMPTY : String.join(System.lineSeparator(),
" by " + throwable.getClass().getSimpleName() + ": " + throwable.getMessage(),
" at " + ArrayUtils.get(throwable.getStackTrace(), 0).map(StackTraceElement::toString).orElseGet("<unknown stacktrace>")
));
" at " + ArrayUtils.get(throwable.getStackTrace(), 0).map(StackTraceElement::toString).orElseGet("<unknown stacktrace>"),
throwException(throwable.getCause())
);
}

public boolean hasFailures() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public LookupController(
@Override
public void handle(Context ctx) {
ReposiliteContext context = contextFactory.create(ctx);
Reposilite.getLogger().info("LOOKUP " + context.uri() + " from " + context.address());
Reposilite.getLogger().debug("LOOKUP " + context.uri() + " from " + context.address());

Result<LookupResponse, ErrorDto> response = lookupService.findLocal(context);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Result<LookupResponse, ErrorDto> findLocal(ReposiliteContext context) {
context.result(outputStream -> FileUtils.copyFile(file, outputStream));
}

Reposilite.getLogger().info("RESOLVED " + file.getPath() + "; mime: " + fileDetails.getContentType() + "; size: " + file.length());
Reposilite.getLogger().debug("RESOLVED " + file.getPath() + "; mime: " + fileDetails.getContentType() + "; size: " + file.length());
return Result.ok(new LookupResponse(fileDetails));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.panda_lang.reposilite.repository;

import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.HttpHeaders;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpRequestFactory;
import com.google.api.client.http.HttpResponse;
Expand Down Expand Up @@ -109,7 +110,13 @@ protected Result<CompletableFuture<Result<LookupResponse, ErrorDto>>, ErrorDto>
continue;
}

long contentLength = Option.of(remoteResponse.getHeaders().getContentLength()).orElseGet(0L);
HttpHeaders headers = remoteResponse.getHeaders();

if ("text/html".equals(headers.getContentType())) {
continue;
}

long contentLength = Option.of(headers.getContentLength()).orElseGet(0L);
String[] path = remoteUri.split("/");

FileDetailsDto fileDetails = new FileDetailsDto(FileDetailsDto.FILE, ArrayUtils.getLast(path), "", remoteResponse.getContentType(), contentLength);
Expand Down
4 changes: 2 additions & 2 deletions reposilite-packages/reposilite-helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.9.21-SNAPSHOT
version: 2.9.22-SNAPSHOT

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "2.9.21-SNAPSHOT"
appVersion: "2.9.22-SNAPSHOT"
4 changes: 2 additions & 2 deletions reposilite-site/docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Reposilite defines two types of builds:
First of all, you have to pull the image from [DockerHub](https://hub.docker.com/r/dzikoysk/reposilite):

```shell-session
// released builds, e.g. 2.9.21-SNAPSHOT
$ docker pull dzikoysk/reposilite:2.9.21-SNAPSHOT
// released builds, e.g. 2.9.22-SNAPSHOT
$ docker pull dzikoysk/reposilite:2.9.22-SNAPSHOT
// nightly builds
$ docker pull dzikoysk/reposilite:nightly
Expand Down

0 comments on commit 213f198

Please sign in to comment.