Current Configuration

code_status

  

services_status

  

nodes_status

  

logging_status

  

cloudi_service_health_check

  

cloudi.conf file

https://cloudi.org (and https://ndforge.com) Configuration

%-*-Mode:erlang;coding:utf-8;tab-width:4;c-basic-offset:4;indent-tabs-mode:()-*-
% ex: set ft=erlang fenc=utf-8 sts=4 ts=4 sw=4 et nomod:
{acl, [
    {api,
     ["/cloudi/api/*"]},
    {api_read_only,
     ["/cloudi/api/rpc/services_status.json/post",
      "/cloudi/api/rpc/nodes_status.json/post",
      "/cloudi/api/rpc/logging_status.json/get",
      "/cloudi/api/rpc/code_status.json/get",
      "/health_check/cloudi/hosts.json/get",
      "/health_check/cloudi/hosts.erl"]},
    {files,
     ["/ndforge.com/*",
      "/cloudi.org/*",
      "/loadbalancer_health_check/*"]}
]}.
{services, [

    % CloudI Service API interface

    {internal,
     "/cloudi/api/",
     cloudi_service_api_requests,
     [],
     none,
     {5, seconds}, {5, seconds}, {5, seconds},
     undefined, undefined, 1, 5, {5, minutes},
     [{response_timeout_immediate_max, limit_min}]},

    % ndforge.com files

    {internal,
     "/ndforge.com/",
     cloudi_service_filesystem,
     [{directory, "${HOME}/www/ndforge.com/"},
      {replace, lfuda_gdsf},  % LFUDA GreedyDual-Size with Frequency (GDSF)
      {files_size, 16384},    % KiB per process
      {refresh, 900},         % 15 minutes
      {cache, refresh}],      % 7.5 minutes
     none,
     {1, minute}, {5, seconds}, {5, seconds},
     undefined, undefined, 4, 5, {5, minutes},
     [{info_pid_uses, 1}]},

    % cloudi.org files

    {internal,
     "/cloudi.org/",
     cloudi_service_filesystem,
     [{directory, "${HOME}/www/cloudi.org/"},
      {replace, lfuda_gdsf},  % LFUDA GreedyDual-Size with Frequency (GDSF)
      {files_size, 16384},    % KiB per process
      {refresh, 900},         % 15 minutes
      {cache, refresh}],      % 7.5 minutes
     none,
     {20, minutes}, {5, seconds}, {5, seconds},
     undefined, undefined, 4, 5, {5, minutes},
     [{info_pid_uses, 1}]},

    % ec2 load-balancer health check

    {internal,
     "/loadbalancer_health_check/",
     cloudi_service_filesystem,
     [{directory, "${HOME}/www/private/"}],
     none,
     {5, seconds}, {5, seconds}, {5, seconds},
     undefined, undefined, 1, 5, {5, minutes},
     [{info_pid_uses, 1}]},

    % CloudI health check requests

    {internal,
     "/health_check/cloudi/",
     cloudi_service_health_check,
     [{hosts,
       [{"$CLOUDI_HOST1",
         [{port, 8000}]},
        {"$CLOUDI_HOST2",
         [{port, 8000}]},
        {"$CLOUDI_HOST3",
         [{port, 8000}]},
        {"$CLOUDI_HOST4",
         [{port, 8000}]},
        {"$LOAD_BALANCER1",
         [{port, 80}]},
        {"$LOAD_BALANCER2",
         [{port, 80}]},
        {"sourceforge.net",
         [{ipv6, false},
          {port, 443},
          {interval, 30},
          {tcp_test,
           {{cloudi_service_health_check, tcp_test_https,
             [get, "/projects/cloudi/files/2.0.7/cloudi-2.0.7.tar.gz/download",
              302]}}}
          ]},
        {"archive.org",
         [{ipv6, false},
          {port, 443},
          {interval, 30},
          {tcp_test,
           {{cloudi_service_health_check, tcp_test_https,
             [get, "/download/cloudi-2.0.7/cloudi-2.0.7.tar.gz",
              302]}}}
          ]},
        {"github.com",
         [{ipv6, false},
          {port, 443}]}
        ]}],
     lazy_local,
     {5, seconds}, {5, seconds}, {5, seconds},
     undefined, undefined, 9, 5, {5, minutes},
     [{info_pid_uses, 1},
      {hibernate, true},
      {restart_all, true}]},

    % HTTP traffic

    {internal,
     "*",
     cloudi_service_null,
     [],
     none,
     {5, seconds}, {5, seconds}, {5, seconds},
     undefined, undefined, 1, 5, {5, minutes},
     [{response_timeout_immediate_max, limit_min}]},
    {internal,
     "?/",
     cloudi_service_router,
     [{add_prefix, false},
      {parameters_strict_matching_default, false},
      {http_redirect_health, "/health_check/cloudi/"},
      {http_redirect_health_refresh, 60}, % 30 seconds * 2
      {destinations,
       [{"www.ndforge.com/*",
         [{parameters_selected, [2]},
          {service_names,
           ["/ndforge.com/*"]}]},
        {"ndforge.com/*",
         [{parameters_selected, [2]},
          {service_names,
           ["/ndforge.com/*"]}]},
        {"www.cloudi.org/*",
         [{parameters_selected, [2]},
          {service_names,
           ["/cloudi.org/*"]}]},
        {"cloudi.org/download/get",
         [{http_redirect, "https://sourceforge.net/projects/cloudi/files/2.0.7/cloudi-2.0.7.tar.gz/download"},
          {http_redirect_secondaries,
           ["https://archive.org/download/cloudi-2.0.7/cloudi-2.0.7.tar.gz"]}]},
        {"cloudi.org/download/cloudi-2.0.7.tar.?/get",
         [{parameters_selected, [2]},
          {http_redirect, "https://sourceforge.net/projects/cloudi/files/2.0.7/cloudi-2.0.7.tar.*/download"},
          {http_redirect_secondaries,
           ["https://archive.org/download/cloudi-2.0.7/cloudi-2.0.7.tar.*"]}]},
        {"cloudi.org/download/cloudi-*.tar.?/get",
         [{parameters_selected, [2, 2, 3]},
          {http_redirect, "https://sourceforge.net/projects/cloudi/files/*/cloudi-*.tar.*/download"}]},
        {"cloudi.org/download/live_cd/?/?/get",
         [{parameters_selected, [2, 3]},
          {http_redirect, "https://sourceforge.net/projects/cloudi/files/live_cd/*/*/download"}]},
        {"cloudi.org/download/cloudi_tutorial_java/?/?/get",
         [{parameters_selected, [2, 3]},
          {http_redirect, "https://sourceforge.net/projects/cloudi/files/cloudi_tutorial_java/*/*/download"}]},
        {"cloudi.org/services_status.json/post",
         [{service_names,
           ["/cloudi/api/rpc/services_status.json/post"]}]},
        {"cloudi.org/nodes_status.json/post",
         [{service_names,
           ["/cloudi/api/rpc/nodes_status.json/post"]}]},
        {"cloudi.org/logging_status.json/get",
         [{service_names,
           ["/cloudi/api/rpc/logging_status.json/get"]}]},
        {"cloudi.org/code_status.json/get",
         [{service_names,
           ["/cloudi/api/rpc/code_status.json/get"]}]},
        {"cloudi.org/health_check/hosts.json/get",
         [{service_names,
           ["/health_check/cloudi/hosts.json/get"]}]},
        {"cloudi.org/*",
         [{parameters_selected, [2]},
          {service_names,
           ["/cloudi.org/*"]}]},
        {"?/loadbalancer_health_check/index.html/get",
         [{parameters_strict_matching, false},
          {service_names,
           ["/loadbalancer_health_check/index.html/get"]}]}
        ]}],
     lazy_closest,
     {5, seconds}, {5, seconds}, {5, seconds},
     undefined, [files, api_read_only], 8, 5, {5, minutes},
     [{duo_mode, true},
      {dest_refresh_start, {3, seconds}}]},
    {internal,
     "/",
     cloudi_service_http_cowboy,
     [{use_client_ip_prefix, true},
      {use_host_prefix, true},
      {content_security_policy,
       "default-src 'self'; "
       "script-src 'unsafe-inline' 'self'; "
       "style-src 'unsafe-inline' 'self'; "
       "object-src 'none'; "
       "worker-src 'none'"},
      {set_x_content_type_options, true},
      {set_x_xss_protection, true},
      {ip, {0, 0, 0, 0}}, {port, 8000}, {output, binary}],
     lazy_closest,
     {5, seconds}, {5, seconds}, {5, seconds},
     [api], undefined, 2, 5, {5, minutes},
     [{info_pid_uses, 1}]}

]}.
{nodes, [
    {discovery,
     [{ec2,
       [{access_key_id, "${AWS_ACCESS_KEY_ID}"},
        {secret_access_key, "${AWS_SECRET_ACCESS_KEY}"},
        {host, "ec2.${AWS_DEFAULT_REGION}.amazonaws.com"},
        {groups, ["ipv6-www"]}]}]}
]}.
{logging, [
    {level, debug}, % levels: off, fatal, error, warn, info, debug, trace
    {log_time_offset, info},
    % For slower logging disk writes
    {file_sync, {5, seconds}}
]}.