Skip to content

Commit

Permalink
feat(adminer): switch to Adminer Evo, pre-login to database servers
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmirloup committed Aug 28, 2024
1 parent 4a4126b commit b52ea4e
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 432 deletions.
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
29 changes: 18 additions & 11 deletions database/adminer/adminer.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
services:
adminer_php:
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.

0 comments on commit b52ea4e

Please sign in to comment.