From 2f0b32e25de01881d62eaff0c0894f5a9892e7a0 Mon Sep 17 00:00:00 2001 From: Serge NOEL Date: Mon, 15 Feb 2021 10:21:47 +0100 Subject: [PATCH] Add swarm manifest --- Docker/Samba-Ad-DC/Dockerfile | 6 +- Docker/Samba-Ad-DC/entrypoint.sh | 2 +- Manifest/EasyCloud.yaml | 34 ++++++ README.md | 14 ++- Sources/webAduc/www/composer.lock | 102 ++++++++++-------- Sources/webAduc/www/src/ajax.php | 6 +- Sources/webAduc/www/src/javascript/main.js | 20 +++- .../webAduc/www/src/templates/header.smarty | 6 +- Sources/webAduc/www/src/templates/main.smarty | 5 +- 9 files changed, 131 insertions(+), 64 deletions(-) create mode 100644 Manifest/EasyCloud.yaml diff --git a/Docker/Samba-Ad-DC/Dockerfile b/Docker/Samba-Ad-DC/Dockerfile index 19c511c..bb9bfce 100644 --- a/Docker/Samba-Ad-DC/Dockerfile +++ b/Docker/Samba-Ad-DC/Dockerfile @@ -8,11 +8,7 @@ RUN apk add --no-cache samba-dc \ # Remove default config data, if any && rm -rf /etc/samba \ && rm -rf /var/lib/samba \ - && rm -rf /var/log/samba \ - # Create needed symbolic links - && ln -s /samba/etc /etc/samba \ - && ln -s /samba/lib /var/lib/samba \ - && ln -s /samba/log /var/log/samba + && rm -rf /var/log/samba # Ports EXPOSE 37/udp \ diff --git a/Docker/Samba-Ad-DC/entrypoint.sh b/Docker/Samba-Ad-DC/entrypoint.sh index a8f8631..ae1f2c5 100755 --- a/Docker/Samba-Ad-DC/entrypoint.sh +++ b/Docker/Samba-Ad-DC/entrypoint.sh @@ -78,5 +78,5 @@ then exec /usr/sbin/samba -i fi -# If we get here, the user wants to run their own command. Let them. +# If we get here, the user wants to run their own command. Let them do. exec "$@" diff --git a/Manifest/EasyCloud.yaml b/Manifest/EasyCloud.yaml new file mode 100644 index 0000000..a41a174 --- /dev/null +++ b/Manifest/EasyCloud.yaml @@ -0,0 +1,34 @@ +version: '3' + +services: + + Images: + image: easylinux/nginx:3.11 + volumes: + - /Data/Docker/Apps/Multi-Cloud/Isos:/var/www + deploy: + labels: + - traefik.enable=true + - traefik.docker.network=Backend + - traefik.http.routers.Images.rule=Host(`images.easylinux.lan`) + - traefik.http.services.Images.loadbalancer.server.port=80 + networks: + - extBackend + + WebAduc: + image: easylinux/webaduc + volumes: + - /home/snoel/Documents/Projets/EasyCloud/Sources/webAduc/www:/var/www/html + deploy: + labels: + - traefik.enable=true + - traefik.docker.network=Backend + - traefik.http.routers.WebAduc.rule=Host(`WebAduc.easylinux.lan`) + - traefik.http.services.WebAduc.loadbalancer.server.port=80 + networks: + - extBackend + +networks: + extBackend: + external: + name: Backend diff --git a/README.md b/README.md index e038ff6..d645df4 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,22 @@ ## Introduction +EasyCloud is a cloud manager. This application permit to manage a multi-site multi-tenant datacenter. It's purpose is to gain full control from infrastructure to middleware deployment and management. + +### Opensource + +All + +### Simple + + ## Fonctionnalités * Dhcp * iPxe * AD/Ldap * webAduc -* Stockage des datas dans AD \ No newline at end of file +* Stockage des datas dans AD +* packer +* Terraform +* Ansible \ No newline at end of file diff --git a/Sources/webAduc/www/composer.lock b/Sources/webAduc/www/composer.lock index 6ab9fe7..5b9080c 100644 --- a/Sources/webAduc/www/composer.lock +++ b/Sources/webAduc/www/composer.lock @@ -194,16 +194,16 @@ }, { "name": "illuminate/contracts", - "version": "v8.15.0", + "version": "v8.27.0", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "d9e6a156efb8332dcce427b7d1ccd2706609bfa5" + "reference": "b91459a9a0bd0de204c3cae6859ebd02dbcee6c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/d9e6a156efb8332dcce427b7d1ccd2706609bfa5", - "reference": "d9e6a156efb8332dcce427b7d1ccd2706609bfa5", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/b91459a9a0bd0de204c3cae6859ebd02dbcee6c6", + "reference": "b91459a9a0bd0de204c3cae6859ebd02dbcee6c6", "shasum": "" }, "require": { @@ -234,7 +234,7 @@ ], "description": "The Illuminate Contracts package.", "homepage": "https://laravel.com", - "time": "2020-11-10T15:48:45+00:00" + "time": "2021-01-20T14:18:13+00:00" }, { "name": "psr/container", @@ -382,23 +382,23 @@ }, { "name": "smarty/smarty", - "version": "v3.1.36", + "version": "v3.1.38", "source": { "type": "git", "url": "https://github.com/smarty-php/smarty.git", - "reference": "fd148f7ade295014fff77f89ee3d5b20d9d55451" + "reference": "63b3c0aed0f614880cda21a5c08c606e97b489bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/smarty-php/smarty/zipball/fd148f7ade295014fff77f89ee3d5b20d9d55451", - "reference": "fd148f7ade295014fff77f89ee3d5b20d9d55451", + "url": "https://api.github.com/repos/smarty-php/smarty/zipball/63b3c0aed0f614880cda21a5c08c606e97b489bb", + "reference": "63b3c0aed0f614880cda21a5c08c606e97b489bb", "shasum": "" }, "require": { "php": ">=5.2" }, "require-dev": { - "phpunit/phpunit": "6.4.1", + "phpunit/phpunit": "^7.5 || ^6.5 || ^5.7 || ^4.8", "smarty/smarty-lexer": "^3.1" }, "type": "library", @@ -435,20 +435,20 @@ "keywords": [ "templating" ], - "time": "2020-04-14T14:44:26+00:00" + "time": "2021-01-08T14:05:42+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.20.0", + "version": "v1.22.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "39d483bdf39be819deabf04ec872eb0b2410b531" + "reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531", - "reference": "39d483bdf39be819deabf04ec872eb0b2410b531", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f377a3dd1fde44d37b9831d68dc8dea3ffd28e13", + "reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13", "shasum": "" }, "require": { @@ -460,7 +460,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-main": "1.22-dev" }, "thanks": { "name": "symfony/polyfill", @@ -512,20 +512,20 @@ "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2021-01-07T16:49:33+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.20.0", + "version": "v1.22.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de" + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/e70aa8b064c5b72d3df2abd5ab1e90464ad009de", - "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", "shasum": "" }, "require": { @@ -534,7 +534,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-main": "1.22-dev" }, "thanks": { "name": "symfony/polyfill", @@ -592,20 +592,20 @@ "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2021-01-07T16:49:33+00:00" }, { "name": "symfony/var-dumper", - "version": "v5.1.8", + "version": "v5.2.3", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "4e13f3fcefb1fcaaa5efb5403581406f4e840b9a" + "reference": "72ca213014a92223a5d18651ce79ef441c12b694" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/4e13f3fcefb1fcaaa5efb5403581406f4e840b9a", - "reference": "4e13f3fcefb1fcaaa5efb5403581406f4e840b9a", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/72ca213014a92223a5d18651ce79ef441c12b694", + "reference": "72ca213014a92223a5d18651ce79ef441c12b694", "shasum": "" }, "require": { @@ -621,7 +621,7 @@ "ext-iconv": "*", "symfony/console": "^4.4|^5.0", "symfony/process": "^4.4|^5.0", - "twig/twig": "^2.4|^3.0" + "twig/twig": "^2.13|^3.0.4" }, "suggest": { "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", @@ -657,7 +657,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony mechanism for exploring and dumping PHP variables", + "description": "Provides mechanisms for walking through any arbitrary PHP variable", "homepage": "https://symfony.com", "keywords": [ "debug", @@ -677,24 +677,24 @@ "type": "tidelift" } ], - "time": "2020-10-27T10:11:13+00:00" + "time": "2021-01-27T10:15:41+00:00" }, { "name": "tightenco/collect", - "version": "v8.14.0", + "version": "v8.19.0", "source": { "type": "git", "url": "https://github.com/tighten/collect.git", - "reference": "8f79c602c872afd7c9371e193d6aa4ed13e97661" + "reference": "0c0243a0dc0b66f54d0ec409f36cd9889665b132" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tighten/collect/zipball/8f79c602c872afd7c9371e193d6aa4ed13e97661", - "reference": "8f79c602c872afd7c9371e193d6aa4ed13e97661", + "url": "https://api.github.com/repos/tighten/collect/zipball/0c0243a0dc0b66f54d0ec409f36cd9889665b132", + "reference": "0c0243a0dc0b66f54d0ec409f36cd9889665b132", "shasum": "" }, "require": { - "php": "^7.2", + "php": "^7.2|^8.0", "symfony/var-dumper": "^3.4 || ^4.0 || ^5.0" }, "require-dev": { @@ -727,20 +727,20 @@ "collection", "laravel" ], - "time": "2020-11-16T18:55:11+00:00" + "time": "2020-12-19T00:06:29+00:00" }, { "name": "twbs/bootstrap", - "version": "v4.5.3", + "version": "v4.6.0", "source": { "type": "git", "url": "https://github.com/twbs/bootstrap.git", - "reference": "a716fb03f965dc0846df479e14388b1b4b93d7ce" + "reference": "6ffb0b48e455430f8a5359ed689ad64c1143fac2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twbs/bootstrap/zipball/a716fb03f965dc0846df479e14388b1b4b93d7ce", - "reference": "a716fb03f965dc0846df479e14388b1b4b93d7ce", + "url": "https://api.github.com/repos/twbs/bootstrap/zipball/6ffb0b48e455430f8a5359ed689ad64c1143fac2", + "reference": "6ffb0b48e455430f8a5359ed689ad64c1143fac2", "shasum": "" }, "replace": { @@ -784,20 +784,20 @@ "type": "open_collective" } ], - "time": "2020-10-13T15:38:30+00:00" + "time": "2021-01-19T16:16:38+00:00" }, { "name": "vakata/jstree", - "version": "3.3.10", + "version": "3.3.11", "source": { "type": "git", "url": "https://github.com/vakata/jstree.git", - "reference": "6dce2271757dd0bd4cd0e941bd093c6678e98faf" + "reference": "4a77e59a3f67b0beb1b576cc211cb7e7a76a9879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vakata/jstree/zipball/6dce2271757dd0bd4cd0e941bd093c6678e98faf", - "reference": "6dce2271757dd0bd4cd0e941bd093c6678e98faf", + "url": "https://api.github.com/repos/vakata/jstree/zipball/4a77e59a3f67b0beb1b576cc211cb7e7a76a9879", + "reference": "4a77e59a3f67b0beb1b576cc211cb7e7a76a9879", "shasum": "" }, "require": { @@ -841,7 +841,17 @@ ], "description": "jsTree is jquery plugin, that provides interactive trees.", "homepage": "http://jstree.com", - "time": "2020-06-16T11:17:46+00:00" + "funding": [ + { + "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=paypal@vakata.com¤cy_code=USD&amount=&return=http://jstree.com/donation&item_name=Buy+me+a+coffee+for+jsTree", + "type": "custom" + }, + { + "url": "https://github.com/vakata", + "type": "github" + } + ], + "time": "2020-12-18T20:56:30+00:00" } ], "packages-dev": [], diff --git a/Sources/webAduc/www/src/ajax.php b/Sources/webAduc/www/src/ajax.php index 5aca809..51edabe 100644 --- a/Sources/webAduc/www/src/ajax.php +++ b/Sources/webAduc/www/src/ajax.php @@ -2,5 +2,9 @@ header('Content-Type: application/json; charset=utf-8'); + +error_log(print_r($_GET,true)); + + if( $_GET['id'] == '#') - echo '[{"id":1,"text":"RootDN","children":[{"id":2,"text":"Serveurs","children":true},{"id":3,"text":"Kubernetes"}]}]'; \ No newline at end of file + echo '[{"id":"REM9ZWFzeWxpbnV4LERDPWxhbgo=","text":"DC=easylinux,DC=lan","type":"default","children":[{"id":2,"text":"Serveurs","children":true},{"id":3,"text":"Kubernetes","type":"demo"}]}]'; \ No newline at end of file diff --git a/Sources/webAduc/www/src/javascript/main.js b/Sources/webAduc/www/src/javascript/main.js index 49cf940..345b1cd 100644 --- a/Sources/webAduc/www/src/javascript/main.js +++ b/Sources/webAduc/www/src/javascript/main.js @@ -9,7 +9,7 @@ function Quit() } // Main Page -$(function() { +// $(function() { // $(function() { // $.contextMenu({ @@ -35,8 +35,7 @@ $(function() { // console.log('clicked', this); // }) // }); - - + $(function() { $('#jsTree') .jstree({ 'core' : { @@ -49,6 +48,7 @@ $(function() { }, 'contextmenu' : { 'items' : function(node) { + console.log(node); var tmp = $.jstree.defaults.contextmenu.items(); delete tmp.create.action; tmp.create.label = "Ajouter"; @@ -57,7 +57,8 @@ $(function() { "separator_after" : true, "label" : "Utilisateur", "action" : function (data) { - alert('user'); + console.log(data); + alert('Ajout user'); } }, "create_file" : { @@ -70,6 +71,15 @@ $(function() { return tmp; } }, - 'plugins' : ['contextmenu'] + "types" : { + "default" : { + "icon" : "fas fa-globe-europe" + }, + "demo" : { + "icon" : "glyphicon glyphicon-ok" + } + }, + "plugins" : ["contextmenu","dnd","search"] }); }); + diff --git a/Sources/webAduc/www/src/templates/header.smarty b/Sources/webAduc/www/src/templates/header.smarty index 70887f7..61af07c 100644 --- a/Sources/webAduc/www/src/templates/header.smarty +++ b/Sources/webAduc/www/src/templates/header.smarty @@ -15,8 +15,9 @@ {$Title} - + + @@ -25,4 +26,5 @@ - + + diff --git a/Sources/webAduc/www/src/templates/main.smarty b/Sources/webAduc/www/src/templates/main.smarty index 678c039..c28ac7e 100644 --- a/Sources/webAduc/www/src/templates/main.smarty +++ b/Sources/webAduc/www/src/templates/main.smarty @@ -16,7 +16,6 @@