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
ac306aa0
Commit
ac306aa0
authored
Feb 18, 2019
by
noplanman
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fresh-install-fixes' into 'develop'
small fixes found from a clean install See merge request
!231
parents
7a668819
60082df5
Pipeline
#1215
passed with stage
in 2 minutes and 15 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
19 deletions
+46
-19
CHANGELOG.md
CHANGELOG.md
+5
-0
README.md
README.md
+8
-4
db/add.php
db/add.php
+13
-6
db/tables.sql
db/tables.sql
+11
-0
db/update-masterversions.php
db/update-masterversions.php
+1
-1
db/update-remote-data.php
db/update-remote-data.php
+0
-1
db/update.php
db/update.php
+8
-7
No files found.
CHANGELOG.md
View file @
ac306aa0
...
...
@@ -4,9 +4,14 @@ The format is based on [Keep a Changelog] and this project adheres to [Semantic
## [Unreleased]
### Added
### Changed
-
add.php test for pod meta like update.php
### Deprecated
### Removed
### Fixed
-
init call on new setup sets up the needed items
-
missing tables.sql item from version 2.5.2
-
missing table on tables.sql
-
link to osada repo updated
### Security
## [2.5.2] - 2019-01-29
...
...
README.md
View file @
ac306aa0
...
...
@@ -8,7 +8,7 @@ Environmental items you need (debian based system assumed):
OS Dependencies:
```
php7.2 php7.2-curl php7.2-pgsql php7.2-bcmath php-geoip php7.2-cli php7.2-common php7.2-bcmath php7.2-json php7.2-readline php7.2-mbstring php7.2-xml php-cgi git curl postgresql postgresql-contrib dnsutils bind9 npm nodejs composer
php7.2 php7.2-curl php7.2-pgsql php7.2-bcmath php-geoip php7.2-cli php7.2-common php7.2-
fpm php7.2-
bcmath php7.2-json php7.2-readline php7.2-mbstring php7.2-xml php-cgi git curl postgresql postgresql-contrib dnsutils bind9 npm nodejs composer
```
Yarn is a separate install: https://yarnpkg.com
...
...
@@ -41,10 +41,14 @@ Import database schema
psql -U podupuser podupdb < db/tables.sql
```
Configure your webserver (nginx example)
```
see file http-server-config.example
```
1.
Edit
`config.php`
to add your DB and file settings
2.
Touch add.log in location you configured in config.php
3.
Create your backup folder
4.
Add a pod and run
`php db/update.php init`
2.
Create your backup folder
3.
Add a pod and run
`php db/update.php init`
# To Use:
...
...
db/add.php
View file @
ac306aa0
...
...
@@ -82,13 +82,20 @@ EOF;
}
if
(
!
$stop
)
{
$link
=
'https://'
.
$_domain
.
'/nodeinfo/1.0'
;
$nodeinfo
=
curl
(
'https://'
.
$_domain
.
'/.well-known/nodeinfo'
);
if
(
$info
=
json_decode
(
$nodeinfo
[
'body'
]
?:
''
,
true
))
{
$link
=
max
(
$info
[
'links'
])[
'href'
];
$nodeinfo_meta
=
curl
(
"https://
{
$_domain
}
/.well-known/nodeinfo"
);
// Default link to fetch node info.
$nodeinfo_url
=
"https://
{
$_domain
}
/nodeinfo/1.0"
;
if
(
$info
=
json_decode
(
$nodeinfo_meta
[
'body'
]
?:
''
,
true
))
{
if
(
count
(
$info
[
'links'
],
COUNT_RECURSIVE
)
===
2
)
{
$nodeinfo_url
=
$info
[
'links'
][
'href'
];
}
else
{
$nodeinfo_url
=
max
(
$info
[
'links'
])[
'href'
];
}
}
$output
=
curl
(
$
link
,
true
);
$output
=
curl
(
$
nodeinfo_url
,
true
);
if
(
$output
[
'body'
]
&&
stripos
(
$output
[
'body'
],
'openRegistrations'
)
!==
false
)
{
echo
'Your pod has ssl and is valid<br>'
;
...
...
@@ -125,6 +132,6 @@ if (!$stop) {
echo
'Data successfully inserted! Your pod will be checked and live on the list in a few hours!'
;
}
else
{
echo
'Could not validate your pod, check your setup!<br>Take a look at
<a href="'
.
$link
.
'">your /
nodeinfo</a>'
;
echo
'Could not validate your pod, check your setup!<br>Take a look at
your <a href="'
.
$nodeinfo_url
.
'">
nodeinfo</a>'
;
}
}
db/tables.sql
View file @
ac306aa0
...
...
@@ -96,6 +96,16 @@ CREATE TABLE masterversions (
date_checked
timestamp
DEFAULT
current_timestamp
);
CREATE
TABLE
monthlystats
(
id
serial8
UNIQUE
PRIMARY
KEY
,
total_users
int
,
total_posts
int
,
total_comments
int
,
total_pods
int
,
total_uptime
int
,
date_checked
timestamp
DEFAULT
current_timestamp
);
CREATE
TABLE
meta
(
id
serial8
UNIQUE
PRIMARY
KEY
,
name
text
,
...
...
@@ -110,3 +120,4 @@ INSERT INTO meta (name) VALUES('federation_updated');
INSERT
INTO
meta
(
name
)
VALUES
(
'statstable_updated'
);
INSERT
INTO
meta
(
name
)
VALUES
(
'backup'
);
INSERT
INTO
meta
(
name
)
VALUES
(
'pods_updated'
);
INSERT
INTO
meta
(
name
)
VALUES
(
'sitemap_updated'
);
\ No newline at end of file
db/update-masterversions.php
View file @
ac306aa0
...
...
@@ -25,7 +25,7 @@ $softwares = [
'writefreely'
=>
[
'repo'
=>
'writeas/writefreely'
,
'gitsite'
=>
'api.github.com'
,
'gittype'
=>
'github'
,
'devbranch'
=>
'develop'
],
'ganggo'
=>
[
'repo'
=>
'ganggo%2fganggo'
,
'gitsite'
=>
'git.feneas.org'
,
'gittype'
=>
'gitlab'
,
'devbranch'
=>
''
],
'funkwhale'
=>
[
'repo'
=>
'funkwhale%2ffunkwhale'
,
'gitsite'
=>
'code.eliotberriot.com'
,
'gittype'
=>
'gitlab'
,
'devbranch'
=>
'develop'
],
'osada'
=>
[
'repo'
=>
'
macgirvin
%2fosada'
,
'gitsite'
=>
'framagit.org'
,
'gittype'
=>
'gitlab'
,
'devbranch'
=>
'dev'
],
'osada'
=>
[
'repo'
=>
'
zot
%2fosada'
,
'gitsite'
=>
'framagit.org'
,
'gittype'
=>
'gitlab'
,
'devbranch'
=>
'dev'
],
];
$opts
=
[
...
...
db/update-remote-data.php
View file @
ac306aa0
...
...
@@ -33,7 +33,6 @@ $foundpods = [];
//pulling all nodes for now
$federationpods
=
curl
(
'https://the-federation.info/graphql?query=%7Bnodes%7Bhost%20platform%7Bname%7Dprotocols%7Bname%7D%7D%7D&raw'
);
if
(
$pods
=
json_decode
(
$federationpods
[
'body'
]
?:
''
,
true
))
{
;
foreach
(
$pods
[
'data'
][
'nodes'
]
??
[]
as
$poddata
)
{
$protocols
=
array_column
(
$poddata
[
'protocols'
]
??
[],
'name'
);
...
...
db/update.php
View file @
ac306aa0
...
...
@@ -29,6 +29,7 @@ if (!is_connected()) {
$time_start
=
microtime
(
true
);
$debug
=
isset
(
$_GET
[
'debug'
])
||
(
isset
(
$argv
)
&&
in_array
(
'debug'
,
$argv
,
true
));
$init
=
isset
(
$_GET
[
'init'
])
||
(
isset
(
$argv
)
&&
in_array
(
'init'
,
$argv
,
true
));
$sqldebug
=
isset
(
$_GET
[
'sqldebug'
])
||
(
isset
(
$argv
)
&&
in_array
(
'sqldebug'
,
$argv
,
true
));
$develop
=
isset
(
$_GET
[
'develop'
])
||
(
isset
(
$argv
)
&&
in_array
(
'develop'
,
$argv
,
true
));
$write
=
!
(
isset
(
$_GET
[
'nowrite'
])
||
(
isset
(
$argv
)
&&
in_array
(
'nowrite'
,
$argv
,
true
)));
...
...
@@ -449,33 +450,33 @@ if (!$_domain) {
$time_end
=
microtime
(
true
);
$execution_time
=
(
$time_end
-
$time_start
)
/
60
;
updateMeta
(
'pods_update_runtime'
,
round
(
$execution_time
));
if
(
$languagesupdated
)
{
if
(
$languagesupdated
||
$init
)
{
updateMeta
(
'languages_updated'
);
}
if
(
Carbon
::
createFromFormat
(
'Y-m-d H:i:s.u'
,
getMeta
(
'masterversions_updated'
,
'date_created'
))
->
diffInHours
()
>
12
)
{
if
(
Carbon
::
createFromFormat
(
'Y-m-d H:i:s.u'
,
getMeta
(
'masterversions_updated'
,
'date_created'
))
->
diffInHours
()
>
12
||
$init
)
{
require
__DIR__
.
'/update-masterversions.php'
;
}
if
(
Carbon
::
createFromFormat
(
'Y-m-d H:i:s.u'
,
getMeta
(
'statstable_updated'
,
'date_created'
))
->
diffInHours
()
>
23
)
{
if
(
Carbon
::
createFromFormat
(
'Y-m-d H:i:s.u'
,
getMeta
(
'statstable_updated'
,
'date_created'
))
->
diffInHours
()
>
23
||
$init
)
{
require
__DIR__
.
'/update-monthly-stats.php'
;
}
if
(
Carbon
::
createFromFormat
(
'Y-m-d H:i:s.u'
,
getMeta
(
'cacert_updated'
,
'date_created'
))
->
diffInHours
()
>
40
)
{
if
(
Carbon
::
createFromFormat
(
'Y-m-d H:i:s.u'
,
getMeta
(
'cacert_updated'
,
'date_created'
))
->
diffInHours
()
>
40
||
$init
)
{
copy
(
'https://curl.haxx.se/ca/cacert.pem'
,
c
(
'cafullpath'
));
updateMeta
(
'cacert_updated'
);
}
if
(
Carbon
::
createFromFormat
(
'Y-m-d H:i:s.u'
,
getMeta
(
'sitemap_updated'
,
'date_created'
))
->
diffInHours
()
>
2
)
{
if
(
Carbon
::
createFromFormat
(
'Y-m-d H:i:s.u'
,
getMeta
(
'sitemap_updated'
,
'date_created'
))
->
diffInHours
()
>
2
||
$init
)
{
require
__DIR__
.
'/update-sitemap.php'
;
}
if
(
Carbon
::
createFromFormat
(
'Y-m-d H:i:s.u'
,
getMeta
(
'geoip_updated'
,
'date_created'
))
->
diffInHours
()
>
45
)
{
if
(
Carbon
::
createFromFormat
(
'Y-m-d H:i:s.u'
,
getMeta
(
'geoip_updated'
,
'date_created'
))
->
diffInHours
()
>
45
||
$init
)
{
copy
(
'compress.zlib://http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz'
,
c
(
'geoip2db'
));
updateMeta
(
'geoip_updated'
);
}
if
(
Carbon
::
createFromFormat
(
'Y-m-d H:i:s.u'
,
getMeta
(
'federation_updated'
,
'date_created'
))
->
diffInHours
()
>
9
)
{
if
(
Carbon
::
createFromFormat
(
'Y-m-d H:i:s.u'
,
getMeta
(
'federation_updated'
,
'date_created'
))
->
diffInHours
()
>
9
||
$init
)
{
require
__DIR__
.
'/update-remote-data.php'
;
}
...
...
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