Skip to content

Commit ed0adfc

Browse files
committed
MSL API: use empty app key by default
and describe procedure for setting key more clearly in README.
1 parent 1b7b2b1 commit ed0adfc

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,19 @@ Upgrade EPOS-MSL instance:
5252
ansible-playbook playbook.yml
5353
```
5454

55+
## Updating the MSL API app key
56+
57+
If you have deployed the server using the default empty MSL API app key, generate
58+
a random one:
59+
60+
```
61+
sudo -u www-data /usr/bin/php8.0 artisan key:generate
62+
sudo -u www-data /usr/bin/php8.0 artisan config:cache
63+
```
64+
65+
Then copy this key from `APP_KEY` in `/var/www/msl_api/.env` to the Ansible configuration of
66+
the server.
67+
5568
## Database creation/seeding for the MSL API
5669

5770
You currently need to manually trigger creation and seeding of the MSL API database, as well as linking its storage
@@ -78,7 +91,7 @@ The main configuration settings are:
7891
|msl_api_app_url | application URL for the MSL API web service, e.g. https://epos-catalog.mydomain.nl/webservice |
7992
|msl_api_asset_url | asset URL for the MSL API web service, e.g. https://epos-catalog.mydomain.nl/webservice |
8093
|ckan_api_token | the MSL API uses this value to authenticate to the CKAN API. this should currently be the API key (not API token!) of the ckanadmin account. The current way to use this field is: deploy the catalog using a dummy value for this parameter, log in on CKAN using the ckanadmin account, generate an API key, replace the dummy value in the host\_vars file with the real API key, and run the playbook a second time.
81-
|msl_api_app_key | the MSL API application key. The current way to configure this is to deploy the application, generate the app key by running `/usr/bin/php8.0 artisan key:generate` in /var/www/msl\_api. Finally copy the generated key in /var/www/msl\_api/.env to the host\_vars file.
94+
|msl_api_app_key | the MSL API application key. The current way to configure this is to deploy the application, generate the app key by running `sudo -u www-data /usr/bin/php8.0 artisan key:generate && sudo -u www-data /usr/bin/php8.0 artisan config:cache` in /var/www/msl\_api. Finally copy the generated key in /var/www/msl\_api/.env to the host\_vars file.
8295

8396
# CKAN catalog
8497

environments/development/host_vars/epos-msl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ ckan_harvest_password: testtest # CKAN harvest user ('harvest') p
2626
msl_api_database_password: testtest
2727
msl_api_app_url: http://epos-msl.ckan.test/webservice
2828
msl_api_asset_url: https://epos-msl.ckan.test/webservice
29+
msl_api_app_key: ""
2930
ckan_api_token: none

0 commit comments

Comments
 (0)