secret
Created — forked from /orion.php

  • Download Gist
orion.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
* Orion Specific constants file
*/
$config = array();
 
/*
* Application title
*
* This value will show up in the title bar for
* your browser and as the title in the navigation bar
*/
$config['APPLICATION_TITLE'] = "Orion";
 
/*
* The base name for the log files
*
* For example, setting this to 'orion', will produce
* log files with the names:
*
* orion-YYYY-MM-DD.log
* orion-errors-YYYY-MM-DD.log
*
*/
$config['LOG_FILE_BASE'] = 'orion';
 
/*
* Default admin user email
*
* NOTE: THIS IS NOT IMPLEMENTED YET
*
* The system will automatically create
* an account for this email the first time
* (if an account doesn't already exist)
* the Orion Analytics System is accessed
* and give this email full priviledges
*/
$config['DEFAULT_ADMIN_EMAIL'] = '';
 
/*
* Metric Formatting Information
*/
 
/*
* Metric prefix
*
* A prefix that is found on
* the beginning of all metric names
*/
$config['METRIC_PREFIX'] = '';
 
/*
* Metric configuration
*
* This is an array of associative
* arrays. Each inner array has up to
* 3 key/value pairs. These are:
* - name
* - display_order
* - allows_wildcard
*
* name is the display name of the segment
* of the metric
*
* display_order is the 0-based index
* in which it should be ordered when
* displayed on the create_dashboard
* page - defaults to the index of the
* segment array is in the config array
*
* allows_wildcard is a boolean value
* that determines whether or not this
* segment can be a substituted with a
* wildcard - defaults to false
*
* The order of the inner arrays denotes
* the order in which that segment appears
* in the metric name (after the metric
* prefix)
*/
$config['METRIC_CONFIG'] = array(
array(
"name" => "type",
"display_order" => 0,
"allows_wildcard" => false
),
array(
"name" => "env",
"display_order" => 1,
"allows_wildcard" => true
),
array(
"name" => "location",
"display_order" => 2,
"allows_wildcard" => true
),
array(
"name" => "cell",
"display_order" => 3,
"allows_wildcard" => true
),
array(
"name" => "server",
"display_order" => 4,
"allows_wildcard" => true
)
);
 
/*
* Unwanted metric segments
*
* This will determine in which order you
* want the names above (and metric segments
* they represent) to show up in the UI
* and be used for filtering with metric names
*
* These values are 0 indexed integers
* that represent the names listed above
*/
$config['UNWANTED_METRIC_STRINGS'] = array('carbon');
/*
* Google OAuth Information
*
* You need to add the following URL to your
* list of redirect URIs on your google APIs
* console as accepted URIs
*
* BASE_URL/index.php/authenticate/googleoauth2callback
*/
 
/*
* Application Name
*
* What you want displayed as your
* application name when people log
* in using google oauth
*/
$config['GOOGLE_OAUTH_APPLICATION_NAME'] = 'Orion Analytics';
 
/*
* OAuth Client ID
*
* This is provided by google and is
* your OAuth client identification key
*/
$config['GOOGLE_OAUTH_CLIENT_ID'] = '';
 
/*
* OAuth Client Secret
*
* This is provided by google and is
* your OAuth client secret key
*/
$config['GOOGLE_OAUTH_CLIENT_SECRET'] = '';
 
/*
* OAuth 1 Site Name
*
* A URL that should be shown in Google's
* OAuth 1 authentication screen
*/
$config['GOOGLE_OAUTH_1_SITE_NAME'] = '';
 
/*
* Authentication Method
*
* This can be one of the following
* authentication methods:
*
* NOAUTH - No authentication is used
* GOOGOAUTH2 - Uses Google OAuth2.0
* authentication
*
*/
$config['AUTHENTICATION_METHOD'] = 'NOAUTH';
 
/*
* Accepted Domain Names
*
* Domain names for which user authentication
* is allowed. If empty, all domain names are
* accepted.
*/
$config['ACCEPTED_DOMAIN_NAMES'] = array();
 
/*
* The ENVIRONMENT variable is set in index.php
*
* This sets the constants based on which
* ENVIRONMENT is in use
*/
if ( ENVIRONMENT == 'production'){
 
/*
* Database information
*/
 
/*
* The database access information
*
* If the database is on the same server as
* the code base for Orion Analytics system,
* then DB_HOSTNAME should be 'localhost'
*
* If you choose to change the value for
* DB_DATABASE, you must also edit the values
* for this in:
* scripts/create_new_dump.sh
* scripts/create_orion_db.sh
*/
$config['DB_HOSTNAME'] = 'localhost';
$config['DB_USERNAME'] = 'root';
$config['DB_PASSWORD'] = '';
$config['DB_DATABASE'] = 'orion';
 
/*
* The directory to log server calls to
*/
$config['LOG_DIRECTORY'] = '/tmp';
 
/*
* The base URL to access the Graphite Server
*
* Accessing this url should load the base
* Graphite Browser that comes with your
* Graphite installation
*/
$config['GRAPHITE_API_URL'] = '';
 
/*
* Any HTTP authentication required when accessing the Graphite server
*
* If your Graphite Installation is behind
* any HTTP authentication, you can use this
* to set the username and password. The format
* for the 'header' key in this array is:
*
* 'Authorization: Basic " . base64_encode("username:password")
*/
$config['GRAPHITE_CONTEXT'] = stream_context_create(
array (
'http' => array( 'header' => "Authorization: Basic " . base64_encode("username:password") )
)
);
} else if ( ENVIRONMENT == 'development' ){
 
/*
* Database information
*/
 
/*
* The database access information
*
* If the database is on the same server as
* the code base for Orion Analytics system,
* then DB_HOSTNAME should be 'localhost'
*
* If you choose to change the value for
* DB_DATABASE, you must also edit the values
* for this in:
* scripts/create_new_dump.sh
* scripts/create_orion_db.sh
*/
$config['DB_HOSTNAME'] = 'localhost';
$config['DB_USERNAME'] = 'orion';
$config['DB_PASSWORD'] = 'orion';
$config['DB_DATABASE'] = 'orion';
 
/*
* The directory to log server calls to
*/
$config['LOG_DIRECTORY'] = '/tmp';
 
/*
* The base URL to access the Graphite Server
*
* Accessing this url should load the base
* Graphite Browser that comes with your
* Graphite installation
*/
$config['GRAPHITE_API_URL'] = 'http://graphite.vpn/';
 
/*
* Any HTTP authentication required when accessing the Graphite server
*
* If your Graphite Installation is behind
* any HTTP authentication, you can use this
* to set the username and password. The format
* for the 'header' key in this array is:
*
* 'Authorization: Basic " . base64_encode("username:password")
*/
$config['GRAPHITE_CONTEXT'] = stream_context_create(
array (
'http' => array( 'header' => "Authorization: Basic " . base64_encode("username:password") )
)
);
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.