Skip to content

Commit

Permalink
Start the installer directory with a simple installation sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
mncaudill committed Jun 18, 2012
1 parent b7c8bbd commit 70c35cc
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ _These instructions are incomplete. They'll probably work but I have tested them

$> cp www/include/config.php.example www/include/config.php

$> cp installer/account_installation_check.php www/

TO DO: updating the config file, see also: https://github.com/straup/flamework-tools/blob/master/bin/make-project.sh

Now, go to http://YOURDOMAINNAME.com/account_installation_check.php and see if all the checks pass. Once all is green, delete this file or move it back out of `www`.

* That's it.

Backing up photos
Expand Down
35 changes: 35 additions & 0 deletions installer/account_installation_check.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

include("include/init.php");

# In theory, this should just be checked right after installation but before users start signing up
# as it is purely an administration issue.
login_ensure_loggedin();

# Per the README, if you are using Flickr PuSH backups (for photo uploads and faves),
# your static directory will need to be writable by the web server.
# Instead of doing tricky-dicky stuff to figure out the user of the web server process
# and various Unix privileges, we'll simply try to write to the directory, if it works,
# thumbs up and congratulations. Not sure what the best way to do this for S3, without poking
# at it (and that case should be a lot more obvious if it doesn't work.


$is_s3 = false;
if ($GLOBALS['enable_feature_storage_s3']) {
$is_s3 = true;
} else {

$path = $GLOBALS['cfg']['flickr_static_path'] . "/test";

$can_write = @mkdir($path, 0755, true);

if ($can_write) {
$cleaned_up = rmdir($path);
}
}

$GLOBALS['smarty']->assign('is_s3', $is_s3);
$GLOBALS['smarty']->assign('can_write', $can_write);
$GLOBALS['smarty']->assign('cleaned_up', $cleaned_up);

$GLOBALS['smarty']->display("page_account_installation_check.txt");
18 changes: 18 additions & 0 deletions www/templates/page_account_installation_check.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{capture assign="page_title"}your parallel-flickr installation check{/capture}
{include file="inc_head.txt"}
{include file="inc_account_head.txt"}

<div style="background-color:yellow;border:1px solid red;padding:10px;">Warning: This page does various sanity checks for your hosting to make sure that parallel-flickr can run properly. Information about your system can and will be leaked if this file is left hanging around. After checking that things work, please move this file back out of the web root or delete it.</div>

<div style="font-weight:bold;text-decoration:underline;margin:10px 0px;">Static File Storage</div>
{if $is_s3}
<p>You have S3 enabled. If you can run any of the backup scripts and see photos being stored, it works!</p>
{else}
{if $can_write}
<p>Your web server <span style="color:green;font-weight:bold;text-decoration:underline;">can</span> write to your static storage directory. This is good as it means you can make use of the push backups features, amongst other things.</p>
{else}
<p>If you want to make use of the PuSH backup scripts, you'll need to make sure that "{$cfg.flickr_static_path|escape}" is writable by your web server. Currently it is not!</p>
{/if}
{/if}

{include file="inc_foot.txt"}

0 comments on commit 70c35cc

Please sign in to comment.