-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
thisisaaroland
committed
Jul 7, 2016
0 parents
commit 53547d9
Showing
273 changed files
with
33,267 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
*~ | ||
.vagrant | ||
www/include/config_dev.php | ||
www/include/secrets_dev.php | ||
www/include/secrets*.php | ||
tests/coverage.state | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Options -Indexes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
templates: | ||
php -q ./bin/compile-templates.php | ||
|
||
secret: | ||
php -q ./bin/generate_secret.php | ||
|
||
setup: | ||
ubuntu/setup-ubuntu.sh | ||
ubuntu/setup-flamework.sh | ||
ubuntu/setup-certified.sh | ||
sudo ubuntu/setup-certified-ca.sh | ||
sudo ubuntu/setup-certified-certs.sh | ||
bin/configure_secrets.sh . | ||
ubuntu/setup-db.sh wof_api wof_api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# whosonfirst-www-api | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Order Allow,Deny | ||
Allow from none | ||
Deny from all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<VirtualHost *:80> | ||
|
||
# RewriteEngine on | ||
# RewriteCond "%{HTTPS}" "!=on" | ||
# RewriteRule "." "-" [F] | ||
|
||
DocumentRoot __PROJECT_ROOT__/www | ||
|
||
<Directory /> | ||
Options FollowSymLinks | ||
AllowOverride None | ||
</Directory> | ||
|
||
<Directory __PROJECT_ROOT__/www> | ||
Options FollowSymLinks Indexes | ||
AllowOverride All | ||
|
||
Require all granted | ||
</Directory> | ||
|
||
ErrorLog ${APACHE_LOG_DIR}/error.log | ||
CustomLog ${APACHE_LOG_DIR}/access.log combined | ||
|
||
LogLevel warn | ||
|
||
</VirtualHost> | ||
|
||
# What follows assumes you have run the following: | ||
# ubuntu/setup-certified.sh | ||
# ubuntu/setup-certified-ca.sh | ||
# ubuntu/setup-certified-certs.sh | ||
# If you have you own SSL keys/certs you will need to | ||
# update things accordingly | ||
|
||
# See als: | ||
# https://wiki.mozilla.org/Security/Server_Side_TLS | ||
# https://wiki.mozilla.org/Security/Server_Side_TLS#Apache | ||
# https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility | ||
|
||
<VirtualHost *:443> | ||
|
||
SSLEngine on | ||
SSLCertificateFile "__PROJECT_ROOT__/certified/db/__PROJECT_NAME__.crt" | ||
SSLCertificateKeyFile "__PROJECT_ROOT__/certified/db/__PROJECT_NAME__.key" | ||
|
||
SSLProtocol all -SSLv2 -SSLv3 | ||
SSLCipherSuite CDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK | ||
|
||
SSLHonorCipherOrder on | ||
SSLCompression off | ||
|
||
SSLUseStapling on | ||
SSLStaplingResponderTimeout 5 | ||
SSLStaplingReturnResponderErrors off | ||
|
||
# On Apache 2.4+, SSLStaplingCache must be set *outside* of the VirtualHost | ||
# SSLStaplingCache shmcb:/var/run/ocsp(128000) | ||
Header add Strict-Transport-Security "max-age=15768000" | ||
|
||
DocumentRoot __PROJECT_ROOT__/www | ||
|
||
<Directory /> | ||
Options FollowSymLinks | ||
AllowOverride None | ||
</Directory> | ||
|
||
<Directory __PROJECT_ROOT__/www> | ||
Options FollowSymLinks Indexes | ||
AllowOverride All | ||
Require all granted | ||
</Directory> | ||
|
||
ErrorLog ${APACHE_LOG_DIR}/error.log | ||
CustomLog ${APACHE_LOG_DIR}/access.log combined | ||
|
||
LogLevel warn | ||
|
||
</VirtualHost> | ||
|
||
# See above | ||
SSLStaplingCache shmcb:/var/run/ocsp(128000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Order Allow,Deny | ||
Allow from none | ||
Deny from all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
include("init_local.php"); | ||
|
||
# http://www.smarty.net/docs/en/api.compile.all.templates.tpl (version 3) | ||
# $GLOBALS['smarty']->compileAllTemplates('.txt', true); | ||
|
||
$pattern = "{$GLOBALS['cfg']['smarty_template_dir']}/*.txt"; | ||
$templates = array(); | ||
|
||
foreach (glob($pattern) as $f){ | ||
$templates[] = basename($f); | ||
} | ||
|
||
$GLOBALS['smarty']->force_compile = true; | ||
|
||
foreach ($templates as $t){ | ||
$GLOBALS['smarty']->fetch($t); | ||
} | ||
|
||
exit(); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
include("init_local.php"); | ||
loadlib("random"); | ||
|
||
$length = 32; | ||
|
||
echo random_string($length) . "\n"; | ||
exit(); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
$root = dirname(dirname(__FILE__)); | ||
ini_set("include_path", "{$root}/www:{$root}/www/include"); | ||
|
||
include("include/init.php"); | ||
|
||
# the end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Extras | ||
-- | ||
|
||
## lib_cache_memcache.php | ||
|
||
In order to use the `memcache` plugin you will need to make sure that you have | ||
installed the `php5-memcache` client. | ||
|
||
You will also need to add a `memcache_pool` config to your `config.php` | ||
file. Memcache can bucket cache requests across a number of hosts hence the list | ||
of lists. For example: | ||
|
||
$GLOBALS['cfg']['memcache_pool'] = array( | ||
array('host' => 'localhost', 'port' => 11211) | ||
); | ||
|
||
You will need to explicitly load the `cache_memcache` library in your code or | ||
enabled it using the `autoload_lib` array in your config file. Like this: | ||
|
||
$GLOBALS['cfg']['autoload_libs'] = array( | ||
'cache_memcache', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
# http://darklaunch.com/2009/08/07/base58-encode-and-decode-using-php-with-example-base58-encode-base58-decode | ||
|
||
################################################################# | ||
|
||
function base58_encode($num) { | ||
$alphabet = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'; | ||
$base_count = strlen($alphabet); | ||
$encoded = ''; | ||
|
||
while ($num >= $base_count) { | ||
$div = $num / $base_count; | ||
$mod = ($num - ($base_count * intval($div))); | ||
$encoded = $alphabet[$mod] . $encoded; | ||
$num = intval($div); | ||
} | ||
|
||
if ($num) { | ||
$encoded = $alphabet[$num] . $encoded; | ||
} | ||
|
||
return $encoded; | ||
} | ||
|
||
################################################################# | ||
|
||
function base58_decode($num) { | ||
$alphabet = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'; | ||
$len = strlen($num); | ||
$decoded = 0; | ||
$multi = 1; | ||
|
||
for ($i = $len - 1; $i >= 0; $i--) { | ||
$decoded += $multi * strpos($alphabet, $num[$i]); | ||
$multi = $multi * strlen($alphabet); | ||
} | ||
|
||
return $decoded; | ||
} | ||
|
||
################################################################# |
Oops, something went wrong.