Skip to content

Conversation

@yungwine
Copy link
Collaborator

No description provided.

@yungwine yungwine requested a review from Copilot July 31, 2025 13:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves user handling across multiple shell scripts and Python modules by replacing direct logname calls with ${SUDO_USER:-$(logname)} and adding proper user parameter support to various commands. It also updates the mypylib submodule.

  • Updates user detection in shell scripts to properly handle sudo contexts
  • Adds user parameter support to backup, btc_teleport, and installer commands
  • Introduces utility functions for consistent user handling across the codebase

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tools/extract_backup_node_keys.sh Adds sudo-aware user detection and -u flag support
scripts/install.sh Updates user detection to handle sudo context
mytoninstaller/settings.py Passes user parameter to backup operations and ton_http_api_installer
mytoninstaller/scripts/ton_http_api_installer.sh Adds user parameter handling with -u flag
mytoninstaller/mytoninstaller.py Replaces hardcoded USER env var with get_current_user()
mytonctrl/utils.py Adds get_current_user() and pop_user_from_args() utility functions
mytonctrl/scripts/restore_backup.sh Updates user detection for sudo context
mytonctrl/scripts/create_backup.sh Adds sudo-aware user detection and -u flag
mytonctrl/scripts/btc_teleport1.sh Updates user detection and adds -u flag support
mytonctrl/mytonctrl.py Adds user parameter handling to btc_teleport upgrade
mypylib Updates submodule commit
modules/btc_teleport.py Adds user parameter support to install and daemon methods
modules/backups.py Updates backup methods to accept and pass user parameters
Comments suppressed due to low confidence (1)

mytonctrl/utils.py:70

  • [nitpick] The error message could be more descriptive. Consider changing it to 'Missing user value after "-u" flag' to be clearer about what's expected.
            raise Exception(f'User value not found after "-u" in args: {args}')

@yungwine yungwine merged commit 5b457de into ton-blockchain:master Jul 31, 2025
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