-
Notifications
You must be signed in to change notification settings - Fork 461
Add mutual TLS (mTLS) support for remote database connections in PhpMyAdmin #448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
6214417
feat:(config.inc.php/docker-entrypoint.sh): Add support for mTLS to a…
LordRobinCbz 2ee310d
Merge pull request #1 from LordRobinCbz/develop
LordRobinCbz b78da1f
fix(config.inc.php/docker-entrypoint.sh,dockerfile,helpers.php): Move…
LordRobinCbz a284aff
Merge pull request #2 from LordRobinCbz/develop
LordRobinCbz 088137e
fix(config.inc.php/docker-entrypoint.sh,dockerfile,helpers.php): Move…
LordRobinCbz 0ffaad3
Merge pull request #3 from LordRobinCbz/develop
LordRobinCbz a245719
fix(config.inc.php): import require statements
LordRobinCbz 76f4def
Update apache/helpers.php
LordRobinCbz 92ca977
Update apache/helpers.php
LordRobinCbz 35ad5ea
Update apache/helpers.php
LordRobinCbz 0e85faf
fix(dockerfiles, config.inc.php): Add ENV in Dockerfile, edited templ…
LordRobinCbz b044109
fix(helpers,update.sh): add helpers file to the root and edited updat…
LordRobinCbz 3332557
Fix return type hint and detect base64 decode crashes
williamdes 4ceefa6
Apply the coding standard
williamdes 95bf927
Make the helper function usable for another use
williamdes 5e50958
Add chown to the ssl folder
williamdes 9b2667c
Fixup config and edit the README
williamdes cdbcee1
Also mkdir the folder and chmod it
williamdes 2cf099c
Ignore all pem files
williamdes 518ebc0
mkdir all the path
williamdes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ __pycache__ | |
.pytest_cache | ||
.vscode | ||
.history | ||
.venv | ||
.venv | ||
testing/*.pem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Helper function to decode and save multiple SSL files from base64. | ||
* | ||
* @param string $base64FilesContents The base64 encoded string containing multiple files separated by commas. | ||
* If no commas are present, the entire string is treated as a single file. | ||
* @param string $prefix The prefix to use for the generated file names. | ||
* @param string $extension The file extension to use for the generated files. | ||
* @param string $storageFolder The folder where to store the generated files. | ||
* | ||
* @return string A comma-separated list of paths to the generated files. | ||
*/ | ||
function decodeBase64AndSaveFiles(string $base64FilesContents, string $prefix, string $extension, string $storageFolder): string | ||
{ | ||
// Ensure the output directory exists | ||
if (! is_dir($storageFolder)) { | ||
mkdir($storageFolder, 0755, true); | ||
} | ||
|
||
// Split the base64 string into an array of files | ||
$base64FilesContents = explode(',', trim($base64FilesContents)); | ||
$counter = 1; | ||
$outputFiles = []; | ||
|
||
// Process each file | ||
foreach ($base64FilesContents as $base64FileContent) { | ||
$outputFile = $storageFolder . '/' . $prefix . '-' . $counter . '.' . $extension; | ||
|
||
$fileContent = base64_decode($base64FileContent, true); | ||
if ($fileContent === false) { | ||
echo 'Failed to decode: ' . $base64FileContent; | ||
exit(1); | ||
} | ||
|
||
// Write the decoded file to the output directory | ||
if (file_put_contents($outputFile, $fileContent) === false) { | ||
echo 'Failed to write to ' . $outputFile; | ||
exit(1); | ||
} | ||
|
||
// Add the output file path to the list | ||
$outputFiles[] = $outputFile; | ||
$counter++; | ||
} | ||
|
||
// Return a comma-separated list of the generated file paths | ||
return implode(',', $outputFiles); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.