From daf1e57bfe6990cc28a105fe64f4fdd8e7713464 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 21 Dec 2018 09:02:21 +0100 Subject: [PATCH 01/14] fixes --- .gitignore | 3 +++ Vagrantfile | 19 ++++++++++++++ ansible/playbook.retry | 1 + ansible/playbook.yml | 8 ++++++ ansible/requirements.yml | 4 +++ ansible/vars/main.yml | 54 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 89 insertions(+) create mode 100644 Vagrantfile create mode 100644 ansible/playbook.retry create mode 100644 ansible/playbook.yml create mode 100644 ansible/requirements.yml create mode 100644 ansible/vars/main.yml diff --git a/.gitignore b/.gitignore index 54a84d9..270d91b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +.vagrant/ +*.log + /app/bootstrap.php.cache /app/config/parameters.yml /build/ diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..b77bc9e --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,19 @@ +Vagrant.configure("2") do |config| + config.vm.box = "ubuntu/bionic64" + + unless Vagrant.has_plugin?("vagrant_hostupdater") + config.vm.hostname = "mental.www" + end + + config.vm.network "private_network", ip: "192.168.179.2" + config.vm.network "forwarded_port", guest: 80, host: 8888 + + config.vm.synced_folder ".", "/srv/www", :nfs => true + + config.vm.provision "shell", inline: "which python || sudo apt -y install python" + + config.vm.provision "ansible" do |ansible| + ansible.playbook = "ansible/playbook.yml" + end + +end diff --git a/ansible/playbook.retry b/ansible/playbook.retry new file mode 100644 index 0000000..4ad96d5 --- /dev/null +++ b/ansible/playbook.retry @@ -0,0 +1 @@ +default diff --git a/ansible/playbook.yml b/ansible/playbook.yml new file mode 100644 index 0000000..bbfa3b2 --- /dev/null +++ b/ansible/playbook.yml @@ -0,0 +1,8 @@ +- hosts: all + become: yes + vars_files: + - vars/main.yml + roles: + - { role: geerlingguy.mysql } + - { role: geerlingguy.nginx } + - { role: geerlingguy.php } diff --git a/ansible/requirements.yml b/ansible/requirements.yml new file mode 100644 index 0000000..8bc8fe3 --- /dev/null +++ b/ansible/requirements.yml @@ -0,0 +1,4 @@ +- geerlingguy.mysql +- geerlingguy.nginx +- geerlingguy.php +- geerlingguy.php-versions diff --git a/ansible/vars/main.yml b/ansible/vars/main.yml new file mode 100644 index 0000000..1a036be --- /dev/null +++ b/ansible/vars/main.yml @@ -0,0 +1,54 @@ +mysql_root_password: root + +mysql_databases: +- name: mental + encoding: utf8 + collation: utf8_general_ci + +mysql_users: +- name: mental + host: "%" + password: mental + priv: "mental.*:ALL" + +nginx_vhosts: +- listen: "443 ssl http2" + server_name: "mental.www" + root: "/srv/www/web" + index: "app_dev.php" + state: "present" + template: "{{ nginx_vhost_template }}" + filename: "mental.www.conf" + extra_parameters: | + location ~ \.php$ { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass 127.0.0.1:9000; + fastcgi_index app_dev.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } + ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem; + ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key; + ssl_protocols TLSv1.1 TLSv1.2; + ssl_ciphers HIGH:!aNULL:!MD5; + +php_packages_state: "latest" +php_version: "7.2" +php_default_version_debian: "7.2" +php_enable_php_fpm: true +php_memory_limit: "128M" +php_max_execution_time: "90" +php_upload_max_filesize: "256M" +php_packages: +- php +- php-fpm +- php-cli +- php-common +- php-gd +- php-mbstring +- php-pdo +- php-xml +- php-mysql +- php-apcu +- php-curl +- php-memcached \ No newline at end of file From 0c32f30b5321fa86219c827195a3f9c61da623b9 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 21 Dec 2018 23:00:08 +0100 Subject: [PATCH 02/14] added some genius commands --- ansible/playbook.yml | 4 +--- ansible/requirements.yml | 2 ++ ansible/roles/initproject/tasks/main.yaml | 14 ++++++++++++++ ansible/roles/memcached/tasks/main.yaml | 4 ++++ ansible/vars/main.yml | 18 +++++++++++++----- app/config/parameters.yml.dist | 6 +++--- web/app_dev.php | 2 +- 7 files changed, 38 insertions(+), 12 deletions(-) create mode 100644 ansible/roles/initproject/tasks/main.yaml create mode 100644 ansible/roles/memcached/tasks/main.yaml diff --git a/ansible/playbook.yml b/ansible/playbook.yml index bbfa3b2..07aef24 100644 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -3,6 +3,4 @@ vars_files: - vars/main.yml roles: - - { role: geerlingguy.mysql } - - { role: geerlingguy.nginx } - - { role: geerlingguy.php } + - { role: initproject } diff --git a/ansible/requirements.yml b/ansible/requirements.yml index 8bc8fe3..1c94bb0 100644 --- a/ansible/requirements.yml +++ b/ansible/requirements.yml @@ -2,3 +2,5 @@ - geerlingguy.nginx - geerlingguy.php - geerlingguy.php-versions +- ocha.yarn +- geerlingguy.composer diff --git a/ansible/roles/initproject/tasks/main.yaml b/ansible/roles/initproject/tasks/main.yaml new file mode 100644 index 0000000..c9b4f21 --- /dev/null +++ b/ansible/roles/initproject/tasks/main.yaml @@ -0,0 +1,14 @@ +--- +- composer: + command: install + working_dir: /srv/www/ + +- name: create database + command: bin/console do:da:cr --if-not-exists + args: + chdir: /srv/www/ + +- name: run migrations + command: bin/console --no-interaction do:mi:mi + args: + chdir: /srv/www/ diff --git a/ansible/roles/memcached/tasks/main.yaml b/ansible/roles/memcached/tasks/main.yaml new file mode 100644 index 0000000..60d7967 --- /dev/null +++ b/ansible/roles/memcached/tasks/main.yaml @@ -0,0 +1,4 @@ +--- +- name: install memcached for crazy nothing + apt: + name: memcached \ No newline at end of file diff --git a/ansible/vars/main.yml b/ansible/vars/main.yml index 1a036be..1f1ca4f 100644 --- a/ansible/vars/main.yml +++ b/ansible/vars/main.yml @@ -20,19 +20,26 @@ nginx_vhosts: template: "{{ nginx_vhost_template }}" filename: "mental.www.conf" extra_parameters: | - location ~ \.php$ { - fastcgi_split_path_info ^(.+\.php)(/.+)$; + location / { + try_files $uri /app.php$is_args$args; + } + location ~ ^/(app_dev|config)\.php(/|$) { + fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_pass 127.0.0.1:9000; - fastcgi_index app_dev.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; + fastcgi_param DOCUMENT_ROOT $realpath_root; include fastcgi_params; } + location ~ \.php$ { + return 404; + } ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem; ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key; ssl_protocols TLSv1.1 TLSv1.2; ssl_ciphers HIGH:!aNULL:!MD5; php_packages_state: "latest" +php_webserver_daemon: "nginx" php_version: "7.2" php_default_version_debian: "7.2" php_enable_php_fpm: true @@ -51,4 +58,5 @@ php_packages: - php-mysql - php-apcu - php-curl -- php-memcached \ No newline at end of file +- php-memcached +- php-zip diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index 83a2979..cf28fab 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -2,10 +2,10 @@ parameters: database_driver: pdo_mysql database_host: 127.0.0.1 database_port: ~ - database_name: symfony + database_name: mental database_name_testing: symfony - database_user: root - database_password: ~ + database_user: mental + database_password: mental database_platform: 5.6 mailer_transport: smtp diff --git a/web/app_dev.php b/web/app_dev.php index 8456754..9be457d 100644 --- a/web/app_dev.php +++ b/web/app_dev.php @@ -12,7 +12,7 @@ // Feel free to remove this, extend it, or make something more sophisticated. if (isset($_SERVER['HTTP_CLIENT_IP']) || isset($_SERVER['HTTP_X_FORWARDED_FOR']) - || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || php_sapi_name() === 'cli-server') + || !(in_array(@$_SERVER['REMOTE_ADDR'], ['192.168.179.1', '127.0.0.1', 'fe80::1', '::1']) || php_sapi_name() === 'cli-server') ) { header('HTTP/1.0 403 Forbidden'); exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); From a12542f59174220a31499e7c8b611e099091f680 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 21 Dec 2018 23:06:05 +0100 Subject: [PATCH 03/14] Added development instruction for running vagrant machine --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index ce4e86a..1df66eb 100644 --- a/README.md +++ b/README.md @@ -30,3 +30,10 @@ if your dev installation is older than 2015-05-15 you will need to add the initi php app/console do:mi:version --add 20150515104913 ``` +running development machine +--------------------------- +* vagrant up +* vagrant ssh +* cd /srv/www +* bin/console fo:us:cr (follow the steps) +* run https://mental.www/app_dev.php in browser and log in with your credentials \ No newline at end of file From c5f68f1a7bfcb51d9b85cc1004c104be6b21d940 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 21 Dec 2018 23:30:18 +0100 Subject: [PATCH 04/14] missing migration? --- .../Version20181221222830.php | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 app/DoctrineMigrations/Version20181221222830.php diff --git a/app/DoctrineMigrations/Version20181221222830.php b/app/DoctrineMigrations/Version20181221222830.php new file mode 100644 index 0000000..6f0ec13 --- /dev/null +++ b/app/DoctrineMigrations/Version20181221222830.php @@ -0,0 +1,36 @@ +abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + + $this->addSql('ALTER TABLE tag CHANGE name name VARCHAR(255) NOT NULL COLLATE utf8_bin, CHANGE created created DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', CHANGE updated updated DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\''); + $this->addSql('ALTER TABLE fos_user DROP locked, DROP expired, DROP expires_at, DROP credentials_expired, DROP credentials_expire_at, CHANGE username username VARCHAR(180) NOT NULL, CHANGE username_canonical username_canonical VARCHAR(180) NOT NULL, CHANGE email email VARCHAR(180) NOT NULL, CHANGE email_canonical email_canonical VARCHAR(180) NOT NULL, CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_957A6479C05FB297 ON fos_user (confirmation_token)'); + $this->addSql('ALTER TABLE entry CHANGE url url VARCHAR(500) NOT NULL, CHANGE title title VARCHAR(255) NOT NULL, CHANGE category category VARCHAR(255) NOT NULL, CHANGE created created DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', CHANGE updated updated DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\''); + $this->addSql('ALTER TABLE visit CHANGE timestamp timestamp DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\''); + } + + public function down(Schema $schema) + { + // this down() migration is auto-generated, please modify it to your needs + $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + + $this->addSql('ALTER TABLE entry CHANGE url url VARCHAR(500) DEFAULT NULL COLLATE utf8mb4_unicode_ci, CHANGE title title VARCHAR(255) DEFAULT NULL COLLATE utf8mb4_unicode_ci, CHANGE category category VARCHAR(255) DEFAULT NULL COLLATE utf8mb4_unicode_ci, CHANGE created created DATETIME NOT NULL, CHANGE updated updated DATETIME NOT NULL'); + $this->addSql('DROP INDEX UNIQ_957A6479C05FB297 ON fos_user'); + $this->addSql('ALTER TABLE fos_user ADD locked TINYINT(1) NOT NULL, ADD expired TINYINT(1) NOT NULL, ADD expires_at DATETIME DEFAULT NULL, ADD credentials_expired TINYINT(1) NOT NULL, ADD credentials_expire_at DATETIME DEFAULT NULL, CHANGE username username VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE username_canonical username_canonical VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE email_canonical email_canonical VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE salt salt VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE confirmation_token confirmation_token VARCHAR(255) DEFAULT NULL COLLATE utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE tag CHANGE name name VARCHAR(255) DEFAULT NULL COLLATE utf8mb4_unicode_ci, CHANGE created created DATETIME NOT NULL, CHANGE updated updated DATETIME NOT NULL'); + $this->addSql('ALTER TABLE visit CHANGE timestamp timestamp DATETIME NOT NULL'); + } +} From f87b5220e90f01b06efb4fe1f40a5e2ca5dadd7b Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 21 Dec 2018 23:46:33 +0100 Subject: [PATCH 05/14] Fix ansible --- ansible/playbook.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ansible/playbook.yml b/ansible/playbook.yml index 07aef24..072e82a 100644 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -3,4 +3,10 @@ vars_files: - vars/main.yml roles: + - { role: geerlingguy.nginx } + - { role: geerlingguy.mysql } + - { role: geerlingguy.php } + - { role: geerlingguy.composer } + - { role: ocha.yarn } + - { role: memcached } - { role: initproject } From 451bdb06fef4026ff24d9770012589cfefed9646 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 21 Dec 2018 23:52:28 +0100 Subject: [PATCH 06/14] Fixing short URL to max length from ie ;) --- .../Version20181221225017.php | 28 +++++++++++++++++++ src/AppBundle/Entity/Entry.php | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 app/DoctrineMigrations/Version20181221225017.php diff --git a/app/DoctrineMigrations/Version20181221225017.php b/app/DoctrineMigrations/Version20181221225017.php new file mode 100644 index 0000000..5a619d1 --- /dev/null +++ b/app/DoctrineMigrations/Version20181221225017.php @@ -0,0 +1,28 @@ +abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + + $this->addSql('ALTER TABLE entry CHANGE url url VARCHAR(2048) NOT NULL'); + } + + public function down(Schema $schema) + { + // this down() migration is auto-generated, please modify it to your needs + $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + + $this->addSql('ALTER TABLE entry CHANGE url url VARCHAR(500) NOT NULL COLLATE utf8mb4_unicode_ci'); + } +} diff --git a/src/AppBundle/Entity/Entry.php b/src/AppBundle/Entity/Entry.php index 17576de..b33979f 100644 --- a/src/AppBundle/Entity/Entry.php +++ b/src/AppBundle/Entity/Entry.php @@ -26,7 +26,7 @@ class Entry extends AbstractEntity private $id; /** - * @ORM\Column(type="string", length=500) + * @ORM\Column(type="string", length=2048) * @Assert\Url */ private $url; From c1d95e255aa05e30302c10ee3907f55bbf0dd2ac Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 23 Dec 2018 20:25:23 +0100 Subject: [PATCH 07/14] added validation 2048 string length --- src/AppBundle/Entity/Entry.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/AppBundle/Entity/Entry.php b/src/AppBundle/Entity/Entry.php index b33979f..2c49b9e 100644 --- a/src/AppBundle/Entity/Entry.php +++ b/src/AppBundle/Entity/Entry.php @@ -28,6 +28,7 @@ class Entry extends AbstractEntity /** * @ORM\Column(type="string", length=2048) * @Assert\Url + * @Assert\Length(max=2048) */ private $url; From 3f66190f772a211f2a3290119164a754553681e3 Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 20 Jan 2019 13:33:36 +0100 Subject: [PATCH 08/14] removed komischen txt --- ansible/roles/memcached/tasks/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/memcached/tasks/main.yaml b/ansible/roles/memcached/tasks/main.yaml index 60d7967..4d46ab2 100644 --- a/ansible/roles/memcached/tasks/main.yaml +++ b/ansible/roles/memcached/tasks/main.yaml @@ -1,4 +1,4 @@ --- -- name: install memcached for crazy nothing +- name: install memcached apt: name: memcached \ No newline at end of file From d5dc75445c6cfce3aa6050a9e5319ed403caf87d Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 20 Jan 2019 13:34:35 +0100 Subject: [PATCH 09/14] reverted changes to add this in a new pr --- src/AppBundle/Entity/Entry.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/AppBundle/Entity/Entry.php b/src/AppBundle/Entity/Entry.php index 2c49b9e..b33979f 100644 --- a/src/AppBundle/Entity/Entry.php +++ b/src/AppBundle/Entity/Entry.php @@ -28,7 +28,6 @@ class Entry extends AbstractEntity /** * @ORM\Column(type="string", length=2048) * @Assert\Url - * @Assert\Length(max=2048) */ private $url; From ad75ad4ae2cddf7115ffbc9981a497d009fd66a9 Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 20 Jan 2019 13:47:05 +0100 Subject: [PATCH 10/14] Added some information text and removed migrations --- README.md | 10 +++--- .../Version20181221222830.php | 36 ------------------- .../Version20181221225017.php | 28 --------------- 3 files changed, 6 insertions(+), 68 deletions(-) delete mode 100644 app/DoctrineMigrations/Version20181221222830.php delete mode 100644 app/DoctrineMigrations/Version20181221225017.php diff --git a/README.md b/README.md index 1df66eb..b669523 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,10 @@ php app/console do:mi:version --add 20150515104913 running development machine --------------------------- -* vagrant up -* vagrant ssh -* cd /srv/www -* bin/console fo:us:cr (follow the steps) +Prerequirements: Vagrant installed, Virtualbox installed, Ansible installed + +* ```vagrant up``` +* ```vagrant ssh``` +* ```cd /srv/www``` +* ```bin/console fo:us:cr``` (follow the steps) * run https://mental.www/app_dev.php in browser and log in with your credentials \ No newline at end of file diff --git a/app/DoctrineMigrations/Version20181221222830.php b/app/DoctrineMigrations/Version20181221222830.php deleted file mode 100644 index 6f0ec13..0000000 --- a/app/DoctrineMigrations/Version20181221222830.php +++ /dev/null @@ -1,36 +0,0 @@ -abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('ALTER TABLE tag CHANGE name name VARCHAR(255) NOT NULL COLLATE utf8_bin, CHANGE created created DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', CHANGE updated updated DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\''); - $this->addSql('ALTER TABLE fos_user DROP locked, DROP expired, DROP expires_at, DROP credentials_expired, DROP credentials_expire_at, CHANGE username username VARCHAR(180) NOT NULL, CHANGE username_canonical username_canonical VARCHAR(180) NOT NULL, CHANGE email email VARCHAR(180) NOT NULL, CHANGE email_canonical email_canonical VARCHAR(180) NOT NULL, CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL'); - $this->addSql('CREATE UNIQUE INDEX UNIQ_957A6479C05FB297 ON fos_user (confirmation_token)'); - $this->addSql('ALTER TABLE entry CHANGE url url VARCHAR(500) NOT NULL, CHANGE title title VARCHAR(255) NOT NULL, CHANGE category category VARCHAR(255) NOT NULL, CHANGE created created DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', CHANGE updated updated DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\''); - $this->addSql('ALTER TABLE visit CHANGE timestamp timestamp DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\''); - } - - public function down(Schema $schema) - { - // this down() migration is auto-generated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('ALTER TABLE entry CHANGE url url VARCHAR(500) DEFAULT NULL COLLATE utf8mb4_unicode_ci, CHANGE title title VARCHAR(255) DEFAULT NULL COLLATE utf8mb4_unicode_ci, CHANGE category category VARCHAR(255) DEFAULT NULL COLLATE utf8mb4_unicode_ci, CHANGE created created DATETIME NOT NULL, CHANGE updated updated DATETIME NOT NULL'); - $this->addSql('DROP INDEX UNIQ_957A6479C05FB297 ON fos_user'); - $this->addSql('ALTER TABLE fos_user ADD locked TINYINT(1) NOT NULL, ADD expired TINYINT(1) NOT NULL, ADD expires_at DATETIME DEFAULT NULL, ADD credentials_expired TINYINT(1) NOT NULL, ADD credentials_expire_at DATETIME DEFAULT NULL, CHANGE username username VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE username_canonical username_canonical VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE email_canonical email_canonical VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE salt salt VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE confirmation_token confirmation_token VARCHAR(255) DEFAULT NULL COLLATE utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE tag CHANGE name name VARCHAR(255) DEFAULT NULL COLLATE utf8mb4_unicode_ci, CHANGE created created DATETIME NOT NULL, CHANGE updated updated DATETIME NOT NULL'); - $this->addSql('ALTER TABLE visit CHANGE timestamp timestamp DATETIME NOT NULL'); - } -} diff --git a/app/DoctrineMigrations/Version20181221225017.php b/app/DoctrineMigrations/Version20181221225017.php deleted file mode 100644 index 5a619d1..0000000 --- a/app/DoctrineMigrations/Version20181221225017.php +++ /dev/null @@ -1,28 +0,0 @@ -abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('ALTER TABLE entry CHANGE url url VARCHAR(2048) NOT NULL'); - } - - public function down(Schema $schema) - { - // this down() migration is auto-generated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('ALTER TABLE entry CHANGE url url VARCHAR(500) NOT NULL COLLATE utf8mb4_unicode_ci'); - } -} From 94dace58e26779df6504e65af9c55aa619a7e54a Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 20 Jan 2019 13:48:03 +0100 Subject: [PATCH 11/14] information text --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b669523..69ded04 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ if your dev installation is older than 2015-05-15 you will need to add the initi php app/console do:mi:version --add 20150515104913 ``` -running development machine +development setup (vagrant) --------------------------- Prerequirements: Vagrant installed, Virtualbox installed, Ansible installed From 31e0e44cab05e43ecb79941497556d28f6449091 Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 20 Jan 2019 13:52:48 +0100 Subject: [PATCH 12/14] rolled back pws --- app/config/parameters.yml.dist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index cf28fab..229beba 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -4,8 +4,8 @@ parameters: database_port: ~ database_name: mental database_name_testing: symfony - database_user: mental - database_password: mental + database_user: root + database_password: ~ database_platform: 5.6 mailer_transport: smtp From d97585e2d52742609928705bc441030d4d89ba4c Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 20 Jan 2019 13:55:45 +0100 Subject: [PATCH 13/14] reverted pw changes --- ansible/vars/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/vars/main.yml b/ansible/vars/main.yml index 1f1ca4f..7848a6b 100644 --- a/ansible/vars/main.yml +++ b/ansible/vars/main.yml @@ -6,9 +6,9 @@ mysql_databases: collation: utf8_general_ci mysql_users: -- name: mental +- name: root host: "%" - password: mental + password: ~ priv: "mental.*:ALL" nginx_vhosts: From af1735792694b565395b18641a8187020bff92e1 Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 20 Jan 2019 17:56:28 +0100 Subject: [PATCH 14/14] Added special config for test, changed mysql pws --- .travis.yml | 2 +- ansible/vars/main.yml | 2 +- app/config/parameters.yml.dist | 2 +- app/config/parameters.yml.test | 23 +++++++++++++++++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 app/config/parameters.yml.test diff --git a/.travis.yml b/.travis.yml index 8745ddb..aee265b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ before_install: # Create database, schema and fixtures install: - composer install -q - - cp app/config/parameters.yml.dist app/config/parameters.yml + - cp app/config/parameters.yml.test app/config/parameters.yml # Run script script: diff --git a/ansible/vars/main.yml b/ansible/vars/main.yml index 7848a6b..11658ac 100644 --- a/ansible/vars/main.yml +++ b/ansible/vars/main.yml @@ -8,7 +8,7 @@ mysql_databases: mysql_users: - name: root host: "%" - password: ~ + password: root priv: "mental.*:ALL" nginx_vhosts: diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index 229beba..edc7236 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -5,7 +5,7 @@ parameters: database_name: mental database_name_testing: symfony database_user: root - database_password: ~ + database_password: root database_platform: 5.6 mailer_transport: smtp diff --git a/app/config/parameters.yml.test b/app/config/parameters.yml.test new file mode 100644 index 0000000..229beba --- /dev/null +++ b/app/config/parameters.yml.test @@ -0,0 +1,23 @@ +parameters: + database_driver: pdo_mysql + database_host: 127.0.0.1 + database_port: ~ + database_name: mental + database_name_testing: symfony + database_user: root + database_password: ~ + database_platform: 5.6 + + mailer_transport: smtp + mailer_host: localhost + mailer_user: ~ + mailer_password: ~ + + locale: en + secret: Ohthaechoosheekohngov2iepaothae5ahd5ya9kie + + session_memcache_host: localhost + session_memcache_port: 11211 + session_memcache_prefix: mn_sess + session_memcache_expire: 604800 # 1 week +