Skip to content

Commit

Permalink
Merge pull request #1325 from iturgeon/issue/fix-heroku-after-config-…
Browse files Browse the repository at this point in the history
…update

fix heroku for config changes on v8.0.0
  • Loading branch information
clpetersonucf authored Feb 25, 2021
2 parents 9116883 + 69b34d6 commit 92178a5
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 17 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ BOOL_SEND_EMAILS=false
#BOOL_ADMIN_UPLOADER_ENABLE=true
#materia.asset_storage_driver
# Where to store author uploaded media? file is easy. db is easy & works when running multiple Materia servers. s3 is harder to set up, but efficient and multi-server friendly.
# Where to store author uploaded media? file is easy. db is easy & works when running multiple Materia servers. s3 is harder to set up, but efficient and multi-server friendly. Do not use file on Heroku.
# [file|db|s3]
# (default: file)
#ASSET_STORAGE_DRIVER=file
Expand All @@ -206,7 +206,7 @@ BOOL_SEND_EMAILS=false
#ASSET_STORAGE_S3_SECRET=
# SESSION & CACHE ===================
# Where to store app cache. file is an easy default if you don't have a memcached server. file is OK on Heroku.
#cache.driver: [memcached|file] (default: file)
#CACHE_DRIVER=file
Expand All @@ -221,7 +221,7 @@ BOOL_SEND_EMAILS=false
#MEMCACHED_PORT=11211
#session.driver
# Where to keep user sessions? file = easy, db = multi-server support, memcached = fast! & multiserver!
# Where to keep user sessions? file = easy, db = multi-server support, memcached = fast! & multiserver! Do not use file on Heroku.
# [db|file|memcached]
# (default: file)
#SESSION_DRIVER=file
Expand Down
43 changes: 34 additions & 9 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,53 @@
"postdeploy": "composer run oil-install-quiet && php oil r widget:install_from_config"
},
"env": {
"FUEL_ENV": {
"description": "FUELPHP Environment to load",
"SYSTEM_EMAIL":{
"description": "From email address for this server",
"required": true,
"value": "production"
"value": "invalid-email@invalid-host.com"
},
"LTI_USERNAME_PARAM":{
"description": "Which LTI post param to use as a username",
"FUEL_LOG_THRESHOLD":{
"description": "Threshold for for which types of logs get written. See Readme",
"required": true,
"value": "300"
},
"SESSION_DRIVER":{
"description": "Where to keep user sessions? See Readme",
"required": true,
"value": "db"
},
"ASSET_STORAGE_DRIVER":{
"description": "Where to store author uploaded media? See Readme",
"required": true,
"value": "db"
},
"LTI_REMOTE_IDENTIFIER":{
"description": "Which LTI post param to use as a username. See Readme",
"required": true,
"value": "lis_person_sourcedid"
},
"LTI_REMOTE_USERNAME":{
"description": "Which LTI post param to use as a username, duplicate of LTI_REMOTE_IDENTIFIER",
"required": true,
"value": "lis_person_sourcedid"
},
"LTI_KEY":{
"description": "LTI Key for configuring your LMS",
"description": "LTI Key for configuring your LMS. See Readme",
"required": true,
"value": "my-demo-materia-heroku-key"
},
"LTI_SECRET":{
"description": "LTI secret for configuring your LMS",
"description": "LTI secret for configuring your LMS. See Readme",
"required": true,
"generator": "secret"
},
"AUTH_SALT":{
"description": "Secret salt for hashing authentication variables. See Readme",
"required": true,
"generator": "secret"
},
"MATERIA_AUTH_SALT":{
"description": "Secret salt for hashing authentication variables",
"AUTH_SIMPLEAUTH_SALT":{
"description": "Secret salt for hashing authentication variables. See Readme",
"required": true,
"generator": "secret"
},
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
"test": "php fuel/vendor/bin/phpunit -c fuel/app/phpunit.xml",
"test-with-xdebug": "php -dzend_extension=xdebug.so fuel/vendor/bin/phpunit -c fuel/app/phpunit.xml",
"coverage": "php oil test --coverage-html=coverage --coverage-clover=coverage.xml --coverage-text=coverage.txt",
"heroku-place-configs": "cp -R fuel/app/config/heroku fuel/app/config/production && cp -R fuel/app/modules/lti/config/heroku fuel/app/modules/lti/config/production",
"heroku-extract-widgets": "php oil r widget:extract_from_config",
"compile": ["@heroku-place-configs", "@heroku-extract-widgets"],
"compile": ["@heroku-extract-widgets"],
"devserver": "php oil server",
"testci":[
"@destroy-everything",
Expand Down
5 changes: 3 additions & 2 deletions fuel/app/config/materia.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@
'db' => [
'driver_class' => '\Materia\Widget_Asset_Storage_Db'
],
's3' => $_ENV['ASSET_STORAGE_DRIVER'] ?? false == 's3'
's3' => (
(($_ENV['ASSET_STORAGE_DRIVER'] ?? 'file') == 's3')
? [
'driver_class' => '\Materia\Widget_Asset_Storage_S3',
'endpoint' =>$_ENV['ASSET_STORAGE_S3_ENDPOINT'] ?? false, // set to url for testing endpoint
Expand All @@ -107,7 +108,7 @@
'key' => $_ENV['ASSET_STORAGE_S3_KEY'] ?? 'KEY' // aws api key
]
: null
,
),
]

];
2 changes: 1 addition & 1 deletion fuel/app/config/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* The theme search paths. They are searched in the order given. You can add paths
* on the fly via Theme::add_path($path) or Theme::add_paths(array($path1, $path2));
*/
'paths' => explode(',', APPPATH.'themes'.','.($_ENV['THEME_PACKAGE'] ? PKGPATH.$_ENV['THEME_PACKAGE'] : '')),
'paths' => explode(',', APPPATH.'themes'.','.(isset($_ENV['THEME_PACKAGE']) ? PKGPATH.$_ENV['THEME_PACKAGE'] : '')),

/**
* The folder inside the theme to be used to store assets. This is relative to the
Expand Down

0 comments on commit 92178a5

Please sign in to comment.