-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
- Loading branch information
Showing
44 changed files
with
8,642 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?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>demo-apps</artifactId> | ||
<version>3.12.0-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>cf-cloud-demo-server</artifactId> | ||
<packaging>jar</packaging> | ||
|
||
<name>Cf-CloudDemoServer</name> | ||
<description>Californium (Cf) Cloud Demo server</description> | ||
|
||
<properties> | ||
<assembly.mainClass>org.eclipse.californium.cloud.DemoServer</assembly.mainClass> | ||
<skipNexusStagingDeployMojo>false</skipNexusStagingDeployMojo> | ||
<skipStaging>false</skipStaging> | ||
<maven.javadoc.skip>false</maven.javadoc.skip> | ||
</properties> | ||
|
||
<dependencies> | ||
<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>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> | ||
|
||
<!-- runtime dependencies --> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>demo-certs</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<!-- inherit configuration from parent POM --> | ||
</plugin> | ||
<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>cf-encrypt</artifactId> | ||
<version>${project.version}</version> | ||
<type>${project.packaging}</type> | ||
</artifactItem> | ||
</artifactItems> | ||
<outputDirectory>target</outputDirectory> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#/******************************************************************************* | ||
# * 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-cloud-demo-server-update.jar | ||
# | ||
# on | ||
# systemctl restart cali | ||
# | ||
# that file is copied to cf-cloud-demo-server.jar and executed. | ||
# If cf-cloud-demo-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 Cloud Demo Server | ||
BindsTo=network-online.target | ||
After=network-online.target | ||
RequiresMountsFor=/home | ||
|
||
[Service] | ||
Type=simple | ||
TasksMax=256 | ||
User=cali | ||
WorkingDirectory=/home/cali | ||
Environment="JAR=cf-cloud-demo-server.jar" | ||
Environment="OPTS=-XX:MaxRAMPercentage=75 -Dlogback.configurationFile=./logback.xml" | ||
Environment="ARGS1=--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" | ||
Environment="HTTPS_CERT_ARGS=--https-credentials=/etc/letsencrypt/live/<domain>" | ||
ExecStartPre=/bin/cp -u cf-cloud-demo-server-update.jar ${JAR} | ||
ExecStart=/usr/bin/java $OPTS -jar ${JAR} $ARGS1 $ARGS2 $HTTPS_ARGS $HTTPS_CERT_ARGS | ||
RestartSec=10 | ||
Restart=always | ||
OOMPolicy=stop | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
47 changes: 47 additions & 0 deletions
47
demo-apps/cf-cloud-demo-server/service/cloud-installs/cloud-config-dev.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#cloud-config | ||
|
||
#/******************************************************************************* | ||
# * 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 | ||
# * | ||
# ******************************************************************************/ | ||
# | ||
# cloud-init configuration to deploy local artefacts with deploy-dev.sh | ||
|
||
package_upgrade: true | ||
|
||
packages: | ||
# java - runtime for java application | ||
- openjdk-17-jre-headless | ||
# fail2ban - network protection | ||
- fail2ban | ||
|
||
snap: | ||
commands: | ||
- snap refresh | ||
# public x509 certificate / letsencrypt | ||
- snap install --classic certbot | ||
|
||
disable_root: false | ||
|
||
users: | ||
- name: cali | ||
gecos: (Cf) Californium Demo Server | ||
lock_passwd: true | ||
|
||
# the java application, ip-firewall and fail2ban configuration | ||
# are applied from local storage with scp/ssh | ||
|
Oops, something went wrong.