This commit is contained in:
afornerot 2019-07-16 12:10:32 +02:00
parent daa2907b8d
commit c5729f13c0
23 changed files with 1406 additions and 71 deletions

View File

@ -12,7 +12,14 @@
<file filelist="ninegate" name="/var/www/html/ninegate/scripts/ninegate-postservice-00.sh" source="ninegate-postservice-00.sh" rm="True" mode="700" />
<file filelist="ninegate" name="/var/www/html/ninegate/src/Cadoles/CoreBundle/Command/data/core-init-01.sql" source="ninegate-init-01.sql" rm="True"/>
<file filelist='ninegate' name='/etc/cron.d/ninegate' source='ninegate.cron' rm='True'/>
<file filelist='ninegate' name='/etc/nginx/conf.d/ninegate.conf' source='ninegate.nginx.conf' rm='True'/>
<service method='apache' servicelist='ninegate'>ninegate</service>
<service_access service='ninegate'>
<port>5555</port>
</service_access>
</container>
</containers>

View File

@ -28,14 +28,18 @@ class AppKernel extends Kernel
new LightSaml\SymfonyBridgeBundle\LightSamlSymfonyBridgeBundle(),
new LightSaml\SpBundle\LightSamlSpBundle(),
new Debril\RssAtomBundle\DebrilRssAtomBundle(),
new Gos\Bundle\WebSocketBundle\GosWebSocketBundle(),
new Gos\Bundle\PubSubRouterBundle\GosPubSubRouterBundle(),
new AppBundle\AppBundle(),
new Cadoles\SAMLBundle\CadolesSAMLBundle(),
new Cadoles\CASBundle\CadolesCASBundle(),
new Cadoles\CoreBundle\CadolesCoreBundle(),
new Cadoles\CronBundle\CadolesCronBundle(),
new Cadoles\PortalBundle\CadolesPortalBundle()
new Cadoles\PortalBundle\CadolesPortalBundle(),
new Cadoles\PortalBundle\CadolesWebsocketBundle(),
];
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {

View File

@ -5,6 +5,7 @@ imports:
- { resource: services.yml }
- { resource: "@CadolesCoreBundle/Resources/config/services.yml" }
- { resource: "@CadolesPortalBundle/Resources/config/services.yml" }
- { resource: "@CadolesWebsocketBundle/Resources/config/services.yml" }
- { resource: twig.yml }
# Put parameters here that don't need to change on each machine where the app is deployed
@ -125,6 +126,19 @@ light_saml_symfony_bridge:
idp:
files: '%saml_idps_list%'
# websocket configuration
gos_web_socket:
client:
session_handler: session.handler.native_file
firewall: main
shared_config: true
server:
port: %websocket_port% #The port the socket server will listen on
host: %weburl% #The host ip to bind to
router:
resources:
- "@CadolesWebsocketBundle/Resources/config/topic.yml"
# ckeditor configuration
ivory_ck_editor:
base_path: "ckeditor"

View File

@ -10,6 +10,10 @@ portal:
resource: "@CadolesPortalBundle/Resources/config/routing.yml"
prefix: /
websocket:
resource: "@CadolesWebsocketBundle/Resources/config/routing.yml"
prefix: /
lightsaml_sp:
resource: "@LightSamlSpBundle/Resources/config/routing.yml"
prefix: saml

View File

@ -13,7 +13,6 @@ twig:
activate_widsonde: %activate_widsonde%
widsonde_url: %widsonde_url%
eportail_sync: %eportail_sync%
moderegistration: %moderegistration%
labelniveau01: %labelniveau01%
labelsniveau01: %labelsniveau01%

View File

@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "8ad66c1cc79500add7118e829f63f6a9",
"content-hash": "15efa0e4514b73fe595c60779f3eec40",
"hash": "f60fc0c21429506c604cf52a1c57f8b1",
"content-hash": "ad29a4c36418b2be7c6f60297d160623",
"packages": [
{
"name": "composer/ca-bundle",
@ -1328,6 +1328,54 @@
],
"time": "2017-02-27 20:18:54"
},
{
"name": "evenement/evenement",
"version": "v2.1.0",
"source": {
"type": "git",
"url": "https://github.com/igorw/evenement.git",
"reference": "6ba9a777870ab49f417e703229d53931ed40fd7a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/igorw/evenement/zipball/6ba9a777870ab49f417e703229d53931ed40fd7a",
"reference": "6ba9a777870ab49f417e703229d53931ed40fd7a",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0||^5.7||^4.8.35"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"autoload": {
"psr-0": {
"Evenement": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Igor Wiedler",
"email": "igor@wiedler.ch"
}
],
"description": "Événement is a very simple event dispatching library for PHP",
"keywords": [
"event-dispatcher",
"event-emitter"
],
"time": "2017-07-17 17:39:19"
},
{
"name": "fig/link-util",
"version": "1.0.0",
@ -1382,6 +1430,333 @@
],
"time": "2016-10-17 18:31:11"
},
{
"name": "gos/pnctl-event-loop-emitter",
"version": "v0.1.7",
"source": {
"type": "git",
"url": "https://github.com/GeniusesOfSymfony/PNCTLEventLoopEmitter.git",
"reference": "93bb0f0e60e4e1f4025f77c8a4fd9ae0c3b45fb3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/GeniusesOfSymfony/PNCTLEventLoopEmitter/zipball/93bb0f0e60e4e1f4025f77c8a4fd9ae0c3b45fb3",
"reference": "93bb0f0e60e4e1f4025f77c8a4fd9ae0c3b45fb3",
"shasum": ""
},
"require": {
"evenement/evenement": "~2.0|~3.0",
"php": ">=5.4",
"react/event-loop": "~0.4.0|^0.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Gos\\Component\\PnctlEventLoopEmitter\\": "src/"
},
"files": [
"src/functions.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Johann Saunier",
"email": "johann_27@hotmail.fr"
}
],
"description": "Pnctl event emitter for event loop",
"homepage": "https://github.com/GeniusesOfSymfony/PnctlEventLoopEmitter",
"keywords": [
"Pnctl",
"event loop",
"reactphp"
],
"time": "2018-04-09 11:12:07"
},
{
"name": "gos/pubsub-router-bundle",
"version": "v0.3.5",
"source": {
"type": "git",
"url": "https://github.com/GeniusesOfSymfony/PubSubRouterBundle.git",
"reference": "a3f9666455dc42f38a7ce31ca2fc55bd27421ea0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/GeniusesOfSymfony/PubSubRouterBundle/zipball/a3f9666455dc42f38a7ce31ca2fc55bd27421ea0",
"reference": "a3f9666455dc42f38a7ce31ca2fc55bd27421ea0",
"shasum": ""
},
"require": {
"doctrine/cache": "~1.4",
"php": ">=5.5",
"symfony/console": "~3.4|~4.0",
"symfony/framework-bundle": "~3.4|~4.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "0.3.x-dev"
}
},
"autoload": {
"psr-4": {
"Gos\\Bundle\\PubSubRouterBundle\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Johann Saunier",
"email": "johann_27@hotmail.fr"
}
],
"description": "Symfony PubSub Router Bundle",
"homepage": "https://github.com/GeniusesOfSymfony/PubSubRouterBundle",
"keywords": [
"PubSub Bundle",
"WAMP",
"bundle",
"pubsub",
"redis",
"zmq"
],
"time": "2018-10-04 17:09:23"
},
{
"name": "gos/ratchet",
"version": "v0.3.6",
"source": {
"type": "git",
"url": "https://github.com/GeniusesOfSymfony/Ratchet.git",
"reference": "f72ee4f70f24da1fc232537088e6c368ae4211e0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/GeniusesOfSymfony/Ratchet/zipball/f72ee4f70f24da1fc232537088e6c368ae4211e0",
"reference": "f72ee4f70f24da1fc232537088e6c368ae4211e0",
"shasum": ""
},
"require": {
"guzzle/http": "^3.6",
"php": ">=5.3.9",
"react/socket": "^0.3 || ^0.4",
"symfony/http-foundation": "^2.2|^3.0|^4.0",
"symfony/routing": "^2.2|^3.0|^4.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Ratchet\\": "src/Ratchet"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Chris Boden",
"email": "cboden@gmail.com",
"role": "Developer"
}
],
"description": "PHP WebSocket library",
"homepage": "http://socketo.me",
"keywords": [
"Ratchet",
"WebSockets",
"server",
"sockets"
],
"time": "2017-12-12 16:15:11"
},
{
"name": "gos/ratchet-stack",
"version": "v0.2.0",
"source": {
"type": "git",
"url": "https://github.com/GeniusesOfSymfony/RatchetStack.git",
"reference": "a7dfc817bf8b786c575022e290ab0769dbf09814"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/GeniusesOfSymfony/RatchetStack/zipball/a7dfc817bf8b786c575022e290ab0769dbf09814",
"reference": "a7dfc817bf8b786c575022e290ab0769dbf09814",
"shasum": ""
},
"require": {
"cboden/ratchet": "^0.3|^0.4",
"php": ">=5.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Gos\\Component\\RatchetStack\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Johann Saunier",
"email": "johann_27@hotmail.fr"
}
],
"description": "Ratchet Stack",
"homepage": "https://github.com/GeniusesOfSymfony/RatchetStack",
"keywords": [
"Ratchet",
"application",
"stack"
],
"time": "2018-05-02 13:03:51"
},
{
"name": "gos/web-socket-bundle",
"version": "v1.8.11",
"source": {
"type": "git",
"url": "https://github.com/GeniusesOfSymfony/WebSocketBundle.git",
"reference": "a26b71e9014a73b95ddbb02a813157563a296a48"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/GeniusesOfSymfony/WebSocketBundle/zipball/a26b71e9014a73b95ddbb02a813157563a296a48",
"reference": "a26b71e9014a73b95ddbb02a813157563a296a48",
"shasum": ""
},
"require": {
"gos/pnctl-event-loop-emitter": "~0.1",
"gos/pubsub-router-bundle": "~0.2",
"gos/ratchet": "~0.3.5",
"gos/ratchet-stack": "~0.1",
"gos/websocket-client": "~0.1.0",
"php": ">=5.4",
"symfony/framework-bundle": "~2.3|~3.0"
},
"replace": {
"cboden/ratchet": "~0.3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8"
},
"suggest": {
"ext-amqp": "*",
"ext-libev": "*",
"ext-libevent": ">=0.0.5",
"ext-zmq": "*",
"ocramius/proxy-manager": "~1.0",
"symfony/proxy-manager-bridge": "~2.3"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "1.8.x-dev"
}
},
"autoload": {
"psr-4": {
"Gos\\Bundle\\WebSocketBundle\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jeremy Dare",
"email": "jeremy.d.dare@gmail.com"
},
{
"name": "Johann Saunier",
"email": "johann_27@hotmail.fr"
}
],
"description": "Symfony Web Socket Bundle",
"homepage": "https://github.com/GeniusesOfSymfony/WebSocketBundle",
"keywords": [
"Ratchet",
"WAMP",
"Web Socket Bundle",
"io",
"websocket"
],
"time": "2017-09-29 16:00:43"
},
{
"name": "gos/websocket-client",
"version": "v0.1.2",
"source": {
"type": "git",
"url": "https://github.com/GeniusesOfSymfony/WebSocketPhpClient.git",
"reference": "13bb38cb01acee648fea1a6ca4ad3dc6148da7fe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/GeniusesOfSymfony/WebSocketPhpClient/zipball/13bb38cb01acee648fea1a6ca4ad3dc6148da7fe",
"reference": "13bb38cb01acee648fea1a6ca4ad3dc6148da7fe",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "0.1.x-dev"
}
},
"autoload": {
"psr-4": {
"Gos\\Component\\WebSocketClient\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Johann Saunier",
"email": "johann_27@hotmail.fr"
},
{
"name": "Martin Bažík",
"email": "martin@bazo.sk"
}
],
"description": "WAMP client in PHP",
"keywords": [
"Ratchet",
"WAMP",
"websocket"
],
"time": "2015-08-04 11:43:11"
},
{
"name": "gregwar/captcha",
"version": "v1.1.7",
@ -1489,6 +1864,208 @@
],
"time": "2018-11-20 10:41:34"
},
{
"name": "guzzle/common",
"version": "v3.9.2",
"target-dir": "Guzzle/Common",
"source": {
"type": "git",
"url": "https://github.com/Guzzle3/common.git",
"reference": "2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Guzzle3/common/zipball/2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc",
"reference": "2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc",
"shasum": ""
},
"require": {
"php": ">=5.3.2",
"symfony/event-dispatcher": ">=2.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.7-dev"
}
},
"autoload": {
"psr-0": {
"Guzzle\\Common": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Common libraries used by Guzzle",
"homepage": "http://guzzlephp.org/",
"keywords": [
"collection",
"common",
"event",
"exception"
],
"abandoned": "guzzle/guzzle",
"time": "2014-08-11 04:32:36"
},
{
"name": "guzzle/http",
"version": "v3.9.2",
"target-dir": "Guzzle/Http",
"source": {
"type": "git",
"url": "https://github.com/Guzzle3/http.git",
"reference": "1e8dd1e2ba9dc42332396f39fbfab950b2301dc5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Guzzle3/http/zipball/1e8dd1e2ba9dc42332396f39fbfab950b2301dc5",
"reference": "1e8dd1e2ba9dc42332396f39fbfab950b2301dc5",
"shasum": ""
},
"require": {
"guzzle/common": "self.version",
"guzzle/parser": "self.version",
"guzzle/stream": "self.version",
"php": ">=5.3.2"
},
"suggest": {
"ext-curl": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.7-dev"
}
},
"autoload": {
"psr-0": {
"Guzzle\\Http": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "HTTP libraries used by Guzzle",
"homepage": "http://guzzlephp.org/",
"keywords": [
"Guzzle",
"client",
"curl",
"http",
"http client"
],
"abandoned": "guzzle/guzzle",
"time": "2014-08-11 04:32:36"
},
{
"name": "guzzle/parser",
"version": "v3.9.2",
"target-dir": "Guzzle/Parser",
"source": {
"type": "git",
"url": "https://github.com/Guzzle3/parser.git",
"reference": "6874d171318a8e93eb6d224cf85e4678490b625c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Guzzle3/parser/zipball/6874d171318a8e93eb6d224cf85e4678490b625c",
"reference": "6874d171318a8e93eb6d224cf85e4678490b625c",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.7-dev"
}
},
"autoload": {
"psr-0": {
"Guzzle\\Parser": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Interchangeable parsers used by Guzzle",
"homepage": "http://guzzlephp.org/",
"keywords": [
"URI Template",
"cookie",
"http",
"message",
"url"
],
"abandoned": "guzzle/guzzle",
"time": "2014-02-05 18:29:46"
},
{
"name": "guzzle/stream",
"version": "v3.9.2",
"target-dir": "Guzzle/Stream",
"source": {
"type": "git",
"url": "https://github.com/Guzzle3/stream.git",
"reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Guzzle3/stream/zipball/60c7fed02e98d2c518dae8f97874c8f4622100f0",
"reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0",
"shasum": ""
},
"require": {
"guzzle/common": "self.version",
"php": ">=5.3.2"
},
"suggest": {
"guzzle/http": "To convert Guzzle request objects to PHP streams"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.7-dev"
}
},
"autoload": {
"psr-0": {
"Guzzle\\Stream": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "Guzzle stream wrapper component",
"homepage": "http://guzzlephp.org/",
"keywords": [
"Guzzle",
"component",
"stream"
],
"abandoned": "guzzle/guzzle",
"time": "2014-05-01 21:36:02"
},
{
"name": "guzzlehttp/guzzle",
"version": "6.3.3",
@ -2798,6 +3375,180 @@
],
"time": "2018-07-19 23:38:55"
},
{
"name": "react/event-loop",
"version": "v0.4.3",
"source": {
"type": "git",
"url": "https://github.com/reactphp/event-loop.git",
"reference": "8bde03488ee897dc6bb3d91e4e17c353f9c5252f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/reactphp/event-loop/zipball/8bde03488ee897dc6bb3d91e4e17c353f9c5252f",
"reference": "8bde03488ee897dc6bb3d91e4e17c353f9c5252f",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "~4.8"
},
"suggest": {
"ext-event": "~1.0",
"ext-libev": "*",
"ext-libevent": ">=0.1.0"
},
"type": "library",
"autoload": {
"psr-4": {
"React\\EventLoop\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Event loop abstraction layer that libraries can use for evented I/O.",
"keywords": [
"asynchronous",
"event-loop"
],
"time": "2017-04-27 10:56:23"
},
{
"name": "react/promise",
"version": "v2.7.1",
"source": {
"type": "git",
"url": "https://github.com/reactphp/promise.git",
"reference": "31ffa96f8d2ed0341a57848cbb84d88b89dd664d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/reactphp/promise/zipball/31ffa96f8d2ed0341a57848cbb84d88b89dd664d",
"reference": "31ffa96f8d2ed0341a57848cbb84d88b89dd664d",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "~4.8"
},
"type": "library",
"autoload": {
"psr-4": {
"React\\Promise\\": "src/"
},
"files": [
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jan Sorgalla",
"email": "jsorgalla@gmail.com"
}
],
"description": "A lightweight implementation of CommonJS Promises/A for PHP",
"keywords": [
"promise",
"promises"
],
"time": "2019-01-07 21:25:54"
},
{
"name": "react/socket",
"version": "v0.4.6",
"source": {
"type": "git",
"url": "https://github.com/reactphp/socket.git",
"reference": "cf074e53c974df52388ebd09710a9018894745d2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/reactphp/socket/zipball/cf074e53c974df52388ebd09710a9018894745d2",
"reference": "cf074e53c974df52388ebd09710a9018894745d2",
"shasum": ""
},
"require": {
"evenement/evenement": "~2.0|~1.0",
"php": ">=5.3.0",
"react/event-loop": "0.4.*|0.3.*",
"react/promise": "^2.0 || ^1.1",
"react/stream": "^0.4.5"
},
"require-dev": {
"clue/block-react": "^1.1",
"phpunit/phpunit": "~4.8",
"react/socket-client": "^0.5.1"
},
"type": "library",
"autoload": {
"psr-4": {
"React\\Socket\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Async, streaming plaintext TCP/IP and secure TLS socket server for React PHP",
"keywords": [
"Socket"
],
"time": "2017-01-26 09:23:38"
},
{
"name": "react/stream",
"version": "v0.4.6",
"source": {
"type": "git",
"url": "https://github.com/reactphp/stream.git",
"reference": "44dc7f51ea48624110136b535b9ba44fd7d0c1ee"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/reactphp/stream/zipball/44dc7f51ea48624110136b535b9ba44fd7d0c1ee",
"reference": "44dc7f51ea48624110136b535b9ba44fd7d0c1ee",
"shasum": ""
},
"require": {
"evenement/evenement": "^2.0|^1.0",
"php": ">=5.3.8"
},
"require-dev": {
"clue/stream-filter": "~1.2",
"react/event-loop": "^0.4|^0.3",
"react/promise": "^2.0|^1.0"
},
"suggest": {
"react/event-loop": "^0.4",
"react/promise": "^2.0"
},
"type": "library",
"autoload": {
"psr-4": {
"React\\Stream\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Basic readable and writable stream interfaces that support piping.",
"keywords": [
"pipe",
"stream"
],
"time": "2017-01-25 14:44:14"
},
{
"name": "robrichards/xmlseclibs",
"version": "3.0.3",

View File

@ -7,6 +7,7 @@ iconniveau01=$(CreoleGet ninegate_niveau01icon non)
affniveau02=$(CreoleGet ninegate_niveau02view non)
labelsniveau02=$(CreoleGet ninegate_niveau02labels non)
iconniveau02=$(CreoleGet ninegate_niveau02icon non)
weburl=$(CreoleGet web_url non)
www_dir="$container_path_web/var/www/html"
eportail_dir="$www_dir/eportail"
@ -48,26 +49,13 @@ fi
# Permissions
./perm.sh www-data
# Paramétrage eportail
if [[ "$ninegate_synceportail" = 'oui' ]]
then
echo "<?" > $eportail_dir/local/config/externe.php
echo "\$config['modeUserExterne'] = 'true';" >> $eportail_dir/local/config/externe.php
echo "\$config['affResgistrationExterne'] = '$moderegistration';" >> $eportail_dir/local/config/externe.php
echo "\$config['urlRegistrationExterne'] = '/ninegate/registration';" >> $eportail_dir/local/config/externe.php
echo "\$config['urlConfigRegistrationExterne'] = '/ninegate/config/registration';" >> $eportail_dir/local/config/externe.php
echo "\$config['urlWhitelistExterne'] = '/ninegate/config/whitelist';" >> $eportail_dir/local/config/externe.php
echo "\$config['urlNiveau01Externe'] = '/ninegate/config/niveau01';" >> $eportail_dir/local/config/externe.php
echo "\$config['labNiveau01Externe'] = '$labelsniveau01';" >> $eportail_dir/local/config/externe.php
echo "\$config['icoNiveau01Externe'] = '$iconniveau01';" >> $eportail_dir/local/config/externe.php
echo "\$config['affNiveau02Externe'] = '$affniveau02';" >> $eportail_dir/local/config/externe.php
echo "\$config['urlNiveau02Externe'] = '/ninegate/config/niveau02';" >> $eportail_dir/local/config/externe.php
echo "\$config['labNiveau02Externe'] = '$labelsniveau02';" >> $eportail_dir/local/config/externe.php
echo "\$config['icoNiveau02Externe'] = '$iconniveau02';" >> $eportail_dir/local/config/externe.php
echo "\$config['urlGroupeExterne'] = '/ninegate/config/group';" >> $eportail_dir/local/config/externe.php
echo "\$config['urlProfilExterne'] = '/ninegate/profil';" >> $eportail_dir/local/config/externe.php
echo "\$config['urlAnnuaireExterne'] = '/ninegate/profil/users';" >> $eportail_dir/local/config/externe.php
echo "\$config['urlUserExterne'] = '/ninegate/config/user';" >> $eportail_dir/local/config/externe.php
echo "\$config['urlLogoutExterne'] = '/ninegate/kill?redirect=/eportail/logout.php';" >> $eportail_dir/local/config/externe.php
echo "?>" >> $eportail_dir/local/config/externe.php
fi
# Server Websocket
echo ""
echo WEBSOCKET = STOP
pid="$(pgrep -f gos:websocket)"
if [ -n "${pid}" ]; then
kill -9 ${pid};
fi
echo WEBSOCKET = START
bin/console gos:websocket:server --port 5556 -a $web_url --no-debug -n -q --env=prod & disown

View File

@ -8,7 +8,7 @@ INSERT IGNORE INTO `niveau01` (`id`, `label`, `siren`) VALUES
(-100, 'DRAAF', '130007107');
INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES
(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}HNhgaEb5yI9ZX4o5Ydrf1+D/YeNPLIdF
(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}TkQTsvHn9GzwqtA6jPZ/ubyfp+ZwNbmH
', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple');

View File

@ -148,6 +148,15 @@ class Group
*/
protected $blogs;
/**
* @var ArrayCollection $message
* @var Message
*
* @ORM\OneToMany(targetEntity="Cadoles\WebsocketBundle\Entity\Message", mappedBy="user", cascade={"persist"}, orphanRemoval=true)
*/
protected $messages;
// ATTENTION NE SURTOUT PAS REGEN TOTALEMENT LES SETTER
// Methode custom sur les Addxxx et Removexxx
@ -821,4 +830,38 @@ class Group
{
return $this->pagetemplate;
}
/**
* Add message
*
* @param \Cadoles\WebsocketBundle\Entity\Message $message
*
* @return Group
*/
public function addMessage(\Cadoles\WebsocketBundle\Entity\Message $message)
{
$this->messages[] = $message;
return $this;
}
/**
* Remove message
*
* @param \Cadoles\WebsocketBundle\Entity\Message $message
*/
public function removeMessage(\Cadoles\WebsocketBundle\Entity\Message $message)
{
$this->messages->removeElement($message);
}
/**
* Get messages
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getMessages()
{
return $this->messages;
}
}

View File

@ -222,7 +222,7 @@ class User implements UserInterface, \Serializable
/**
* @ORM\ManyToMany(targetEntity="Cadoles\PortalBundle\Entity\Notice", mappedBy="users")
*/
protected $notices;
private $notices;
/**
* @var ArrayCollection $blog
@ -235,7 +235,7 @@ class User implements UserInterface, \Serializable
/**
* @ORM\ManyToMany(targetEntity="Cadoles\PortalBundle\Entity\Blog", mappedBy="writers")
*/
protected $blogwriters;
private $blogwriters;
/**
* @var ArrayCollection $blogarticle
@ -253,6 +253,15 @@ class User implements UserInterface, \Serializable
*/
private $icons;
/**
* @var ArrayCollection $message
* @var Message
*
* @ORM\OneToMany(targetEntity="Cadoles\WebsocketBundle\Entity\Message", mappedBy="user", cascade={"persist"}, orphanRemoval=true)
*/
private $messages;
//== CODE A NE PAS REGENERER
/**
* @ORM\PostLoad
@ -1339,4 +1348,38 @@ class User implements UserInterface, \Serializable
{
return $this->ownergroups;
}
/**
* Add message
*
* @param \Cadoles\WebsocketBundle\Entity\Message $message
*
* @return User
*/
public function addMessage(\Cadoles\WebsocketBundle\Entity\Message $message)
{
$this->messages[] = $message;
return $this;
}
/**
* Remove message
*
* @param \Cadoles\WebsocketBundle\Entity\Message $message
*/
public function removeMessage(\Cadoles\WebsocketBundle\Entity\Message $message)
{
$this->messages->removeElement($message);
}
/**
* Get messages
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getMessages()
{
return $this->messages;
}
}

View File

@ -149,6 +149,10 @@
{{ include('@CadolesCore/Include/footer.html.twig') }}
{% block localexternalscript %}
{% endblock %}
<script>
{% block localjavascript %}

View File

@ -28,7 +28,7 @@
<div class="widgetheader" style="{{ stylewidgetbodyimage }}; height:100%;">
{% set style = "width: 90px;display: block;margin: 0px auto 10px auto; padding-top: 10px; position: inherit;height: auto;" %}
{% set style = "width: 90px;display: block;margin: auto; padding: 10px 0px 10px 0px; position: inherit;height: auto;" %}
{% if icon %}
<img src="/{{ alias }}{{ icon }}" class="logo" style="{{ style }}" />
{% else %}

View File

@ -0,0 +1,9 @@
<?php
namespace Cadoles\WebsocketBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class CadolesWebsocketBundle extends Bundle
{
}

View File

@ -0,0 +1,49 @@
<?php
namespace Cadoles\WebsocketBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Form\FormError;
use Ramsey\Uuid\Uuid;
class ChatController extends Controller
{
public function clientAction($id, Request $request)
{
$user=$this->getUser();
if(!$user) {
die();
}
else {
// Génération d'une clé temporaire d'accès au chat
$key = Uuid::uuid4();
$user->setKeyvalue($key);
// Sauvegarde
$em = $this->getDoctrine()->getManager();
$em->persist($user);
$em->flush();
// On récupère les 100 derniers message du groupe
$group=$user=$em->getRepository("CadolesCoreBundle:Group")->find($id);
if(!$group) die();
$messages=$em->getRepository("CadolesWebsocketBundle:Message")->findBy(["group"=>$group],["submitdate"=>"DESC"]);
dump($messages);
// Affichage du chat
return $this->render('CadolesWebsocketBundle:Chat:client.html.twig',[
'useheader' => false,
'usemenu' => false,
'usesidebar' => false,
'userkey' => $key,
'groupid' => $id,
'messages' => $messages
]);
}
}
}

View File

@ -0,0 +1,158 @@
<?php
namespace Cadoles\WebsocketBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="message")
*/
class Message
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="text")
*/
private $topic;
/**
* @ORM\Column(type="datetime")
*/
private $submitdate;
/**
* @ORM\ManyToOne(targetEntity="Cadoles\CoreBundle\Entity\User", inversedBy="messages")
*/
private $user;
/**
* @ORM\ManyToOne(targetEntity="Cadoles\CoreBundle\Entity\group", inversedBy="messages")
*/
private $group;
/**
* Constructor
*/
public function __construct()
{
$this->submitdate = new \DateTime();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set topic
*
* @param string $topic
*
* @return Message
*/
public function setTopic($topic)
{
$this->topic = $topic;
return $this;
}
/**
* Get topic
*
* @return string
*/
public function getTopic()
{
return $this->topic;
}
/**
* Set submitdate
*
* @param \DateTime $submitdate
*
* @return Message
*/
public function setSubmitdate($submitdate)
{
$this->submitdate = $submitdate;
return $this;
}
/**
* Get submitdate
*
* @return \DateTime
*/
public function getSubmitdate()
{
return $this->submitdate;
}
/**
* Set user
*
* @param \Cadoles\CoreBundle\Entity\User $user
*
* @return Message
*/
public function setUser(\Cadoles\CoreBundle\Entity\User $user = null)
{
$this->user = $user;
return $this;
}
/**
* Get user
*
* @return \Cadoles\CoreBundle\Entity\User
*/
public function getUser()
{
return $this->user;
}
/**
* Set group
*
* @param \Cadoles\CoreBundle\Entity\group $group
*
* @return Message
*/
public function setGroup(\Cadoles\CoreBundle\Entity\group $group = null)
{
$this->group = $group;
return $this;
}
/**
* Get group
*
* @return \Cadoles\CoreBundle\Entity\group
*/
public function getGroup()
{
return $this->group;
}
}

View File

@ -0,0 +1,37 @@
<?php
namespace Cadoles\WebsocketBundle\RPC;
use Ratchet\ConnectionInterface;
use Gos\Bundle\WebSocketBundle\RPC\RpcInterface;
use Gos\Bundle\WebSocketBundle\Router\WampRequest;
use Cadoles\WebsocketBundle\Topic\WebsocketTopic;
class RPCService implements RpcInterface {
/**
* Adds the params together
*
* Note: $conn isnt used here, but contains the connection of the person making this request.
*
* @param ConnectionInterface $connection
* @param WampRequest $request
* @param array $params
* @return int
*/
public function updateConnectionData(ConnectionInterface $connection, WampRequest $request, $params) {
$connection->userkey = $params['userkey'];
return array("result" => array_sum($params));
}
/**
* Name of RPC, use for pubsub router (see step3)
*
* @return string
*/
public function getName() {
return 'websocket.rpc';
}
}

View File

@ -0,0 +1,3 @@
cadoles_websocket_chat:
path: /websocket/chat/{id}
defaults: { _controller: CadolesWebsocketBundle:Chat:client }

View File

@ -0,0 +1,11 @@
services:
cadoles.websocket.topic:
class: Cadoles\WebsocketBundle\Topic\WebsocketTopic
arguments: ['@gos_web_socket.websocket.client_manipulator','@doctrine.orm.entity_manager','@service_container']
tags:
- { name: gos_web_socket.topic }
cadoles.websocket.rpc:
class: Cadoles\WebsocketBundle\RPC\RPCService
tags:
- { name: gos_web_socket.rpc }

View File

@ -0,0 +1,15 @@
websocket_topic:
channel: websocket/channel/{group}
handler:
callback: 'websocket.topic'
requirements:
group:
pattern: '[-+]?\d+'
websocket_rpc:
channel: websocket/rpc/{method}
handler:
callback: 'websocket.rpc'
requirements:
method:
pattern: "[a-z_]+"

View File

@ -0,0 +1,81 @@
{% extends '@CadolesCore/base.html.twig' %}
{% block localstyle %}
.message {
padding:10px;
margin-top: 5px;
background-color: #{{ color['main'] }};
color: #{{ color['fontcolorhover'] }};
}
.msgavatar {
float:left;
height:40px;
}
.msgdiv {
float:left;
padding-left:10px;
}
.msgtitle {
line-height: 12px;
margin-bottom: 10px;
}
{% endblock %}
{% block pagewrapper %}
<div class="mychat">
</div>
{% endblock %}
{% block localexternalscript %}
<script src="/{{alias}}/bundles/goswebsocket/js/vendor/autobahn.min.js"></script>
<script src="/{{alias}}/bundles/goswebsocket/js/gos_web_socket_client.js"></script>
{% endblock %}
{% block localjavascript %}
$(document).ready(function(){
var dateoptions = {weekday: "long", year: "numeric", month: "long", day: "numeric", hour: "2-digit", minute: "2-digit" };
{% if app.user %}
var _WS_URI = "wss://{{ gos_web_socket_server_host }}:{{ gos_web_socket_server_port }}";
var _WS_URI = "wss://{{ gos_web_socket_server_host }}:5555";
console.log(_WS_URI);
var webSocket = WS.connect(_WS_URI);
webSocket.on("socket/connect", function (session) {
session.call("websocket/rpc/update_connection_data", {"userkey": "{{userkey}}" }).then(
function (result)
{
console.log("RPC Valid!", result);
},
function (error, desc)
{
console.log("RPC Error", error, desc);
}
);
//the callback function in "subscribe" is called everytime an event is published in that channel.
session.subscribe("websocket/channel/{{groupid}}", function (uri, payload) {
html ="<div class='message row'>";
html+="<div class='msgavatar'><img id='user_avatar_img' src='/{{ alias }}/uploads/avatar/"+payload.msg.avatar+"' class='avatar'></div>";
html+="<div class='msgdiv'>"
html+="<div class='msgtitle'>"+payload.msg.lastname+"<br><small>"+new Date(payload.msg.submitdate.date).toLocaleDateString("fr-FR", dateoptions)+"</small></div>";
html+="<div class='msgtopic'>"+payload.msg.message+"</div>";
html+="</div>";
html+="</div>";
$(".mychat").append(html);
console.log("Received message", payload.msg);
});
session.publish("websocket/channel/{{groupid}}", "This is a message!");
session.publish("websocket/channel/{{groupid}}", "This is a message!");
session.publish("websocket/channel/{{groupid}}", "This is a message!");
})
{% endif %}
});
{% endblock %}

View File

@ -0,0 +1,121 @@
<?php
namespace Cadoles\WebsocketBundle\Topic;
use Gos\Bundle\WebSocketBundle\Topic\TopicInterface;
use Ratchet\ConnectionInterface;
use Ratchet\Wamp\Topic;
use Gos\Bundle\WebSocketBundle\Router\WampRequest;
use Doctrine\ORM\EntityManager;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Gos\Bundle\WebSocketBundle\Client\ClientManipulatorInterface;
use Cadoles\WebsocketBundle\Entity\Message;
class WebsocketTopic implements TopicInterface
{
protected $em;
protected $container;
protected $clientManipulator;
public function __construct(ClientManipulatorInterface $clientManipulator, EntityManager $em, ContainerInterface $container) {
$this->clientManipulator = $clientManipulator;
$this->em = $em;
$this->container = $container;
}
/**
* This will receive any Subscription requests for this topic.
*
* @param ConnectionInterface $connection
* @param Topic $topic
* @param WampRequest $request
* @return void
*/
public function onSubscribe(ConnectionInterface $connection, Topic $topic, WampRequest $request)
{
/*
$userkey=$request->getAttributes()->get('user');
$groupid=$request->getAttributes()->get('group');
$user=$this->em->getRepository("CadolesCoreBundle:User")->findOneBy(['keyvalue'=> $userkey]);
if(!$user) $topic->broadcast(['msg' => 'user NOT FIND']);
else $topic->broadcast(['msg' => $user->getUsername()]);
//this will broadcast the message to ALL subscribers of this topic.
$topic->broadcast(['msg' => $connection->resourceId . " group = $groupid && user = $userkey has joined " . $topic->getId()]);
*/
}
/**
* This will receive any UnSubscription requests for this topic.
*
* @param ConnectionInterface $connection
* @param Topic $topic
* @param WampRequest $request
* @return void
*/
public function onUnSubscribe(ConnectionInterface $connection, Topic $topic, WampRequest $request)
{
//this will broadcast the message to ALL subscribers of this topic.
//$topic->broadcast(['msg' => $connection->resourceId . " has left " . $topic->getId()]);
}
/**
* This will receive any Publish requests for this topic.
*
* @param ConnectionInterface $connection
* @param Topic $topic
* @param WampRequest $request
* @param $event
* @param array $exclude
* @param array $eligible
* @return mixed|void
*/
public function onPublish(ConnectionInterface $connection, Topic $topic, WampRequest $request, $event, array $exclude, array $eligible)
{
$userkey=$connection->userkey;
$groupid=$request->getAttributes()->get('group');
$group=$this->em->getRepository("CadolesCoreBundle:Group")->find($groupid);
if(!$group) {
$topic->broadcast(['msg' => 'group NOT FIND']);
}
$user=$this->em->getRepository("CadolesCoreBundle:User")->findOneBy(['keyvalue'=> $userkey]);
if(!$user) {
$topic->broadcast(['msg' => 'user NOT FIND']);
}
if($group&&$user) {
$message=new Message();
$message->setTopic($event);
$message->setUser($user);
$message->setGroup($group);
$this->em->persist($message);
$this->em->flush();
$return["lastname"]=$user->getLastname()." ".$user->getFirstname();
$return["avatar"]=$user->getAvatar();
$return["submitdate"]=$message->getSubmitdate();
$return["message"]=$event;
//this will broadcast the message to ALL subscribers of this topic.
$topic->broadcast([
'msg' => $return,
]);
}
}
/**
* Like RPC is will use to prefix the channel
* @return string
*/
public function getName()
{
return 'websocket.topic';
}
}

View File

@ -36,6 +36,13 @@ parameters:
%else
syncenvole_activate: false
%end if
%if %%getVar("ninegate_activate_websocket", 'non') == "oui"
websocket_activate: true
websocket_port: 5555
%else
websocket_activate: false
websocket_port: 5555
%end if
%if %%getVar("ninegate_activate_portal", 'non') == "oui"
portal_activate: true
module_activate: false
@ -218,27 +225,6 @@ parameters:
activate_widwordpress: false
%end if
# Synchrinisation eportail
%if %%getVar("ninegate_synceportail", 'non') == "oui"
eportail_sync: true
eportail_url: /eportail
eportail_login: /eportail/login.php
eportail_database_host: '%database_host%'
eportail_database_port: 3306
eportail_database_name: eportail
eportail_database_user: eportail
eportail_database_password: "changme"
%else
eportail_sync: false
eportail_url: # /eportail
eportail_login: # /eportail/login.php
eportail_database_host: # 172.27.7.64
eportail_database_port: # 3306
eportail_database_name: # eportail
eportail_database_user: # eportail
eportail_database_password: # "changme"
%end if
# Si mode_auth = CAS
cas_host: %%eolesso_adresse
cas_path: %%eolesso_cas_folder
@ -285,16 +271,6 @@ doctrine:
user: '%database_user%'
password: '%database_password%'
charset: UTF8
%if %%getVar("ninegate_synceportail", 'non') == "oui"
eportail:
driver: pdo_mysql
host: '%eportail_database_host%'
port: '%eportail_database_port%'
dbname: '%eportail_database_name%'
user: '%eportail_database_user%'
password: '%eportail_database_password%'
charset: UTF8
%end if
orm:
default_entity_manager: default
entity_managers:
@ -304,13 +280,7 @@ doctrine:
CadolesCoreBundle: ~
CadolesCronBundle: ~
CadolesPortalBundle: ~
%if %%getVar("ninegate_synceportail", 'non') == "oui"
eportail:
connection: eportail
mappings:
CadolesCoreBundle: ~
CadolesCronBundle: ~
CadolesPortalBundle: ~
%end if
CadolesWebsocketBundle: ~

24
tmpl/ninegate.nginx.conf Normal file
View File

@ -0,0 +1,24 @@
server {
listen 5555 ssl;
ssl on;
ssl_certificate %%server_cert;
ssl_certificate_key %%server_key;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Proxy "";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://%%web_url:5556;
}
}