Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .ci_cd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ docker image tag updates. The file layout is:

```json
{
// Configure behaviour on push
// Configure behavior on push
"push": {
// Name of branch to react to (exact match)
"develop": {
Expand All @@ -32,7 +32,7 @@ docker image tag updates. The file layout is:
}
}
},
// Configure behaviour on release
// Configure behavior on release
"release": {
// Comma separated list of tags to push to openremote/manager docker hub image $version is replaced with release version
// This can only be used on the OpenRemote Core repo (openremote/core)
Expand Down Expand Up @@ -81,24 +81,24 @@ The naming convention should be as follows:

# `host_init` Directory

Contains scripts/files required to initialise the host ready for running the stack (e.g. download map tiles etc.); if
Contains scripts/files required to initialize the host ready for running the stack (e.g. download map tiles etc.); if
the repo is a custom project then any files in the same path of the custom repo will be overlaid on top of the
standard openremote repo files (thus allowing custom project override of any behaviour). The workflow looks for one of
standard openremote repo files (thus allowing custom project override of any behavior). The workflow looks for one of
the following bash scripts (in priority order):

- `host_init/init_${ENVIRONMENT}.sh` - Bash script for environment specific host initialisation
- `host_init/init_${ENVIRONMENT}.sh` - Bash script for environment specific host initialization
- `host_init/init.sh` - Bash script that can be used by any environment as a fallback if no environment specific script
exists

If an initialisation script is found then the entire `host_init` directory will be copied to the host and the script
will be executed; by copying the entire directory additional files can be included and called from the initialisation
If an initialization script is found then the entire `host_init` directory will be copied to the host and the script
will be executed; by copying the entire directory additional files can be included and called from the initialization
script as required.

# `aws` Directory

Contains AWS scripts and resources for CI/CD within AWS. If the repo is a custom project then any files in the same path
of the custom repo will be overlaid on top of the standard openremote repo files (thus allowing custom project override
of any behaviour).
of any behavior).

# Variables

Expand Down
2 changes: 1 addition & 1 deletion .ci_cd/aws/cloudformation-create-ec2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ Resources:

# ------------------------------------------------------------------------------------------------------
#
# Script for synchronising files in /deployment.local/backup with S3 bucket with same name as this host
# Script for synchronizing files in /deployment.local/backup with S3 bucket with same name as this host
#
# ------------------------------------------------------------------------------------------------------

Expand Down
10 changes: 5 additions & 5 deletions .ci_cd/aws/provision_account.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Provisions a member account of the specified name under the specified OU using Control Tower Account Factory via
# Service Catalog; callee must have required permissions to call the service catalog and must also be in the Control
# Tower home account.
# The customisations for control tower will perform some standard customisations of the provisioned account as defined
# The customizations for control tower will perform some standard customizations of the provisioned account as defined
# in the custom-control-tower-configuration CodeCommit repo. Also does the following:
#
# * Add /SSH-Key/developers store parameter to the new account's list of SSH public keys (this is used when provisioning
Expand Down Expand Up @@ -121,21 +121,21 @@ fi
echo "Storing account ID for future reference"
aws ssm put-parameter --name "/Account-Ids/$AWS_ACCOUNT_NAME" --value "$AWS_ACCOUNT_ID" --type String &>/dev/null

# Wait for control tower customisations to complete
# Wait for control tower customizations to complete
STATUS=$(aws codepipeline list-pipeline-executions --pipeline-name Custom-Control-Tower-CodePipeline --query "pipelineExecutionSummaries[0].status" --output text)
count=0
while [ "$STATUS" == 'InProgress' ] && [ $count -lt 30 ]; do
echo "Code pipeline for control tower customisations status is $STATUS .. Sleeping 30 seconds"
echo "Code pipeline for control tower customizations status is $STATUS .. Sleeping 30 seconds"
sleep 30
STATUS=$(aws codepipeline list-pipeline-executions --pipeline-name Custom-Control-Tower-CodePipeline --query "pipelineExecutionSummaries[0].status" --output text)
count=$((count+1))
done

if [ "$STATUS" != 'Succeeded' ]; then
echo "Control tower customisation pipeline has failed cannot continue until this is resolved"
echo "Control tower customization pipeline has failed cannot continue until this is resolved"
exit 1
else
echo "Control tower customisation pipeline has succeeded"
echo "Control tower customization pipeline has succeeded"
fi

# Update aws github-da profile with this account
Expand Down
2 changes: 1 addition & 1 deletion .ci_cd/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# !!!!!!!!! MUST BE RUN FROM THE REPO ROOT DIR !!!!!!!!!
#
# Script that handles packaging deployment files and executing stack down/up via SCP/SSH; between stack down/up the
# host init script is executed (see .ci_cd/host_init/init.sh) this initialises the host and configures any standard
# host init script is executed (see .ci_cd/host_init/init.sh) this initializes the host and configures any standard
# deployment maintenance tasks (daily restart, daily backups, etc.).
#
# If AWS CLI authentication variables are configured then this script can use the AWS CLI to perform AWS specific
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# - Deploying to hosts on push/release and/or manual trigger and/or when certain openremote/manager docker tags are updated
#
# By default this workflow will just run tests on push/release; distribution (pushing of openremote/manager docker image)
# and deployment behaviour is configured via the .ci_cd/ci_cd.json file (see .ci_cd/README.md for more details).
# and deployment behavior is configured via the .ci_cd/ci_cd.json file (see .ci_cd/README.md for more details).
#
# DEPLOYMENTS
#
Expand Down Expand Up @@ -451,7 +451,7 @@ jobs:

pushSnapshot = os.getenv('INPUT_PUSH_SNAPSHOT')
if pushSnapshot == 'true' and repoOwner != 'openremote':
os.system("echo 'Only Openremote organisation can push to ECR'")
os.system("echo 'Only Openremote organization can push to ECR'")
sys.exit(1)
else:
os.system(f"echo 'pushSnapshot={pushSnapshot}' >> $GITHUB_OUTPUT")
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# The repo must contain a 'deployment/Dockerfile' and a 'deployment/build.gradle' with an installDist task that prepares
# the deployment image in the 'deployment/build' directory; if this condition is not met the deployment will fail.
# Deployments are only done for repos owned by the openremote organisation.
# Deployments are only done for repos owned by the openremote organization.
#
# Each deployment consists of an environment and an openremote/manager docker tag, taken from:
#
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/provision-account.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ---------------------------------------------------------------------------------------------------------------------
# This workflow handles creation of AWS member accounts by calling (.ci_cd/aws/provision_account.sh)
# You need to be a member of the CI/CD github team to use this action as it will incur costs for the organisation.
# You need to be a member of the CI/CD github team to use this action as it will incur costs for the organization.
# ---------------------------------------------------------------------------------------------------------------------

name: Provision Account
Expand All @@ -27,7 +27,7 @@ on:
type: boolean
required: false
OU:
description: "Organisational unit to use for account"
description: "Organizational unit to use for account"
type: string
default: Custom

Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ In sandboxed environments, add `--offline` (requires dependencies to already be

### Writing tests

All backend tests are Groovy Spock specifications. Unit tests live in the project that holds the code, under `<project>/src/test/groovy`. Use an integration test in the `test` project only when the behaviour needs a running manager. Tests for anything under `ui/` follow `ui/AGENTS.md`.
All backend tests are Groovy Spock specifications. Unit tests live in the project that holds the code, under `<project>/src/test/groovy`. Use an integration test in the `test` project only when the behavior needs a running manager. Tests for anything under `ui/` follow `ui/AGENTS.md`.

Since Spock 2.0, unrolling is the default, don't add un-necessary @Unroll annotations.

Expand Down Expand Up @@ -44,7 +44,7 @@ Annotate every endpoint with the resource role of its domain, e.g. `read:alarms`

### Access control

Access control belongs in the resource implementation, not in the service. Extend `ManagerWebResource` and use its checks rather than reaching for the identity provider: `throwIfNotRealmActiveAndAccessible` and `throwIfRestrictedUser` reject with a 403, and `isRealmActiveAndAccessible` and `isRestrictedUser` are there for conditions that need more than a rejection. Resolve the entity first and return 404 when it is missing, then require access to its realm, and apply restricted user rules in the same place. Service methods take already authorised input and state that in their javadoc with "Callers are responsible for enforcing realm authorization." Alarms and notifications are the reference for this shape; equivalent endpoints across the two must enforce the same way. Flows that never pass through a resource, such as notifications published to the message broker, authorise inside the service instead.
Access control belongs in the resource implementation, not in the service. Extend `ManagerWebResource` and use its checks rather than reaching for the identity provider: `throwIfNotRealmActiveAndAccessible` and `throwIfRestrictedUser` reject with a 403, and `isRealmActiveAndAccessible` and `isRestrictedUser` are there for conditions that need more than a rejection. Resolve the entity first and return 404 when it is missing, then require access to its realm, and apply restricted user rules in the same place. Service methods take already authorized input and state that in their javadoc with "Callers are responsible for enforcing realm authorization." Alarms and notifications are the reference for this shape; equivalent endpoints across the two must enforce the same way. Flows that never pass through a resource, such as notifications published to the message broker, authorize inside the service instead.

## Spelling

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[Source](https://github.com/openremote/core) **·** [Documentation](https://docs.openremote.io) **·** [Forum](https://forum.openremote.io) **·** [Issues](https://github.com/openremote/core/issues) **·** [Docker Images](https://hub.docker.com/u/openremote/) **·** [OpenRemote Inc.](https://openremote.io)

Welcome to OpenRemote; an intuitive user-friendly 100% open source IoT platform. You can build a complete IoT device management solution including: device management and auto provisioning, customisation of asset types, automation via when-then, flow, javascript and groovy rules, data analytics, connectivity via several protocol agents and manager APIs (e.g. MQTT broker, HTTP/REST, WS), Multi-tenancy (realms), Users and roles management, Edge gateway, Front-end UI web components and consoles, and an Insights dashboard builder.
Welcome to OpenRemote; an intuitive user-friendly 100% open source IoT platform. You can build a complete IoT device management solution including: device management and auto provisioning, customization of asset types, automation via when-then, flow, javascript and groovy rules, data analytics, connectivity via several protocol agents and manager APIs (e.g. MQTT broker, HTTP/REST, WS), Multi-tenancy (realms), Users and roles management, Edge gateway, Front-end UI web components and consoles, and an Insights dashboard builder.

As the code base is 100% open source, applications are limitless. Here's an architecture overview:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ void cancelConnection() {
executeOnMainThread(
() -> {
LOG.info(
"Cancelling peripheral connection: [Name="
"Canceling peripheral connection: [Name="
+ getPeripheral().getName()
+ ", Address="
+ getPeripheral().getAddress()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ final synchronized ControlMessage parseSegmentedControlLowerTransportPDU(final b
incompleteTimerTask = null;

LOG.info(
"Cancelling Scheduled block ack and incomplete timer, sending an immediate block ack");
"Canceling Scheduled block ack and incomplete timer, sending an immediate block ack");
sendBlockAck(seqZero, ttl, blockAckSrc, blockAckDst, segN);
// mBlockAckSent = false;
}
Expand Down Expand Up @@ -881,7 +881,7 @@ private void sendBlockAck(
final int seqZero, final int ttl, final int src, final int dst, final int segN) {
final int blockAck = mSegmentedAccessBlockAck;
if (BlockAcknowledgementMessage.hasAllSegmentsBeenReceived(blockAck, segN)) {
LOG.info("All segments received cancelling incomplete timer");
LOG.info("All segments received canceling incomplete timer");
cancelIncompleteTimer();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ protected ScheduledFuture<?> schedulePollingRequest(
LOG.log(
Level.WARNING,
prefixLogMessage(
"Exception thrown whilst processing polling response ["
"Exception thrown while processing polling response ["
+ (e.getCause() != null
? e.getCause().getMessage()
: e.getMessage())
Expand All @@ -583,7 +583,7 @@ protected ScheduledFuture<?> schedulePollingRequest(
LOG.log(
Level.WARNING,
prefixLogMessage(
"Exception thrown whilst processing polling response ["
"Exception thrown while processing polling response ["
+ (e.getCause() != null ? e.getCause().getMessage() : e.getMessage())
+ "]: "
+ clientRequest.requestTarget.getUriBuilder().build().toString()));
Expand Down Expand Up @@ -616,7 +616,7 @@ protected void executePollingRequest(
LOG.log(
Level.WARNING,
prefixLogMessage(
"Exception thrown whilst doing polling request ["
"Exception thrown while doing polling request ["
+ (e.getCause() != null ? e.getCause().getMessage() : e.getMessage())
+ "]: "
+ clientRequest.requestTarget.getUriBuilder().build().toString()));
Expand Down Expand Up @@ -651,7 +651,7 @@ protected void executeAttributeWriteRequest(
try (Response response = clientRequest.invoke(valueStr)) {
responseConsumer.accept(response);
} catch (Exception e) {
LOG.log(Level.SEVERE, "Exception thrown whilst doing attribute write request", e);
LOG.log(Level.SEVERE, "Exception thrown while doing attribute write request", e);
}
}

Expand Down Expand Up @@ -680,7 +680,7 @@ protected void onPollingResponse(
value = response.readEntity(String.class);
}
} catch (Exception e) {
LOG.log(Level.WARNING, "Error occurred whilst trying to read response body", e);
LOG.log(Level.WARNING, "Error occurred while trying to read response body", e);
response.close();
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void operationComplete(ChannelFuture future) {
}

if (future.isSuccess()) {
LOG.log(Level.INFO, "Connection initialising: " + getSocketAddressString());
LOG.log(Level.INFO, "Connection initializing: " + getSocketAddressString());
reconnectTask = null;
reconnectDelayMilliseconds = INITIAL_RECONNECT_DELAY_MILLIS;
} else if (future.cause() != null) {
Expand All @@ -147,7 +147,7 @@ public void operationComplete(ChannelFuture future) {
});

} catch (Exception e) {
LOG.log(Level.SEVERE, "An error occurred whilst starting the server so shutting down", e);
LOG.log(Level.SEVERE, "An error occurred while starting the server so shutting down", e);
stop();
}
}
Expand Down Expand Up @@ -301,10 +301,10 @@ public void channelInactive(ChannelHandlerContext ctx) throws Exception {
}

/**
* Initialise the specified client channel (will be called when a new client connection is made)
* Initialize the specified client channel (will be called when a new client connection is made)
*/
protected void initClientChannel(U channel) {
LOG.fine("Client initialising: " + getClientDescriptor(channel));
LOG.fine("Client initializing: " + getClientDescriptor(channel));

// Add handler to track when a channel becomes active and to handle exceptions
channel
Expand Down Expand Up @@ -366,7 +366,7 @@ protected void handleMessageReceived(U channel, T message) {

protected void onClientDisconnected(U client) {
LOG.fine("Client disconnected: " + getClientDescriptor(client));
// Channel group manages removal of stale channels but whilst we're here
// Channel group manages removal of stale channels but while we're here
allChannels.remove(client);
sendClientConnectionStatus(client, ConnectionStatus.DISCONNECTED);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public synchronized void connect() {
onConnectionStatusChanged(ConnectionStatus.CONNECTED);

// Get the values of all registered group addresses
LOG.finest("Initialising group address values");
LOG.finest("Initializing group address values");
synchronized (groupAddressConsumerMap) {
groupAddressConsumerMap.forEach(
(groupAddress, datapointConsumerList) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public Future<Void> startAssetImport(byte[] fileData, Consumer<AssetTreeNode[]>
String xsd = IOUtils.toString(inputStream, StandardCharsets.UTF_8);
xsd =
xsd.trim()
.replaceFirst("^([\\W]+)<", "<"); // Get weird behaviour sometimes without this
.replaceFirst("^([\\W]+)<", "<"); // Get weird behavior sometimes without this
Transformer transformer =
createSecureTransformerFactory()
.newTransformer(new StreamSource(new StringReader(xsd)));
Expand All @@ -296,7 +296,7 @@ public Future<Void> startAssetImport(byte[] fileData, Consumer<AssetTreeNode[]>
String xml = IOUtils.toString(zin, StandardCharsets.UTF_8);
xml =
xml.trim()
.replaceFirst("^([\\W]+)<", "<"); // Get weird behaviour sometimes without this
.replaceFirst("^([\\W]+)<", "<"); // Get weird behavior sometimes without this
StringWriter writer = new StringWriter();
StringReader reader = new StringReader(xml);
transformer.transform(new StreamSource(reader), new StreamResult(writer));
Expand Down
Loading
Loading