Skip to content

Commit

Permalink
S3
Browse files Browse the repository at this point in the history
  • Loading branch information
timkelty committed Feb 22, 2022
1 parent 248dd60 commit 9abdfe8
Show file tree
Hide file tree
Showing 93 changed files with 6,362 additions and 21,948 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14.15.0
v14.15.0
2 changes: 2 additions & 0 deletions config/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
'maxSlugIncrement' => 100,
'aliases' => [
'@web' => App::env('DEFAULT_SITE_URL'),
'@assetBaseUrl' => App::env('S3_BASE_URL') ?: App::env('DEFAULT_SITE_URL'),
'@distBaseUrl' => (App::env('S3_BASE_URL') ?: App::env('DEFAULT_SITE_URL')) . '/dist',
],
],
'dev' => [
Expand Down
6 changes: 5 additions & 1 deletion config/license.key
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
temp
!&7FHIWL+P$6*IF8T!8Y/9RV8DI^/SP8#M*JM#Z*G6/BPL29X$
!&ETLOT$09YHBB/T6*QGCYMTI4U7YT/RTGWXH^CZ^QR$U!VLDR
HTVE+LPV07=JXB/CN51S!053$#&2TVL7OMFCCR1W#$!51BXXMK
X^X*4XD%Q4ATL+/3F+2=L*W%#EESHA2W#S8IABZSM4YGB0LP2H
J4HWVZ6$EY=MMU0EXN0%FBA9PLI*0CTQ!9K9YH9S#039D9ZV#L
5 changes: 4 additions & 1 deletion config/project/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dateModified: 1644970269
dateModified: 1645544307
email:
fromEmail: [email protected]
fromName: 'Europa Museum'
Expand Down Expand Up @@ -126,6 +126,7 @@ plugins:
freeform:
edition: lite
enabled: true
licenseKey: VKEWWWS910PS87ALDS4HIVX8
schemaVersion: 3.5.1
settings:
ajaxByDefault: '1'
Expand Down Expand Up @@ -188,6 +189,7 @@ plugins:
imager-x:
edition: pro
enabled: true
licenseKey: 921AV00SG3ZDR1HG4V4K6GSC
schemaVersion: 3.0.0
minify:
edition: standard
Expand All @@ -212,6 +214,7 @@ plugins:
seomatic:
edition: standard
enabled: true
licenseKey: F05LKTHK735ZMFRL0LNY2YWC
schemaVersion: 3.0.11
typedlinkfield:
edition: standard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,21 @@ handle: images
hasUrls: true
name: Images
settings:
path: '@webroot/assets/images'
addSubfolderToRootUrl: '1'
autoFocalPoint: ''
bucket: $S3_BUCKET
bucketSelectionMode: manual
cfDistributionId: ''
cfPrefix: ''
expires: ''
keyId: ''
makeUploadsPublic: '1'
region: $AWS_REGION
secret: ''
storageClass: ''
subfolder: assets/images
sortOrder: 1
titleTranslationKeyFormat: null
titleTranslationMethod: site
type: craft\volumes\Local
url: '@web/assets/images'
type: craft\awss3\Volume
url: '@assetBaseUrl'
31 changes: 27 additions & 4 deletions modules/demos/src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace modules\demos;

use modules\demos\widgets\Guide;

use Craft;

use craft\events\RegisterComponentTypesEvent;
use craft\events\RegisterTemplateRootsEvent;
use craft\services\Dashboard;
use craft\web\View;
use modules\demos\widgets\Guide;
use yii\base\Event;

class Module extends \yii\base\Module
Expand All @@ -28,17 +28,40 @@ public function init(): void
Event::on(
View::class,
View::EVENT_REGISTER_CP_TEMPLATE_ROOTS,
function(RegisterTemplateRootsEvent $event) {
function (RegisterTemplateRootsEvent $event) {
$event->roots['modules'] = __DIR__ . '/templates';
}
);

Event::on(
Dashboard::class,
Dashboard::EVENT_REGISTER_WIDGET_TYPES,
static function(RegisterComponentTypesEvent $event) {
static function (RegisterComponentTypesEvent $event) {
$event->types[] = Guide::class;
}
);
}

private function _useLocalVolumes()
{
Craft::$container->set(AwsVolume::class, function ($container, $params, $config) {
if (empty($config['id'])) {
return new AwsVolume($config);
}

return new LocalVolume([
'id' => $config['id'],
'uid' => $config['uid'],
'name' => $config['name'],
'handle' => $config['handle'],
'hasUrls' => $config['hasUrls'],
'url' => "@web/{$config['subfolder']}",
'path' => "@webroot/{$config['subfolder']}",
'sortOrder' => $config['sortOrder'],
'dateCreated' => $config['dateCreated'],
'dateUpdated' => $config['dateUpdated'],
'fieldLayoutId' => $config['fieldLayoutId'],
]);
});
}
}
Loading

0 comments on commit 9abdfe8

Please sign in to comment.