Skip to content


Add support for adding headers in .s3cfg file #41

merged 1 commit into from

6 participants


Adding headers with --add-header from the command line is helpful But, it's sometimes nice to be able to set headers for all files in the .s3cfg. For example, to use AES256 encryption on all files uploaded. There are other places this is useful as well. It's a simple change that I think adds decent functionality to s3cmd. Here's how it looks in a config file:

add_headers = x-amz-server-side-encryption:AES256, x-foo:something


+1 This would be a massive help


Still would like to see this merged if you're willing.



s3tools member

I've pulled this (relistan/master) branch into a merge branch in my tree. Hopefully that'll help with an official upstream merge down the line...


Great, thanks.


I see that other pull requests have been merged since I opened this. Is there an objection to this request, or the implementation that is preventing this from getting pulled into master?


Anyone home? 8 months and counting!


There was an announcement a few weeks ago saying that the author was no longer
able to develop this tool. He was asking for volunteers to step in and take
over from him. I've not seen anything indicating that somebody has taken over
so I assume there is still a vacancy.

Hope this helps.


Ah, that explains why the pull request list has grown and grown recently. Thanks for the info, I missed that. I'll contact the author directly--hopefully he'll respond. Cheers.


If you end up wanting to lead the project, I don't mind helping. I don't have the cycles to take the lead on it, but I can help out a great deal. Let me know what you think.


@mludvig mludvig merged commit 50a4233 into s3tools:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 0 deletions.
  1. +7 −0 S3/
7 S3/
@@ -83,6 +83,7 @@ class Config(object):
website_index = "index.html"
website_error = ""
website_endpoint = "http://%(bucket)s.s3-website-%(location)"
+ add_headers = ""
## Creating a singleton
def __new__(self, configfile = None):
@@ -112,6 +113,12 @@ def read_config_file(self, configfile):
cp = ConfigParser(configfile)
for option in self.option_list():
self.update_option(option, cp.get(option))
+ if cp.get('add_headers'):
+ for option in cp.get('add_headers').split(","):
+ (key, value) = option.split(':')
+ self.extra_headers[key.replace('_', '-').strip()] = value.strip()
def dump_config(self, stream):
Something went wrong with that request. Please try again.