Skip to content

upload: ask at the terminal whether to send a backup with the report - #231

Merged
openipc-ai merged 1 commit into
masterfrom
upload-ask-backup
Oct 6, 2026
Merged

openipc-ai merged 1 commit into
masterfrom
upload-ask-backup

Conversation

@openipc-ai

Copy link
Copy Markdown
Contributor

All three reports ipctool has sent to openipc.org came without a flash
backup: the backup went only with --backup, which nobody runs. Now the
owner is asked once the report is on the screen:

Send a backup? [no/private/public]:

  • no, Enter or anything else: the report alone, as before.
  • private: the backup too, for OpenIPC's maintainers only.
  • public: the backup too, published with the report once reviewed, with
    the MAC, chip ID and cloud ID in clear.

The question says what the flash holds before it is answered, and the
flash is read only after it, so the answer is the consent and no second
yes is asked. Nothing is asked without a terminal, with --yes, or with
the new --no-backup: those send the report alone unless --backup was
given, which still needs its typed yes or --yes. Answers read from a
telnet session end in \r\n, which the old yes check refused; both now
drop the line end.

On the lab Hi3516EV300 against a local receiver: no, Enter and "maybe"
sent the YAML only; private and public sent the 16 MB backup with that
consent; no terminal, --yes and --no-backup asked nothing and sent the
YAML; --backup still asked for its yes.

All three reports ipctool has sent to openipc.org came without a flash
backup: the backup went only with --backup, which nobody runs. Now the
owner is asked once the report is on the screen:

  Send a backup? [no/private/public]:

- no, Enter or anything else: the report alone, as before.
- private: the backup too, for OpenIPC's maintainers only.
- public: the backup too, published with the report once reviewed, with
  the MAC, chip ID and cloud ID in clear.

The question says what the flash holds before it is answered, and the
flash is read only after it, so the answer is the consent and no second
yes is asked. Nothing is asked without a terminal, with --yes, or with
the new --no-backup: those send the report alone unless --backup was
given, which still needs its typed yes or --yes. Answers read from a
telnet session end in \r\n, which the old yes check refused; both now
drop the line end.

On the lab Hi3516EV300 against a local receiver: no, Enter and "maybe"
sent the YAML only; private and public sent the 16 MB backup with that
consent; no terminal, --yes and --no-backup asked nothing and sent the
YAML; --backup still asked for its yes.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Prompt for flash-backup consent during interactive uploads

✨ Enhancement 📝 Documentation 🐞 Bug fix 🕐 20-40 Minutes

Grey Divider

AI Description

• Ask interactive upload users whether to send a private or public flash backup.
• Keep unattended uploads report-only by default; add --no-backup to suppress the prompt.
• Accept telnet-style line endings in backup choices and existing yes confirmations.
Diagram

graph TD
  Report["Build report"] --> Choice{"Backup choice"} -->|interactive default| Prompt["Terminal prompt"] -->|private or public| Flash["Flash capture"] --> Body["Multipart body"] --> Receiver["OpenIPC endpoint"]
  Choice -->|explicit backup| Confirm["Yes confirmation"] --> Flash
  Choice -->|report only| Body
  Choice -->|backup with yes| Flash
  Prompt -->|no or other| Body
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Keep backups CLI-only
  • ➕ Avoids an interactive branch in the default upload path.
  • ➕ Makes every backup request explicit in the command line.
  • ➖ Preserves the reported problem that users rarely supply --backup.
  • ➖ Does not let users decide after seeing the report and privacy warning.

Recommendation: Prefer the PR's terminal-only prompt: it addresses low backup uptake while requiring an informed choice before reading flash. Retaining explicit flags and a report-only unattended default preserves script behavior. Given the privacy stakes, automated coverage of the choice and flag combinations would strengthen this approach.

Files changed (3) +99 / -34

Enhancement (1) +73 / -12
report_cmd.cAdd consent-driven backup selection to upload +73/-12

Add consent-driven backup selection to upload

• Prompts terminal users after showing the report, records private or public consent, and reads flash only after a backup choice. Adds --no-backup, rejects its combination with --backup, preserves explicit --backup confirmation, and strips CRLF from answers so telnet confirmations work.

src/report_cmd.c

Documentation (2) +26 / -22
README.mdDocument interactive backup choices and unattended defaults +23/-19

Document interactive backup choices and unattended defaults

• Explains the no, private, and public choices and their privacy implications. Documents --no-backup, --yes, and explicit backup examples for scripts and agents.

README.md

main.cReflect backup prompting in top-level usage +3/-3

Reflect backup prompting in top-level usage

• Updates the upload synopsis to include --no-backup and describes the new private-or-public backup question.

src/main.c

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can add REVIEW.md to your repo root and Qodo follows it on every PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@openipc-ai
openipc-ai merged commit a691c5d into master Oct 6, 2026
5 checks passed
@openipc-ai
openipc-ai deleted the upload-ask-backup branch October 6, 2026 11:31
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.

1 participant