Skip to content

Commit

Permalink
Add coap-S3-proxy.
Browse files Browse the repository at this point in the history
Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
  • Loading branch information
boaks committed Jun 5, 2024
1 parent cfffbd1 commit 722b2a3
Show file tree
Hide file tree
Showing 52 changed files with 12,172 additions and 1 deletion.
650 changes: 650 additions & 0 deletions demo-apps/cf-s3-proxy-server/README.md

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 88 additions & 0 deletions demo-apps/cf-s3-proxy-server/docs/coap-s3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions demo-apps/cf-s3-proxy-server/docs/quadrant.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
144 changes: 144 additions & 0 deletions demo-apps/cf-s3-proxy-server/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
<?xml version='1.0' encoding='UTF-8'?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.eclipse.californium</groupId>
<artifactId>cf-bom</artifactId>
<version>3.12.0-SNAPSHOT</version>
<relativePath>../../bom</relativePath>
</parent>
<artifactId>cf-s3-proxy-server</artifactId>
<packaging>jar</packaging>

<name>Cf-S3-ProxyServer</name>
<description>Californium (Cf) S3 Proxy Server</description>

<properties>
<assembly.mainClass>org.eclipse.californium.cloud.s3.S3ProxyServer</assembly.mainClass>
<skipNexusStagingDeployMojo>false</skipNexusStagingDeployMojo>
<skipStaging>false</skipStaging>
<maven.javadoc.skip>false</maven.javadoc.skip>
<animal.sniffer.skip>true</animal.sniffer.skip>
<revapi.skip>true</revapi.skip>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.javaVersion>1.8</project.build.javaVersion>
<maven.compiler.release>8</maven.compiler.release>
<aws.sdk.version>2.25.55</aws.sdk.version>
</properties>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>californium-legal</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>californium-core</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>scandium</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>cf-unix-health</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
</dependency>
<dependency>
<groupId>com.upokecenter</groupId>
<artifactId>cbor</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>cf-cloud-demo-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version>${aws.sdk.version}</version>
<exclusions>
<exclusion>
<groupId>software.amazon.awssdk</groupId>
<artifactId>apache-client</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- runtime dependencies -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>demo-certs</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<artifactId>netty-nio-client</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>${aws.sdk.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-installed</id>
<?m2e ignore?>
<phase>install</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<type>${project.packaging}</type>
</artifactItem>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>cf-encrypt</artifactId>
<version>${project.version}</version>
<type>${project.packaging}</type>
</artifactItem>
</artifactItems>
<outputDirectory>target</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>enhanced-jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>

</project>
67 changes: 67 additions & 0 deletions demo-apps/cf-s3-proxy-server/service/cali.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#/*******************************************************************************
# * Copyright (c) 2024 Contributors to the Eclipse Foundation.
# *
# * See the NOTICE file(s) distributed with this work for additional
# * information regarding copyright ownership.
# *
# * This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v2.0
# * and Eclipse Distribution License v1.0 which accompany this distribution.
# *
# * The Eclipse Public License is available at
# * http://www.eclipse.org/legal/epl-v20.html
# * and the Eclipse Distribution License is available at
# * http://www.eclipse.org/org/documents/edl-v10.html.
# *
# * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
# *
# ******************************************************************************/
#
# To install, cp <file> to /etc/systemd/system
#
# The value of "TasksMax" is increasing with the numbers of connectors
# according the used networkconfig.
#
# Use
# top -H
#
# to see the number of threads
#
# In order to update the service, cp the new .jar to
# /home/cali/cf-s3-proxy-server-update.jar
#
# on
# systemctl restart cali
#
# that file is copied to cf-s3-proxy-server.jar and executed.
# If cf-s3-proxy-server.jar is updated inplace when running,
# that my cause unintended exceptions, which prevents Californium
# from successfully gracefull-restart of the dtls state.
#

[Unit]
Description=Californium S3-Proxy Server
BindsTo=network-online.target
After=network-online.target
RequiresMountsFor=/home

[Service]
Type=simple
TasksMax=256
User=cali
WorkingDirectory=/home/cali
Environment="JAR=cf-s3-proxy-server.jar"
Environment="OPTS=-XX:MaxRAMPercentage=75 -Dlogback.configurationFile=./logback.xml"
Environment="ARGS= --diagnose --no-loopback --store-file=connections.bin --store-max-age=72 --store-password64=TDNLOmJTWi13JUs/YGdvNA=="
Environment="ARGS2=--device-file=demo-devices.txt --coaps-credentials ."
Environment="HTTPS_ARGS=--https-port=8080 --user-file users.txt --config-file configs.txt"
Environment="HTTPS_CERT_ARGS=--https-credentials=/etc/letsencrypt/live/<domain>"
Environment="S3_ARGS=--s3-config /home/cali/.s3cfg --s3-concurrency 400 --s3-redirect --spa-s3"
ExecStartPre=/bin/cp -u cf-s3-proxy-server-update.jar ${JAR}
ExecStart=/usr/bin/java $OPTS -jar ${JAR} $ARGS $ARGS2 $HTTPS_ARGS $HTTPS_CERT_ARGS $S3_ARGS
RestartSec=10
Restart=always
OOMPolicy=stop

[Install]
WantedBy=multi-user.target
Loading

0 comments on commit 722b2a3

Please sign in to comment.