Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Poduptime
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diasporg
Poduptime
Commits
7b233d54
Unverified
Commit
7b233d54
authored
Jan 29, 2017
by
dmorley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some more
parent
aa99799e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
12 deletions
+7
-12
db/pull.php
db/pull.php
+4
-9
db/pull.sh
db/pull.sh
+2
-2
showfull.php
showfull.php
+1
-1
No files found.
db/pull.php
View file @
7b233d54
...
...
@@ -4,7 +4,6 @@
$debug
=
isset
(
$_GET
[
'debug'
])
||
(
isset
(
$argv
)
&&
in_array
(
'debug'
,
$argv
,
true
));
$newline
=
PHP_SAPI
===
'cli'
?
"
\n
"
:
'<br>'
;
// Other parameters.
$_domain
=
$_GET
[
'domain'
]
??
''
;
require_once
__DIR__
.
'/../config.php'
;
...
...
@@ -70,7 +69,6 @@ while ($row = pg_fetch_assoc($result)) {
_debug
(
'Cert expire date'
,
$sslexpire
);
_debug
(
'TTL'
,
$ttl
);
//get new json from nodeinfo
$jsonssl
=
json_decode
(
$outputssl
);
if
(
!
$jsonssl
)
{
...
...
@@ -133,15 +131,14 @@ while ($row = pg_fetch_assoc($result)) {
$country
=
!
empty
(
$location
[
'country_code'
])
?
iconv
(
'UTF-8'
,
'UTF-8//IGNORE'
,
$location
[
'country_code'
])
:
null
;
$city
=
!
empty
(
$location
[
'city'
])
?
iconv
(
'UTF-8'
,
'UTF-8//IGNORE'
,
$location
[
'city'
])
:
null
;
$state
=
!
empty
(
$location
[
'region'
])
?
iconv
(
'UTF-8'
,
'UTF-8//IGNORE'
,
$location
[
'region'
])
:
null
;
$lat
=
!
empty
(
$location
[
'latitude'
])
?
$location
[
'latitude'
]
:
null
;
$long
=
!
empty
(
$location
[
'longitude'
])
?
$location
[
'longitude'
]
:
null
;
$lat
=
!
empty
(
$location
[
'latitude'
])
?
$location
[
'latitude'
]
:
0
;
$long
=
!
empty
(
$location
[
'longitude'
])
?
$location
[
'longitude'
]
:
0
;
echo
$newline
;
$statslastdate
=
date
(
'Y-m-d H:i:s'
);
$diff
=
(
new
DateTime
())
->
diff
(
new
DateTime
(
$dateadded
));
$months
=
$diff
->
m
+
(
$diff
->
y
*
12
);
$diff
=
(
new
DateTime
())
->
diff
(
new
DateTime
(
$dateadded
));
$months
=
$diff
->
m
+
(
$diff
->
y
*
12
);
$responsetime
=
0
;
$sqlttl
=
'SELECT round(avg(ttl) * 1000) AS ttl FROM checks WHERE domain = $1'
;
...
...
@@ -164,14 +161,12 @@ while ($row = pg_fetch_assoc($result)) {
$hidden
=
$score
<=
70
;
_debug
(
'Hidden'
,
$hidden
?
'yes'
:
'no'
);
// lets cap the scores or you can go too high or too low to never be effected by them
if
(
$score
>
100
)
{
$score
=
100
;
}
elseif
(
$score
<
0
)
{
$score
=
0
;
}
$weightedscore
=
(
$uptime
+
$score
+
(
$active_users_monthly
/
19999
)
-
((
10
-
$weight
)
*
.
12
));
//sql it
$timenow
=
date
(
'Y-m-d H:i:s'
);
$sql_set
=
'UPDATE pods SET secure = $2, hidden = $3, ip = $4, ipv6 = $5, monthsmonitored = $6, uptime_alltime = $7, status = $8, date_laststats = $9, date_updated = $10, responsetime = $11, score = $12, adminrating = $13, country = $14, city = $15, state = $16, lat = $17, long = $18, userrating = $19, shortversion = $20, masterversion = $21, signup = $22, total_users = $23, active_users_halfyear = $24, active_users_monthly = $25, local_posts = $26, name = $27, comment_counts = $28, service_facebook = $29, service_tumblr = $30, service_twitter = $31, service_wordpress = $32, weightedscore = $33, service_xmpp = $34, softwarename = $35, sslvalid = $36, dnssec = $37, sslexpire = $38 WHERE domain = $1'
;
...
...
db/pull.sh
View file @
7b233d54
SCRIPT_DIR
=
"
$(
cd
"
$(
dirname
"
$0
"
)
"
&&
pwd
)
"
TIME
=
`
date
+%k
`
SCRIPT_DIR
=
"
$(
cd
"
$(
dirname
"
$0
"
)
"
&&
pwd
)
"
TIME
=
`
date
+%k
`
if
[
-s
/tmp/index.google
]
;
then
echo
"already running die"
...
...
showfull.php
View file @
7b233d54
...
...
@@ -97,7 +97,7 @@ $numrows = pg_num_rows($result);
$row
[
'service_wordpress'
]
===
't'
&&
print
'<div class="smlogo smlogo-wordpress" title="Publish to WordPress"></div>'
;
$row
[
'service_xmpp'
]
===
't'
&&
print
'<div class="smlogo smlogo-xmpp"><img src="/images/icon-xmpp.png" width="16" height="16" title="XMPP chat server" alt="XMPP chat server"></div>'
;
echo
'</td>'
;
echo
'<td><a href="https://'
.
$row
[
'domain'
]
.
$row
[
'terms'
]
.
'">🔗</a
></td></tr>'
;
$row
[
'terms'
]
===
't'
?
print
'<td><a href="https://'
.
$row
[
'domain'
]
.
$row
[
'terms'
]
.
'">🔗</a></td></tr>'
:
print
'<td
></td></tr>'
;
}
?>
</tbody>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment