Skip to content

become the ubuntu user when root logs in#3494

Merged
winglian merged 1 commit into
mainfrom
cloud-sudo-ubuntu-user
Mar 13, 2026
Merged

become the ubuntu user when root logs in#3494
winglian merged 1 commit into
mainfrom
cloud-sudo-ubuntu-user

Conversation

@winglian
Copy link
Copy Markdown
Collaborator

@winglian winglian commented Mar 13, 2026

Summary by CodeRabbit

  • Chores
    • Restructured cloud container initialization and entrypoint configuration.
    • Enhanced SSH key setup to support multiple user contexts with improved permission management.
    • Refined Jupyter launcher to better handle user execution context.
    • Improved workspace directory ownership configuration and environment variable sourcing during container startup.

@winglian winglian merged commit e1ff756 into main Mar 13, 2026
1 check was pending
@winglian winglian deleted the cloud-sudo-ubuntu-user branch March 13, 2026 13:06
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 13, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 611a2089-f06d-441b-be64-baa07190923b

📥 Commits

Reviewing files that changed from the base of the PR and between 083c5a0 and f93879f.

📒 Files selected for processing (2)
  • docker/Dockerfile-cloud-uv
  • scripts/cloud-entrypoint.sh

📝 Walkthrough

Walkthrough

This PR relocates the cloud entrypoint script from /home/ubuntu/ to /etc/, removes the explicit USER directive from the Dockerfile, and refactors the entrypoint script to support multiple home directories for SSH key setup and user-aware command execution.

Changes

Cohort / File(s) Summary
Docker entrypoint relocation
docker/Dockerfile-cloud-uv
Moves cloud-entrypoint.sh COPY destination and ENTRYPOINT from /home/ubuntu/ to /etc/. Removes USER ubuntu directive, keeping container running as root. Updates .bashrc tty check logic and adds root shell bootstrap line with AXOLOTL_SKIP_SWITCH=1.
SSH key setup refactoring
scripts/cloud-entrypoint.sh
Adds target_home parameter to add_keys_to_authorized(). Introduces new setup_ssh_keys() function to orchestrate SSH key addition for current user and /home/ubuntu when running as root. Ensures proper ownership of .ssh directories.
User execution and environment handling
scripts/cloud-entrypoint.sh
Adds logic to source /etc/rp_environment in user bashrcs. Changes Jupyter launch to run as ubuntu user when available via sudo. Modifies final CMD execution to run as ubuntu when root with ubuntu user present. Ensures /workspace ownership to ubuntu:ubuntu.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cloud-sudo-ubuntu-user
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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