Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
s3fs-3315723
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
s3fs-3315723
Commits
376889dd
Commit
376889dd
authored
7 years ago
by
coredumperror
Browse files
Options
Downloads
Patches
Plain Diff
Added read/write permission checking to the default cache location.
parent
326e9813
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
s3fs.admin.inc
+2
-1
2 additions, 1 deletion
s3fs.admin.inc
s3fs.install
+22
-0
22 additions, 0 deletions
s3fs.install
s3fs.module
+5
-4
5 additions, 4 deletions
s3fs.module
with
29 additions
and
5 deletions
s3fs.admin.inc
+
2
−
1
View file @
376889dd
...
...
@@ -73,7 +73,8 @@ function s3fs_settings() {
'#type'
=>
'textfield'
,
'#title'
=>
t
(
'Default Cache Location'
),
'#default_value'
=>
_s3fs_get_setting
(
'awssdk2_default_cache_config'
),
'#description'
=>
t
(
'The default cache location for your EC2 Instance Profile Credentials.'
),
'#description'
=>
t
(
'The default location to which your EC2 Instance Profile Credentials should be cached.
This must be a path to a folder in which the webserver can read and write.'
),
'#states'
=>
array
(
'visible'
=>
array
(
':input[id=edit-s3fs-use-instance-profile]'
=>
array
(
'checked'
=>
TRUE
),
...
...
This diff is collapsed.
Click to expand it.
s3fs.install
+
22
−
0
View file @
376889dd
...
...
@@ -82,6 +82,28 @@ function s3fs_requirements($phase) {
);
}
if
(
_s3fs_get_setting
(
'awssdk2_use_instance_profile'
))
{
$default_cache_config
=
_s3fs_get_setting
(
'awssdk2_default_cache_config'
);
if
(
isset
(
$config
[
'awssdk2_default_cache_config'
]))
{
$default_cache_config
=
$config
[
'awssdk2_default_cache_config'
];
}
$message
=
array
(
'title'
=>
$t
(
'AWS Instance Profile Cache'
),
);
if
(
empty
(
$default_cache_config
)
||
!
(
is_writable
(
$default_cache_config
)
&&
is_readable
(
$default_cache_config
)))
{
$message
[
'value'
]
=
$t
(
'The instance profile cache is NOT configured correctly in S3FS. It must be set to an
existing folder on the server, and the webserver must have read and write permissions on that folder.'
);
$message
[
'severity'
]
=
REQUIREMENT_ERROR
;
}
else
{
$message
[
'value'
]
=
$t
(
'The instance profile cache setting in S3FS is configured correctly.'
);
$message
[
'severity'
]
=
REQUIREMENT_INFO
;
}
$requirements
[
's3fs_default_cache_location_status'
]
=
$message
;
}
return
$requirements
;
}
...
...
This diff is collapsed.
Click to expand it.
s3fs.module
+
5
−
4
View file @
376889dd
...
...
@@ -731,12 +731,13 @@ function _s3fs_get_amazons3_client($config) {
array
(
'!settings_page'
=>
l
(
t
(
'settings page'
),
'admin/config/media/s3fs/settings'
)))
);
}
else
if
(
$use_instance_profile
&&
empty
(
$default_cache_config
))
{
else
if
(
$use_instance_profile
&&
(
empty
(
$default_cache_config
)
||
!
(
is_writable
(
$default_cache_config
)
&&
is_readable
(
$default_cache_config
))))
{
throw
new
s3fsException
(
t
(
"Your AWS credentials have not been properly configured.
You are attempting to use instance profile credentials but you have not set a default cache location.
You are attempting to use instance profile credentials but you have not set a
valid
default cache location.
Please set it on the !settings_page or set
\$
conf['awssdk2_default_cache_config'] in settings.php.
Note that this cache location must be an existing folder that can be read and written by
both
your webserver
and
whichever user you run drush commands under."
,
Note that this cache location must be an existing folder that can be read and written by your webserver
.
It should also be writable by
whichever user you run drush commands under."
,
array
(
'!settings_page'
=>
l
(
t
(
'settings page'
),
'admin/config/media/s3fs/settings'
)))
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment