Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
phphr
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
phphr
Commits
664210e8
Commit
664210e8
authored
Apr 08, 2026
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update 7 files via Son of Anton
parent
63bd524e
Pipeline
#17
canceled with stage
Changes
7
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
115 additions
and
63 deletions
+115
-63
Dockerfile
Dockerfile
+3
-5
create-superadmin.php
cli/create-superadmin.php
+3
-1
seed.php
cli/seed.php
+3
-1
database.php
config/database.php
+2
-0
000-default.conf
docker/000-default.conf
+15
-1
entrypoint.sh
docker/entrypoint.sh
+80
-54
Connection.php
engine/Database/Connection.php
+9
-1
No files found.
Dockerfile
View file @
664210e8
...
...
@@ -26,7 +26,6 @@ RUN apt-get update && apt-get install -y \
# Apache configuration
RUN
a2enmod rewrite headers
COPY
docker/000-default.conf /etc/apache2/sites-available/000-default.conf
# PHP configuration
RUN
mv
"
$PHP_INI_DIR
/php.ini-production"
"
$PHP_INI_DIR
/php.ini"
...
...
@@ -47,10 +46,9 @@ RUN mkdir -p \
&&
chown
-R
www-data:www-data /var/www/html/storage
\
&&
chmod
-R
775 /var/www/html/storage
# Set Apache document root to public/
ENV
APACHE_DOCUMENT_ROOT=/var/www/html/public
RUN
sed
-ri
-e
's!/var/www/html!/var/www/html/public!g'
/etc/apache2/sites-available/
*
.conf
\
&&
sed
-ri
-e
's!/var/www/!/var/www/html/public!g'
/etc/apache2/apache2.conf /etc/apache2/conf-available/
*
.conf
# ─── Apache: Set DocumentRoot to /var/www/html/public ───
# Do NOT use sed — it causes double-path bugs. Use a clean vhost config instead.
COPY
docker/000-default.conf /etc/apache2/sites-available/000-default.conf
# Entrypoint for DB initialization
COPY
docker/entrypoint.sh /usr/local/bin/entrypoint.sh
...
...
cli/create-superadmin.php
View file @
664210e8
...
...
@@ -8,7 +8,9 @@ $dbConfig = require ROOT_PATH . '/config/database.php';
try
{
$dsn
=
"mysql:host=
{
$dbConfig
[
'host'
]
}
;port=
{
$dbConfig
[
'port'
]
}
;dbname=
{
$dbConfig
[
'database'
]
}
;charset=
{
$dbConfig
[
'charset'
]
}
"
;
$pdo
=
new
PDO
(
$dsn
,
$dbConfig
[
'username'
],
$dbConfig
[
'password'
],
$dbConfig
[
'options'
]);
$options
=
$dbConfig
[
'options'
]
??
[];
$options
[
PDO
::
MYSQL_ATTR_SSL_VERIFY_SERVER_CERT
]
=
false
;
$pdo
=
new
PDO
(
$dsn
,
$dbConfig
[
'username'
],
$dbConfig
[
'password'
],
$options
);
}
catch
(
PDOException
$e
)
{
echo
"DB Connection Failed:
{
$e
->
getMessage
()
}
\n
"
;
exit
(
1
);
...
...
cli/seed.php
View file @
664210e8
...
...
@@ -8,7 +8,9 @@ $dbConfig = require ROOT_PATH . '/config/database.php';
try
{
$dsn
=
"mysql:host=
{
$dbConfig
[
'host'
]
}
;port=
{
$dbConfig
[
'port'
]
}
;dbname=
{
$dbConfig
[
'database'
]
}
;charset=
{
$dbConfig
[
'charset'
]
}
"
;
$pdo
=
new
PDO
(
$dsn
,
$dbConfig
[
'username'
],
$dbConfig
[
'password'
],
$dbConfig
[
'options'
]);
$options
=
$dbConfig
[
'options'
]
??
[];
$options
[
PDO
::
MYSQL_ATTR_SSL_VERIFY_SERVER_CERT
]
=
false
;
$pdo
=
new
PDO
(
$dsn
,
$dbConfig
[
'username'
],
$dbConfig
[
'password'
],
$options
);
}
catch
(
PDOException
$e
)
{
echo
"DB Connection Failed:
{
$e
->
getMessage
()
}
\n
"
;
exit
(
1
);
...
...
config/database.php
View file @
664210e8
...
...
@@ -12,5 +12,7 @@ return [
PDO
::
ATTR_DEFAULT_FETCH_MODE
=>
PDO
::
FETCH_ASSOC
,
PDO
::
ATTR_EMULATE_PREPARES
=>
false
,
PDO
::
ATTR_STRINGIFY_FETCHES
=>
false
,
// Disable SSL verification for internal Docker networking
PDO
::
MYSQL_ATTR_SSL_VERIFY_SERVER_CERT
=>
false
,
],
];
\ No newline at end of file
docker/000-default.conf
View file @
664210e8
<
VirtualHost
*:
80
>
ServerAdmin
webmaster
@
localhost
DocumentRoot
/
var
/
www
/
html
/
public
ServerName
localhost
<
Directory
/
var
/
www
/
html
/
public
>
Options
-
Indexes
+
FollowSymLinks
AllowOverride
All
Require
all
granted
Options
-
Indexes
+
FollowSymLinks
# Route everything through index.php
FallbackResource
/
index
.
php
</
Directory
>
# Deny access to sensitive directories
<
DirectoryMatch
"/var/www/html/(engine|modules|config|database|cli|bootstrap|storage|docker|templates)"
>
Require
all
denied
</
DirectoryMatch
>
# Allow storage/uploads for file serving
<
Directory
/
var
/
www
/
html
/
storage
/
uploads
>
Require
all
granted
</
Directory
>
ErrorLog
${
APACHE_LOG_DIR
}/
error
.
log
...
...
docker/entrypoint.sh
View file @
664210e8
This diff is collapsed.
Click to expand it.
engine/Database/Connection.php
View file @
664210e8
...
...
@@ -25,7 +25,15 @@ final class Connection
$this
->
config
[
'database'
],
$this
->
config
[
'charset'
]
);
$this
->
pdo
=
new
PDO
(
$dsn
,
$this
->
config
[
'username'
],
$this
->
config
[
'password'
],
$this
->
config
[
'options'
]
??
[]);
$options
=
$this
->
config
[
'options'
]
??
[];
// Ensure SSL cert verification is disabled for Docker internal networking
if
(
!
isset
(
$options
[
PDO
::
MYSQL_ATTR_SSL_VERIFY_SERVER_CERT
]))
{
$options
[
PDO
::
MYSQL_ATTR_SSL_VERIFY_SERVER_CERT
]
=
false
;
}
$this
->
pdo
=
new
PDO
(
$dsn
,
$this
->
config
[
'username'
],
$this
->
config
[
'password'
],
$options
);
}
return
$this
->
pdo
;
}
...
...
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