📗
Janus Manual
  • Introduction
  • Installation
    • Docker
  • Quick Start
    • Authenticating
    • Add an endpoint
    • Modify (Update/Delete) an endpoint
    • Add Plugins
    • Authentication
    • Adding your API - File System
  • Clustering/HA
  • Proxy Reference
    • Terminology
    • Overview
    • Routing capabilities
    • Load Balacing
    • Request Host header
      • Using wildcard hostnames
      • The preserve_host property
    • Request URI
      • The strip_path property
      • The append_path property
    • Request HTTP method
    • Routing priorities
    • Conclusion
  • Plugins
    • Basic
    • Organization
    • Body Limit
    • Circuit Breaker
    • Compression
    • CORS
    • OAuth
    • Rate Limit
    • Request Transformer
    • Response Transformer
    • Retry
  • Auth
    • OAuth 2.0
  • Misc
    • Health Checks
    • Monitoring
    • Tracing
  • Known Issues
    • Stale HTTP Keep-Alive
  • Upgrade Notes
    • 2.x to 3.x
    • 3.6.x to 3.7.x
Powered by GitBook
On this page

Was this helpful?

  1. Upgrade Notes

2.x to 3.x

If you're using MongoDB as configuration database run the following script against api_specs collection:

db.getCollection('api_specs').find({}).forEach(function(doc) {
    doc.plugins = [];

    var corsMeta = doc.cors_meta || {enabled: false};
    doc.plugins.push({
        "name": "cors",
        "enabled": !!corsMeta.enabled,
        "config": corsMeta
    });
    delete doc.plugins[0].config.enabled;

    var rateLimit = doc.rate_limit || {enabled: false, limit: 0};
    doc.plugins.push({
        "name": "rate_limit",
        "enabled": !!rateLimit.enabled,
        "config": {
            "limit": rateLimit.limit,
            "policy": "local"
        }
    });

    doc.plugins.push({
        "name": "oauth2",
        "enabled": !!doc.use_oauth2,
        "config": {"server_name": doc.oauth_server_name || null}
    });

    doc.plugins.push({
        "name": "compression",
        "enabled": !!doc.use_compression
    });

    delete doc.rate_limit;
    delete doc.cors_meta;
    delete doc.use_oauth2;
    delete doc.use_basic_auth;
    delete doc.use_compression;

    doc.updated_at = new Date();
    db.api_specs.update({"_id": doc._id}, doc);
});
PreviousUpgrade NotesNext3.6.x to 3.7.x

Last updated 4 years ago

Was this helpful?