{
  "manifest_version": "1.0.0",
  "template": {
    "id": "d507d26b-e530-4efe-85da-19773f133705",
    "slug": "papermark-no-saas-keys",
    "name": "Papermark (No SaaS Keys)",
    "description": "Open-source DocSend: share PDFs with page-by-page analytics, no SaaS keys",
    "url": "https://railway.com/deploy/papermark-no-saas-keys",
    "upstream": {
      "image": "ghcr.io/hmseeb/papermark-railway:bb93cfd-r4"
    }
  },
  "status": "unvalidated",
  "validated_at": null,
  "success_rate_30d": null,
  "services": [
    {
      "name": "Redis",
      "source": {
        "image": "redis:8.2.1"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    },
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "papermark",
      "source": {
        "image": "ghcr.io/hmseeb/papermark-railway:bb93cfd-r4"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "redis-http",
      "source": {
        "image": "hiett/serverless-redis-http:0.0.10"
      },
      "needs_volume": false,
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "REDIS_PASSWORD",
      "service": "Redis",
      "description": "Redis password, generated per deploy.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Subdirectory of the volume; initdb refuses the mount root because of lost+found.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Internal hostname of this database.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Port the database listens on.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Role the application connects as.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Database the application connects to.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Password for the application role.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database created on first boot.",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Connection string used by Papermark.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Superuser created on first boot.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "Lifetime in days of the self-signed TLS certificate.",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Superuser password, generated per deploy.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Seconds to finish in-flight work before shutdown.",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "PORT",
      "service": "papermark",
      "description": "Port Next.js listens on and the public domain targets.",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "ADMIN_EMAIL",
      "service": "papermark",
      "description": "Your email address. You sign in with it and ADMIN_PASSWORD.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "ADMIN_PASSWORD",
      "service": "papermark",
      "description": "Password for ADMIN_EMAIL, generated per deploy. Delete it to turn password sign-in off once email sign-in works.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "NEXTAUTH_SECRET",
      "service": "papermark",
      "description": "Signs session tokens.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "INTERNAL_API_KEY",
      "service": "papermark",
      "description": "Authenticates the app's internal API calls to itself.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "REVALIDATE_TOKEN",
      "service": "papermark",
      "description": "Authenticates page revalidation after a document changes.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "POSTGRES_PRISMA_URL",
      "service": "papermark",
      "description": "Database connection (Prisma).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "UPSTASH_REDIS_REST_URL",
      "service": "papermark",
      "description": "Upstash-compatible REST endpoint (serverless-redis-http).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "UPSTASH_REDIS_REST_TOKEN",
      "service": "papermark",
      "description": "Token for the REST endpoint.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NEXT_PRIVATE_UPLOAD_BUCKET",
      "service": "papermark",
      "description": "Bucket that stores uploaded documents and rendered pages.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NEXT_PRIVATE_UPLOAD_REGION",
      "service": "papermark",
      "description": "Bucket region.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NEXT_PRIVATE_ARCHIVE_BUCKET",
      "service": "papermark",
      "description": "Bucket for data-room freeze archives (same bucket).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NEXT_PRIVATE_UPLOAD_ENDPOINT",
      "service": "papermark",
      "description": "Bucket S3 endpoint.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "UPSTASH_REDIS_REST_LOCKER_URL",
      "service": "papermark",
      "description": "Upload lock store (same Redis).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_PRISMA_URL_NON_POOLING",
      "service": "papermark",
      "description": "Direct database connection used by migrations.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "UPSTASH_REDIS_REST_LOCKER_TOKEN",
      "service": "papermark",
      "description": "Token for the upload lock store.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NEXT_PRIVATE_VERIFICATION_SECRET",
      "service": "papermark",
      "description": "Signs email verification links.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "NEXT_PRIVATE_SLACK_ENCRYPTION_KEY",
      "service": "papermark",
      "description": "Encrypts Slack tokens if you connect the Slack integration.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID",
      "service": "papermark",
      "description": "Bucket access key.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NEXT_PRIVATE_DOCUMENT_PASSWORD_KEY",
      "service": "papermark",
      "description": "Encrypts link passwords. Do not change after links exist.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "NEXT_PRIVATE_UNSUBSCRIBE_JWT_SECRET",
      "service": "papermark",
      "description": "Signs unsubscribe links in notification emails.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY",
      "service": "papermark",
      "description": "Bucket secret key.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "SRH_MODE",
      "service": "redis-http",
      "description": "Read the single Redis connection from the variables below.",
      "secret": false,
      "strategy": "default",
      "default": "env"
    },
    {
      "key": "SRH_TOKEN",
      "service": "redis-http",
      "description": "Bearer token clients must present.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "SRH_CONNECTION_STRING",
      "service": "redis-http",
      "description": "Redis behind the proxy.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "papermark-no-saas-keys"
      }
    },
    "cli": "railway deploy --template papermark-no-saas-keys",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "d507d26b-e530-4efe-85da-19773f133705",
            "serializedConfig": {
              "buckets": {
                "c70b62fc-f47e-48c5-9359-754f244de929": {
                  "name": "papermark-files"
                }
              },
              "services": {
                "0c22950e-447f-4c9f-9cca-3f6a40273c2c": {
                  "icon": "https://devicons.railway.app/i/redis.svg",
                  "name": "Redis",
                  "deploy": {
                    "startCommand": "/bin/sh -c \"rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH\"",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "redis:8.2.1"
                  },
                  "variables": {
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "description": "Redis password, generated per deploy.",
                      "defaultValue": "{{REDIS_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "8fc2b612-7872-44ff-97a4-d9fd3a809156": {
                      "mountPath": "/data"
                    }
                  }
                },
                "1fcc5471-75f3-4e1b-a50c-ee6bf7ea74bb": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Subdirectory of the volume; initdb refuses the mount root because of lost+found.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Internal hostname of this database.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Port the database listens on.",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Role the application connects as.",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Database the application connects to.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Password for the application role.",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database created on first boot.",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Connection string used by Papermark.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Superuser created on first boot.",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "Lifetime in days of the self-signed TLS certificate.",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Superuser password, generated per deploy.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Seconds to finish in-flight work before shutdown.",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "4ec69b3f-4d70-438e-8509-f0a69494b3cb": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "3c940fe8-32e0-4897-867c-7e346e24d683": {
                  "icon": "https://www.papermark.com/apple-touch-icon.png",
                  "name": "papermark",
                  "deploy": {
                    "healthcheckPath": "/api/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/hmseeb/papermark-railway:bb93cfd-r4"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Next.js listens on and the public domain targets.",
                      "defaultValue": "3000"
                    },
                    "EMAIL_FROM": {
                      "isOptional": true,
                      "description": "Optional. Sender for all email, e.g. Papermark <docs@yourdomain.com> on a domain verified in Resend.",
                      "defaultValue": ""
                    },
                    "ADMIN_EMAIL": {
                      "isOptional": false,
                      "description": "Your email address. You sign in with it and ADMIN_PASSWORD.",
                      "defaultValue": "{{ADMIN_EMAIL}}"
                    },
                    "ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for ADMIN_EMAIL, generated per deploy. Delete it to turn password sign-in off once email sign-in works.",
                      "defaultValue": "{{ADMIN_PASSWORD}}"
                    },
                    "RESEND_API_KEY": {
                      "isOptional": true,
                      "description": "Optional. Resend API key for sign-in links, invites and view notifications.",
                      "defaultValue": ""
                    },
                    "NEXTAUTH_SECRET": {
                      "isOptional": false,
                      "description": "Signs session tokens.",
                      "defaultValue": "{{NEXTAUTH_SECRET}}"
                    },
                    "GOOGLE_CLIENT_ID": {
                      "isOptional": true,
                      "description": "Optional. Google OAuth client id for Sign in with Google.",
                      "defaultValue": ""
                    },
                    "INTERNAL_API_KEY": {
                      "isOptional": false,
                      "description": "Authenticates the app's internal API calls to itself.",
                      "defaultValue": "{{INTERNAL_API_KEY}}"
                    },
                    "REVALIDATE_TOKEN": {
                      "isOptional": false,
                      "description": "Authenticates page revalidation after a document changes.",
                      "defaultValue": "{{REVALIDATE_TOKEN}}"
                    },
                    "POSTGRES_PRISMA_URL": {
                      "isOptional": false,
                      "description": "Database connection (Prisma).",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "GOOGLE_CLIENT_SECRET": {
                      "isOptional": true,
                      "description": "Optional. Google OAuth client secret.",
                      "defaultValue": ""
                    },
                    "UPSTASH_REDIS_REST_URL": {
                      "isOptional": false,
                      "description": "Upstash-compatible REST endpoint (serverless-redis-http).",
                      "defaultValue": "http://${{redis-http.RAILWAY_PRIVATE_DOMAIN}}:80"
                    },
                    "UPSTASH_REDIS_REST_TOKEN": {
                      "isOptional": false,
                      "description": "Token for the REST endpoint.",
                      "defaultValue": "${{redis-http.SRH_TOKEN}}"
                    },
                    "NEXT_PRIVATE_UPLOAD_BUCKET": {
                      "isOptional": false,
                      "description": "Bucket that stores uploaded documents and rendered pages.",
                      "defaultValue": "${{papermark-files.BUCKET}}"
                    },
                    "NEXT_PRIVATE_UPLOAD_REGION": {
                      "isOptional": false,
                      "description": "Bucket region.",
                      "defaultValue": "${{papermark-files.REGION}}"
                    },
                    "NEXT_PRIVATE_ARCHIVE_BUCKET": {
                      "isOptional": false,
                      "description": "Bucket for data-room freeze archives (same bucket).",
                      "defaultValue": "${{papermark-files.BUCKET}}"
                    },
                    "NEXT_PRIVATE_UPLOAD_ENDPOINT": {
                      "isOptional": false,
                      "description": "Bucket S3 endpoint.",
                      "defaultValue": "${{papermark-files.ENDPOINT}}"
                    },
                    "UPSTASH_REDIS_REST_LOCKER_URL": {
                      "isOptional": false,
                      "description": "Upload lock store (same Redis).",
                      "defaultValue": "http://${{redis-http.RAILWAY_PRIVATE_DOMAIN}}:80"
                    },
                    "POSTGRES_PRISMA_URL_NON_POOLING": {
                      "isOptional": false,
                      "description": "Direct database connection used by migrations.",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "UPSTASH_REDIS_REST_LOCKER_TOKEN": {
                      "isOptional": false,
                      "description": "Token for the upload lock store.",
                      "defaultValue": "${{redis-http.SRH_TOKEN}}"
                    },
                    "NEXT_PRIVATE_VERIFICATION_SECRET": {
                      "isOptional": false,
                      "description": "Signs email verification links.",
                      "defaultValue": "{{NEXT_PRIVATE_VERIFICATION_SECRET}}"
                    },
                    "NEXT_PRIVATE_SLACK_ENCRYPTION_KEY": {
                      "isOptional": false,
                      "description": "Encrypts Slack tokens if you connect the Slack integration.",
                      "defaultValue": "{{NEXT_PRIVATE_SLACK_ENCRYPTION_KEY}}"
                    },
                    "NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID": {
                      "isOptional": false,
                      "description": "Bucket access key.",
                      "defaultValue": "${{papermark-files.ACCESS_KEY_ID}}"
                    },
                    "NEXT_PRIVATE_DOCUMENT_PASSWORD_KEY": {
                      "isOptional": false,
                      "description": "Encrypts link passwords. Do not change after links exist.",
                      "defaultValue": "{{NEXT_PRIVATE_DOCUMENT_PASSWORD_KEY}}"
                    },
                    "NEXT_PRIVATE_UNSUBSCRIBE_JWT_SECRET": {
                      "isOptional": false,
                      "description": "Signs unsubscribe links in notification emails.",
                      "defaultValue": "{{NEXT_PRIVATE_UNSUBSCRIBE_JWT_SECRET}}"
                    },
                    "NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY": {
                      "isOptional": false,
                      "description": "Bucket secret key.",
                      "defaultValue": "${{papermark-files.SECRET_ACCESS_KEY}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:3000": {
                        "port": 3000
                      }
                    }
                  }
                },
                "b9120b49-53ea-4ae5-9196-96e0944d0407": {
                  "icon": "https://devicons.railway.app/i/redis.svg",
                  "name": "redis-http",
                  "deploy": {
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "hiett/serverless-redis-http:0.0.10"
                  },
                  "variables": {
                    "SRH_MODE": {
                      "isOptional": false,
                      "description": "Read the single Redis connection from the variables below.",
                      "defaultValue": "env"
                    },
                    "SRH_TOKEN": {
                      "isOptional": false,
                      "description": "Bearer token clients must present.",
                      "defaultValue": "{{SRH_TOKEN}}"
                    },
                    "SRH_CONNECTION_STRING": {
                      "isOptional": false,
                      "description": "Redis behind the proxy.",
                      "defaultValue": "redis://default:${{Redis.REDIS_PASSWORD}}@${{Redis.RAILWAY_PRIVATE_DOMAIN}}:6379"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "papermark",
      "method": "GET",
      "path": "/api/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 4,
    "needs_volume": true
  },
  "generated_at": "2026-10-25T22:14:45.812Z",
  "generator_version": "0.1.0"
}
