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
2418bc31
Commit
2418bc31
authored
Jul 09, 2018
by
dmorley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaner lookups, utf8 does not seem needed to fix now, something to watch still in dev
parent
0d352583
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
15 deletions
+16
-15
Changelog.md
Changelog.md
+1
-0
config.php.example
config.php.example
+4
-4
db/add.php
db/add.php
+1
-1
db/backup.php
db/backup.php
+4
-4
db/pull.php
db/pull.php
+6
-6
No files found.
Changelog.md
View file @
2418bc31
...
...
@@ -15,6 +15,7 @@
*
Use the git API for release versions, check development releases on pods https://github.com/diasporg/Poduptime/issues/143
*
Forbid access to files that should be cli only https://github.com/diasporg/Poduptime/issues/152
*
Move from bower to yarn for packages
*
NOTE config.php.examples change to full paths for 2 items!
## End Users
*
Show version and update in full view cleaner https://github.com/diasporg/Poduptime/issues/143
...
...
config.php.example
View file @
2418bc31
...
...
@@ -5,10 +5,10 @@
declare
(
strict_types
=
1
);
//backup directory -
app directory
path
//backup directory -
full dir
path
$backup_dir
=
'/backup'
;
//log directory -
app directory
path
//log directory -
full dir
path
$log_dir
=
'/log'
;
//location of pg dump - full dir path
...
...
@@ -32,11 +32,11 @@ $adminemail = '';
//DNS server for dnssec testing. 1.1.1.1 tests the best
$dnsserver
=
''
;
//CA for curl to use - full path
//CA for curl to use - full
file
path
$cafullpath
=
''
;
//Mapbox.com API key. https://www.mapbox.com/help/how-access-tokens-work/
$mapboxkey
=
''
;
//GeoIp2 city database file in mmdb format - full path
//GeoIp2 city database file in mmdb format - full
file
path
$geoip2db
=
''
;
\ No newline at end of file
db/add.php
View file @
2418bc31
...
...
@@ -15,7 +15,7 @@ require_once __DIR__ . '/../config.php';
define
(
'PODUPTIME'
,
microtime
(
true
));
$log
=
new
Logging
();
$log
->
lfile
(
__DIR__
.
'/../'
.
$log_dir
.
'/add.log'
);
$log
->
lfile
(
$log_dir
.
'/add.log'
);
if
(
!
(
$_domain
=
$_GET
[
'domain'
]
??
null
))
{
$log
->
lwrite
(
'no domain given'
);
die
(
'no pod domain given'
);
...
...
db/backup.php
View file @
2418bc31
...
...
@@ -15,15 +15,15 @@ require_once __DIR__ . '/../config.php';
$keep
=
(
60
*
60
*
6
)
*
1
;
$dump_date
=
date
(
'Ymd_Hs'
);
$file_name
=
__DIR__
.
'/..'
.
$backup_dir
.
'/dump_'
.
$dump_date
.
'.sql'
;
$file_name
=
$backup_dir
.
'/dump_'
.
$dump_date
.
'.sql'
;
system
(
"export PGPASSWORD=
$pgpass
&&
$pg_dump_dir
/pg_dump --username=
$pguser
$pgdb
>>
$file_name
"
);
echo
"pg backup of
$pgdb
made"
;
$dirh
=
dir
(
__DIR__
.
'/..'
.
$backup_dir
);
$dirh
=
dir
(
$backup_dir
);
while
(
$entry
=
$dirh
->
read
())
{
$old_file_time
=
(
date
(
'U'
)
-
$keep
);
$file_created
=
filectime
(
__DIR__
.
'/..'
.
"
$backup_dir
/
$entry
"
);
$file_created
=
filectime
(
"
$backup_dir
/
$entry
"
);
if
(
$file_created
<
$old_file_time
&&
!
is_dir
(
$entry
))
{
if
(
unlink
(
__DIR__
.
'/..'
.
"
$backup_dir
/
$entry
"
))
{
if
(
unlink
(
"
$backup_dir
/
$entry
"
))
{
echo
'Cleaned up old backups'
;
}
}
...
...
db/pull.php
View file @
2418bc31
...
...
@@ -240,12 +240,12 @@ foreach ($pods as $pod) {
_debug
(
'Iplookupv6'
,
$iplookupv6
,
true
);
$geo
=
$reader
->
city
(
$ip
);
$countryname
=
!
empty
(
$geo
->
country
->
name
)
?
iconv
(
'UTF-8'
,
'UTF-8//IGNORE'
,
$geo
->
country
->
name
)
:
null
;
$country
=
!
empty
(
$geo
->
country
->
isoCode
)
?
iconv
(
'UTF-8'
,
'UTF-8//IGNORE'
,
$geo
->
country
->
isoCode
)
:
null
;
$city
=
!
empty
(
$geo
->
city
->
name
)
?
iconv
(
'UTF-8'
,
'UTF-8//IGNORE'
,
$geo
->
city
->
name
)
:
null
;
$state
=
!
empty
(
$geo
->
mostSpecificSubdivision
->
name
)
?
iconv
(
'UTF-8'
,
'UTF-8//IGNORE'
,
$geo
->
mostSpecificSubdivision
->
name
)
:
null
;
$lat
=
!
empty
(
$geo
->
location
->
latitude
)
?
$geo
->
location
->
latitude
:
0
;
$long
=
!
empty
(
$geo
->
location
->
longitude
)
?
$geo
->
location
->
longitude
:
0
;
$countryname
=
$geo
->
country
->
name
??
null
?:
0
;
$country
=
$geo
->
country
->
isoCode
??
null
?:
0
;
$city
=
$geo
->
city
->
name
??
null
?:
0
;
$state
=
$geo
->
mostSpecificSubdivision
->
name
??
null
?:
0
;
$lat
=
$geo
->
location
->
latitude
??
null
?
:
0
;
$long
=
$geo
->
location
->
longitude
??
null
?
:
0
;
_debug
(
'Location'
,
json_encode
(
$geo
->
raw
),
true
);
...
...
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