Skip to content

Commit 33e42af

Browse files
committed
chore: fix merge conflicts and remove old code
- remove unused variable - remove ow table creation from astarte_export - fix comments in readme - remove duplicates from dup db helper - remove old rendezvous config - disable port 8080 from docker compose - fix e2e workflow - removed duplicated create table - remove @create_ownership_vouchers_table from services Signed-off-by: Riccardo Nalgi <riccardo.nalgi@secomind.com>
1 parent 12590ee commit 33e42af

File tree

17 files changed

+55
-244
lines changed

17 files changed

+55
-244
lines changed

.github/workflows/astarte-end-to-end-test-workflow.yaml

Lines changed: 23 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -32,46 +32,22 @@ env:
3232
jobs:
3333
e2e-build:
3434
uses: ./.github/workflows/astarte-e2e-build-workflow.yaml
35-
3635
astarte-build:
3736
uses: ./.github/workflows/astarte-build-workflow.yaml
38-
3937
end-to-end-test:
4038
needs: [e2e-build, astarte-build]
4139
name: End-to-end Test
4240
runs-on: ubuntu-22.04
4341
steps:
44-
- uses: actions/checkout@v2
45-
- name: Initialize docker compose files
46-
run: docker run -v $(pwd)/compose:/compose astarte/docker-compose-initializer
47-
- name: Restore astarte images
48-
uses: actions/download-artifact@v4
49-
with:
50-
# Download all app images; merge them into the same directory for loading
51-
pattern: astarte-images-*
52-
merge-multiple: true
53-
path: ${{ runner.temp }}
54-
- name: Restore astarte e2e image
55-
uses: actions/download-artifact@v4
56-
with:
57-
name: astarte-e2e-image
58-
path: ${{ runner.temp }}
59-
- name: Load astarte images
60-
run: ls ${{ runner.temp }}/*.tar | xargs --max-args 1 docker load --input
61-
- name: Start all Astarte services
62-
run: docker compose up --no-build --pull missing -d
63-
- name: Wait for Astarte to come up
64-
run: |
65-
wget https://github.com/astarte-platform/wait-for-astarte-docker-compose/releases/download/v1.1.0/wait-for-astarte-docker-compose_1.1.0_linux_amd64.tar.gz
66-
tar xf wait-for-astarte-docker-compose_1.1.0_linux_amd64.tar.gz
67-
./wait-for-astarte-docker-compose
6842
- uses: actions/checkout@v2
6943
- name: Initialize docker compose files
7044
run: docker run -v $(pwd)/compose:/compose astarte/docker-compose-initializer
7145
- name: Restore astarte images
7246
uses: actions/download-artifact@v4
7347
with:
74-
name: astarte-images
48+
# Download all app images; merge them into the same directory for loading
49+
pattern: astarte-images-*
50+
merge-multiple: true
7551
path: ${{ runner.temp }}
7652
- name: Restore astarte e2e image
7753
uses: actions/download-artifact@v4
@@ -81,16 +57,16 @@ jobs:
8157
- name: Load astarte images
8258
run: ls ${{ runner.temp }}/*.tar | xargs --max-args 1 docker load --input
8359
- name: Start all Astarte services
84-
run: docker compose up -d
60+
run: docker compose up --no-build --pull missing -d
8561
- name: Wait for Astarte to come up
8662
run: |
8763
wget https://github.com/astarte-platform/wait-for-astarte-docker-compose/releases/download/v1.1.0/wait-for-astarte-docker-compose_1.1.0_linux_amd64.tar.gz
8864
tar xf wait-for-astarte-docker-compose_1.1.0_linux_amd64.tar.gz
8965
./wait-for-astarte-docker-compose
9066
- name: Install astartectl
9167
run: |
92-
wget https://github.com/astarte-platform/astartectl/releases/download/v22.11.02/astartectl_22.11.02_linux_x86_64.tar.gz
93-
tar xf astartectl_22.11.02_linux_x86_64.tar.gz
68+
wget https://github.com/astarte-platform/astartectl/releases/download/v24.5.3/astartectl_24.5.3_linux_x86_64.tar.gz
69+
tar xf astartectl_24.5.3_linux_x86_64.tar.gz
9470
chmod +x astartectl
9571
- name: Generate realm keypair and JWT
9672
run: |
@@ -116,12 +92,12 @@ jobs:
11692
E2E_MAILER_TO_ADDRESS: mail@example.com
11793
E2E_MAIL_SUBJECT: "Subj: Astarte Notification"
11894
run: |
119-
docker run \
120-
-e E2E_REALM_PUBLIC_KEY_PEM="$(cat ../../test_public.pem)" \
121-
--env-file=<(env | grep '^E2E_' | grep -v '^E2E_REALM_PUBLIC_KEY_PEM=') \
122-
--network astarte \
123-
--hostname "$E2E_HOST" \
124-
astarte-e2e
95+
docker run \
96+
-e E2E_REALM_PUBLIC_KEY_PEM="$(cat ../../test_public.pem)" \
97+
--env-file=<(env | grep '^E2E_' | grep -v '^E2E_REALM_PUBLIC_KEY_PEM=') \
98+
--network astarte \
99+
--hostname "$E2E_HOST" \
100+
astarte-e2e
125101
- name: Check Docker
126102
if: ${{ failure() }}
127103
run: docker compose logs
@@ -141,44 +117,9 @@ jobs:
141117
- uses: ./.github/actions/install-deps
142118
- name: Install astartectl
143119
run: |
144-
wget https://github.com/astarte-platform/astartectl/releases/download/v22.11.02/astartectl_22.11.02_linux_x86_64.tar.gz
145-
tar xf astartectl_22.11.02_linux_x86_64.tar.gz
120+
wget https://github.com/astarte-platform/astartectl/releases/download/v24.5.3/astartectl_24.5.3_linux_x86_64.tar.gz
121+
tar xf astartectl_24.5.3_linux_x86_64.tar.gz
146122
chmod +x astartectl
147-
- name: Generate realm keypair and JWT
148-
run: |
149-
./astartectl utils gen-keypair test
150-
E2E_HOUSEKEEPING_API_JWT=$(./astartectl utils gen-jwt housekeeping -k compose/astarte-keys/housekeeping_private.pem)
151-
echo "E2E_HOUSEKEEPING_API_JWT=$E2E_HOUSEKEEPING_API_JWT" >> $GITHUB_ENV
152-
- name: Generate JWT
153-
run: |
154-
JWT=$(./astartectl utils gen-jwt appengine channels pairing realm-management -k test_private.pem)
155-
echo "E2E_JWT=$JWT" >> $GITHUB_ENV
156-
- name: Run Astarte E2E
157-
working-directory: tools/astarte_e2e
158-
env:
159-
E2E_HOST: "astarte-e2e"
160-
E2E_PAIRING_URL: http://api.astarte.localhost/pairing
161-
E2E_APPENGINE_URL: http://api.astarte.localhost/appengine
162-
E2E_HOUSEKEEPING_URL: http://api.astarte.localhost/housekeeping
163-
E2E_REALM_MANAGEMENT_URL: http://api.astarte.localhost/realmmanagement
164-
E2E_AMQP_CONSUMER_HOST: rabbitmq
165-
E2E_IGNORE_SSL_ERRORS: true
166-
E2E_CHECK_INTERVAL_SECONDS: 5
167-
E2E_CHECK_REPETITIONS: 5
168-
E2E_MAILER_TO_ADDRESS: mail@example.com
169-
E2E_MAIL_SUBJECT: "Subj: Astarte Notification"
170-
run: |
171-
docker run \
172-
-e E2E_REALM_PUBLIC_KEY_PEM="$(cat ../../test_public.pem)" \
173-
--env-file=<(env | grep '^E2E_' | grep -v '^E2E_REALM_PUBLIC_KEY_PEM=') \
174-
--network astarte \
175-
--hostname "$E2E_HOST" \
176-
astarte-e2e
177-
- name: Check Docker
178-
if: ${{ failure() }}
179-
run: docker compose logs
180-
- name: Bring down Astarte docker-compose
181-
run: docker compose down
182123
mkdir -p ${{ runner.temp }}/bin
183124
mv ./astartectl ${{ runner.temp }}/bin
184125
echo ${{ runner.temp }}/bin >> "$GITHUB_PATH"
@@ -189,23 +130,25 @@ jobs:
189130
name: checkout astarte
190131
with:
191132
path: .tmp/repos/astarte
133+
- name: Initialize docker compose files
134+
working-directory: .tmp/repos/astarte
135+
run: docker run -v $(pwd)/compose:/compose astarte/docker-compose-initializer
192136
- name: Restore astarte images
193137
uses: actions/download-artifact@v4
194138
with:
195-
name: astarte-images
139+
pattern: astarte-images-*
140+
merge-multiple: true
196141
path: ${{ runner.temp }}
197-
- name: Initialize keys
198-
working-directory: .tmp/repos/astarte
199-
run: |
200-
docker run -v $(pwd)/compose:/compose astarte/docker-compose-initializer
201-
astartectl utils gen-keypair test
202142
- name: Load astarte images
203143
run: ls ${{ runner.temp }}/*.tar | xargs --max-args 1 docker load --input
144+
- name: Initialize keys
145+
working-directory: .tmp/repos/astarte
146+
run: astartectl utils gen-keypair test
204147
- name: Enable FDO
205148
run: echo "PAIRING_ENABLE_FDO=true" >> .tmp/repos/astarte/.env
206149
- name: Start all Astarte services
207150
working-directory: .tmp/repos/astarte
208-
run: docker compose up -d
151+
run: docker compose up --no-build --pull missing -d
209152
- uses: actions-rust-lang/setup-rust-toolchain@v1.15.2
210153
- uses: mozilla-actions/sccache-action@v0.0.9
211154
- name: Cache container build

CHANGELOG.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99

1010
### Changed
1111

12+
- [astarte_pairing] FDO authentication (EXPERIMENTAL feature, disabled by default). New environment variables are needed in order to use FDO:
13+
- `PAIRING_ENABLE_FDO` - whether the FDO feature is enabled or not (default: false)
14+
- `PAIRING_FDO_RENDEZVOUS_URL` - URL of the rendezvous server (default: "http://rendezvous:8041")
15+
- `ASTARTE_BASE_URL_DOMAIN` - domain part of the base URL of astarte, used by devices to connect in TO2 phase (required if FDO enabled)
16+
- `ASTARTE_BASE_URL_PORT` - port of the base URL of astarte (required if FDO enabled)
17+
- `ASTARTE_BASE_URL_PROTOCOL` - protocol of the base URL of astarte (required if FDO enabled)
18+
1219
- [astarte_housekeeping] AMQP management configuration moved to `astarte_events` library. Environment variables changed:
1320
- `HOUSEKEEPING_AMQP_SSL_ENABLED` is now `ASTARTE_EVENTS_AMQP_MANAGEMENT_SSL_ENABLED`
1421
- `HOUSEKEEPING_AMQP_SSL_CA_FILE` is now `ASTARTE_EVENTS_AMQP_MANAGEMENT_SSL_CA_FILE`
@@ -21,15 +28,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2128

2229
## [1.3.0-rc.1] - 2026-01-26
2330

24-
## [1.3.0] - Unreleased
25-
- [astarte_pairing] FDO authentication (EXPERIMENTAL feature, disabled by default). New environment variables are needed in order to use FDO:
26-
- `PAIRING_ENABLE_FDO` - whether the FDO feature is enabled or not (default: false)
27-
- `PAIRING_FDO_RENDEZVOUS_URL` - URL of the rendezvous server (default: "http://rendezvous:8041")
28-
- `ASTARTE_BASE_URL_DOMAIN` - domain part of the base URL of astarte, used by devices to connect in TO2 phase (required if FDO enabled)
29-
- `ASTARTE_BASE_URL_PORT` - port of the base URL of astarte (required if FDO enabled)
30-
- `ASTARTE_BASE_URL_PROTOCOL` - protocol of the base URL of astarte (required if FDO enabled)
31-
32-
## [1.3.0-rc.0] - 2025-11-21
3331
### Added
3432

3533
- New environment variables for trigger notifications between realm management replicas and realm management -> pairing. These variables are currently being used only by realm management

apps/astarte_appengine_api/test/support/helpers/database.ex

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,6 @@ defmodule Astarte.Helpers.Database do
109109
);
110110
"""
111111

112-
@create_ownership_vouchers_table """
113-
CREATE TABLE #{Realm.keyspace_name(@test_realm)}.ownership_vouchers (
114-
private_key blob,
115-
voucher_data blob,
116-
device_id uuid,
117-
PRIMARY KEY (device_id, voucher_data)
118-
);
119-
"""
120-
121112
@create_devices_table """
122113
CREATE TABLE #{Realm.keyspace_name(@test_realm)}.devices (
123114
device_id uuid,
@@ -444,8 +435,6 @@ defmodule Astarte.Helpers.Database do
444435
{:ok, _} ->
445436
Repo.query!(@create_capabilities_type)
446437

447-
Repo.query!(@create_ownership_vouchers_table)
448-
449438
Repo.query!(@create_devices_table)
450439

451440
Repo.query!(@create_deletion_in_progress_table)

apps/astarte_appengine_api/test/support/helpers/database_v2.ex

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,6 @@ defmodule Astarte.Helpers.DatabaseV2 do
6969
);
7070
"""
7171

72-
@create_ownership_vouchers_table """
73-
CREATE TABLE :keyspace.ownership_vouchers (
74-
private_key blob,
75-
voucher_data blob,
76-
device_id uuid,
77-
PRIMARY KEY (device_id, voucher_data)
78-
);
79-
"""
80-
8172
@create_devices_table """
8273
CREATE TABLE :keyspace.devices (
8374
device_id uuid,
@@ -258,7 +249,6 @@ defmodule Astarte.Helpers.DatabaseV2 do
258249
realm_keyspace = Realm.keyspace_name(realm_name)
259250
execute!(realm_keyspace, @create_keyspace)
260251
execute!(realm_keyspace, @create_capabilities_type)
261-
execute!(realm_keyspace, @create_ownership_vouchers_table)
262252
execute!(realm_keyspace, @create_devices_table)
263253
execute!(realm_keyspace, @create_groups_table)
264254
execute!(realm_keyspace, @create_names_table)

apps/astarte_data_updater_plant/test/support/database_test_helper.ex

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,6 @@ defmodule Astarte.DataUpdaterPlant.DatabaseTestHelper do
5353
);
5454
"""
5555

56-
@create_ownership_vouchers_table """
57-
CREATE TABLE :keyspace.ownership_vouchers (
58-
private_key blob,
59-
voucher_data blob,
60-
device_id uuid,
61-
PRIMARY KEY (device_id, voucher_data)
62-
);
63-
"""
64-
6556
@create_devices_table """
6657
CREATE TABLE :keyspace.devices (
6758
device_id uuid,
@@ -378,7 +369,6 @@ defmodule Astarte.DataUpdaterPlant.DatabaseTestHelper do
378369
case execute(keyspace_name, @create_autotestrealm) do
379370
{:ok, _} ->
380371
execute!(keyspace_name, @create_capabilities_type)
381-
execute!(keyspace_name, @create_ownership_vouchers_table)
382372
execute!(keyspace_name, @create_devices_table)
383373
execute!(keyspace_name, @create_endpoints_table)
384374

apps/astarte_data_updater_plant/test/support/helpers/database.ex

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,6 @@ defmodule Astarte.Helpers.Database do
7575
);
7676
"""
7777

78-
@create_ownership_vouchers_table """
79-
CREATE TABLE :keyspace.ownership_vouchers (
80-
private_key blob,
81-
voucher_data blob,
82-
device_id uuid,
83-
PRIMARY KEY (device_id, voucher_data)
84-
);
85-
"""
86-
8778
@create_devices_table """
8879
CREATE TABLE :keyspace.devices (
8980
device_id uuid,
@@ -327,19 +318,6 @@ defmodule Astarte.Helpers.Database do
327318
execute!(realm_keyspace, @create_individual_datastreams_table, [], timeout: 60_000)
328319
execute!(realm_keyspace, @create_interfaces_table, [], timeout: 60_000)
329320
execute!(realm_keyspace, @create_deletion_in_progress_table, [], timeout: 60_000)
330-
execute!(realm_keyspace, @create_keyspace)
331-
execute!(realm_keyspace, @create_capabilities_type)
332-
execute!(realm_keyspace, @create_ownership_vouchers_table)
333-
execute!(realm_keyspace, @create_devices_table)
334-
execute!(realm_keyspace, @create_groups_table)
335-
execute!(realm_keyspace, @create_names_table)
336-
execute!(realm_keyspace, @create_kv_store)
337-
execute!(realm_keyspace, @create_endpoints_table)
338-
execute!(realm_keyspace, @create_simple_triggers_table)
339-
execute!(realm_keyspace, @create_individual_properties_table)
340-
execute!(realm_keyspace, @create_individual_datastreams_table)
341-
execute!(realm_keyspace, @create_interfaces_table)
342-
execute!(realm_keyspace, @create_deletion_in_progress_table)
343321

344322
Enum.each(@insert_endpoints, fn query ->
345323
execute!(realm_keyspace, query, [], timeout: 60_000)

apps/astarte_housekeeping/test/support/helpers/database.ex

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,6 @@ defmodule Astarte.Housekeeping.Helpers.Database do
6868
);
6969
"""
7070

71-
@create_ownership_vouchers_table """
72-
CREATE TABLE :keyspace.ownership_vouchers (
73-
private_key blob,
74-
voucher_data blob,
75-
guid blob,
76-
PRIMARY KEY (guid)
77-
);
78-
"""
79-
8071
@create_devices_table """
8172
CREATE TABLE :keyspace.devices (
8273
device_id uuid,
@@ -334,7 +325,6 @@ defmodule Astarte.Housekeeping.Helpers.Database do
334325
realm_keyspace = Realm.keyspace_name(realm_name)
335326
execute(realm_keyspace, @create_keyspace)
336327
execute(realm_keyspace, @create_capabilities_type)
337-
execute(realm_keyspace, @create_ownership_vouchers_table)
338328
execute(realm_keyspace, @create_devices_table)
339329
execute(realm_keyspace, @create_groups_table)
340330
execute(realm_keyspace, @create_names_table)

apps/astarte_pairing/README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,25 @@ CASSANDRA_NODES=localhost CFSSL_API_URL=http://localhost:8080 mix test
5050

5151
# Test FDO
5252

53+
> The feature is experimental and PAIRING_ENABLE_FDO must be set to true
54+
5355
To test FDO, the manufacturer and Device CA keys are required and
5456
can be generated from the following tools:
5557

56-
# Generate manufacturer keys
58+
## Generate manufacturer keys
5759
docker run --rm \
5860
-v $(pwd)/compose/fdo-keys:/keys \
5961
quay.io/fido-fdo/admin-cli:latest \
6062
generate-key-and-cert manufacturer \
6163
--destination-dir /keys
6264

63-
# Generate device CA keys
65+
## Generate device CA keys
6466
docker run --rm \
6567
-v $(pwd)/compose/fdo-keys:/keys \
6668
quay.io/fido-fdo/admin-cli:latest \
6769
generate-key-and-cert device-ca \
6870
--destination-dir /keys
6971

70-
# Set permissions
72+
## Set permissions
7173
chmod 644 compose/fdo-keys/*.pem
72-
chmod 600 compose/fdo-keys/*.der
73-
74-
An ownership voucher and owner private key are also required.
75-
For testing purposes, a mock key and voucher have been stored in the priv folder of the Pairing Service.
74+
chmod 600 compose/fdo-keys/*.der

apps/astarte_pairing/mix.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ defmodule Astarte.Pairing.Mixfile do
9696
{:telemetry_metrics_prometheus_core, "~> 1.2"},
9797
{:observer_cli, "~> 1.5"},
9898
{:cfxxl, github: "ispirata/cfxxl"},
99-
{:httpoison, "~> 1.6"},
10099
{:astarte_data_access, path: astarte_lib("astarte_data_access")},
101100
{:bcrypt_elixir, "~> 2.2"},
102101
{:xandra, "~> 0.19"},

0 commit comments

Comments
 (0)