From 9858f86b21e79322965745a5e8e6c79d0db4d4e3 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 1 Oct 2021 08:35:09 +0200 Subject: [PATCH 1/9] Vagrant: Use Debian stable With the release of Debian 11 the Vagrant was still using _oldstable_ with this we are now using Debian stable again in the Vagrant VM. --- Vagrantfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 81676df612..7d88beec2b 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -6,8 +6,8 @@ server_timezone = "UTC" public_folder = "/vagrant" Vagrant.configure(2) do |config| - # Set server to Debian 10 / Buster 64bit - config.vm.box = "debian/buster64" + # Set server to Debian 11 / Bullseye 64bit + config.vm.box = "debian/bullseye64" # Disable automatic box update checking. If you disable this, then # boxes will only be checked for updates when the user runs From 93bbf27d525b702a00bd52eb1e9d5f3edbbb7990 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 1 Oct 2021 08:37:19 +0200 Subject: [PATCH 2/9] Vagrant: Do not pull PHP requirements during VM setup Don't pull the PHP requirements of Friendica with composer during the VM setup. First coding is done out side of the VM, so should be the management of the dependencies. Additionally if the _VirtualBox Guest Additions_ versions don't match on the guest and host systems, writing to the shared directory will not work, thus running composer will generate error messages during the initial setup and Friendica wont work. --- bin/dev/vagrant_provision.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bin/dev/vagrant_provision.sh b/bin/dev/vagrant_provision.sh index c8e62f2915..a7cb7f308d 100755 --- a/bin/dev/vagrant_provision.sh +++ b/bin/dev/vagrant_provision.sh @@ -94,11 +94,7 @@ rm -rf /var/www/ ln -fs /vagrant /var/www # install deps with composer -echo ">>> Installing php requirements" -apt install unzip cd /var/www -php bin/composer.phar install - echo ">>> Setup Friendica" From 7331e90c000f20ae903233f15e17ea692daae88d Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 1 Oct 2021 08:41:58 +0200 Subject: [PATCH 3/9] Vagrant: Avoid mis-leading error during setup With the use of Friendicas auto-installation feature and the pre-configured config file, the admin email address is set. Setting it again after the installation is compleated will generate a mis-leading error message. --- bin/dev/vagrant_provision.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bin/dev/vagrant_provision.sh b/bin/dev/vagrant_provision.sh index a7cb7f308d..a9ce293207 100755 --- a/bin/dev/vagrant_provision.sh +++ b/bin/dev/vagrant_provision.sh @@ -116,10 +116,6 @@ bin/console user password "$ADMIN_NICK" "$ADMIN_PASSW" bin/console user add "$USER_NICK" "$USER_NICK" "$USER_NICK@friendica.local" en bin/console user password "$USER_NICK" "$USER_PASSW" -# set the admin -bin/console config config admin_email ""$ADMIN_NICK@friendica.local"" - - # create cronjob - activate if you have enough memory in you dev VM # cronjob runs as www-data user echo ">>> Installing cronjob" From d6f89da11ba9fdfa8f2d688f8b680fd2f1ff0564 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 1 Oct 2021 08:54:08 +0200 Subject: [PATCH 4/9] Vagrant: updating the docs --- doc/Vagrant.md | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/doc/Vagrant.md b/doc/Vagrant.md index 4040495ca6..06c14ff761 100644 --- a/doc/Vagrant.md +++ b/doc/Vagrant.md @@ -10,27 +10,26 @@ Getting started No need to setup up a webserver, database etc. before actually starting. Vagrant creates a virtual machine for you that you can just run inside VirtualBox and start to work directly on Friendica. -It brings an Ubuntu Xenial (16.04) with PHP 7.0 and MySQL 5.7.16 +It brings an Debian Bullseye with PHP 7.4 and MariaDB 10.5.11. What you need to do: 1. Install VirtualBox and vagrant. Please use an up-to-date vagrant version from https://www.vagrantup.com/downloads.html. 2. Git clone your Friendica repository. -Inside, you'll find a "Vagrantfile" and some scripts in the utils folder. -3. Run "vagrant up" from inside the friendica clone: - $> vagrant up -Be patient: When it runs for the first time, it downloads an Ubuntu Server image. -4. Run "vagrant ssh" to log into the virtual machine to log in to the VM: - $> vagrant ssh +Inside, you'll find a `Vagrantfile` and some scripts in the `bin/dev` folder. +3. Run `vagrant up` from inside the friendica clone. +This will start the virtual machine. +Be patient: When it runs for the first time, it downloads an Debian Server image and installs Friendica. +4. Run `vagrant ssh` to log into the virtual machine to log in to the VM in case you need to debug something on the server. 5. Open you test installation in a browser. -Go to 192.168.22.10. +Go to friendica.local (or 192.168.22.10). +friendica.local is using a self-signed TLS certificate, so you will need to add an exception to trust the certificate the first time you are visiting the page. The mysql database is called "friendica", the mysql user and password both are "friendica". 6. Work on Friendica's code in your git clone on your machine (not in the VM). Your local working directory is set up as a shared directory with the VM (/vagrant). 7. Check the changes in your browser in the VM. -Debug via the "vagrant ssh" login. -Find the Friendica log file /vagrant/logfile.out. +Find the Friendica log file `/vagrant/logfile.out` on the VM or in the `logfile.out` in you local Friendica directory. 8. Commit and push your changes directly back to Github. If you want to stop vagrant after finishing your work, run the following command @@ -46,13 +45,22 @@ This will not delete the virtual machine. to make sure that you can start from scratch with another "vagrant up". -The vagrant Friendica instance contains a test database. -You will then have the following accounts to login: +Default User Accounts +--------------------- + +By default the provision script will setup two user accounts. * admin, password admin - * friendica1, password friendica1 - * friendica2, password friendica2 and so on until friendica5 - * friendica1 is connected to all others. friendica1 has two groups: group1 with friendica2 and friendica4, group2 with friendica3 and friendica5. - * friendica2 and friendica3 are connected. friendica4 and friendica5 are connected. + * friendica, password friendica -For further documentation of vagrant, please see [the vagrant*docs*](https://docs.vagrantup.com/v2/). +Trouble Shooting +---------------- + +If you see a version mis-match for the _VirtualBox Guest Additions_ between host and guest during the initial setup of the Vagrant VM, you will need to install an addon to Vagrant (ref. [Stack Overflow](https://stackoverflow.com/a/38010683)). +Stop the Vagrant VM and run the following command: + + $> vagrant plugin install vagrant-vbguest + +On the next Vagrant up, the version problem should be fixed. + +For further documentation of vagrant, please see [the vagrant*docs*](https://docs.vagrantup.com/v2/). \ No newline at end of file From e4dc2b8e1c0ef1a88d0f57fe98203e9be3150575 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 1 Oct 2021 09:38:51 +0200 Subject: [PATCH 5/9] Vagrant: Docs A typo and a note about resolving friendica.local --- doc/Vagrant.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/Vagrant.md b/doc/Vagrant.md index 06c14ff761..94cebd7194 100644 --- a/doc/Vagrant.md +++ b/doc/Vagrant.md @@ -20,7 +20,7 @@ Please use an up-to-date vagrant version from https://www.vagrantup.com/download Inside, you'll find a `Vagrantfile` and some scripts in the `bin/dev` folder. 3. Run `vagrant up` from inside the friendica clone. This will start the virtual machine. -Be patient: When it runs for the first time, it downloads an Debian Server image and installs Friendica. +Be patient: When it runs for the first time, it downloads a Debian Server image and installs Friendica. 4. Run `vagrant ssh` to log into the virtual machine to log in to the VM in case you need to debug something on the server. 5. Open you test installation in a browser. Go to friendica.local (or 192.168.22.10). @@ -63,4 +63,6 @@ Stop the Vagrant VM and run the following command: On the next Vagrant up, the version problem should be fixed. +If `friendica.local` is not resolved, you may need to add an entry to the `/etc/hosts` file (or similar configuration depending on the OS you are using). + For further documentation of vagrant, please see [the vagrant*docs*](https://docs.vagrantup.com/v2/). \ No newline at end of file From 4960d0f438002176fde5265cb3e23bb42f6777fc Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 1 Oct 2021 09:42:08 +0200 Subject: [PATCH 6/9] Vagrant: Add the type to the synced folder in the Vagrantfile --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 7d88beec2b..a7740d3279 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -24,7 +24,7 @@ Vagrant.configure(2) do |config| # Share a folder between host and guest # config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", owner: "www-data", group: "vagrant" - config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", owner: "www-data", group: "www-data" + config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", owner: "www-data", group: "www-data", type: "virtualbox" # Provider-specific configuration so you can fine-tune various # backing providers for Vagrant. These expose provider-specific options. From d52e2ab7915ae9819aa43932aa94f0ae5f3b320b Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 1 Oct 2021 10:00:01 +0200 Subject: [PATCH 7/9] Vagrant: Replace comment with more fitting one in provision --- bin/dev/vagrant_provision.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/dev/vagrant_provision.sh b/bin/dev/vagrant_provision.sh index a9ce293207..6eb9460bd6 100755 --- a/bin/dev/vagrant_provision.sh +++ b/bin/dev/vagrant_provision.sh @@ -93,9 +93,8 @@ echo ">>> Symlink /var/www to /vagrant" rm -rf /var/www/ ln -fs /vagrant /var/www -# install deps with composer +# Setup Friendica cd /var/www - echo ">>> Setup Friendica" # copy the .htaccess-dist file to .htaccess so that rewrite rules work From 0b2fa63bcb8a1bbf5306ecab67d3ccb286091f21 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 1 Oct 2021 10:04:40 +0200 Subject: [PATCH 8/9] Vagrant: Docs add a note about the PHP dependencies --- doc/Vagrant.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/Vagrant.md b/doc/Vagrant.md index 94cebd7194..3751b7bc06 100644 --- a/doc/Vagrant.md +++ b/doc/Vagrant.md @@ -18,6 +18,7 @@ What you need to do: Please use an up-to-date vagrant version from https://www.vagrantup.com/downloads.html. 2. Git clone your Friendica repository. Inside, you'll find a `Vagrantfile` and some scripts in the `bin/dev` folder. +Pull the PHP requirements with `bin/composer install`. 3. Run `vagrant up` from inside the friendica clone. This will start the virtual machine. Be patient: When it runs for the first time, it downloads a Debian Server image and installs Friendica. From 9b23ac578e183ce2dabc1ae11f5acea6e9d65ae0 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 1 Oct 2021 10:18:43 +0200 Subject: [PATCH 9/9] Vagrant: create the correct mail aliases during provision --- bin/dev/vagrant_provision.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/dev/vagrant_provision.sh b/bin/dev/vagrant_provision.sh index 6eb9460bd6..2dc386a4b4 100755 --- a/bin/dev/vagrant_provision.sh +++ b/bin/dev/vagrant_provision.sh @@ -82,7 +82,7 @@ echo ">>> Installing 'Local Only' postfix" debconf-set-selections <<< "postfix postfix/mailname string friendica.local" debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Local Only'" apt-get install -qq postfix mailutils libmailutils-dev -echo -e "friendica1: vagrant\nfriendica2: vagrant\nfriendica3: vagrant\nfriendica4: vagrant\nfriendica5: vagrant" >> /etc/aliases && newaliases +echo -e "$ADMIN_NICK: vagrant\n$USER_NICK: vagrant" >> /etc/aliases && newaliases # Friendica needs git for fetching some dependencies echo ">>> Installing git"