Sha256: 75bbe07adfd5b921ff5c895038aded8214ecca07194ff1007dd817de801cb179

Contents?: true

Size: 1.74 KB

Versions: 1

Compression:

Stored size: 1.74 KB

Contents

module App42

    # app42 server version
    VERSION = 1.0.to_s

    # app42 host url
    HOST = "https://paashq.shephertz.com/paas/#{VERSION}"
    
    # app42 configuration directory
    CONFIG_DIR = "~/.app42".freeze

    # TODO, need to configure for client log
    LOGS_DIR = "#{CONFIG_DIR}/logs".freeze
    KEYS_FILE = "#{CONFIG_DIR}/app42paas.yml".freeze
    
    JSON_MIME_TYPE = "application/json".freeze
    XML_MIME_TYPE = "application/xml".freeze

    # Error codes
    APP42_HTTP_ERROR_CODES = [ 1500 ]

    # Scale type
    SCALE_TYPE = ['Horizontal', 'Vertical']

    # Subscription type
    SUBSCRIPTION_TYPE = ['FREE', 'PAID']

    # flavour type
    FLAVOUR_TYPE = ['light', 'medium', 'heavy']

    # app operation type
    APP_STOP = { "hardStop" => "Hard Stop", "softStop" => "Soft Stop"}
    APP_START = { "hardStart" => "Hard Start", "softStart" => "Soft Start"}
    APP_RESTART = { "hardRestart" => "Hard Restart", "softRestart" => "Soft Restart"}

    DATABASE_NAME_NOT_ALLOWED = %w(mysql couchdb mongodb postgresql database sql)

    # regex for special character
    SPECIAL   = "?<>',?[]}{=-)(*&^%$#`~{}@ .+!_/"
    REGEX     = /[#{SPECIAL.gsub(/./){|char| "\\#{char}"}}]/
    URL_REGEX = /(((^https?)|(^ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/

    # regex for special character (Database Name)
    DBNAME_SPECIAL = "?<>',?[]}{=-)(*&^%$#`~{}@ .+!/"
    DBNAME_REGEX = /[#{DBNAME_SPECIAL.gsub(/./){|char| "\\#{char}"}}]/

    # regex for IP Address
    IP_REGEX = /^([0]?\d\d?|1[0-1,3-9]\d|12[0-6,8-9]|2[0-4]d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.((?!0)|(?!1)|010|(01[0-9]{1,1}&0[1-9]{1,2})|0[0-9]{1,1}[1-9]{1,1}|[2-9]{0,2}|1[0-9]{1,2}|2[0-4]\d|25[0-4])$/
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
app42-0.7.0 lib/app42/base/constants.rb