kopia lustrzana https://github.com/gaul/s3proxy
Upgrade to Jetty 11.0.11
Jetty 9 is EOL. This requires Java 11 and updating some Java EE imports. Fixes #422.pull/458/head
rodzic
277ef3c9d7
commit
d375011388
|
@ -23,7 +23,8 @@ and has instructions on how to run it.
|
||||||
|
|
||||||
Users can [download releases](https://github.com/gaul/s3proxy/releases)
|
Users can [download releases](https://github.com/gaul/s3proxy/releases)
|
||||||
from GitHub. Developers can build the project by running `mvn package` which
|
from GitHub. Developers can build the project by running `mvn package` which
|
||||||
produces a binary at `target/s3proxy`. S3Proxy requires Java 8 or newer to run.
|
produces a binary at `target/s3proxy`. S3Proxy requires Java 11 or newer to
|
||||||
|
run.
|
||||||
|
|
||||||
Configure S3Proxy via a properties file. An example using the local
|
Configure S3Proxy via a properties file. An example using the local
|
||||||
file system as the storage backend with anonymous access:
|
file system as the storage backend with anonymous access:
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -491,7 +491,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty</groupId>
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
<artifactId>jetty-servlet</artifactId>
|
<artifactId>jetty-servlet</artifactId>
|
||||||
<version>9.4.45.v20220203</version>
|
<version>11.0.11</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
|
|
|
@ -34,7 +34,6 @@ import java.util.regex.Pattern;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.crypto.Mac;
|
import javax.crypto.Mac;
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
|
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
import com.google.common.base.Splitter;
|
import com.google.common.base.Splitter;
|
||||||
|
@ -46,6 +45,8 @@ import com.google.common.io.BaseEncoding;
|
||||||
import com.google.common.net.HttpHeaders;
|
import com.google.common.net.HttpHeaders;
|
||||||
import com.google.common.net.PercentEscaper;
|
import com.google.common.net.PercentEscaper;
|
||||||
|
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,10 @@ package org.gaul.s3proxy;
|
||||||
|
|
||||||
import static java.util.Objects.requireNonNull;
|
import static java.util.Objects.requireNonNull;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import com.google.common.base.CaseFormat;
|
import com.google.common.base.CaseFormat;
|
||||||
|
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of S3 error codes. Reference:
|
* List of S3 error codes. Reference:
|
||||||
* http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html
|
* http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html
|
||||||
|
|
|
@ -34,6 +34,7 @@ import com.google.common.collect.Lists;
|
||||||
import org.eclipse.jetty.http.HttpCompliance;
|
import org.eclipse.jetty.http.HttpCompliance;
|
||||||
import org.eclipse.jetty.server.HttpConfiguration;
|
import org.eclipse.jetty.server.HttpConfiguration;
|
||||||
import org.eclipse.jetty.server.HttpConnectionFactory;
|
import org.eclipse.jetty.server.HttpConnectionFactory;
|
||||||
|
import org.eclipse.jetty.server.SecureRequestCustomizer;
|
||||||
import org.eclipse.jetty.server.Server;
|
import org.eclipse.jetty.server.Server;
|
||||||
import org.eclipse.jetty.server.ServerConnector;
|
import org.eclipse.jetty.server.ServerConnector;
|
||||||
import org.eclipse.jetty.server.handler.ContextHandler;
|
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||||
|
@ -84,9 +85,13 @@ public final class S3Proxy {
|
||||||
context.setContextPath(builder.servicePath);
|
context.setContextPath(builder.servicePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HttpConfiguration httpConfiguration = new HttpConfiguration();
|
||||||
|
httpConfiguration.setHttpCompliance(HttpCompliance.LEGACY);
|
||||||
|
SecureRequestCustomizer src = new SecureRequestCustomizer();
|
||||||
|
src.setSniHostCheck(false);
|
||||||
|
httpConfiguration.addCustomizer(src);
|
||||||
HttpConnectionFactory httpConnectionFactory =
|
HttpConnectionFactory httpConnectionFactory =
|
||||||
new HttpConnectionFactory(
|
new HttpConnectionFactory(httpConfiguration);
|
||||||
new HttpConfiguration(), HttpCompliance.LEGACY);
|
|
||||||
ServerConnector connector;
|
ServerConnector connector;
|
||||||
if (builder.endpoint != null) {
|
if (builder.endpoint != null) {
|
||||||
connector = new ServerConnector(server, httpConnectionFactory);
|
connector = new ServerConnector(server, httpConnectionFactory);
|
||||||
|
@ -99,7 +104,7 @@ public final class S3Proxy {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (builder.secureEndpoint != null) {
|
if (builder.secureEndpoint != null) {
|
||||||
SslContextFactory sslContextFactory =
|
SslContextFactory.Server sslContextFactory =
|
||||||
new SslContextFactory.Server();
|
new SslContextFactory.Server();
|
||||||
sslContextFactory.setKeyStorePath(builder.keyStorePath);
|
sslContextFactory.setKeyStorePath(builder.keyStorePath);
|
||||||
sslContextFactory.setKeyStorePassword(builder.keyStorePassword);
|
sslContextFactory.setKeyStorePassword(builder.keyStorePassword);
|
||||||
|
|
|
@ -53,8 +53,6 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.crypto.Mac;
|
import javax.crypto.Mac;
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import javax.xml.stream.XMLOutputFactory;
|
import javax.xml.stream.XMLOutputFactory;
|
||||||
import javax.xml.stream.XMLStreamException;
|
import javax.xml.stream.XMLStreamException;
|
||||||
import javax.xml.stream.XMLStreamWriter;
|
import javax.xml.stream.XMLStreamWriter;
|
||||||
|
@ -82,6 +80,9 @@ import com.google.common.net.HostAndPort;
|
||||||
import com.google.common.net.HttpHeaders;
|
import com.google.common.net.HttpHeaders;
|
||||||
import com.google.common.net.PercentEscaper;
|
import com.google.common.net.PercentEscaper;
|
||||||
|
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.apache.commons.fileupload.MultipartStream;
|
import org.apache.commons.fileupload.MultipartStream;
|
||||||
import org.jclouds.blobstore.BlobStore;
|
import org.jclouds.blobstore.BlobStore;
|
||||||
import org.jclouds.blobstore.KeyNotFoundException;
|
import org.jclouds.blobstore.KeyNotFoundException;
|
||||||
|
|
|
@ -21,11 +21,12 @@ import java.io.InputStream;
|
||||||
import java.util.concurrent.TimeoutException;
|
import java.util.concurrent.TimeoutException;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.eclipse.jetty.server.Request;
|
import org.eclipse.jetty.server.Request;
|
||||||
import org.eclipse.jetty.server.handler.AbstractHandler;
|
import org.eclipse.jetty.server.handler.AbstractHandler;
|
||||||
import org.jclouds.blobstore.BlobStore;
|
import org.jclouds.blobstore.BlobStore;
|
||||||
|
|
|
@ -1006,7 +1006,7 @@ public final class AwsSdkTest {
|
||||||
@Test
|
@Test
|
||||||
public void testSinglepartUploadJettyCachedHeader() throws Exception {
|
public void testSinglepartUploadJettyCachedHeader() throws Exception {
|
||||||
String blobName = "singlepart-upload-jetty-cached";
|
String blobName = "singlepart-upload-jetty-cached";
|
||||||
String contentType = "text/plain;charset=utf-8";
|
String contentType = "text/plain";
|
||||||
ObjectMetadata metadata = new ObjectMetadata();
|
ObjectMetadata metadata = new ObjectMetadata();
|
||||||
metadata.setContentLength(BYTE_SOURCE.size());
|
metadata.setContentLength(BYTE_SOURCE.size());
|
||||||
metadata.setContentType(contentType);
|
metadata.setContentType(contentType);
|
||||||
|
|
Ładowanie…
Reference in New Issue