]> git.nbdom.net Git - nb.git/commitdiff
dbq
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 29 Nov 2016 23:49:15 +0000 (23:49 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 29 Nov 2016 23:49:15 +0000 (23:49 +0000)
12 files changed:
etc/dbq/000-local.php
lib/css/button.css
lib/php/nb.php
share/db/shell.db [deleted file]
src/Docker/nginx/Dockerfile
www/Docker [new symlink]
www/dbq/button.css [deleted symlink]
www/dbq/db.css [deleted symlink]
www/dbq/default.css
www/dbq/docker-compose.yaml [new file with mode: 0644]
www/dbq/etc/nginx/default.conf [new file with mode: 0644]
www/dbq/index.php

index 08e7a43d64003650cc8f4fd1efee99bf69e19f95..d5d6aebd14cf299b045bc0811ec8c21d3950057c 100644 (file)
@@ -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',
   ],
 ];
index e02b8a4457c269a95caa3d0f95fc66e9946e25fa..680a4e476c8531a269a0c2b8d9c79bc459c961e5 100644 (file)
@@ -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;
index 0c275cca43e7500345fcd83fb701a3ba5c6e6b6b..feb76f1c8f18a00ce25bb06e08203791e76b7a18 100644 (file)
@@ -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 (file)
index f8fae83..0000000
Binary files a/share/db/shell.db and /dev/null differ
index d8e3f0cd9f9b72764f75589a370f0514ffc86242..0460608a0045adaa697e3b41fd9ddb64bc0db473 100644 (file)
@@ -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 '<html><head><title>Welcom to Nginx</title></head><body><h1>Welcom to Nginx</h1></body></html>' > $WWW_ROOT/index.html
+
+# Run daemon
 CMD nginx -g 'daemon off;'
diff --git a/www/Docker b/www/Docker
new file mode 120000 (symlink)
index 0000000..c21bfe5
--- /dev/null
@@ -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 (symlink)
index 3657d48..0000000
+++ /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 (symlink)
index d12264f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../lib/css/db.css
\ No newline at end of file
index 553a7a37b6b2a993308b05fa2c95b063552b240f..003f2b4bc8a94dabb21f9a82362eb2598eee5c4a 100644 (file)
@@ -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 (file)
index 0000000..e2f27cd
--- /dev/null
@@ -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 (file)
index 0000000..ac59a71
--- /dev/null
@@ -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;
+    }
+}
index 4f96b8e7cee6e788f7cae1a14317808e5e259525..7ec1f9e8ddf27bb629be2a9c7ee6cccd70a8a749 100644 (file)
@@ -1,3 +1,5 @@
 <?php
+require_once($_SERVER['DOCUMENT_ROOT'].'/../../lib/php/page.php');
+Page::pdef('action','ls');
 require_once($_SERVER['DOCUMENT_ROOT'].'/../../lib/php/db/page.php');
 ?>