Skip to content

Commit 4c0edc0

Browse files
committed
feat: [#10] add Rust installation to cloud-init configuration
- Install Rust using rustup following official documentation - Configure Rust installation as torrust user for proper ownership - Add Rust's cargo bin directory to PATH in .bashrc and .profile - Include verification commands for rustc and cargo - Update final message to reflect Rust installation - Add Rust-related terms to project-words.txt for spell checking This enables future source compilation of Torrust Tracker for better performance, moving away from the current Docker-based approach.
1 parent 6203f29 commit 4c0edc0

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

infrastructure/cloud-init/user-data.yaml.tpl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,21 @@ runcmd:
150150
- docker --version
151151
- docker compose version
152152

153+
# Install Rust using rustup (official method)
154+
# Install as torrust user to ensure proper ownership
155+
- >
156+
sudo -u torrust bash -c 'curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y'
157+
158+
# Add Rust to PATH for torrust user
159+
- >
160+
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> /home/torrust/.bashrc
161+
- >
162+
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> /home/torrust/.profile
163+
164+
# Verify Rust installation
165+
- sudo -u torrust bash -c 'source ~/.cargo/env && rustc --version'
166+
- sudo -u torrust bash -c 'source ~/.cargo/env && cargo --version'
167+
153168
# CRITICAL: Configure UFW firewall SAFELY (allow SSH BEFORE enabling)
154169
- ufw --force reset
155170
- ufw default deny incoming
@@ -183,6 +198,7 @@ final_message: |
183198
- OS: Ubuntu 24.04 LTS
184199
- User: torrust (with sudo privileges and SSH key access only)
185200
- Docker: Installed and configured
201+
- Rust: Installed via rustup (latest stable version)
186202
- Firewall: UFW enabled with proper SSH rules
187203
- Security: Automatic updates enabled
188204
- Torrust Tracker dependencies: pkg-config, libssl-dev, make, build-essential, libsqlite3-dev, sqlite3

project-words.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ qcow
6363
repomix
6464
rmem
6565
runcmd
66+
rustc
67+
rustup
6668
rwxr
6769
SAMEORIGIN
6870
secp
@@ -74,6 +76,7 @@ testpass
7476
testuser
7577
tfstate
7678
tfvars
79+
tlsv
7780
UEFI
7881
usermod
7982
vcpu

0 commit comments

Comments
 (0)