some security fixes + lighttpd config sample

This commit is contained in:
Tanguy Pruvot 2015-07-02 22:44:59 +02:00
parent 66d613b7ac
commit cfc0d15ae3
8 changed files with 20 additions and 44 deletions

2
.gitignore vendored
View file

@ -2,6 +2,6 @@
*.a
stratum/stratum
stratum/blocknotify
stratum/config/
*.log
web/yaamp/runtime/*

View file

@ -20,13 +20,25 @@ Config for nginx:
include fastcgi_params;
}
If you use apache, it should be something like (set in web/.htaccess):
If you use apache, it should be something like (already set in web/.htaccess):
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php?r=$1 [QSA]
If you use lighttpd, use the following config:
$HTTP["host"] =~ "yiimp.ccminer.org" {
server.document-root = "/var/yaamp/web"
url.rewrite-if-not-file = (
"^(.*)\?(.*)" => "index.php?r=$1&$2",
"^(.*)" => "index.php?r=$1",
"." => "index.php"
)
}
The recommended install folder for the stratum engine is /var/stratum. Copy all the .conf files, run.sh, the stratum binary and the blocknotify binary to this folder.
Some scripts are expecting the web folder to be /var/web.

View file

@ -1,10 +1,6 @@
RewriteEngine On
#RewriteCond %{REQUEST_FILENAME} -s [OR]
#RewriteCond %{REQUEST_FILENAME} -l [OR]
#RewriteCond %{REQUEST_FILENAME} -d
#RewriteRule ^.*$ - [NC,L]
#RewriteRule ^.*$ index.php [NC,L]
RewriteOptions Inherit
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php?r=$1 [QSA]

View file

@ -1,2 +1,2 @@
User-agent: *
Disallow:

2
web/yaamp/.htaccess Normal file
View file

@ -0,0 +1,2 @@
deny from all

View file

@ -1,33 +0,0 @@
<?php
class db_shares_vip extends CActiveRecord
{
public static function model($className=__CLASS__)
{
return parent::model($className);
}
public function tableName()
{
return 'shares_vip';
}
public function rules()
{
return array(
);
}
public function relations()
{
return array(
);
}
public function attributeLabels()
{
return array(
);
}
}

View file

@ -3,7 +3,6 @@
if(php_sapi_name() != "cli") return;
require_once('serverconfig.php');
//require_once('yaamp/include.php');
require_once('yaamp/core/core.php');
require_once('yaamp/ui/lib/lib.php');

View file

@ -1,4 +1,4 @@
#!/bin/bash
php yiic.php $*
php yaamp/yiic.php $*