From: Nicolas Boisselier Date: Tue, 29 Nov 2016 23:49:15 +0000 (+0000) Subject: dbq X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=af0cb598689457fea2d54709c84df6fa6dbe63a0;p=nb.git dbq --- diff --git a/etc/dbq/000-local.php b/etc/dbq/000-local.php index 08e7a43d..d5d6aebd 100644 --- a/etc/dbq/000-local.php +++ b/etc/dbq/000-local.php @@ -3,16 +3,16 @@ # !!! MANDATORY !!! # if (true or !nb::is_vm()) $DBQ = [ - 'shell' => [ - 'type' => 'sqlite', - 'name' => 'shell', - 'default_table' => 'shell_function', - 'host' => nb::ROOT_DIR.'/share/db/shell.db', - ], +# NB 29.11.16 'shell' => [ +# NB 29.11.16 'type' => 'sqlite', +# NB 29.11.16 'name' => 'shell', +# NB 29.11.16 'default_table' => 'shell_function', +# NB 29.11.16 'host' => nb::ROOT_DIR.'/share/db/shell.db', +# NB 29.11.16 ], 'sys' => [ 'type' => 'sqlite', 'name' => 'sys', - 'default_table' => 'mime', + 'default_table' => 'port', 'host' => nb::ROOT_DIR.'/share/db/sys.db', ], ]; diff --git a/lib/css/button.css b/lib/css/button.css index e02b8a44..680a4e47 100644 --- a/lib/css/button.css +++ b/lib/css/button.css @@ -1,11 +1,14 @@ .button { display: inline-block; text-decoration: none; + /* font-size: 13px; line-height: 26px; height: 28px; - margin: 0; padding: 0 10px 1px; + */ + line-height: 1.5em; + margin: 0; cursor: pointer; border-width: 1px; border-style: solid; diff --git a/lib/php/nb.php b/lib/php/nb.php index 0c275cca..feb76f1c 100644 --- a/lib/php/nb.php +++ b/lib/php/nb.php @@ -6,8 +6,8 @@ if (!defined('NB_EOL')) define('NB_EOL',defined('NB_PROD') ? '' : "\n"); require_once(realpath(dirname(__FILE__).'/functions.php')); #$nb = new NB(); debug($nb->test()); #if (!defined('NB_PARAMS')) define('NB_PARAMS',$_REQUEST); +if (class_exists('NB')) return; -#if (class_exists('NB')) return; class NB { const ROOT_DIR = NB_ROOT; diff --git a/share/db/shell.db b/share/db/shell.db deleted file mode 100644 index f8fae83d..00000000 Binary files a/share/db/shell.db and /dev/null differ diff --git a/src/Docker/nginx/Dockerfile b/src/Docker/nginx/Dockerfile index d8e3f0cd..0460608a 100644 --- a/src/Docker/nginx/Dockerfile +++ b/src/Docker/nginx/Dockerfile @@ -1,7 +1,15 @@ FROM nginx:latest + ARG WWW_ROOT ENV WWW_ROOT=${WWW_ROOT:-/var/www/html} + COPY ./default.conf /etc/nginx/conf.d/default.conf -RUN sed -ie 's,^\([\t ]*root \).*$,\1'$WWW_ROOT';,' /etc/nginx/conf.d/default.conf + +# Set DOCUMENT_ROOT +RUN test "$WWW_ROOT" && sed -ie 's,^\([\t ]*root \).*$,\1'$WWW_ROOT';,' /etc/nginx/conf.d/default.conf + +# Create default index.html RUN mkdir -p $WWW_ROOT && echo 'Welcom to Nginx

Welcom to Nginx

' > $WWW_ROOT/index.html + +# Run daemon CMD nginx -g 'daemon off;' diff --git a/www/Docker b/www/Docker new file mode 120000 index 00000000..c21bfe5d --- /dev/null +++ b/www/Docker @@ -0,0 +1 @@ +../src/Docker \ No newline at end of file diff --git a/www/dbq/button.css b/www/dbq/button.css deleted file mode 120000 index 3657d48f..00000000 --- a/www/dbq/button.css +++ /dev/null @@ -1 +0,0 @@ -../../lib/css/button.css \ No newline at end of file diff --git a/www/dbq/db.css b/www/dbq/db.css deleted file mode 120000 index d12264f1..00000000 --- a/www/dbq/db.css +++ /dev/null @@ -1 +0,0 @@ -../../lib/css/db.css \ No newline at end of file diff --git a/www/dbq/default.css b/www/dbq/default.css index 553a7a37..003f2b4b 100644 --- a/www/dbq/default.css +++ b/www/dbq/default.css @@ -11,6 +11,10 @@ body { background-color: #E6E6E6; } +h1 { + margin: 0 0 0.2em 0; +} + a, body { color: #333333; @@ -30,56 +34,49 @@ a, a:visited { text-decoration: none; } -.button { - color: #ddd; - background-color: #3C3C3B; -} - table { border-collapse: collapse; } td, th { padding: 0.2em 0.7em; } th { font-size: 0.8em; } textarea, +select, input:not([type]), -input[type=''], -input[type='text'] { +input[type='text'] +input[type='password'] +input[type='date'] +input[type='email'] +input[type='url'] +input[type=''], { box-shadow: 0 0 5px 0 #eee; border-radius: 4px; border: solid 1px #eee; - padding: 0.4em; - margin-right: 0.3em; } -form label:after { - content: ': '; -} +form label:after { content: ':'; } form label, form input, form select { vertical-align: middle; + margin: 0.2em 0.4em 0.2em 0; } table.rows, div.rows, .menu, -object, iframe, pre, .t2d tr +object, iframe, pre { border-collapse: separate; border-spacing: 0; - padding: 0.5em 0.2em; border-radius: 4px; - border: solid 1px #fff; - margin-bottom: 0.5em; -} + padding: 0.5em 0.2em; + margin-bottom: 0.5em; -table.rows th, table.rows td, -table.border th, table.border td { - border-bottom: solid 1px #fff; } +table.rows th, table.rows td, table.border th, table.border td { border-bottom: solid 1px #fff; } table.rows tr:last-child td, table.border tr:last-child td { border-bottom: none; } .menu, .nav, .rows, @@ -89,3 +86,33 @@ table.rows tr:last-child td, table.border tr:last-child td { border-bottom: none display: table; } +.menu { padding: 0.5em; } + +.button { + display: inline-block; + text-decoration: none; + line-height: 1.5em; + margin: 0; + cursor: pointer; + border-width: 1px; + border-style: solid; + white-space: nowrap; + box-sizing: border-box; + color: #ddd; + background-color: #3C3C3B; + border-color: #3C3C3B; + border-radius: 4px; +} + +a:hover, +.button:hover { + opacity: 0.8; +} + +/* +form a.button:visited, form a.button { + display: inline-block; + position: relative; + top: -1px; +} +*/ diff --git a/www/dbq/docker-compose.yaml b/www/dbq/docker-compose.yaml new file mode 100644 index 00000000..e2f27cdb --- /dev/null +++ b/www/dbq/docker-compose.yaml @@ -0,0 +1,34 @@ +version: '2' +services: + php: + #image: php:7.0-fpm-alpine + build: ../Docker/php/ + expose: + - 9000 + environment: + NB_ROOT: /opt/nb + volumes: + - ./../..:$NB_ROOT + - ./:/var/www/html + - php + #- ./../../lib/php/db:/var/www/html + command: "echo . $NB_ROOT/etc/profile > /etc/profile.d/nb.sh" + +# NB 29.11.16 php: +# NB 29.11.16 build: ../Docker/php/ +# NB 29.11.16 expose: +# NB 29.11.16 - 9000 +# NB 29.11.16 volumes_from: +# NB 29.11.16 - code + + nginx: + build: + context: ../Docker/nginx/ + args: + - WWW_ROOT=$NB_ROOT/www/dbq + volumes_from: + - php + links: + - php + ports: + - "8080:80" diff --git a/www/dbq/etc/nginx/default.conf b/www/dbq/etc/nginx/default.conf new file mode 100644 index 00000000..ac59a71a --- /dev/null +++ b/www/dbq/etc/nginx/default.conf @@ -0,0 +1,38 @@ +server { + listen 80 default_server; + root /var/www/html; + index index.html index.php; + + charset utf-8; + + location / { + try_files $uri $uri/ /index.php?$query_string; + } + + location = /favicon.ico { access_log off; log_not_found off; } + location = /robots.txt { access_log off; log_not_found off; } + + #access_log off; + #error_log /var/log/nginx/error.log error; + + error_log /dev/stderr error; + access_log /dev/stdout main; + sendfile off; + + client_max_body_size 100m; + + location ~ \.php$ { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass php:9000; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_intercept_errors off; + fastcgi_buffer_size 16k; + fastcgi_buffers 4 16k; + } + + location ~ /\.ht { + deny all; + } +} diff --git a/www/dbq/index.php b/www/dbq/index.php index 4f96b8e7..7ec1f9e8 100644 --- a/www/dbq/index.php +++ b/www/dbq/index.php @@ -1,3 +1,5 @@