From 1490193deb6a9dbe8dd78b26990340835c875a42 Mon Sep 17 00:00:00 2001 From: Samshuijzen Date: Thu, 18 Apr 2024 13:40:23 +0200 Subject: [PATCH 1/3] Explain setting up a shared folder for local development within virtualbox management tool. --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 6e376fb..7933b96 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,24 @@ sudo -u www-data /usr/bin/php8.0 artisan db:seed sudo -u www-data /usr/bin/php8.0 artisan storage:link ``` +# Local development setup + +## Configuring shared folder for local development (Windows host) + +For local development on the msl_api codebase a shared folder can be created and mounted within the server to easy work +with git and an IDE on the local filesystem. + +1. Open the Virtualbox management program +2. Right-click the 'epos-msl' container and select settings +3. Go to 'shared folders' and click to add a new shared folder with the following settings: + - name: epos + - path: + - access: full + - automatically connect: yes + + + + # Configuration The main configuration settings are: From a249d706926bba91a2efe6c6a81769039afed144 Mon Sep 17 00:00:00 2001 From: Samsh001 Date: Tue, 23 Apr 2024 13:46:46 +0200 Subject: [PATCH 2/3] Update README to include instructions on how to setup a local development environment on Windows host. --- README.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7933b96..d39cd45 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Upgrading the EPOS-MSL development instance to the latest version can be done by On a Windows host first SSH into the Ansible controller virtual machine (skip this step on GNU/Linux or macOS): ```bash -vagrant ssh controller +vagrant ssh epos-msl-controller cd ~/epos-msl ``` @@ -78,9 +78,9 @@ sudo -u www-data /usr/bin/php8.0 artisan db:seed sudo -u www-data /usr/bin/php8.0 artisan storage:link ``` -# Local development setup +## Local development setup -## Configuring shared folder for local development (Windows host) +### Configuring shared folder for local development (Windows host) For local development on the msl_api codebase a shared folder can be created and mounted within the server to easy work with git and an IDE on the local filesystem. @@ -93,6 +93,76 @@ with git and an IDE on the local filesystem. - access: full - automatically connect: yes +Next ssh in to epos-msl: +```bash +vagrant ssh epos-msl +``` +The share should now be visible within /media. To give the vagrant and msl-api users access to the folder and its +contents: +```bash +sudo adduser www-data vboxsf +sudo adduser vagrant vboxsf +``` + +Next, restart the server: +```bash +sudo restart +``` + +After rebooting ssh into epos-msl again and the content of the share should be visible within /media/sf_epos! + +Now we will use the actual contents to replace the currently used checkout of msl_api by the contents of the share. +First remove the current msl_api folder or rename it: + +```bash +sudo mv /var/www/msl_api /var/www/msl_api_bck +``` + +Create a symlink to use the contents from the shared folder to replace the msl_api folder: +```bash +sudo ln -s /media/sf_epos /var/www/msl_api +``` + +Check to see if the login page is accessible by navigating to epos-msl.ckan.test/webservice/login, a reboot might be +needed. + +### Seeding test admin panel account(s) + +The msl_api project contains a specific seeder for adding test admin accounts. Contents can be adjusted to add or +adjust accounts within /database/seeders/AdminUserSeeder.php. Add the account(s) by running the following command: + +```bash +sudo -u www-data /usr/bin/php8.0 artisan db:seed --class=AdminUserSeeder +``` + +You should now be able to login to the admin panel. + +### Create and set CKAN apikey for msl_api connections + +An API key needs to be generated within CKAN to be used by msl-api for transferring data. + +1. Navigate to: https://epos-msl.ckan.test/user/login and sigin in with: + Username: ckanadmin + Password: testtest +2. Navigate to: https://epos-msl.ckan.test/user/edit/ckanadmin and click 'Regenerate API key' +3. Copy the API Key displayed in the bottom left +4. Paste the value within the .env file of msl-api for the 'CKAN_API_TOKEN' key + +### Restarting the queue processor + +After changing settings in the .env file or making changes to the code used by queue processing jobs the queue needs to +be restarted using: + +```bash +sudo -u www-data /usr/bin/php8.0 artisan queue:restart +``` + + + + + + + From aac1267741a21212ea196650de6bccacdcb39701 Mon Sep 17 00:00:00 2001 From: Samsh001 Date: Tue, 23 Apr 2024 16:26:39 +0200 Subject: [PATCH 3/3] typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d39cd45..20763f7 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ sudo -u www-data /usr/bin/php8.0 artisan storage:link ### Configuring shared folder for local development (Windows host) -For local development on the msl_api codebase a shared folder can be created and mounted within the server to easy work +For local development on the msl_api codebase a shared folder can be created and mounted within the server to work with git and an IDE on the local filesystem. 1. Open the Virtualbox management program