Setup:
$ mongo
> use pubsub
> db.createCollection('messages', { capped: true, size: 100000 })
> db.messages.insert({})
### | |
a small connect middleware proxy for cross domain ajax | |
@path first match group will be forwarded | |
@host the host you want to proxy | |
connect_server.use proxy '^(/.+)', 'api.twitter.com' | |
connect_server.use proxy '^/gh(/.+)', 'api.github.com' | |
### |
<!-- country codes (ISO 3166) and Dial codes. --> | |
<select name="countryCode" id=""> | |
<option data-countryCode="GB" value="44" Selected>UK (+44)</option> | |
<option data-countryCode="US" value="1">USA (+1)</option> | |
<optgroup label="Other countries"> | |
<option data-countryCode="DZ" value="213">Algeria (+213)</option> | |
<option data-countryCode="AD" value="376">Andorra (+376)</option> | |
<option data-countryCode="AO" value="244">Angola (+244)</option> | |
<option data-countryCode="AI" value="1264">Anguilla (+1264)</option> | |
<option data-countryCode="AG" value="1268">Antigua & Barbuda (+1268)</option> |
I am deploying with this IAM using Codeship and Circle CI to Elastic Beanstalk. I had a lot of trouble with this config. I talked to the aws support for about 6 hours until this worked properly, so, I guess it is worth to share.
UPDATE: In the end, I have to use the AWSElasticBeanstalkFullAccess
policy. My custom policy keep breaking every week with some new added permission or some EB internal change. Anyway, the IAM I was using is below.
This works for me with CircleCI and EB Cli.
{
"Version": "2012-10-17",
"Statement": [
{
An IAM user policy document to give minimal rights for deploying an Elastic Beanstalk application.
Where:
REGION
: AWS region.ACCOUNT_ID
: AWS account ID.APPLICATION_NAME
: Desired target Elastic Beanstalk application name(space).IAM_INSTANCE_PROFILE_ROLE
: The instance profile (IAM role) Elastic Beanstalk EC2 instaces will run under.# Last updated: 08/24/2916 | |
# | |
# Total instructions available: 18 | |
# | |
# https://docs.docker.com/engine/reference/builder/ | |
# | |
# You can use a .dockerignore file in the same context directory as | |
# your Dockerfile to ignore files in the context before sending them | |
# to the Docker daemon for building to speed up building. |
addEventListener('fetch', event => { | |
event.respondWith(fetchAndCheckPassword(event.request)) | |
}) | |
async function fetchAndCheckPassword(req) { | |
if (req.method == "POST") { | |
try { | |
const post = await req.formData(); | |
const pwd = post.get('password') | |
const enc = new TextEncoder("utf-8").encode(pwd) |
map $http_origin $allow_origin { | |
default "$http_origin"; | |
} | |
map $request_method $cors_method { | |
default "allowed"; | |
"OPTIONS" "preflight"; | |
} | |
map $cors_method $cors_max_age { |
map $http_origin $allow_origin { | |
default "$http_origin"; | |
} | |
map $request_method $cors_method { | |
default "allowed"; | |
"OPTIONS" "preflight"; | |
} | |
map $cors_method $cors_max_age { |
API_KEY='xxxxxxxxxxxxxxxxxxx-us1' | |
LIST_ID=12033101ax |