Commit ba0fb1dd authored by noplanman's avatar noplanman Committed by GitHub

Merge pull request #67 from diasporg/removedomain

remove domain hardcode
parents af3fa032 08432934
...@@ -45,7 +45,7 @@ touch add.log in location you configured in config.php ...@@ -45,7 +45,7 @@ touch add.log in location you configured in config.php
============================ ============================
Source for https://podupti.me Source for Diaspora Pod Uptime
Poduptime is software to get live stats and data on listed Diaspora Pods. Poduptime is software to get live stats and data on listed Diaspora Pods.
Copyright (C) 2011 David Morley Copyright (C) 2011 David Morley
......
...@@ -17,8 +17,8 @@ if ($_format === 'georss') { ...@@ -17,8 +17,8 @@ if ($_format === 'georss') {
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:georss="http://www.georss.org/georss"> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:georss="http://www.georss.org/georss">
<title>Diaspora Pods</title> <title>Diaspora Pods</title>
<subtitle>IP Locations of Diaspora pods on podupti.me</subtitle> <subtitle>IP Locations of Diaspora pods on {$_SERVER['HTTP_HOST']}</subtitle>
<link href="https://podupti.me/"/> <link href="https://{$_SERVER['HTTP_HOST']}/"/>
EOF; EOF;
$sql = "SELECT * FROM pods WHERE hidden <> 'yes'"; $sql = "SELECT * FROM pods WHERE hidden <> 'yes'";
......
<!-- /* Copyright (c) 2011, David Morley. This file is licensed under the Affero General Public License version 3 or later. See the COPYRIGHT file. */ --> <!-- /* Copyright (c) 2011, David Morley. This file is licensed under the Affero General Public License version 3 or later. See the COPYRIGHT file. */ -->
<?php <?php
require_once __DIR__ . '/../logging.php'; require_once __DIR__ . '/../logging.php';
require_once __DIR__ . '/../config.php';
$log = new Logging(); $log = new Logging();
$log->lfile(__DIR__ . $log_dir . '/add.log'); $log->lfile(__DIR__ . '/../' . $log_dir . '/add.log');
if (!($_domain = $_POST['domain'] ?? null)) { if (!($_domain = $_POST['domain'] ?? null)) {
$log->lwrite('no domain given'); $log->lwrite('no domain given');
die('no pod domain given'); die('no pod domain given');
...@@ -25,7 +25,6 @@ if (strlen($_url) < 14) { ...@@ -25,7 +25,6 @@ if (strlen($_url) < 14) {
die('API key bad needs to be like m58978-80abdb799f6ccf15e3e3787ee'); die('API key bad needs to be like m58978-80abdb799f6ccf15e3e3787ee');
} }
require_once __DIR__ . '/../config.php';
$dbh = pg_connect("dbname=$pgdb user=$pguser password=$pgpass"); $dbh = pg_connect("dbname=$pgdb user=$pguser password=$pgpass");
$dbh || die('Error in connection: ' . pg_last_error()); $dbh || die('Error in connection: ' . pg_last_error());
...@@ -84,12 +83,12 @@ if ($valid) { ...@@ -84,12 +83,12 @@ if ($valid) {
$to = $adminemail; $to = $adminemail;
$cc = $_email; $cc = $_email;
$subject = 'New pod added to podupti.me '; $subject = 'New pod added to '. $_SERVER['HTTP_HOST'];
$message = sprintf( $message = sprintf(
"%1\$s\n\nStats Url: %2\$s\n\nPod: %3\$s\n\n", "%1\$s\n\nStats Url: %2\$s\n\nPod: %3\$s\n\n",
'https://podupti.me', 'https://' . $_SERVER['HTTP_HOST'],
'https://api.uptimerobot.com/getMonitors?format=json&customUptimeRatio=7-30-60-90&apiKey=' . $_url, 'https://api.uptimerobot.com/getMonitors?format=json&customUptimeRatio=7-30-60-90&apiKey=' . $_url,
'https://podupti.me/db/pull.php?debug=1&domain=' . $_domain 'https://' . $_SERVER['HTTP_HOST'] . '/db/pull.php?debug=1&domain=' . $_domain
); );
$message .= 'Your pod will not show right away, needs to pass a few checks, Give it a few hours!'; $message .= 'Your pod will not show right away, needs to pass a few checks, Give it a few hours!';
$headers = 'From: ' . $_email . "\r\nReply-To: " . $_email . "\r\nCc: " . $_email . "\r\n"; $headers = 'From: ' . $_email . "\r\nReply-To: " . $_email . "\r\nCc: " . $_email . "\r\n";
......
...@@ -30,8 +30,8 @@ while ($row = pg_fetch_array($result)) { ...@@ -30,8 +30,8 @@ while ($row = pg_fetch_array($result)) {
$result || die('Error in SQL query: ' . pg_last_error()); $result || die('Error in SQL query: ' . pg_last_error());
$to = $_email; $to = $_email;
$subject = 'Temporary edit key for podupti.me'; $subject = 'Temporary edit key for ' . $_SERVER['HTTP_HOST'];
$message = 'Link: https://podupti.me/db/edit.php?domain=' . $_domain . '&token=' . $uuid . ' Expires: ' . $expire . ' ' . $systemTimeZone . "\n\n"; $message = 'Link: https://' . $_SERVER['HTTP_HOST'] . '/db/edit.php?domain=' . $_domain . '&token=' . $uuid . ' Expires: ' . $expire . ' ' . $systemTimeZone . "\n\n";
$headers = "From: " . $adminemail . "\r\nBcc: " . $adminemail . "\r\n"; $headers = "From: " . $adminemail . "\r\nBcc: " . $adminemail . "\r\n";
@mail($to, $subject, $message, $headers); @mail($to, $subject, $message, $headers);
echo 'Link sent to your email'; echo 'Link sent to your email';
...@@ -43,8 +43,8 @@ while ($row = pg_fetch_array($result)) { ...@@ -43,8 +43,8 @@ while ($row = pg_fetch_array($result)) {
$result || die('Error in SQL query: ' . pg_last_error()); $result || die('Error in SQL query: ' . pg_last_error());
$to = $adminemail; $to = $adminemail;
$subject = 'FORWARD REQUEST: Temporary edit key for podupti.me'; $subject = 'FORWARD REQUEST: Temporary edit key for ' . $_SERVER['HTTP_HOST'];
$message = 'User trying to edit pod without email address. Email found: ' . $row['email'] . ' Link: https://podupti.me/db/edit.php?domain=' . $_domain . '&token=' . $uuid . ' Expires: ' . $expire . ' ' . $systemTimeZone . "\n\n"; $message = 'User trying to edit pod without email address. Email found: ' . $row['email'] . ' Link: https://' . $_SERVER['HTTP_HOST'] . '/db/edit.php?domain=' . $_domain . '&token=' . $uuid . ' Expires: ' . $expire . ' ' . $systemTimeZone . "\n\n";
$headers = "From: " . $adminemail . "\r\nBcc: " . $adminemail . "\r\n"; $headers = "From: " . $adminemail . "\r\nBcc: " . $adminemail . "\r\n";
@mail($to, $subject, $message, $headers); @mail($to, $subject, $message, $headers);
echo 'Link sent to administrator to review and verify, if approved they will forward the edit key to you.'; echo 'Link sent to administrator to review and verify, if approved they will forward the edit key to you.';
......
...@@ -28,8 +28,8 @@ while ($row = pg_fetch_array($result)) { ...@@ -28,8 +28,8 @@ while ($row = pg_fetch_array($result)) {
if ($row['email']) { if ($row['email']) {
$to = $row['email']; $to = $row['email'];
$subject = 'Pod deleted from poduptime '; $subject = 'Pod deleted from ' . $_SERVER['HTTP_HOST'];
$message = 'Pod ' . $_domain . ' was deleted from podupti.me as it was dead on the list. ' . $_comments . " Feel free to add back at any time. \n\n"; $message = 'Pod ' . $_domain . ' was deleted from ' . $_SERVER['HTTP_HOST'] . ' as it was dead on the list. ' . $_comments . " Feel free to add back at any time. \n\n";
$headers = "From: " . $adminemail ."\r\nCc:" . $adminemail . "," . $row['email'] . "\r\n"; $headers = "From: " . $adminemail ."\r\nCc:" . $adminemail . "," . $row['email'] . "\r\n";
@mail($to, $subject, $message, $headers); @mail($to, $subject, $message, $headers);
} }
...@@ -37,7 +37,7 @@ while ($row = pg_fetch_array($result)) { ...@@ -37,7 +37,7 @@ while ($row = pg_fetch_array($result)) {
} elseif ($_action === 'warn') { } elseif ($_action === 'warn') {
if ($row['email']) { if ($row['email']) {
$to = $row['email']; $to = $row['email'];
$subject = 'Pod removal warning from poduptime '; $subject = 'Pod removal warning from ' . $_SERVER['HTTP_HOST'];
$message = 'Pod ' . $_domain . ' is on the list to be deleted now because: ' . $_comments . ". \n\n Please let me know if you need help fixing before it is removed. \n\n"; $message = 'Pod ' . $_domain . ' is on the list to be deleted now because: ' . $_comments . ". \n\n Please let me know if you need help fixing before it is removed. \n\n";
$headers = "From: " . $adminemail ."\r\nCc:" . $adminemail . "," . $row['email'] . "\r\n"; $headers = "From: " . $adminemail ."\r\nCc:" . $adminemail . "," . $row['email'] . "\r\n";
@mail($to, $subject, $message, $headers); @mail($to, $subject, $message, $headers);
......
...@@ -12,14 +12,14 @@ $simpleview = !($advancedview || $mapview || $cleanup || $podmin || $podminedi ...@@ -12,14 +12,14 @@ $simpleview = !($advancedview || $mapview || $cleanup || $podmin || $podminedi
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Diaspora Pod Uptime Status - Find your new social home on a hosted pod</title> <title>Diaspora Pod Uptime Status - Find your new social home on a hosted pod</title>
<meta name="keywords" content="diaspora, federated pods, podupti.me, open source social, open source social network"/> <meta name="keywords" content="diaspora, federated pods, <?php echo $_SERVER['HTTP_HOST'] ?>, open source social, open source social network"/>
<meta name="description" content="Diaspora Pod Live Status. Find a Diaspora pod to sign up for, rate pods, find one close to you!"/> <meta name="description" content="Diaspora Pod Live Status. Find a Diaspora pod to sign up for, rate pods, find one close to you!"/>
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="css/newstyle.css"/> <link rel="stylesheet" href="css/newstyle.css"/>
<link rel="stylesheet" href="bower_components/facebox/src/facebox.css"/> <link rel="stylesheet" href="bower_components/facebox/src/facebox.css"/>
<link rel="stylesheet" href="css/dashboard.css"/> <link rel="stylesheet" href="css/dashboard.css"/>
<link rel="stylesheet" href="bower_components/jquery-ui/themes/base/jquery-ui.min.css"/> <link rel="stylesheet" href="bower_components/jquery-ui/themes/base/jquery-ui.min.css"/>
<meta property="og:url" content="https://podupti.me"/> <meta property="og:url" content="https://<?php echo $_SERVER['HTTP_HOST'] ?>"/>
<meta property="og:title" content="Diaspora Pod Finder"/> <meta property="og:title" content="Diaspora Pod Finder"/>
<meta property="og:type" content="website"/> <meta property="og:type" content="website"/>
<meta property="og:description" content="Diaspora Pod Live Status. Find a Diaspora pod to sign up for, rate pods, find one close to you!"/> <meta property="og:description" content="Diaspora Pod Live Status. Find a Diaspora pod to sign up for, rate pods, find one close to you!"/>
......
...@@ -3,7 +3,7 @@ Want your pod listed?<br> ...@@ -3,7 +3,7 @@ Want your pod listed?<br>
Its easy start monitoring on your pod with a free <a href="https://uptimerobot.com" target="_blank">Uptime Robot</a> account.<br> Its easy start monitoring on your pod with a free <a href="https://uptimerobot.com" target="_blank">Uptime Robot</a> account.<br>
Create a monitor for your pod, then in "My Settings" create a monitor-specific API key and paste below.<br> Create a monitor for your pod, then in "My Settings" create a monitor-specific API key and paste below.<br>
<br> <br>
<form action="https://podupti.me/db/add.php" method="post"> <form action="https://<?php echo $_SERVER['HTTP_HOST'] ?>/db/add.php" method="post">
<label>Monitor API Key: <input type="text" name="url" class="xlarge span8" placeholder="m58978-80abdb799f6ccf15e3e4ttwe"> (don't copy the period on the end)</label><br> <label>Monitor API Key: <input type="text" name="url" class="xlarge span8" placeholder="m58978-80abdb799f6ccf15e3e4ttwe"> (don't copy the period on the end)</label><br>
<label>Pod Domain Name: <input type="text" name="domain" class="xlarge span4" placeholder="domain.com"></label><br> <label>Pod Domain Name: <input type="text" name="domain" class="xlarge span4" placeholder="domain.com"></label><br>
<label>Your Email: <input type="text" name="email" class="xlarge span4" placeholder="user@domain.com"></label><br> <label>Your Email: <input type="text" name="email" class="xlarge span4" placeholder="user@domain.com"></label><br>
......
<form action="https://podupti.me/db/gettoken.php" method="post"> <form action="https://<?php echo $_SERVER['HTTP_HOST'] ?>/db/gettoken.php" method="post">
<label>Pod Domain Name: <input type="text" name="domain"></label> <label>Pod Domain Name: <input type="text" name="domain"></label>
<label>Registered Email: <input type="text" name="email" placeholder="Ok to leave blank if you forgot"></label> <label>Registered Email: <input type="text" name="email" placeholder="Ok to leave blank if you forgot"></label>
<input type="submit" value="send"> <input type="submit" value="send">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment