root Apostolos
6 years ago
7 changed files with 344 additions and 0 deletions
@ -0,0 +1,209 @@ |
|||||
|
-- MySQL dump 10.13 Distrib 5.7.26, for Linux (x86_64) |
||||
|
-- |
||||
|
-- Host: localhost Database: labroom |
||||
|
-- ------------------------------------------------------ |
||||
|
-- Server version 5.7.26-0ubuntu0.16.04.1 |
||||
|
|
||||
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; |
||||
|
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; |
||||
|
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; |
||||
|
/*!40101 SET NAMES utf8 */; |
||||
|
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; |
||||
|
/*!40103 SET TIME_ZONE='+00:00' */; |
||||
|
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; |
||||
|
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; |
||||
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; |
||||
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; |
||||
|
|
||||
|
-- |
||||
|
-- Table structure for table `oauth_access_tokens` |
||||
|
-- |
||||
|
|
||||
|
DROP TABLE IF EXISTS `oauth_access_tokens`; |
||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */; |
||||
|
/*!40101 SET character_set_client = utf8 */; |
||||
|
CREATE TABLE `oauth_access_tokens` ( |
||||
|
`access_token` varchar(40) NOT NULL, |
||||
|
`client_id` varchar(80) NOT NULL, |
||||
|
`user_id` varchar(80) DEFAULT NULL, |
||||
|
`expires` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
||||
|
`scope` varchar(4000) DEFAULT NULL, |
||||
|
PRIMARY KEY (`access_token`) |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1; |
||||
|
/*!40101 SET character_set_client = @saved_cs_client */; |
||||
|
|
||||
|
-- |
||||
|
-- Dumping data for table `oauth_access_tokens` |
||||
|
-- |
||||
|
|
||||
|
LOCK TABLES `oauth_access_tokens` WRITE; |
||||
|
/*!40000 ALTER TABLE `oauth_access_tokens` DISABLE KEYS */; |
||||
|
/*!40000 ALTER TABLE `oauth_access_tokens` ENABLE KEYS */; |
||||
|
UNLOCK TABLES; |
||||
|
|
||||
|
-- |
||||
|
-- Table structure for table `oauth_authorization_codes` |
||||
|
-- |
||||
|
|
||||
|
DROP TABLE IF EXISTS `oauth_authorization_codes`; |
||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */; |
||||
|
/*!40101 SET character_set_client = utf8 */; |
||||
|
CREATE TABLE `oauth_authorization_codes` ( |
||||
|
`authorization_code` varchar(40) NOT NULL, |
||||
|
`client_id` varchar(80) NOT NULL, |
||||
|
`user_id` varchar(80) DEFAULT NULL, |
||||
|
`redirect_uri` varchar(2000) DEFAULT NULL, |
||||
|
`expires` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
||||
|
`scope` varchar(4000) DEFAULT NULL, |
||||
|
`id_token` varchar(1000) DEFAULT NULL, |
||||
|
PRIMARY KEY (`authorization_code`) |
||||
|
/*!40101 SET character_set_client = @saved_cs_client */; |
||||
|
|
||||
|
-- |
||||
|
-- Dumping data for table `oauth_authorization_codes` |
||||
|
-- |
||||
|
|
||||
|
LOCK TABLES `oauth_authorization_codes` WRITE; |
||||
|
/*!40000 ALTER TABLE `oauth_authorization_codes` DISABLE KEYS */; |
||||
|
/*!40000 ALTER TABLE `oauth_authorization_codes` ENABLE KEYS */; |
||||
|
UNLOCK TABLES; |
||||
|
|
||||
|
-- |
||||
|
-- Table structure for table `oauth_clients` |
||||
|
-- |
||||
|
|
||||
|
DROP TABLE IF EXISTS `oauth_clients`; |
||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */; |
||||
|
/*!40101 SET character_set_client = utf8 */; |
||||
|
CREATE TABLE `oauth_clients` ( |
||||
|
`client_id` varchar(80) NOT NULL, |
||||
|
`client_secret` varchar(80) DEFAULT NULL, |
||||
|
`redirect_uri` varchar(2000) DEFAULT NULL, |
||||
|
`grant_types` varchar(80) DEFAULT NULL, |
||||
|
`scope` varchar(4000) DEFAULT NULL, |
||||
|
`user_id` varchar(80) DEFAULT NULL, |
||||
|
PRIMARY KEY (`client_id`) |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1; |
||||
|
/*!40101 SET character_set_client = @saved_cs_client */; |
||||
|
|
||||
|
-- |
||||
|
-- Dumping data for table `oauth_clients` |
||||
|
-- |
||||
|
|
||||
|
LOCK TABLES `oauth_clients` WRITE; |
||||
|
/*!40000 ALTER TABLE `oauth_clients` DISABLE KEYS */; |
||||
|
INSERT INTO `oauth_clients` VALUES ('user','psssssssssss','http://fake/',NULL,'owner',NULL); |
||||
|
/*!40000 ALTER TABLE `oauth_clients` ENABLE KEYS */; |
||||
|
UNLOCK TABLES; |
||||
|
|
||||
|
-- |
||||
|
-- Table structure for table `oauth_jwt` |
||||
|
-- |
||||
|
|
||||
|
DROP TABLE IF EXISTS `oauth_jwt`; |
||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */; |
||||
|
/*!40101 SET character_set_client = utf8 */; |
||||
|
CREATE TABLE `oauth_jwt` ( |
||||
|
`client_id` varchar(80) NOT NULL, |
||||
|
`subject` varchar(80) DEFAULT NULL, |
||||
|
`public_key` varchar(2000) NOT NULL |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1; |
||||
|
/*!40101 SET character_set_client = @saved_cs_client */; |
||||
|
|
||||
|
-- |
||||
|
-- Dumping data for table `oauth_jwt` |
||||
|
-- |
||||
|
|
||||
|
LOCK TABLES `oauth_jwt` WRITE; |
||||
|
/*!40000 ALTER TABLE `oauth_jwt` DISABLE KEYS */; |
||||
|
/*!40000 ALTER TABLE `oauth_jwt` ENABLE KEYS */; |
||||
|
UNLOCK TABLES; |
||||
|
|
||||
|
-- |
||||
|
-- Table structure for table `oauth_refresh_tokens` |
||||
|
-- |
||||
|
|
||||
|
DROP TABLE IF EXISTS `oauth_refresh_tokens`; |
||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */; |
||||
|
/*!40101 SET character_set_client = utf8 */; |
||||
|
CREATE TABLE `oauth_refresh_tokens` ( |
||||
|
`refresh_token` varchar(40) NOT NULL, |
||||
|
`client_id` varchar(80) NOT NULL, |
||||
|
`user_id` varchar(80) DEFAULT NULL, |
||||
|
`expires` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
||||
|
`scope` varchar(4000) DEFAULT NULL, |
||||
|
PRIMARY KEY (`refresh_token`) |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1; |
||||
|
/*!40101 SET character_set_client = @saved_cs_client */; |
||||
|
|
||||
|
-- |
||||
|
-- Dumping data for table `oauth_refresh_tokens` |
||||
|
-- |
||||
|
|
||||
|
LOCK TABLES `oauth_refresh_tokens` WRITE; |
||||
|
/*!40000 ALTER TABLE `oauth_refresh_tokens` DISABLE KEYS */; |
||||
|
/*!40000 ALTER TABLE `oauth_refresh_tokens` ENABLE KEYS */; |
||||
|
UNLOCK TABLES; |
||||
|
|
||||
|
-- |
||||
|
-- Table structure for table `oauth_scopes` |
||||
|
-- |
||||
|
|
||||
|
DROP TABLE IF EXISTS `oauth_scopes`; |
||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */; |
||||
|
/*!40101 SET character_set_client = utf8 */; |
||||
|
CREATE TABLE `oauth_scopes` ( |
||||
|
`scope` varchar(80) NOT NULL, |
||||
|
`is_default` tinyint(1) DEFAULT NULL, |
||||
|
PRIMARY KEY (`scope`) |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1; |
||||
|
/*!40101 SET character_set_client = @saved_cs_client */; |
||||
|
|
||||
|
-- |
||||
|
-- Dumping data for table `oauth_scopes` |
||||
|
-- |
||||
|
|
||||
|
LOCK TABLES `oauth_scopes` WRITE; |
||||
|
/*!40000 ALTER TABLE `oauth_scopes` DISABLE KEYS */; |
||||
|
INSERT INTO `oauth_scopes` VALUES ('admin',NULL),('devel',NULL),('owner',NULL),('student',NULL),('superuser',NULL),('teacher',NULL),('user',1); |
||||
|
/*!40000 ALTER TABLE `oauth_scopes` ENABLE KEYS */; |
||||
|
UNLOCK TABLES; |
||||
|
|
||||
|
-- |
||||
|
-- Table structure for table `oauth_users` |
||||
|
-- |
||||
|
|
||||
|
DROP TABLE IF EXISTS `oauth_users`; |
||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */; |
||||
|
/*!40101 SET character_set_client = utf8 */; |
||||
|
CREATE TABLE `oauth_users` ( |
||||
|
`username` varchar(80) NOT NULL, |
||||
|
`password` varchar(80) DEFAULT NULL, |
||||
|
`first_name` varchar(80) DEFAULT NULL, |
||||
|
`last_name` varchar(80) DEFAULT NULL, |
||||
|
`email` varchar(80) DEFAULT NULL, |
||||
|
`email_verified` tinyint(1) DEFAULT NULL, |
||||
|
`scope` varchar(4000) DEFAULT NULL, |
||||
|
PRIMARY KEY (`username`) |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1; |
||||
|
/*!40101 SET character_set_client = @saved_cs_client */; |
||||
|
|
||||
|
-- |
||||
|
-- Dumping data for table `oauth_users` |
||||
|
-- |
||||
|
|
||||
|
LOCK TABLES `oauth_users` WRITE; |
||||
|
/*!40000 ALTER TABLE `oauth_users` DISABLE KEYS */; |
||||
|
/*!40000 ALTER TABLE `oauth_users` ENABLE KEYS */; |
||||
|
UNLOCK TABLES; |
||||
|
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; |
||||
|
|
||||
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; |
||||
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; |
||||
|
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; |
||||
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; |
||||
|
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; |
||||
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
||||
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; |
||||
|
|
||||
|
-- Dump completed on 2019-07-20 21:32:48 |
@ -0,0 +1 @@ |
|||||
|
docker exec main_mysql.1.kn567pgacbuc6vasr9dsi4zhq mysql -udbuser -ppssssssssss dbname < api_labroom.sql |
@ -0,0 +1,5 @@ |
|||||
|
openssl genrsa -des3 -passout pass:x -out server.pass.key 2048 |
||||
|
openssl rsa -passin pass:x -in server.pass.key -out server.key |
||||
|
rm server.pass.key |
||||
|
openssl req -new -key server.key -out server.csr |
||||
|
openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt |
@ -0,0 +1,60 @@ |
|||||
|
version: "3.3" |
||||
|
services: |
||||
|
api: |
||||
|
image: registry.vlabs.uniwa.gr:5080/docker-php-apache-ubuntu:16.04.18 |
||||
|
command: bash -c " |
||||
|
rm /run/apache2/apache2.pid |
||||
|
" |
||||
|
deploy: |
||||
|
replicas: 1 |
||||
|
placement: |
||||
|
constraints: |
||||
|
- node.id == ${API1} |
||||
|
networks: |
||||
|
mongo-net: |
||||
|
ipv4_address: 192.168.20.11 |
||||
|
ports: |
||||
|
- "8081:443" |
||||
|
restart: on-failure |
||||
|
volumes: |
||||
|
- "/var/lab/swarmexec/api:/var/www/api" |
||||
|
- "/var/lab/swarmexec/api_ports.conf:/etc/apache2/sites-enabled/ports.conf" |
||||
|
- "/var/lab/swarmexec/api_ports.conf:/etc/apache2/sites-available/ports.conf" |
||||
|
- "/var/lab/swarmexec/api_000-default.conf:/etc/apache2/sites-enabled/000-default.conf" |
||||
|
- "/var/lab/swarmexec/api_000-default.conf:/etc/apache2/sites-available/000-default.conf" |
||||
|
- "/var/lab/swarmexec/api_ssl/apache-selfsigned-apiswarm.key:/usr/local/apache2/conf/domain.key" |
||||
|
- "/var/lab/swarmexec/api_ssl/apache-selfsigned-apiswarm.crt:/usr/local/apache2/conf/domain.crt" |
||||
|
- "/var/lab/swarmexec/api_my.cnf:/etc/mysql/my.cnf" |
||||
|
- "/var/lab/swarmexec/api_apache2-php.ini:/etc/php/7.2/apache2/php.ini" |
||||
|
- "/var/lab/swarmexec/api_cli-php.ini:/etc/php/7.2/cli/php.ini" |
||||
|
- "/var/lab/swarmexec/modules/rewrite.load:/etc/apache2/mods-available/rewrite.load" |
||||
|
- "/var/lab/swarmexec/modules/rewrite.load:/etc/apache2/mods-enabled/rewrite.load" |
||||
|
- "/var/lab/swarmexec/api_error.log:/var/log/apache2/error.log" |
||||
|
- "/var/lab/swarmexec/api_access.log:/var/log/apache2/access.log" |
||||
|
- "/var/lab/swarmexec/api_php_errors.log:/var/log/apache2/php_errors.log" |
||||
|
- "/var/lab/swarmexec/api_other_vhosts_access.log:/var/log/apache2/other_vhosts_access.log" |
||||
|
|
||||
|
|
||||
|
mysql: |
||||
|
image: mariadb:10.4.6 |
||||
|
deploy: |
||||
|
replicas: 1 |
||||
|
placement: |
||||
|
constraints: |
||||
|
- node.id == ${API1} |
||||
|
networks: |
||||
|
mongo-net: |
||||
|
ipv4_address: 192.168.20.12 |
||||
|
environment: |
||||
|
MYSQL_ROOT_PASSWORD: apostolos |
||||
|
MYSQL_DATABASE: labroom |
||||
|
MYSQL_USER: labroom |
||||
|
MYSQL_PASSWORD: apostolos |
||||
|
restart: on-failure |
||||
|
volumes: |
||||
|
- "/var/lab/swarmexec/api_mysql:/var/lib/mysql" |
||||
|
|
||||
|
networks: |
||||
|
mongo-net: |
||||
|
external: true |
||||
|
|
@ -0,0 +1,4 @@ |
|||||
|
env API1=mtoje636wza8b0pxvhj7ewto3 \ |
||||
|
env API2=teab4qgrb17mb5sv2a8ex599g \ |
||||
|
env API3=st6ebl5y2kjvgjthq88v6r2fs \ |
||||
|
docker stack deploy -c debug.traefik-stack.yml mongo |
@ -0,0 +1,61 @@ |
|||||
|
version: "3.3" |
||||
|
services: |
||||
|
api: |
||||
|
image: registry.vlabs.uniwa.gr:5080/docker-php-apache-ubuntu:16.04.18 |
||||
|
#command: bash -c " |
||||
|
# rm /run/apache2/apache2.pid |
||||
|
# " |
||||
|
deploy: |
||||
|
replicas: 1 |
||||
|
placement: |
||||
|
constraints: |
||||
|
- node.id == ${API1} |
||||
|
networks: |
||||
|
mongo-net: |
||||
|
ipv4_address: 192.168.20.11 |
||||
|
ports: |
||||
|
- "8081:443" |
||||
|
restart: on-failure |
||||
|
volumes: |
||||
|
- "/var/lab/swarmexec/api:/var/www/api" |
||||
|
- "/var/lab/swarmexec/bin:/var/www/api/bin" |
||||
|
- "/var/lab/swarmexec/api_ports.conf:/etc/apache2/sites-enabled/ports.conf" |
||||
|
- "/var/lab/swarmexec/api_ports.conf:/etc/apache2/sites-available/ports.conf" |
||||
|
- "/var/lab/swarmexec/api_000-default.conf:/etc/apache2/sites-enabled/000-default.conf" |
||||
|
- "/var/lab/swarmexec/api_000-default.conf:/etc/apache2/sites-available/000-default.conf" |
||||
|
- "/var/lab/swarmexec/api_ssl/apache-selfsigned-apiswarm.key:/usr/local/apache2/conf/domain.key" |
||||
|
- "/var/lab/swarmexec/api_ssl/apache-selfsigned-apiswarm.crt:/usr/local/apache2/conf/domain.crt" |
||||
|
- "/var/lab/swarmexec/api_my.cnf:/etc/mysql/my.cnf" |
||||
|
- "/var/lab/swarmexec/api_apache2-php.ini:/etc/php/7.2/apache2/php.ini" |
||||
|
- "/var/lab/swarmexec/api_cli-php.ini:/etc/php/7.2/cli/php.ini" |
||||
|
- "/var/lab/swarmexec/modules/rewrite.load:/etc/apache2/mods-available/rewrite.load" |
||||
|
- "/var/lab/swarmexec/modules/rewrite.load:/etc/apache2/mods-enabled/rewrite.load" |
||||
|
- "/var/lab/swarmexec/api_error.log:/var/log/apache2/error.log" |
||||
|
- "/var/lab/swarmexec/api_access.log:/var/log/apache2/access.log" |
||||
|
- "/var/lab/swarmexec/api_php_errors.log:/var/log/apache2/php_errors.log" |
||||
|
- "/var/lab/swarmexec/api_other_vhosts_access.log:/var/log/apache2/other_vhosts_access.log" |
||||
|
|
||||
|
|
||||
|
mysql: |
||||
|
image: mariadb:10.4.6 |
||||
|
deploy: |
||||
|
replicas: 1 |
||||
|
placement: |
||||
|
constraints: |
||||
|
- node.id == ${API1} |
||||
|
networks: |
||||
|
mongo-net: |
||||
|
ipv4_address: 192.168.20.12 |
||||
|
environment: |
||||
|
MYSQL_ROOT_PASSWORD: apostolos |
||||
|
MYSQL_DATABASE: labroom |
||||
|
MYSQL_USER: labroom |
||||
|
MYSQL_PASSWORD: apostolos |
||||
|
restart: on-failure |
||||
|
volumes: |
||||
|
- "/var/lab/swarmexec/api_mysql:/var/lib/mysql" |
||||
|
|
||||
|
networks: |
||||
|
mongo-net: |
||||
|
external: true |
||||
|
|
@ -0,0 +1,4 @@ |
|||||
|
env API1=mtoje636wza8b0pxvhj7ewto3 \ |
||||
|
env API2=teab4qgrb17mb5sv2a8ex599g \ |
||||
|
env API3=st6ebl5y2kjvgjthq88v6r2fs \ |
||||
|
docker stack deploy -c traefik-stack.yml mongo |
Loading…
Reference in new issue