Double Auth www/g1billet/ PHP web interface to ./shell/sms_AUTH.sh

This commit is contained in:
qo-op 2020-03-12 15:22:21 +01:00
parent 164bf129d8
commit 850413e229
5 changed files with 98 additions and 0 deletions

26
www/g1billet.conf Normal file
View File

@ -0,0 +1,26 @@
server {
listen 9980;
server_name rock64.p2p.legal g1sms.local localhost 127.0.0.1;
index index.php index.html;
root /var/www/g1billet;
# set expiration of assets to MAX for caching
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
expires max;
log_not_found off;
}
# php parsing
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
error_log /var/log/nginx/g1billet_error.log;
access_log /var/log/nginx/g1billet_access.log;
}

17
www/g1billet/code_sms.php Normal file
View File

@ -0,0 +1,17 @@
<?php
header("Access-Control-Allow-Origin: *");
if ( strlen($_REQUEST['code']) == 4 && strlen($_REQUEST['num']) == 10 ) {
$newNumber = preg_replace('/^0?/', '+33', $_REQUEST['num']);
$pinfile = '/tmp/'.$newNumber.'.PIN.auth';
if (file_exists($pinfile)) {
$authpin = file_get_contents($pinfile);
if ( trim($authpin) === trim($_REQUEST['code']) ) {
echo "OK ".$authpin. " == ".$_REQUEST['code'];
} else { echo "KO ".$pinfile." != ".$_REQUEST['code']; }
} else { echo "KO FILE ".$pinfile; }
} else {
echo "KO";
return false;
}
?>

5
www/g1billet/test.php Normal file
View File

@ -0,0 +1,5 @@
<?php
header("Access-Control-Allow-Origin: *");
var_dump($_REQUEST);
?>

12
www/g1billet/zen_sms.php Normal file
View File

@ -0,0 +1,12 @@
<?php
header("Access-Control-Allow-Origin: *");
if (strlen($_REQUEST['num']) == 10 ) {
$newNumber = preg_replace('/^0?/', '+33', $_REQUEST['num']);
$data = '"'.$newNumber.'" "'.$_REQUEST['val'].'"'.PHP_EOL;
$fp = fopen('/tmp/sms.commands', 'a');
fwrite($fp, $data);
} else {
return false;
}
?>

38
www/rompr.conf Normal file
View File

@ -0,0 +1,38 @@
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/rompr;
index index.php index.html index.htm;
server_name copylaradio;
# This section can be copied into an existing default setup
location / {
allow all;
index index.php;
location ~ \.php {
try_files $uri index.php =404;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
fastcgi_read_timeout 1800;
}
error_page 404 = /404.php;
try_files $uri $uri/ =404;
location ~ /albumart/* {
expires -1s;
}
}
# IPFS GATEWAY PROXY
location /ipfs {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
}