Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 458 lines (331 sloc) 15.394 kb
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 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457
<?

$GLOBALS['cfg'] = array();

# Things you may want to change in a hurry

$GLOBALS['cfg']['site_name'] = '🐼 | parallel-flickr';
$GLOBALS['cfg']['environment'] = 'prod';

$GLOBALS['cfg']['site_disabled'] = 0;
$GLOBALS['cfg']['site_disabled_retry_after'] = 0; # seconds; if set will return HTTP Retry-After header

#
# Things you need to tweak before you get started
#

# Database configs
# See also: https://github.com/straup/parallel-flickr/blob/master/bin/generate_secret.php

$GLOBALS['cfg']['db_main'] = array(
'host' => 'localhost',
'name' => 'flickr',
'user' => 'flickr',
'pass' => 'TWEAK ME',
'auto_connect' => 1,
);

# Flickr configs
# http://www.flickr.com/services/apps/create/apply/

# Seriously Flickr, fuck you...
# http://code.flickr.net/2012/01/13/farewell-flickrauth/

$GLOBALS['cfg']['flickr_api_use_oauth_bridge'] = 0;
$GLOBALS['cfg']['flickr_oauth_key'] = '';
$GLOBALS['cfg']['flickr_oauth_secret'] = '';

$GLOBALS['cfg']['flickr_api_key'] = 'TWEAK ME';
$GLOBALS['cfg']['flickr_api_secret'] = 'TWEAK ME';

# See also: YOUR-PARALLEL-FLICKR/account/flickr/auth

$GLOBALS['cfg']['flickr_api_perms'] = 'read';
$GLOBALS['cfg']['enable_feature_flickr_api_change_perms'] = 0;

# Use Flickr as a ticketing server!
# See also: parallel-flickr:bin/dbtickets_flickr_token_dance.php

$GLOBALS['cfg']['enable_feature_dbtickets_flickr'] = 0;
        $GLOBALS['cfg']['dbtickets_flickr_user_id'] = 0;

# Basic cookie/crypto configs
# See also: https://github.com/straup/parallel-flickr/blob/master/bin/generate_secret.php

$GLOBALS['cfg']['crypto_cookie_secret'] = 'TWEAK ME';
$GLOBALS['cfg']['crypto_password_secret'] = 'TWEAK ME';
$GLOBALS['cfg']['crypto_crumb_secret'] = 'TWEAK ME';

#
# Things you may want to tweak (backups, registrations, invite codes)
#

# Flags to indicate whether Flickr should be polled for new photos to backup;
# whether users can register themselves as backup users; whether registerting
# also requires a valid invite code. Note that in order to use any of the
# god pages you will also need to enable and configure the poorman's god auth
# settings below.

# Backups - by default anyone who knows where your copy of
# parallel-flickr is (on the Internet) could register to have
# their photos (and likes) backed up. If you don't want to
# let anyone else backup their photos then you should disable
# the 'backups_enable_registration' flag. If you want
# to limit who can register take a look at the invite code
# flags below.

$GLOBALS['cfg']['enable_feature_backups'] = 1;
$GLOBALS['cfg']['enable_feature_backups_registration'] = 1;
$GLOBALS['cfg']['enable_feature_backups_registration_uninvited'] = 0;

# API URLs and endpoints

$GLOBALS['cfg']['api_abs_root_url'] = ''; # leave blank - set in api_config_init()
$GLOBALS['cfg']['site_abs_root_url'] = ''; # leave blank - set in api_config_init()

$GLOBALS['cfg']['api_subdomain'] = '';
$GLOBALS['cfg']['api_endpoint'] = 'api/rest/';

$GLOBALS['cfg']['api_require_ssl'] = 1;

# API site keys

$GLOBALS['cfg']['enable_feature_api_site_keys'] = 1;
$GLOBALS['cfg']['enable_feature_api_site_tokens'] = 1;

$GLOBALS['cfg']['api_site_keys_ttl'] = 28800; # 8 hours
$GLOBALS['cfg']['api_site_tokens_ttl'] = 28000; # 8 hours
$GLOBALS['cfg']['api_site_tokens_user_ttl'] = 3600; # 1 hour

# API pagination

$GLOBALS['cfg']['api_per_page_default'] = 100;
$GLOBALS['cfg']['api_per_page_max'] = 500;

# The actual API config

$GLOBALS['cfg']['api'] = array(

'formats' => array( 'json' ),
'default_format' => 'json',

# We're defining methods using the method_definitions
# hooks defined below to minimize the clutter in the
# main config file, aka this one (20130308/straup)
'methods' => array(),

# We are NOT doing the same for blessed API keys since
# it's expected that their number will be small and
# manageable (20130308/straup)

'blessings' => array(
'xxx-apikey' => array(
'hosts' => array('127.0.0.1'),
# 'tokens' => array(),
# 'environments' => array(),
'methods' => array(
'foo.bar.baz' => array(
'environments' => array('sd-931')
)
),
'method_classes' => array(
'foo.bar' => array(
# see above
)
),
),
),
);

# Load api methods defined in separate PHP files whose naming
# convention is FLAMEWORK_INCLUDE_DIR . "/config_api_{$definition}.php";
#
# IMPORTANT: This is syntactic sugar and helper code to keep the growing
# number of API methods out of the main config. Stuff is loaded in to
# memory in lib_api_config:api_config_init (20130308/straup)

$GLOBALS['cfg']['api_method_definitions'] = array(
'methods',
'methods_flickr',
'methods_parallel_flickr',
);

# Uploads
# Allow parallel flickr to upload photos which may or may not be
# routed on to Flickr.

# Valid options for _default_send_to are: flickr; parallel-flickr
# Valid options for _default_notifications are: flickr

$GLOBALS['cfg']['enable_feature_uploads'] = 0;

$GLOBALS['cfg']['uploads_default_send_to'] = '';
$GLOBALS['cfg']['uploads_default_notifications'] = '';
$GLOBALS['cfg']['uploads_default_tags'] = 'uploaded:by=parallel-flickr';

# Uploads - notifications

# Tell Flickr (with a tiny stylized preview image) when you've uploaded
# a photo to parallel-flickr. TO DO: twitter (20130706/straup)

$GLOBALS['cfg']['enable_feature_uploads_flickr_notifications'] = 0;

# Uploads - send to Flickr

# Allow photos to be sent to Flickr and optionally pre-archive them
# in parallel-flickr as they are uploaded - you will need to configure
# your storage provider accordingly (in order to be able to write photos
# to disk)

$GLOBALS['cfg']['enable_feature_uploads_flickr'] = 0;
$GLOBALS['cfg']['enable_feature_uploads_flickr_archive'] = 0;

# Uploads - send to Parallel-Flickr

# You will absolutely need to configure your storage provider to allow you
# to write files to disk. You will also need to ensure that you users have
# a Flickr auth token with 'delete' permissions in order to do the
# dbtickets_flickr trick – careful readers will also note that this means
# ensuring that the _dbtickets_flickr feature flag be enabled.

# TO DO: user interface glue and prompts for ensuring that a user has a valid
# 'delete' auth token from Flickr

$GLOBALS['cfg']['enable_feature_uploads_parallel_flickr'] = 0;

# Uploads (by API (which also means the website))
# See also: http://parallel-flickr/photos/upload/

$GLOBALS['cfg']['enable_feature_uploads_by_api'] = 0;

# Uploads (OAuth Echo Upload)
# Think: custom image backend for Twitter clients like tweetbot.
# This URL is handy to get the twitter user_id: http://www.idfromuser.com/
# Also, some day this should be a user settings page. Some day.

$GLOBALS['cfg']['enable_feature_oauth_upload'] = 0;

$GLOBALS['cfg']['oauth_upload_user_mapping'] = array(
// twitter user_id => p-flickr user_id
);

# Uploads (by email)

# Note: setting up and configuring a mail server is left to
# the individual. The bin/upload_by_email.php script expects
# to be handd a MIME compatible email message on STDIN; see
# also sample postfix config files in the postfix directory

# 1048576 is 1MB; web based upload sizes are controled by the
# 'upload_max_filesize' directive in www/.htaccess

$GLOBALS['cfg']['enable_feature_uploads_by_email'] = 0;
$GLOBALS['cfg']['uploads_by_email_hostname'] = '';
$GLOBALS['cfg']['uploads_by_email_maxbytes'] = 1048576 * 5;

# Uploads filt(e)ring

$GLOBALS['cfg']['enable_feature_uploads_filtr'] = 0;

$GLOBALS['cfg']['filtr_valid_filtrs'] = array(
'dazd',
'postr',
'postcrd',
'pxl',
'rockstr'
);

# Invite codes – these are used to limit who can register
# to have their photos backed up. You'll need to do a
# few things to enable this:

# 1) enable the feature flags below for invite codes and
# god auth (which is explained later)

# 2) generate a new secret for encrypting invite cookies
# parallel-flickr/bin/generate_secret.php

# 3) set up poorman's 'god auth' – basically this is just
# restricting access to a list of logged in user using
# cookies; it works but I wouldn't call it "secure"

# Once that's done you can manage or create new invites
# here:

# $GLOBALS['cfg']['abs_root_url']/god/invites/
# $GLOBALS['cfg']['abs_root_url']/god/invites/generate/

# In addition, if a user tries to go to the backup page
# they've got stopped by an invite code wall which will
# allow them to request an invite code but you'll still
# need to send it manually (by pressing a button on the
# god page).

$GLOBALS['cfg']['enable_feature_invite_codes'] = 1;
$GLOBALS['cfg']['crypto_invite_secret'] = '';

#
# Things you may want to tweak (poorman's god auth)
#

$GLOBALS['cfg']['auth_enable_poormans_god_auth'] = 0;

$GLOBALS['cfg']['auth_poormans_god_auth'] = array(

# poormans god auth is keyed off a user's UID
#
# xxx => array(
# 'roles' => array( 'admin' ),
# ),
);

#
# Things you may want to tweak (storage)
#

# By default, parallel-flickr stores files on the local file system. It is possible
# to store your photos (and metadata) using Amazon's S3 service but you'll need to
# enable/configure it below.

# Storage providers. Valid options are:
# 'fs' which will store stuff to the local filesystem
# 's3' which will store stuff to S3
# 'storagemaster' which will store stuff to the local filesystem - see details below

$GLOBALS['cfg']['storage_provider'] = 'fs';

# The 'flickr_static_url/path' flags needs to match the Alias directive
# in your Apache config. Not that the 'flickr_static_url' config is a
# relative path; relative to the root URL which is assigned separately.
# See also: https://github.com/straup/parallel-flickr/blob/master/apache/parallel-flickr.conf.example

$GLOBALS['cfg']['flickr_static_path'] = "TWEAK ME";
$GLOBALS['cfg']['flickr_static_url'] = "static/";

# If you want to store your photos (and metadata) using Amazon's S3
# service you'll need to enable this feature flag and fill in the
# 'amazon_s3_*' flags below.

$GLOBALS['cfg']['amazon_s3_access_key'] = 'TWEAK ME';
$GLOBALS['cfg']['amazon_s3_secret_key'] = 'TWEAK ME';
$GLOBALS['cfg']['amazon_s3_bucket_name'] = 'TWEAK ME';

# Storagemaster. See also:
# parallel-flickr/storagemaster/bin/storagemaster.py
# parallel-flickr/storagemaster/init.d/storagemaster.sh

$GLOBALS['cfg']['storage_storagemaster_host'] = '127.0.0.1';
$GLOBALS['cfg']['storage_storagemaster_port'] = '9999';


#
# Things you may want to tweak (maps)
#

$GLOBALS['cfg']['enable_feature_slippymaps'] = 1;
$GLOBALS['cfg']['slippymap_provider'] = 'toner'; # assumes canned htmapl provider strings
# see also: http://htmapl.com/examples/providers.html

#
# Things you may want to tweak (Flickr PuSH feeds)
#

$GLOBALS['cfg']['enable_feature_flickr_push'] = 1;
$GLOBALS['cfg']['flickr_push_enable_registrations'] = 1;
$GLOBALS['cfg']['flickr_push_enable_photos_friends'] = 1;

# this one doesn't seem to work anymore - sad face (20130625/straup)
# $GLOBALS['cfg']['flickr_push_enable_photos_friends_faves'] = 0;

$GLOBALS['cfg']['flickr_push_enable_photos_recent_activity'] = 0;
$GLOBALS['cfg']['flickr_push_notification_email'] = '';
$GLOBALS['cfg']['flickr_push_ignore_key'] = '';

# This is off by default because it requires that you ensure that
# the directory specified in $GLOBALS['cfg']['flickr_static_path']
# is both:
#
# Writeable by the web server and that whichever users who may run
# the bin/backup_*.php scripts are in a shared (unix) group with
# the web server user account.
#
# If you are already storing your photos using Amazon's S3 service
# (see above) then you don't need to worry about these unix-specific
# permissions issues.

$GLOBALS['cfg']['enable_feature_flickr_push_backups'] = 0;

#
# Things you may want to tweak (Solr)
#

# Solr is used for search and fancy features like places and cameras
# https://github.com/straup/parallel-flickr/tree/master/solr/
# https://lucene.apache.org/solr/#intro

$GLOBALS['cfg']['enable_feature_solr'] = 0;
$GLOBALS['cfg']['solr_endpoint'] = 'http://localhost:9999/solr/parallel-flickr/';

# Hey look! Things that require Solr.

$GLOBALS['cfg']['enable_feature_places'] = 0;
$GLOBALS['cfg']['enable_feature_cameras'] = 0;
$GLOBALS['cfg']['enable_feature_archives'] = 0;

$GLOBALS['cfg']['places_prefetch_data'] = 1;

#
# Things you may want to tweak (misc. and silly stuff)
#

$GLOBALS['cfg']['enable_feature_sharkify'] = 1; # http://www.iamcal.com/sharkify/

$GLOBALS['cfg']['enable_keyboard_browse'] = 1;

$GLOBALS['cfg']['enable_feature_path_alias_redirects'] = 0;

#
# Things you probably don't need to worry about
#

$GLOBALS['cfg']['enable_feature_signup'] = 1;
$GLOBALS['cfg']['enable_feature_signin'] = 1;
$GLOBALS['cfg']['enable_feature_account_delete'] = 0;
$GLOBALS['cfg']['enable_feature_password_retrieval'] = 0;

# See this? It assumes everything is running on a single
# (read: not federated) database.

$GLOBALS['cfg']['db_enable_poormans_federation'] = 1;
$GLOBALS['cfg']['db_enable_poormans_ticketing'] = 1;

$GLOBALS['cfg']['smarty_template_dir'] = realpath(dirname(__FILE__) . '/../templates/');
$GLOBALS['cfg']['smarty_compile_dir'] = realpath(dirname(__FILE__) . '/../templates_c/');

$GLOBALS['cfg']['auth_cookie_domain'] = parse_url($GLOBALS['cfg']['abs_root_url'], 1);
$GLOBALS['cfg']['auth_cookie_name'] = 'a';

$GLOBALS['cfg']['auth_cookie_secure'] = 0; # see also: http://github.com/blog/737-sidejack-prevention
$GLOBALS['cfg']['auth_cookie_httponly'] = 0;

$GLOBALS['cfg']['crumb_ttl_default'] = 300; # seconds

$GLOBALS['cfg']['rewrite_static_urls'] = array(
# '/foo' => '/bar/',
);

$GLOBALS['cfg']['email_from_name'] = 'flamework app';
$GLOBALS['cfg']['email_from_email'] = 'admin@ourapp.com';
$GLOBALS['cfg']['auto_email_args'] = '-fadmin@ourapp.com';

$GLOBALS['cfg']['user'] = null;

# This is only relevant if are running parallel-flickr on a machine where you
# can not make the www/templates_c folder writeable by the web server. If that's
# the case set this to 0 but understand that you'll need to pre-compile all
# of your templates before they can be used by the site.
# See also: https://github.com/straup/parallel-flickr/blob/master/bin/compile-templates.php

$GLOBALS['cfg']['smarty_compile'] = 1;

# Do not always compile all the things all the time. Unless you know you're in to
# that kind of thing. One important thing to note about this setting is that you
# will need to reenabled it at least once (and load the template in question) if
# you've got a template that calls a non-standard function. For example, something
# like: {$foo|@bar_all_the_things}

$GLOBALS['cfg']['smarty_force_compile'] = 0;

$GLOBALS['cfg']['http_timeout'] = 3;

$GLOBALS['cfg']['check_notices'] = 1;

$GLOBALS['cfg']['db_profiling'] = 0;

$GLOBALS['cfg']['pagination_assign_smarty_variable'] = 1;
$GLOBALS['cfg']['pagination_per_page'] = 10;
$GLOBALS['cfg']['pagination_spill'] = 2;
$GLOBALS['cfg']['pagination_style'] = 'pretty';

#
# enable this flag to show a full call chain (instead of just the
# immediate caller) in database query log messages and embedded in
# the actual SQL sent to the server.
#

$GLOBALS['cfg']['db_full_callstack'] = 0;
?>
Something went wrong with that request. Please try again.