Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/city-of-helsinki/drupal-module-helfi-azure-fs
Drupal module for Azure specific file system fixes
https://github.com/city-of-helsinki/drupal-module-helfi-azure-fs
Last synced: 6 days ago
JSON representation
Drupal module for Azure specific file system fixes
- Host: GitHub
- URL: https://github.com/city-of-helsinki/drupal-module-helfi-azure-fs
- Owner: City-of-Helsinki
- Created: 2021-05-07T08:58:05.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T09:53:30.000Z (3 months ago)
- Last Synced: 2024-10-29T11:52:53.546Z (3 months ago)
- Language: PHP
- Size: 186 KB
- Stars: 0
- Watchers: 9
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Drupal Azure FS
![CI](https://github.com/City-of-Helsinki/drupal-module-helfi-azure-fs/workflows/CI/badge.svg) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=City-of-Helsinki_drupal-module-helfi-azure-fs&metric=coverage)](https://sonarcloud.io/summary/new_code?id=City-of-Helsinki_drupal-module-helfi-azure-fs)
Provides various fixes to deal with Azure's NFS mount and an integration to Azure's Blob storage service using [flysystem](https://www.drupal.org/project/flysystem).
Azure's NFS file mount does not support certain file operations (such as chmod), causing any request that performs them to give a 5xx error, like when trying to generate an image style.
This module decorates core's `file_system` service to skip unsupported file operations when the site is operating on Azure environment.
## Requirements
- PHP 8.1 or higher
## Usage
Enable the module.
### Using Azure Blob storage to host all files (optional)
- Populate required environment variables:
```
AZURE_BLOB_STORAGE_CONTAINER: The container name
AZURE_BLOB_STORAGE_NAME: The blob storage name
BLOBSTORAGE_ACCOUNT_KEY: The blob storage secret
```or if you're using SAS token authentication:
```
BLOBSTORAGE_SAS_TOKEN: The SAS token
AZURE_BLOB_STORAGE_NAME: The blob storage name
```### Testing on local
Add something like this to your `local.settings.php` file:
```php
$schemes = [
'azure' => [
'driver' => 'helfi_azure',
'config' => [
'name' => '[ insert account name here ]',
'token' => '[ insert sas token here ]',
'container' => '[ insert container name here ]',
'endpointSuffix' => 'core.windows.net',
'protocol' => 'https',
],
'cache' => TRUE,
],
];
$config['helfi_azure_fs.settings']['use_blob_storage'] = TRUE;
$settings['flysystem'] = $schemes;
$settings['is_azure'] = TRUE;
```The correct values can be found by running `printenv | grep BLOB` inside a OpenShift Drupal pod.
## Contact
Slack: #helfi-drupal (http://helsinkicity.slack.com/)