Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elliotpenson/s4
S3 Search: easily add search to your S3 website.
https://github.com/elliotpenson/s4
Last synced: 5 days ago
JSON representation
S3 Search: easily add search to your S3 website.
- Host: GitHub
- URL: https://github.com/elliotpenson/s4
- Owner: ElliotPenson
- Created: 2019-03-09T04:27:56.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-09T14:44:46.000Z (almost 6 years ago)
- Last Synced: 2024-11-07T20:52:19.369Z (about 2 months ago)
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# S4
S4 ("S3 Search") enables quick searches on static websites hosted
with [S3](https://aws.amazon.com/s3/). Users enter their query as part of the
URL path. For example, `search.example.com/code` might redirect to
`example.com/pages/how-to-write-clean-code.html`. The project exists as a Lambda
behind API Gateway. This project was bootstrapped
with [Chalice](https://github.com/aws/chalice).Try the project at [s.penson.io](http://s.penson.io)! This page will
search [my wiki](http://wiki.penson.io).## Deployment
First, install requirements.
cd s4
virtualenv -p python3 venv
. venv/bin/activate
pip install -r requirements.txtThen, deploy with Chalice.
chalice deploy.
## Development
View logs with Chalice.
chalice logs
Run tests with `pytest`.
python -m pytest
Note that you'll need to install dependencies from `tests/requirements.txt`.
## Configuration
This project relies on one environment variable. `BUCKET` holds the name of the
S3 bucket you'd like to search. Edit this value in `s4/.chalice/config.json`.## Custom Domain
Follow the steps below to serve the search from a custom domain name. These
steps assume that you have a domain registered with
[Route53](https://aws.amazon.com/route53/).1. Navigate to API Gateway from the AWS console.
2. Click *Custom Domain Names* in the sidebar.
3. Select *Create Custom Domain Name* and enter your domain name.
4. Add a *Base Path Mapping* with a destination of `s4:api`.
5. Navigate to Route53 from the AWS console.
6. Click *Hosted zones* and select your domain name.
7. Select *Create Record Set* and enter a subdomain (I chose `s`).
8. Choose `A - IPv4` as the type.
9. Toggle *Yes* under *Alias* and look for the API Gateway API under *Alias
Target*.
10. Lastly, click *Create*.