Skip to content

Added support for Meala remote log database - #23

Closed
phinchey wants to merge 2 commits into
ARK-Electronics:mainfrom
phinchey:main
Closed

phinchey wants to merge 2 commits into
ARK-Electronics:mainfrom
phinchey:main

Conversation

@phinchey

Copy link
Copy Markdown

Added support to choose FlightReview or Meala as a remote log database.

FlightReview is the default remote upload service. To use Meala, the following configuration settings are used:

Upload service = 1
Remote server = http://www.apisdynamics.ca
Credentials file = /home/jetson//.local/share/logloader/meala_creds.cert (or any other prefered location)

You need to sign up for Meala and download a credential certificate to use.

@dakejahl dakejahl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Can you update the PR description to include a link to the docs/website for Meala? What level of testing has been done? Can you update the README and add a table to indicate the supported backends?

Comment thread src/ServerInterface.hpp
#include <vector>
#include <sqlite3.h>
#include <mavsdk/plugins/log_files/log_files.h>
#include <optional>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary?

Comment thread src/ServerInterface.hpp
MealaCredentials _creds;
std::string _session_cookie;
bool _logged_in = false;
}; No newline at end of file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put this class declaration and MealaCredentials struct in a separate header

Comment thread src/ServerInterface.cpp
#include <functional>
#define CPPHTTPLIB_OPENSSL_SUPPORT
#include <httplib.h>
#include <vector>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary?

Comment thread src/LogLoader.cpp
.public_logs = true, // Public required true for searching using Web UI
.upload_service = UploadService::FlightReview, // Local server is always FlightReview,
.credentials_file = "" // FlightReview does not need credentials

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Comment thread src/LogLoader.cpp
#include <future>
#include <regex>
#include <fstream>
#include "ServerInterface.hpp"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include "ServerInterface.hpp"

already in the hpp

@dakejahl

Copy link
Copy Markdown
Collaborator

feel free to re-open this if you want to follow through with this integration

@dakejahl dakejahl closed this Feb 24, 2026
phinchey pushed a commit to phinchey/logloader that referenced this pull request Sep 24, 2026
Reimplements the Meala integration on top of the current UploadTarget
architecture and addresses the review feedback from PR ARK-Electronics#23.

A target now carries a backend ("flight_review" by default, or "meala") and an
optional credentials_file. UploadTarget grows a virtual upload() plus protected
helpers for the parts every backend shares -- the reachability probe, the
401/403 cooldown, and the local-file checks -- and make_upload_target() builds
the one the config names. Backend is per target, so the local Flight Review and
the remote server are independent, and since a target is keyed in the database
by its name rather than its url, switching backends does not re-upload what is
already up.

MealaUploadTarget logs in for a session cookie and posts the log in 5 MB
Dropzone-style chunks, mapping Meala's replies onto the existing Outcome set so
the upload loop's retry, rejection and cooldown handling applies unchanged. The
credentials file is read on first login rather than at construction, so one that
appears after startup is picked up. A meala target with no credentials_file is
disabled at startup with a warning instead of failing a login every upload pass.

Review comments addressed:
- MealaCredentials and the Meala class live in their own header, not in the
  base class's.
- The unused includes (<optional> and <vector> in the old ServerInterface, the
  hpp-duplicating include in LogLoader.cpp) are gone; nothing here includes what
  it does not use.
- The commented-out _remote_server line is gone.
- README documents the supported backends in a table, with a link to Meala and
  what each backend needs.

Verified against a stub Meala server: login, cookie reuse, and a 12 MB log in
three chunks reassembling to a matching sha256, plus the refused-login,
no-cookie, rejected-chunk, missing/empty-file, missing/malformed-credentials
and unreachable-server paths. Full build with -Werror, ctest and make
check-format all pass.
phinchey added a commit to phinchey/logloader that referenced this pull request Sep 24, 2026
Reimplements the Meala integration on top of the current UploadTarget
architecture and addresses the review feedback from PR ARK-Electronics#23.

A target now carries a backend ("flight_review" by default, or "meala") and an
optional credentials_file. UploadTarget grows a virtual upload() plus protected
helpers for the parts every backend shares -- the reachability probe, the
401/403 cooldown, and the local-file checks -- and make_upload_target() builds
the one the config names. Backend is per target, so the local Flight Review and
the remote server are independent, and since a target is keyed in the database
by its name rather than its url, switching backends does not re-upload what is
already up.

MealaUploadTarget logs in for a session cookie and posts the log in 5 MB
Dropzone-style chunks, mapping Meala's replies onto the existing Outcome set so
the upload loop's retry, rejection and cooldown handling applies unchanged. The
credentials file is read on first login rather than at construction, so one that
appears after startup is picked up. A meala target with no credentials_file is
disabled at startup with a warning instead of failing a login every upload pass.

Review comments addressed:
- MealaCredentials and the Meala class live in their own header, not in the
  base class's.
- The unused includes (<optional> and <vector> in the old ServerInterface, the
  hpp-duplicating include in LogLoader.cpp) are gone; nothing here includes what
  it does not use.
- The commented-out _remote_server line is gone.
- README documents the supported backends in a table, with a link to Meala and
  what each backend needs.

Verified against a stub Meala server: login, cookie reuse, and a 12 MB log in
three chunks reassembling to a matching sha256, plus the refused-login,
no-cookie, rejected-chunk, missing/empty-file, missing/malformed-credentials
and unreachable-server paths. Full build with -Werror, ctest and make
check-format all pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants