Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Thomas Gambier
slapos
Commits
b3042e57
Commit
b3042e57
authored
Jun 30, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/matomo: set environment variables to configure database
using
https://github.com/matomo-org/matomo/pull/13676
parent
aba7fac7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
3 deletions
+37
-3
software/matomo/buildout.hash.cfg
software/matomo/buildout.hash.cfg
+1
-1
software/matomo/matomo-instance.cfg.in
software/matomo/matomo-instance.cfg.in
+9
-0
software/matomo/test/setup.py
software/matomo/test/setup.py
+1
-0
software/matomo/test/test.py
software/matomo/test/test.py
+26
-2
No files found.
software/matomo/buildout.hash.cfg
View file @
b3042e57
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
[template-matomo-instance]
[template-matomo-instance]
filename = matomo-instance.cfg.in
filename = matomo-instance.cfg.in
md5sum =
9ff98282480b9edf9af75fca5da5f349
md5sum =
145ebeb4adcd4ec3d13929f1d2ee239c
[template-matomo-backup.sh]
[template-matomo-backup.sh]
filename = matomo-backup.sh.in
filename = matomo-backup.sh.in
...
...
software/matomo/matomo-instance.cfg.in
View file @
b3042e57
...
@@ -19,3 +19,12 @@ output = ${directory:scripts}/matomo-backup
...
@@ -19,3 +19,12 @@ output = ${directory:scripts}/matomo-backup
context =
context =
section parameter_dict instance-parameter
section parameter_dict instance-parameter
key php_bin php-bin:wrapper-path
key php_bin php-bin:wrapper-path
[apache-php-service]
environment=
MATOMO_DATABASE_HOST=${mariadb-urlparse:host}:${mariadb-urlparse:port}
MATOMO_DATABASE_ADAPTER=mysql
MATOMO_DATABASE_TABLES_PREFIX=matomo_
MATOMO_DATABASE_USERNAME=${mariadb-urlparse:username}
MATOMO_DATABASE_PASSWORD=${mariadb-urlparse:password}
MATOMO_DATABASE_DBNAME=${mariadb-urlparse:path}
software/matomo/test/setup.py
View file @
b3042e57
...
@@ -46,6 +46,7 @@ setup(
...
@@ -46,6 +46,7 @@ setup(
'slapos.libnetworkcache'
,
'slapos.libnetworkcache'
,
'erp5.util'
,
'erp5.util'
,
'requests'
,
'requests'
,
'lxml'
,
],
],
zip_safe
=
True
,
zip_safe
=
True
,
test_suite
=
'test'
,
test_suite
=
'test'
,
...
...
software/matomo/test/test.py
View file @
b3042e57
...
@@ -25,10 +25,14 @@
...
@@ -25,10 +25,14 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
##############################################################################
##############################################################################
import
io
import
os
import
os
import
requests
import
urllib.parse
import
glob
import
glob
import
lxml.etree
import
requests
from
slapos.testing.testcase
import
makeModuleSetUpAndTestCaseClass
from
slapos.testing.testcase
import
makeModuleSetUpAndTestCaseClass
setUpModule
,
SlapOSInstanceTestCase
=
makeModuleSetUpAndTestCaseClass
(
setUpModule
,
SlapOSInstanceTestCase
=
makeModuleSetUpAndTestCaseClass
(
...
@@ -63,5 +67,25 @@ class MatomoTestCase(SlapOSInstanceTestCase):
...
@@ -63,5 +67,25 @@ class MatomoTestCase(SlapOSInstanceTestCase):
resp
=
requests
.
get
(
self
.
connection_parameters
[
'monitor-setup-url'
],
verify
=
False
)
resp
=
requests
.
get
(
self
.
connection_parameters
[
'monitor-setup-url'
],
verify
=
False
)
self
.
assertEqual
(
requests
.
codes
.
ok
,
resp
.
status_code
)
self
.
assertEqual
(
requests
.
codes
.
ok
,
resp
.
status_code
)
def
test_database_setup
(
self
):
# Database setup page is prefilled with mariadb connection parameters
resp
=
requests
.
get
(
urllib
.
parse
.
urljoin
(
self
.
connection_parameters
[
'backend-url'
],
'index.php?module=CoreUpdater&action=databaseSetup'
),
verify
=
False
)
parser
=
lxml
.
etree
.
HTMLParser
()
tree
=
lxml
.
etree
.
parse
(
io
.
StringIO
(
resp
.
text
),
parser
)
self
.
assertEqual
(
tree
.
xpath
(
'//input[@name="username"]/@value'
),
[
'matomo'
])
self
.
assertEqual
(
tree
.
xpath
(
'//input[@name="dbname"]/@value'
),
[
'matomo'
])
self
.
assertTrue
(
tree
.
xpath
(
'//input[@name="password"]/@value'
)[
0
])
self
.
assertEqual
(
tree
.
xpath
(
'//input[@name="host"]/@value'
),
[
f'
{
self
.
_ipv4_address
}
:2099'
]
)
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