/weewx-s3

Extension to upload web files to an AWS S3 bucket from where they are publicly served

Primary LanguagePythonGNU General Public License v2.0GPL-2.0

weewx-s3

This repository is a fork of https://github.com/wmadill/weewx-S3upload, a weeWX extension to sync web files to an AWS S3 bucket.

Rather than serving the web pages generated by weeWX directly from a webserver running on the same system as weeWX, those pages can be uploaded to an AWS S3 bucket. The bucket is configured to be a static website.

This has been tested against weeWX 3.8.2.

Setup

Before installing this extensions, get an S3 bucket at Amazon https://aws.amazon.com/. Sign into the management console, create an account if necessary, then create an S3 bucket.

Search their help pages for how to set up the bucket as a static website. You'll need to add a DNS record for the URL you choose for accessing the bucket.

Install s3cmd from http://s3tools.org/s3cmd. It is a Python 2.x tool so will run fine on the same computer as weeWX. This has been tested with s3cmd 2.0.2.

Installation instructions

  1. Download the extension
wget -O weewx-s3.zip https://github.com/jonotaegi/weewx-s3/archive/master.zip
  1. Install the extension
sudo wee_extension --install weewx-s3.zip
  1. Modify the S3 stanza in weewx.conf and set your S3 access code, secret token, and bucket name. You will get those when you set up the bucket you want to use.

  2. Restart weeWX

sudo /etc/init.d/weewx restart

Manual installation instructions:

  1. Clone this repo
git clone git@github.com:jonotaegi/weewx-s3 ~/weewx-s3
  1. Copy files to the weeWX user directory
cp -rp ~/weewx-s3/skins/S3 /home/weewx/skins
cp -rp ~/weewx-s3/bin/user/s3.py /home/weewx/bin/user
  1. Add the following to weewx.conf
[StdReport]
    ...
    [[S3]]
        skin = S3
        access_key = 'REPLACE_WITH_YOUR_S3_ACCESS_KEY'
        secret_token ='REPLACE_WITH_YOUR_SECRET_TOKEN'
        bucket = 'REPLACE_WITH_THE_NAME_OF_YOUR_S3_BUCKET'
  1. Restart weeWX
sudo /etc/init.d/weewx restart