/api/program/zip-support-files

GET

Creates a compressed ZIP archive of log files and configuration files for technical support and debugging purposes.

Description

The /api/program/zip-support-files endpoint packages all diagnostic files specified in SupportFiles.txt into a single ZIP archive. This is essential for troubleshooting, bug reports, and technical support tickets. The archive is created with an ISO timestamp and saved to the Zipped Logs directory.

The endpoint reads a list of files from SupportFiles.txt (located in the Data directory) and compresses them using the miniz library. Files that don't exist are silently skipped to avoid errors when optional logs are missing.

Use Case

This endpoint is perfect for:

  • Submitting bug reports with complete diagnostic information
  • Technical support ticket attachments
  • Backing up configuration and log files before major operations
  • System diagnostics and troubleshooting
  • Sharing operational history with development team
Prerequisites

The SupportFiles.txt file must exist in the Data directory. This file should contain a list of file paths (one per line) to include in the archive. If the file is missing, the endpoint returns a 404 error.

Parameters

This endpoint does not require any parameters.

Response

Returns a JSON object with information about the created ZIP archive.

Success Response Properties

status string
Always "success" when the archive is created.
operation string
Always "zip-support-files".
filename string
Name of the created ZIP file with ISO timestamp (e.g., "ForSupport.2025-01-31_15-30-45.zip").
location string
Directory path where the ZIP file was saved (the "Zipped Logs" folder).
full_path string
Complete filesystem path to the created ZIP archive.
message string
Confirmation message: "Support files zipped successfully".

Success Response Example

{
  "status": "success",
  "operation": "zip-support-files",
  "filename": "ForSupport.2025-01-31_15-30-45.zip",
  "location": "D:\\CloudCoin\\Pro\\Data\\Zipped Logs",
  "full_path": "D:\\CloudCoin\\Pro\\Data\\Zipped Logs\\ForSupport.2025-01-31_15-30-45.zip",
  "message": "Support files zipped successfully"
}

Error Responses

The endpoint may return the following error responses:

404 Not Found - SupportFiles.txt Missing

{
  "status": "error",
  "message": "SupportFiles.txt not found",
  "error_code": 101
}

Returned when the SupportFiles.txt configuration file does not exist in the Data directory.

500 Internal Server Error - ZIP Creation Failed

{
  "status": "error",
  "message": "Failed to create support files zip",
  "error_code": 102
}

Returned when the ZIP archive cannot be created due to filesystem permissions, disk space, or file I/O errors.

Implementation Details

Archive Contents

The ZIP archive includes all files listed in SupportFiles.txt. Typical contents include:

  • main.log - Primary application log with all operations
  • program-config.txt - Main configuration settings
  • wallet-locations.csv - Wallet directory paths
  • raidas-ips.csv - RAIDA server IP addresses
  • root-hints.csv - DNS resolver hints
  • guardians.csv - Backup guardian configuration
  • UnpackLog.csv - File movement tracking from unpack operations
  • Any other diagnostic or configuration files specified

File Handling

  • Files are read line-by-line from SupportFiles.txt
  • Empty lines and whitespace-only lines are skipped
  • Files that don't exist are silently skipped (not treated as errors)
  • Only the filename (not full path) is stored in the ZIP archive structure
  • Compression uses the miniz library with MZ_BEST_COMPRESSION level

Filename Format

ZIP files are named with the pattern: ForSupport.YYYY-MM-DD_HH-MM-SS.zip

Example: ForSupport.2025-01-31_15-30-45.zip

Storage Location

Archives are saved to: [DataDirectory]/Zipped Logs/

The "Zipped Logs" directory is created automatically if it doesn't exist.

Examples

JavaScript (fetch)

const API_HOST = 'http://localhost:8080';

async function createSupportZip() {
    try {
        const response = await fetch(`${API_HOST}/api/program/zip-support-files`);
        const result = await response.json();

        if (result.status === 'success') {
            console.log('Support archive created successfully!');
            console.log(`Filename: ${result.filename}`);
            console.log(`Location: ${result.location}`);
            console.log(`Full path: ${result.full_path}`);

            // You can now share the full_path with support team
            alert(`Support files packaged: ${result.filename}`);
        } else {
            console.error('Error creating archive:', result.message);
            console.error('Error code:', result.error_code);
        }
    } catch (error) {
        console.error('Request failed:', error);
    }
}

createSupportZip();

cURL

# Create support files ZIP archive
curl -X GET "http://localhost:8080/api/program/zip-support-files"

# Pretty-print JSON response
curl -X GET "http://localhost:8080/api/program/zip-support-files" | jq

# Save the response to a file
curl -X GET "http://localhost:8080/api/program/zip-support-files" \
     -o support_archive_info.json

Go

package main

import (
    "encoding/json"
    "fmt"
    "io/ioutil"
    "net/http"
)

const ApiHost = "http://localhost:8080"

type ZipSupportResponse struct {
    Status    string `json:"status"`
    Operation string `json:"operation"`
    Filename  string `json:"filename"`
    Location  string `json:"location"`
    FullPath  string `json:"full_path"`
    Message   string `json:"message"`
}

type ErrorResponse struct {
    Status    string `json:"status"`
    Message   string `json:"message"`
    ErrorCode int    `json:"error_code"`
}

func main() {
    url := fmt.Sprintf("%s/api/program/zip-support-files", ApiHost)
    resp, err := http.Get(url)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, _ := ioutil.ReadAll(resp.Body)

    if resp.StatusCode == 200 {
        var result ZipSupportResponse
        if err := json.Unmarshal(body, &result); err != nil {
            panic(err)
        }

        fmt.Println("Support Archive Created Successfully!")
        fmt.Printf("Filename: %s\n", result.Filename)
        fmt.Printf("Location: %s\n", result.Location)
        fmt.Printf("Full Path: %s\n", result.FullPath)
        fmt.Printf("Message: %s\n", result.Message)
    } else {
        var errResult ErrorResponse
        if err := json.Unmarshal(body, &errResult); err != nil {
            panic(err)
        }

        fmt.Printf("Error: %s (code %d)\n", errResult.Message, errResult.ErrorCode)
    }
}

Python

import requests
import json

API_HOST = 'http://localhost:8080'

def create_support_zip():
    """Create a ZIP archive of support files."""
    url = f'{API_HOST}/api/program/zip-support-files'

    try:
        response = requests.get(url)
        result = response.json()

        if result['status'] == 'success':
            print('Support archive created successfully!')
            print(f"Filename: {result['filename']}")
            print(f"Location: {result['location']}")
            print(f"Full Path: {result['full_path']}")
            print(f"Message: {result['message']}")
            return result['full_path']
        else:
            print(f"Error: {result['message']}")
            print(f"Error code: {result['error_code']}")
            return None

    except requests.exceptions.RequestException as e:
        print(f'Request failed: {e}')
        return None

if __name__ == '__main__':
    archive_path = create_support_zip()
    if archive_path:
        print(f"\nArchive ready for support ticket: {archive_path}")

SupportFiles.txt Configuration

The SupportFiles.txt file should be located in the Data directory and contain one file path per line. Here's an example configuration:

D:\CloudCoin\Pro\Data\main.log
D:\CloudCoin\Pro\Data\program-config.txt
D:\CloudCoin\Pro\Data\wallet-locations.csv
D:\CloudCoin\Pro\Data\raidas-ips.csv
D:\CloudCoin\Pro\Data\root-hints.csv
D:\CloudCoin\Pro\Data\guardians.csv
D:\CloudCoin\Pro\Data\UnpackLog.csv
D:\CloudCoin\Pro\Data\Performance Statistics\latest_stats.csv
File Path Notes
  • Use absolute file paths for reliability
  • One file path per line
  • Empty lines are ignored
  • Files that don't exist are skipped silently
  • No need for quotes around paths with spaces

Related Endpoints

/api/wallet/backup

Create a backup archive of wallet coins and configuration for disaster recovery.

/api/program/status

Get program version information and verify the server is running correctly.

/api/program/echo

Test RAIDA network connectivity and get diagnostic information about server health.

Best Practices

Tips for Support Tickets
  • Create archive immediately after issues: Capture logs while the problem is fresh
  • Include in bug reports: Attach the ZIP file to GitHub issues or support tickets
  • Verify file existence: Check that SupportFiles.txt is properly configured before calling the endpoint
  • Monitor disk space: Ensure sufficient space in the "Zipped Logs" directory
  • Archive rotation: Old archives are not automatically deleted - clean them periodically
  • Privacy check: Review the contents of SupportFiles.txt to ensure no sensitive data (private keys, passwords) are included