[object Object]

← back to Designer Wallcoverings

fix: remove backup source leak from public dir, fix duplicate-const syntax error, harden .gitignore

20cf51fad2153ac537e1d6673f291c4e70b42e39 · 2026-05-30 23:53:29 -0700 · SteveStudio2

- Delete DW-MCP/public/index.html.backup (backup file sitting in served public dir = source leak)
- Fix SyntaxError in DW-Programming/150dpi/_archive/server.js: rename duplicate const cookies (line 161) to pageCookies so the block-scoped re-declaration no longer conflicts with the outer const cookies (line 102)
- Add *.bak / *.bak-* / *.pre-* / *.orig / *.save / *~ / *.old / copy-of-* / *.backup to .gitignore to prevent future backup leaks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files touched

Diff

commit 20cf51fad2153ac537e1d6673f291c4e70b42e39
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date:   Sat May 30 23:53:29 2026 -0700

    fix: remove backup source leak from public dir, fix duplicate-const syntax error, harden .gitignore
    
    - Delete DW-MCP/public/index.html.backup (backup file sitting in served public dir = source leak)
    - Fix SyntaxError in DW-Programming/150dpi/_archive/server.js: rename duplicate const cookies (line 161) to pageCookies so the block-scoped re-declaration no longer conflicts with the outer const cookies (line 102)
    - Add *.bak / *.bak-* / *.pre-* / *.orig / *.save / *~ / *.old / copy-of-* / *.backup to .gitignore to prevent future backup leaks
    
    Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
 .gitignore                               |  11 +
 DW-MCP/public/index.html.backup          | 534 -------------------------------
 DW-Programming/150dpi/_archive/server.js |   4 +-
 3 files changed, 13 insertions(+), 536 deletions(-)

diff --git a/.gitignore b/.gitignore
index 8d7806e5..4f934aca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,3 +36,14 @@ shopify/scripts/sheets-service-account.json
 # Python bytecode (added 2026-05-30 — stale .pyc still contained pre-strip dw_admin pw)
 __pycache__/
 *.pyc
+
+# Backup / scratch files — never serve these (added 2026-05-30)
+*.bak
+*.bak-*
+*.pre-*
+*.orig
+*.save
+*~
+*.old
+copy-of-*
+*.backup
diff --git a/DW-MCP/public/index.html.backup b/DW-MCP/public/index.html.backup
deleted file mode 100644
index 19ff6e6e..00000000
--- a/DW-MCP/public/index.html.backup
+++ /dev/null
@@ -1,534 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>DW-MCP API Dashboard</title>
-    <style>
-        * {
-            margin: 0;
-            padding: 0;
-            box-sizing: border-box;
-        }
-
-        body {
-            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
-            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
-            min-height: 100vh;
-            padding: 20px;
-        }
-
-        .container {
-            max-width: 1200px;
-            margin: 0 auto;
-        }
-
-        .header {
-            text-align: center;
-            color: white;
-            margin-bottom: 30px;
-        }
-
-        .header h1 {
-            font-size: 2.5rem;
-            margin-bottom: 10px;
-        }
-
-        .header p {
-            font-size: 1.1rem;
-            opacity: 0.9;
-        }
-
-        .login-container {
-            background: white;
-            border-radius: 10px;
-            padding: 40px;
-            max-width: 400px;
-            margin: 50px auto;
-            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
-        }
-
-        .login-container h2 {
-            text-align: center;
-            margin-bottom: 30px;
-            color: #333;
-        }
-
-        .form-group {
-            margin-bottom: 20px;
-        }
-
-        .form-group label {
-            display: block;
-            margin-bottom: 5px;
-            color: #555;
-            font-weight: 500;
-        }
-
-        .form-group input {
-            width: 100%;
-            padding: 12px;
-            border: 2px solid #e0e0e0;
-            border-radius: 5px;
-            font-size: 1rem;
-            transition: border-color 0.3s;
-        }
-
-        .form-group input:focus {
-            outline: none;
-            border-color: #667eea;
-        }
-
-        .btn {
-            width: 100%;
-            padding: 12px;
-            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
-            color: white;
-            border: none;
-            border-radius: 5px;
-            font-size: 1rem;
-            font-weight: 600;
-            cursor: pointer;
-            transition: transform 0.2s;
-        }
-
-        .btn:hover {
-            transform: translateY(-2px);
-        }
-
-        .btn:active {
-            transform: translateY(0);
-        }
-
-        .dashboard {
-            display: none;
-        }
-
-        .dashboard.active {
-            display: block;
-        }
-
-        .card-grid {
-            display: grid;
-            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
-            gap: 20px;
-            margin-bottom: 30px;
-        }
-
-        .card {
-            background: white;
-            border-radius: 10px;
-            padding: 25px;
-            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
-            transition: transform 0.3s;
-        }
-
-        .card:hover {
-            transform: translateY(-5px);
-        }
-
-        .card h3 {
-            color: #333;
-            margin-bottom: 15px;
-            font-size: 1.3rem;
-        }
-
-        .status-badge {
-            display: inline-block;
-            padding: 5px 15px;
-            border-radius: 20px;
-            font-size: 0.85rem;
-            font-weight: 600;
-            margin-bottom: 10px;
-        }
-
-        .status-configured {
-            background: #10b981;
-            color: white;
-        }
-
-        .status-not-configured {
-            background: #ef4444;
-            color: white;
-        }
-
-        .api-form {
-            background: white;
-            border-radius: 10px;
-            padding: 25px;
-            margin-bottom: 20px;
-            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
-        }
-
-        .api-form h3 {
-            color: #333;
-            margin-bottom: 20px;
-        }
-
-        .api-form textarea {
-            width: 100%;
-            padding: 12px;
-            border: 2px solid #e0e0e0;
-            border-radius: 5px;
-            font-family: inherit;
-            font-size: 1rem;
-            resize: vertical;
-            min-height: 100px;
-        }
-
-        .response {
-            background: #f3f4f6;
-            border-radius: 5px;
-            padding: 15px;
-            margin-top: 15px;
-            display: none;
-            font-family: monospace;
-            font-size: 0.9rem;
-        }
-
-        .response.show {
-            display: block;
-        }
-
-        .response.success {
-            background: #d1fae5;
-            color: #065f46;
-        }
-
-        .response.error {
-            background: #fee2e2;
-            color: #991b1b;
-        }
-
-        .logout-btn {
-            position: fixed;
-            top: 20px;
-            right: 20px;
-            background: white;
-            color: #667eea;
-            padding: 10px 20px;
-            border: none;
-            border-radius: 5px;
-            font-weight: 600;
-            cursor: pointer;
-            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
-        }
-
-        .error-message {
-            background: #fee2e2;
-            color: #991b1b;
-            padding: 10px;
-            border-radius: 5px;
-            margin-top: 10px;
-            display: none;
-        }
-
-        .error-message.show {
-            display: block;
-        }
-    </style>
-</head>
-<body>
-    <div class="container">
-        <div class="header">
-            <h1>DW-MCP API Dashboard</h1>
-            <p>Unified API Management Platform</p>
-        </div>
-
-        <!-- Login Form -->
-        <div id="loginContainer" class="login-container">
-            <h2>Login</h2>
-            <div class="form-group">
-                <label for="username">Username</label>
-                <input type="text" id="username" placeholder="Enter username">
-            </div>
-            <div class="form-group">
-                <label for="password">Password</label>
-                <input type="password" id="password" placeholder="Enter password">
-            </div>
-            <button class="btn" onclick="login()">Login</button>
-            <div id="loginError" class="error-message"></div>
-        </div>
-
-        <!-- Dashboard -->
-        <div id="dashboard" class="dashboard">
-            <button class="logout-btn" onclick="logout()">Logout</button>
-
-            <!-- API Status Cards -->
-            <div class="card-grid" id="apiStatus">
-                <!-- Status cards will be loaded here -->
-            </div>
-
-            <!-- Gmail API -->
-            <div class="api-form">
-                <h3>Gmail - View Messages</h3>
-                <div class="form-group">
-                    <label>Number of Messages:</label>
-                    <input type="number" id="gmailCount" value="10" min="1" max="50">
-                </div>
-                <button class="btn" onclick="viewGmailMessages()">Load Messages</button>
-                <div id="gmailMessagesResponse" class="response"></div>
-            </div>
-
-            <div class="api-form">
-                <h3>Gmail - Send Email</h3>
-                <div class="form-group">
-                    <label>To:</label>
-                    <input type="email" id="gmailTo" placeholder="recipient@example.com">
-                </div>
-                <div class="form-group">
-                    <label>Subject:</label>
-                    <input type="text" id="gmailSubject" placeholder="Email subject">
-                </div>
-                <div class="form-group">
-                    <label>Body:</label>
-                    <textarea id="gmailBody" placeholder="Email content"></textarea>
-                </div>
-                <button class="btn" onclick="sendEmail()">Send Email</button>
-                <div id="gmailResponse" class="response"></div>
-            </div>
-
-            <!-- Twilio API -->
-            <div class="api-form">
-                <h3>Twilio - Send SMS</h3>
-                <div class="form-group">
-                    <label>To (Phone Number):</label>
-                    <input type="tel" id="twilioTo" placeholder="+1234567890">
-                </div>
-                <div class="form-group">
-                    <label>Message:</label>
-                    <textarea id="twilioBody" placeholder="SMS message"></textarea>
-                </div>
-                <button class="btn" onclick="sendSMS()">Send SMS</button>
-                <div id="twilioResponse" class="response"></div>
-            </div>
-
-            <!-- Slack API -->
-            <div class="api-form">
-                <h3>Slack - Send Message</h3>
-                <div class="form-group">
-                    <label>Channel:</label>
-                    <input type="text" id="slackChannel" placeholder="#general">
-                </div>
-                <div class="form-group">
-                    <label>Message:</label>
-                    <textarea id="slackText" placeholder="Slack message"></textarea>
-                </div>
-                <button class="btn" onclick="sendSlackMessage()">Send Message</button>
-                <div id="slackResponse" class="response"></div>
-            </div>
-
-            <!-- Weather API -->
-            <div class="api-form">
-                <h3>Weather - Get Current Weather</h3>
-                <div class="form-group">
-                    <label>City:</label>
-                    <input type="text" id="weatherCity" placeholder="London">
-                </div>
-                <button class="btn" onclick="getWeather()">Get Weather</button>
-                <div id="weatherResponse" class="response"></div>
-            </div>
-        </div>
-    </div>
-
-    <script>
-        let authToken = null;
-
-        function login() {
-            const username = document.getElementById('username').value;
-            const password = document.getElementById('password').value;
-
-            authToken = 'Basic ' + btoa(username + ':' + password);
-
-            // Test authentication
-            fetch('/api/status', {
-                headers: {
-                    'Authorization': authToken
-                }
-            })
-            .then(response => {
-                if (response.ok) {
-                    document.getElementById('loginContainer').style.display = 'none';
-                    document.getElementById('dashboard').classList.add('active');
-                    loadAPIStatus();
-                } else {
-                    document.getElementById('loginError').textContent = 'Invalid credentials';
-                    document.getElementById('loginError').classList.add('show');
-                }
-            })
-            .catch(error => {
-                document.getElementById('loginError').textContent = 'Error: ' + error.message;
-                document.getElementById('loginError').classList.add('show');
-            });
-        }
-
-        function logout() {
-            authToken = null;
-            document.getElementById('loginContainer').style.display = 'block';
-            document.getElementById('dashboard').classList.remove('active');
-            document.getElementById('username').value = '';
-            document.getElementById('password').value = '';
-        }
-
-        function loadAPIStatus() {
-            fetch('/api/status')
-                .then(response => response.json())
-                .then(data => {
-                    const statusContainer = document.getElementById('apiStatus');
-                    statusContainer.innerHTML = '';
-
-                    data.apis.forEach(api => {
-                        const statusClass = api.status === 'configured' ? 'status-configured' : 'status-not-configured';
-                        const card = `
-                            <div class="card">
-                                <h3>${api.name}</h3>
-                                <span class="status-badge ${statusClass}">${api.status}</span>
-                            </div>
-                        `;
-                        statusContainer.innerHTML += card;
-                    });
-                });
-        }
-
-        function sendEmail() {
-            const data = {
-                to: document.getElementById('gmailTo').value,
-                subject: document.getElementById('gmailSubject').value,
-                body: document.getElementById('gmailBody').value
-            };
-
-            fetch('/api/gmail/send', {
-                method: 'POST',
-                headers: {
-                    'Content-Type': 'application/json',
-                    'Authorization': authToken
-                },
-                body: JSON.stringify(data)
-            })
-            .then(response => response.json())
-            .then(result => {
-                const responseDiv = document.getElementById('gmailResponse');
-                responseDiv.textContent = JSON.stringify(result, null, 2);
-                responseDiv.className = 'response show ' + (result.success ? 'success' : 'error');
-            })
-            .catch(error => {
-                const responseDiv = document.getElementById('gmailResponse');
-                responseDiv.textContent = 'Error: ' + error.message;
-                responseDiv.className = 'response show error';
-            });
-        }
-
-        function sendSMS() {
-            const data = {
-                to: document.getElementById('twilioTo').value,
-                body: document.getElementById('twilioBody').value
-            };
-
-            fetch('/api/twilio/sms', {
-                method: 'POST',
-                headers: {
-                    'Content-Type': 'application/json',
-                    'Authorization': authToken
-                },
-                body: JSON.stringify(data)
-            })
-            .then(response => response.json())
-            .then(result => {
-                const responseDiv = document.getElementById('twilioResponse');
-                responseDiv.textContent = JSON.stringify(result, null, 2);
-                responseDiv.className = 'response show ' + (result.success ? 'success' : 'error');
-            })
-            .catch(error => {
-                const responseDiv = document.getElementById('twilioResponse');
-                responseDiv.textContent = 'Error: ' + error.message;
-                responseDiv.className = 'response show error';
-            });
-        }
-
-        function sendSlackMessage() {
-            const data = {
-                channel: document.getElementById('slackChannel').value,
-                text: document.getElementById('slackText').value
-            };
-
-            fetch('/api/slack/message', {
-                method: 'POST',
-                headers: {
-                    'Content-Type': 'application/json',
-                    'Authorization': authToken
-                },
-                body: JSON.stringify(data)
-            })
-            .then(response => response.json())
-            .then(result => {
-                const responseDiv = document.getElementById('slackResponse');
-                responseDiv.textContent = JSON.stringify(result, null, 2);
-                responseDiv.className = 'response show ' + (result.success ? 'success' : 'error');
-            })
-            .catch(error => {
-                const responseDiv = document.getElementById('slackResponse');
-                responseDiv.textContent = 'Error: ' + error.message;
-                responseDiv.className = 'response show error';
-            });
-        }
-
-        function getWeather() {
-            const city = document.getElementById('weatherCity').value;
-
-            fetch('/api/weather/' + encodeURIComponent(city))
-            .then(response => response.json())
-            .then(result => {
-                const responseDiv = document.getElementById('weatherResponse');
-                responseDiv.textContent = JSON.stringify(result, null, 2);
-                responseDiv.className = 'response show ' + (result.error ? 'error' : 'success');
-            })
-            .catch(error => {
-                const responseDiv = document.getElementById('weatherResponse');
-                responseDiv.textContent = 'Error: ' + error.message;
-                responseDiv.className = 'response show error';
-            });
-        }
-
-        function viewGmailMessages() {
-            const maxResults = document.getElementById('gmailCount').value;
-
-            fetch('/api/gmail/messages?maxResults=' + maxResults, {
-                headers: {
-                    'Authorization': authToken
-                }
-            })
-            .then(response => response.json())
-            .then(result => {
-                const responseDiv = document.getElementById('gmailMessagesResponse');
-
-                if (result.success && result.messages) {
-                    let html = '<div style="text-align: left;">';
-                    result.messages.forEach((msg, index) => {
-                        html += `
-                            <div style="border-bottom: 1px solid #ccc; padding: 10px 0; margin-bottom: 10px;">
-                                <strong style="color: #667eea;">#${index + 1}</strong><br>
-                                <strong>From:</strong> ${msg.from}<br>
-                                <strong>Subject:</strong> ${msg.subject}<br>
-                                <strong>Date:</strong> ${msg.date}<br>
-                                <strong>Preview:</strong> ${msg.snippet}<br>
-                                <small style="color: #888;">ID: ${msg.id}</small>
-                            </div>
-                        `;
-                    });
-                    html += '</div>';
-                    responseDiv.innerHTML = html;
-                    responseDiv.className = 'response show success';
-                } else {
-                    responseDiv.textContent = JSON.stringify(result, null, 2);
-                    responseDiv.className = 'response show error';
-                }
-            })
-            .catch(error => {
-                const responseDiv = document.getElementById('gmailMessagesResponse');
-                responseDiv.textContent = 'Error: ' + error.message;
-                responseDiv.className = 'response show error';
-            });
-        }
-    </script>
-</body>
-</html>
diff --git a/DW-Programming/150dpi/_archive/server.js b/DW-Programming/150dpi/_archive/server.js
index 9525d2a5..20a15717 100644
--- a/DW-Programming/150dpi/_archive/server.js
+++ b/DW-Programming/150dpi/_archive/server.js
@@ -158,8 +158,8 @@ app.post('/api/download-spoonflower', async (req, res) => {
         console.log('Download link found:', downloadLink);
 
         // Get cookies from the page to use with axios
-        const cookies = await page.cookies();
-        const cookieString = cookies.map(c => `${c.name}=${c.value}`).join('; ');
+        const pageCookies = await page.cookies();
+        const cookieString = pageCookies.map(c => `${c.name}=${c.value}`).join('; ');
 
         await browser.close();
 

← 59c3ba19 security: strip hardcoded dw_admin pw across 27 files (paren  ·  back to Designer Wallcoverings  ·  track DW-Agents/scripts/reverse-sync.js (orphan relink dry-r a45a0194 →