Skip to content

Bridget service saves settings in the wrong location #3523

@joaoantoniocardoso

Description

@joaoantoniocardoso

All BlueOS services follow the pattern of saving their config at /root/.config/blueos/<service-name>/., except for Bridget, which does it at /usr/blueos/userdata/settings/bridget/bridget/settings-2.json.

A quick verification of all settings files in BlueOS (sudo find / -type f -name "*settings*.json*" | less) shows that Bridget is the only service not following the pattern.

The impacts need to be further verified, but possibly:

  • BlueOS "reset settings" functionality not reaching Bridget
  • Cloud Backup could be missing Bridget's configs

The mitigations could be:

  1. Define a new location service: /root/.config/blueos/bridget/.
  2. Patch BlueOS to (1) move the current settings folder to the location, and (2) symlink the old location to the new location.

A low-effort initial draft just to be clear about it:

#!/bin/bash
OLD_DIR="/usr/blueos/userdata/settings/bridget/bridget"
NEW_DIR="/root/.config/blueos/bridget"

# Note:
# 1. We should only move OLD_DIR to NEW_DIR if:
#   - NEW_DIR doesn't exist
#   - OLD_DIR exists
#   - OLD_DIR is not a symbolic link
# 2. We must symlink OLD_DIR to NEW_DIR to keep backward compatibility when:
#   - OLD_DIR is not a symlink to NEW_DIR

mv "$OLD_DIR" "$NEW_DIR"
ln -s "$NEW_DIR" "$OLD_DIR"

Note: Migration should happen before the service initialization
Note: Remember to check if the folder/files' permissions/owner are correct after moving the folder.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions