PutPlace Client Quick Startď
This guide shows you how to quickly start using the PutPlace client to scan and upload files.
Prerequisitesď
PutPlace server running (see main README.md for setup)
User account (get credentials from server administrator)
Getting Account Credentialsď
Option 1: Ask Server Administratorď
Request a username and password from your PutPlace server administrator.
Option 2: Use Admin Account (if you have server access)ď
The admin account is automatically created on first server startup. Check the server logs or /tmp/putplace_initial_creds.txt for the auto-generated credentials.
Option 3: Register New User (if registration is enabled)ď
# Register via API
curl -X POST http://localhost:8000/api/register \
-H "Content-Type: application/json" \
-d '{"username": "myuser", "email": "user@example.com", "password": "secure-password"}'
Using the Clientď
The client supports three ways to provide your credentials:
Method 1: Command Line (Quick Testing)ď
python pp_client.py /path/to/scan --username "admin" --password "your-password"
Pros: Quick and easy for testing Cons: Credentials visible in shell history and process list
Method 2: Environment Variable (Recommended for Scripts)ď
# Set environment variables
export PUTPLACE_USERNAME="admin"
export PUTPLACE_PASSWORD="your-password"
# Run client (no need to specify --username/--password)
python pp_client.py /path/to/scan
Add to your .bashrc or .zshrc for persistence:
echo 'export PUTPLACE_USERNAME="admin"' >> ~/.bashrc
echo 'export PUTPLACE_PASSWORD="your-password"' >> ~/.bashrc
source ~/.bashrc
Pros: Not in command history, works across all commands Cons: Visible in environment, need to set in each shell
Method 3: Config File (Recommended for Production)ď
# Create config file
cat > ~/pp_client.conf << 'EOF'
[DEFAULT]
username = admin
password = your-password
EOF
# Set secure permissions (IMPORTANT!)
chmod 600 ~/pp_client.conf
# Run client (automatically reads from ~/pp_client.conf)
python pp_client.py /path/to/scan
Pros: Most secure, persistent, supports all settings Cons: Requires file setup
Configuration Priorityď
If you specify credentials in multiple places, the priority is:
Command line (
--username/--password) - Highest priorityEnvironment variables (
PUTPLACE_USERNAME/PUTPLACE_PASSWORD)Config file (
~/pp_client.conforpp_client.conf) - Lowest priority
Complete Examplesď
Example 1: Scan Local Directoryď
# Using environment variables
export PUTPLACE_USERNAME="admin"
export PUTPLACE_PASSWORD="your-password"
python pp_client.py /var/log
Example 2: Scan with Exclusionsď
python pp_client.py /home/user \
--exclude ".git" \
--exclude "node_modules" \
--exclude "*.log"
Example 3: Scan Remote Serverď
python pp_client.py /var/www \
--url "https://putplace.example.com/put_file" \
--username "admin" \
--password "production-password"
Example 4: Dry Run (Test Without Sending)ď
# See what would be sent without actually sending
python pp_client.py /path/to/scan --dry-run
Example 5: Using Config Fileď
~/pp_client.conf:
[DEFAULT]
url = https://putplace.example.com/put_file
username = admin
password = your-password
exclude = .git
exclude = node_modules
exclude = *.log
Run:
# All settings loaded from config file
python pp_client.py /var/www
Security Best Practicesď
â DO:ď
Protect your credentials
# Config file permissions chmod 600 ~/pp_client.conf # Never commit passwords # pp_client.conf is already in .gitignore
Use separate accounts per client
One account per server
One account per application
Easier to manage access
Use strong passwords
At least 8 characters
Mix of letters, numbers, symbols
Use password manager to generate
â DONâT:ď
Donât commit passwords to version control
pp_client.conf is in .gitignore
Never put passwords in code
Donât share passwords
Create separate accounts for each user/server
Donât use command line in production
Credentials visible in process list
Use config file or environment variable
Troubleshootingď
âBoth username and password are requiredâď
â Both username and password are required for authentication
Solution: Provide both credentials via:
--usernameand--passwordflagsPUTPLACE_USERNAMEandPUTPLACE_PASSWORDenvironment variablesusernameandpasswordin ~/pp_client.conf
âLogin failed: 401âď
â Login failed: 401
Incorrect username or password
Possible causes:
No credentials provided
Invalid username or password
User account disabled
Solution:
# Test your credentials
curl -X POST http://localhost:8000/api/login \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "your-password"}'
# If you forgot password, contact server admin to reset
âConfig file not foundâď
The client looks for config files in this order:
pp_client.conf(current directory)~/pp_client.conf(home directory)Path specified with
--config
Create one:
cp pp_client.conf.example ~/pp_client.conf
chmod 600 ~/pp_client.conf
nano ~/pp_client.conf
Common Workflowsď
Development Setupď
# 1. Get credentials from server admin
export PUTPLACE_USERNAME="dev-user"
export PUTPLACE_PASSWORD="dev-password"
# 2. Test connection
python pp_client.py /tmp --dry-run
# 3. Scan actual directory
python pp_client.py /home/user/projects
Production Server Setupď
# 1. Create config file
cat > ~/pp_client.conf << 'EOF'
[DEFAULT]
url = https://putplace.example.com/put_file
username = prod-user
password = production-password
exclude = .git
exclude = *.log
exclude = tmp
EOF
# 2. Set secure permissions
chmod 600 ~/pp_client.conf
# 3. Test
python pp_client.py /var/www --dry-run
# 4. Run for real
python pp_client.py /var/www
# 5. Set up cron job
echo "0 2 * * * /usr/bin/python3 /path/to/pp_client.py /var/www" | crontab -
Multi-Environment Setupď
# Development
cat > ~/pp_client.conf.dev << 'EOF'
url = http://dev-putplace:8000/put_file
username = dev-user
password = dev-password
EOF
# Production
cat > ~/pp_client.conf.prod << 'EOF'
url = https://putplace.example.com/put_file
username = prod-user
password = prod-password
EOF
# Use with --config flag
python pp_client.py /var/www --config ~/pp_client.conf.prod
Getting Helpď
# Show all options
python pp_client.py --help
# Check version and settings
python pp_client.py --version
Next Stepsď
đ Read Authentication Guide for JWT token management
đ Check Client Guide for comprehensive usage
đ Review Security Guide for best practices