diff --git a/Vagrantfile b/Vagrantfile index 81676df61..a7740d327 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 @@ -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. diff --git a/bin/dev/vagrant_provision.sh b/bin/dev/vagrant_provision.sh index c8e62f291..2dc386a4b 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" @@ -93,13 +93,8 @@ echo ">>> Symlink /var/www to /vagrant" rm -rf /var/www/ ln -fs /vagrant /var/www -# install deps with composer -echo ">>> Installing php requirements" -apt install unzip +# Setup Friendica cd /var/www -php bin/composer.phar install - - echo ">>> Setup Friendica" # copy the .htaccess-dist file to .htaccess so that rewrite rules work @@ -120,10 +115,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" diff --git a/doc/Vagrant.md b/doc/Vagrant.md index 4040495ca..3751b7bc0 100644 --- a/doc/Vagrant.md +++ b/doc/Vagrant.md @@ -10,27 +10,27 @@ 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. +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. +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 +46,24 @@ 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. + +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