{
  "manifest_version": "1.0.0",
  "template": {
    "id": "1905a654-ac8c-4888-86cb-067cc0f98a4d",
    "slug": "copyparty",
    "name": "Copyparty",
    "description": "Lightweight highly configurable extremely robust file server",
    "url": "https://railway.com/deploy/copyparty",
    "upstream": {
      "image": "copyparty/ac"
    }
  },
  "status": "unvalidated",
  "validated_at": null,
  "success_rate_30d": null,
  "services": [
    {
      "name": "Copyparty",
      "source": {
        "image": "copyparty/ac"
      },
      "needs_volume": true,
      "volume_mount_path": "/w",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "Copyparty",
      "description": "Provide a value for PORT.",
      "secret": false,
      "strategy": "default",
      "default": "3923"
    },
    {
      "key": "ACCOUNTS",
      "service": "Copyparty",
      "description": "Account list seperated by commas formatted as \"username: password\" (req. PERMS_VIA_VARS)",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "LD_PRELOAD",
      "service": "Copyparty",
      "description": "Enable mimalloc by replacing \"NOPE\" with \"2\" for a nice speed-boost (will use twice as much ram)",
      "secret": false,
      "strategy": "default",
      "default": "/usr/lib/libmimalloc-secure.so.NOPE"
    },
    {
      "key": "PERMS_VIA_VARS",
      "service": "Copyparty",
      "description": "Whether to handle accounts and permissions via service variables",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "CONFIG_ADDON_SCRIPT",
      "service": "Copyparty",
      "description": "Copyparty addon script for handling Railway integration and configuration sync in volume",
      "secret": false,
      "strategy": "default",
      "default": "echo \"[INFO] Running account configuration addon...\"\n\n# Set default value for PERMS_VIA_VARS if not specified\nif [ -z \"${PERMS_VIA_VARS}\" ]; then\n    PERMS_VIA_VARS=\"true\"\nfi\n\n# Set default template URL if not specified\nif [ -z \"${CONFIG_TEMPLATE_RAW_URL}\" ]; then\n    CONFIG_TEMPLATE_RAW_URL=\"https://raw.githubusercontent.com/FraglyG/copyparty-railway-config/main/copyparty.conf\"\nfi\n\n# Paths\nVOLUME_CONFIG=\"${RAILWAY_VOLUME_MOUNT_PATH}/copyparty.config\"\nRUNTIME_CONFIG=\"/cfg/copyparty.conf\"\n\n# Check if user config exists in volume, if not create from template\nif [ ! -f \"${VOLUME_CONFIG}\" ]; then\n    echo \"[INFO] User config file not found in volume, downloading template...\"\n    echo \"[INFO] Using template URL: ${CONFIG_TEMPLATE_RAW_URL}\"\n    wget -q -O \"${VOLUME_CONFIG}\" \"${CONFIG_TEMPLATE_RAW_URL}\"\n    echo \"[INFO] Template downloaded to ${VOLUME_CONFIG}.\"\n    echo \"[INFO] You can now edit this file in your volume to customize your configuration.\"\nelse\n    echo \"[INFO] Found existing user config file at ${VOLUME_CONFIG}.\"\nfi\n\n# Copy user config to runtime location\necho \"[INFO] Copying user config to runtime location...\"\ncp \"${VOLUME_CONFIG}\" \"${RUNTIME_CONFIG}\"\n\n# Only proceed with account/permission management if PERMS_VIA_VARS is true\nif [ \"${PERMS_VIA_VARS}\" = \"true\" ]; then\n    echo \"[INFO] PERMS_VIA_VARS is enabled, managing accounts and permissions via environment variables...\"\n    \n    if [ -z \"${ACCOUNTS}\" ]; then\n        echo \"[ERROR] The ACCOUNTS environment variable is not set or is empty.\" >&2\n        echo \"[ERROR] Please set it to one or more 'username: password' pairs, separated by commas.\" >&2\n        exit 1\n    fi\n\n    # Process accounts for [accounts] section\n    ACCOUNT_LINES=$(echo \"${ACCOUNTS}\" | awk -F, '{for(i=1;i<=NF;i++) {gsub(/^ */, \"\", $i); print \"  \" $i}}')\n\n    # Process permissions for [/] section\n    PERM_LINES=\"\"\n\n    # Add everyone permissions if specified\n    if [ -n \"${EVERYONE_PERMS}\" ]; then\n        PERM_LINES=\"${PERM_LINES}    ${EVERYONE_PERMS}: *\"$'\\n'\n    fi\n\n    # Add default account permissions\n    if [ -n \"${DEFAULT_ACCOUNT_PERMS}\" ]; then\n        ACCOUNT_NAMES=$(echo \"${ACCOUNTS}\" | awk -F, '{for(i=1;i<=NF;i++) {gsub(/^ */, \"\", $i); split($i, parts, \":\"); gsub(/^ */, \"\", parts[1]); print \"    \" default_perms \": \" parts[1]}}' default_perms=\"${DEFAULT_ACCOUNT_PERMS}\")\n        PERM_LINES=\"${PERM_LINES}${ACCOUNT_NAMES}\"$'\\n'\n    fi\n\n    # Add specific account permissions (these override defaults)\n    if [ -n \"${SPEC_ACCOUNT_PERMS}\" ]; then\n        SPEC_PERM_LINES=$(echo \"${SPEC_ACCOUNT_PERMS}\" | awk -F, '{for(i=1;i<=NF;i++) {gsub(/^ */, \"\", $i); print \"    \" $i}}')\n        PERM_LINES=\"${PERM_LINES}${SPEC_PERM_LINES}\"$'\\n'\n    fi\n\n    # Remove trailing newline\n    PERM_LINES=$(echo \"${PERM_LINES}\" | sed '$d')\n\n    # Update runtime config file with accounts and permissions\n    awk -v accounts=\"${ACCOUNT_LINES}\" -v perms=\"${PERM_LINES}\" '\n    /^\\[accounts\\]/ {\n        print\n        if (accounts) print accounts\n        next\n    }\n    /^\\[\\/\\]/ {\n        print\n        getline  # read next line (/w)\n        print\n        getline  # read next line (accs:)\n        print\n        if (perms) print perms\n        # Skip any existing permission lines until next section or EOF\n        while ((getline > 0) && !/^\\s*\\[.*\\]\\s*$/) {\n            # skip existing permissions\n        }\n        if (/^\\s*\\[.*\\]\\s*$/) print  # print the section header we just read\n        next\n    }\n    {print}' \"${RUNTIME_CONFIG}\" > \"${RUNTIME_CONFIG}.tmp\" && mv \"${RUNTIME_CONFIG}.tmp\" \"${RUNTIME_CONFIG}\"\n\n    echo \"[INFO] Successfully configured accounts and permissions in ${RUNTIME_CONFIG}.\"\nelse\n    echo \"[INFO] PERMS_VIA_VARS is disabled, using configuration from ${VOLUME_CONFIG} as-is.\"\nfi\n\necho \"[INFO] To customize configuration, edit ${VOLUME_CONFIG} and restart the container.\""
    },
    {
      "key": "DEFAULT_ACCOUNT_PERMS",
      "service": "Copyparty",
      "description": "The default permissions for added accounts (req. PERMS_VIA_VARS)",
      "secret": false,
      "strategy": "default",
      "default": "rwmda"
    },
    {
      "key": "CONFIG_TEMPLATE_RAW_URL",
      "service": "Copyparty",
      "description": "copyparty.conf template location; note: only a template, you can edit the generated config after boot",
      "secret": false,
      "strategy": "default",
      "default": "https://raw.githubusercontent.com/FraglyG/copyparty-railway-config/main/copyparty.conf"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "copyparty"
      }
    },
    "cli": "railway deploy --template copyparty",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "1905a654-ac8c-4888-86cb-067cc0f98a4d",
            "serializedConfig": {
              "services": {
                "e7dcb806-2b51-4356-bccd-1c17707f9440": {
                  "icon": "https://raw.githubusercontent.com/9001/copyparty/hovudstraum/docs/logo.svg",
                  "name": "Copyparty",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'if [ -n \"${CONFIG_ADDON_SCRIPT}\" ]; then eval \"${CONFIG_ADDON_SCRIPT}\"; fi; echo \"[INFO] Starting application...\"; exec python3 -m copyparty --no-crt --xff-src=100.64.0.0/10 --rproxy=-1 -c /z/initcfg'",
                    "healthcheckPath": null
                  },
                  "source": {
                    "image": "copyparty/ac"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "defaultValue": "3923"
                    },
                    "ACCOUNTS": {
                      "isOptional": false,
                      "description": "Account list seperated by commas formatted as \"username: password\" (req. PERMS_VIA_VARS)",
                      "defaultValue": "{{ACCOUNTS}}"
                    },
                    "LD_PRELOAD": {
                      "isOptional": false,
                      "description": "Enable mimalloc by replacing \"NOPE\" with \"2\" for a nice speed-boost (will use twice as much ram)",
                      "defaultValue": "/usr/lib/libmimalloc-secure.so.NOPE"
                    },
                    "EVERYONE_PERMS": {
                      "isOptional": true,
                      "description": "Default permissions for everyone, including logged out / anon users; leave empty to require login (req. PERMS_VIA_VARS)",
                      "defaultValue": ""
                    },
                    "PERMS_VIA_VARS": {
                      "isOptional": true,
                      "description": "Whether to handle accounts and permissions via service variables",
                      "defaultValue": "true"
                    },
                    "SPEC_ACCOUNT_PERMS": {
                      "isOptional": true,
                      "description": "Specific permission overrides for individual accounts, e.g `rwmda: john, r: jane`; leave empty if all accounts should use default account perms  (req. PERMS_VIA_VARS)",
                      "defaultValue": ""
                    },
                    "CONFIG_ADDON_SCRIPT": {
                      "isOptional": false,
                      "description": "Copyparty addon script for handling Railway integration and configuration sync in volume",
                      "defaultValue": "echo \"[INFO] Running account configuration addon...\"\n\n# Set default value for PERMS_VIA_VARS if not specified\nif [ -z \"${PERMS_VIA_VARS}\" ]; then\n    PERMS_VIA_VARS=\"true\"\nfi\n\n# Set default template URL if not specified\nif [ -z \"${CONFIG_TEMPLATE_RAW_URL}\" ]; then\n    CONFIG_TEMPLATE_RAW_URL=\"https://raw.githubusercontent.com/FraglyG/copyparty-railway-config/main/copyparty.conf\"\nfi\n\n# Paths\nVOLUME_CONFIG=\"${RAILWAY_VOLUME_MOUNT_PATH}/copyparty.config\"\nRUNTIME_CONFIG=\"/cfg/copyparty.conf\"\n\n# Check if user config exists in volume, if not create from template\nif [ ! -f \"${VOLUME_CONFIG}\" ]; then\n    echo \"[INFO] User config file not found in volume, downloading template...\"\n    echo \"[INFO] Using template URL: ${CONFIG_TEMPLATE_RAW_URL}\"\n    wget -q -O \"${VOLUME_CONFIG}\" \"${CONFIG_TEMPLATE_RAW_URL}\"\n    echo \"[INFO] Template downloaded to ${VOLUME_CONFIG}.\"\n    echo \"[INFO] You can now edit this file in your volume to customize your configuration.\"\nelse\n    echo \"[INFO] Found existing user config file at ${VOLUME_CONFIG}.\"\nfi\n\n# Copy user config to runtime location\necho \"[INFO] Copying user config to runtime location...\"\ncp \"${VOLUME_CONFIG}\" \"${RUNTIME_CONFIG}\"\n\n# Only proceed with account/permission management if PERMS_VIA_VARS is true\nif [ \"${PERMS_VIA_VARS}\" = \"true\" ]; then\n    echo \"[INFO] PERMS_VIA_VARS is enabled, managing accounts and permissions via environment variables...\"\n    \n    if [ -z \"${ACCOUNTS}\" ]; then\n        echo \"[ERROR] The ACCOUNTS environment variable is not set or is empty.\" >&2\n        echo \"[ERROR] Please set it to one or more 'username: password' pairs, separated by commas.\" >&2\n        exit 1\n    fi\n\n    # Process accounts for [accounts] section\n    ACCOUNT_LINES=$(echo \"${ACCOUNTS}\" | awk -F, '{for(i=1;i<=NF;i++) {gsub(/^ */, \"\", $i); print \"  \" $i}}')\n\n    # Process permissions for [/] section\n    PERM_LINES=\"\"\n\n    # Add everyone permissions if specified\n    if [ -n \"${EVERYONE_PERMS}\" ]; then\n        PERM_LINES=\"${PERM_LINES}    ${EVERYONE_PERMS}: *\"$'\\n'\n    fi\n\n    # Add default account permissions\n    if [ -n \"${DEFAULT_ACCOUNT_PERMS}\" ]; then\n        ACCOUNT_NAMES=$(echo \"${ACCOUNTS}\" | awk -F, '{for(i=1;i<=NF;i++) {gsub(/^ */, \"\", $i); split($i, parts, \":\"); gsub(/^ */, \"\", parts[1]); print \"    \" default_perms \": \" parts[1]}}' default_perms=\"${DEFAULT_ACCOUNT_PERMS}\")\n        PERM_LINES=\"${PERM_LINES}${ACCOUNT_NAMES}\"$'\\n'\n    fi\n\n    # Add specific account permissions (these override defaults)\n    if [ -n \"${SPEC_ACCOUNT_PERMS}\" ]; then\n        SPEC_PERM_LINES=$(echo \"${SPEC_ACCOUNT_PERMS}\" | awk -F, '{for(i=1;i<=NF;i++) {gsub(/^ */, \"\", $i); print \"    \" $i}}')\n        PERM_LINES=\"${PERM_LINES}${SPEC_PERM_LINES}\"$'\\n'\n    fi\n\n    # Remove trailing newline\n    PERM_LINES=$(echo \"${PERM_LINES}\" | sed '$d')\n\n    # Update runtime config file with accounts and permissions\n    awk -v accounts=\"${ACCOUNT_LINES}\" -v perms=\"${PERM_LINES}\" '\n    /^\\[accounts\\]/ {\n        print\n        if (accounts) print accounts\n        next\n    }\n    /^\\[\\/\\]/ {\n        print\n        getline  # read next line (/w)\n        print\n        getline  # read next line (accs:)\n        print\n        if (perms) print perms\n        # Skip any existing permission lines until next section or EOF\n        while ((getline > 0) && !/^\\s*\\[.*\\]\\s*$/) {\n            # skip existing permissions\n        }\n        if (/^\\s*\\[.*\\]\\s*$/) print  # print the section header we just read\n        next\n    }\n    {print}' \"${RUNTIME_CONFIG}\" > \"${RUNTIME_CONFIG}.tmp\" && mv \"${RUNTIME_CONFIG}.tmp\" \"${RUNTIME_CONFIG}\"\n\n    echo \"[INFO] Successfully configured accounts and permissions in ${RUNTIME_CONFIG}.\"\nelse\n    echo \"[INFO] PERMS_VIA_VARS is disabled, using configuration from ${VOLUME_CONFIG} as-is.\"\nfi\n\necho \"[INFO] To customize configuration, edit ${VOLUME_CONFIG} and restart the container.\""
                    },
                    "DEFAULT_ACCOUNT_PERMS": {
                      "isOptional": true,
                      "description": "The default permissions for added accounts (req. PERMS_VIA_VARS)",
                      "defaultValue": "rwmda"
                    },
                    "CONFIG_TEMPLATE_RAW_URL": {
                      "isOptional": true,
                      "description": "copyparty.conf template location; note: only a template, you can edit the generated config after boot",
                      "defaultValue": "https://raw.githubusercontent.com/FraglyG/copyparty-railway-config/main/copyparty.conf"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "e7dcb806-2b51-4356-bccd-1c17707f9440": {
                      "mountPath": "/w"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T22:14:37.505Z",
  "generator_version": "0.1.0"
}
