Skip to content
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

feat(adminer): switch to Adminer Evo, pre-login to database servers #32

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.idea/

**/*.override.yml
.env
30 changes: 19 additions & 11 deletions database/adminer/adminer.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
services:
adminer_php:
restart: unless-stopped
image: lephare/adminerevo
volumes:
- "./database/adminer/index.php:/var/www/adminer/index.php:ro"
- "./database/adminer/plugins:/var/www/adminer/plugins:ro"
networks:
- private

adminer:
restart: always
image: adminer
restart: unless-stopped
image: lephare/apache:2.4
volumes_from:
- adminer_php:ro
labels:
caddy: adminer.${DOCKER_HOST_SUFFIX:-local}
caddy.tls: internal
caddy.reverse_proxy: "{{upstreams 8080}}"
caddy.reverse_proxy: "{{ upstreams }}"
environment:
DOCUMENT_ROOT: /var/www/adminer
PHP_CONTAINER_NAME: adminer_php
networks:
public:
private:
healthcheck:
test: ["CMD", "php", "-r", "@file_get_contents('http://localhost:8080') or exit(1);"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
- public
- private
31 changes: 31 additions & 0 deletions database/adminer/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

function adminer_object()
{
// required to run any plugin
include_once "./plugin.php";

// autoloader
foreach (glob("plugins/*.php") as $filename) {
include_once "./$filename";
}

// enable extra drivers just by including them
//~ include "./plugins/drivers/simpledb.php";

$plugins = array(
// specify enabled plugins here
new LePharePluginPreLoginToDatabases(),
);

/* It is possible to combine customization and plugins:
class AdminerCustomization extends AdminerPlugin {
}
return new AdminerCustomization($plugins);
*/

return new AdminerPlugin($plugins);
}

// include original Adminer or Adminer Editor
include "./adminer.php";
21 changes: 21 additions & 0 deletions database/adminer/plugins/le-phare-pre-login-to-databases.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/** Pre-login to Le Phare database servers */
class LePharePluginPreLoginToDatabases
{
function __construct()
{
set_password('server', 'mysql_5', 'root', 'root');

set_password('server', 'mariadb_10', 'root', 'root');

set_password('pgsql', 'pgsql_9', 'postgres', 'root');
set_password('pgsql', 'pgsql_10', 'postgres', 'root');
set_password('pgsql', 'pgsql_11', 'postgres', 'root');
set_password('pgsql', 'pgsql_12', 'postgres', 'root');
set_password('pgsql', 'pgsql_13', 'postgres', 'root');
set_password('pgsql', 'pgsql_14', 'postgres', 'root');
set_password('pgsql', 'pgsql_15', 'postgres', 'root');
set_password('pgsql', 'pgsql_16', 'postgres', 'root');
}
}
421 changes: 0 additions & 421 deletions database/adminer/theme.css

This file was deleted.

Loading