These are chat archives for reactioncommerce/reaction

16th
Oct 2016
Ivanthadev
@ivanthemeh
Oct 16 2016 00:05
@zenweasel if I have ssl, is browser-policy necessary?
Brent Hoover
@zenweasel
Oct 16 2016 00:06
yeah, SSL does not prevent things like cross-scripting attacks
Brent Hoover
@zenweasel
Oct 16 2016 00:12
@hydrotik So you are missing an import (or it’s missing in the original code depending on how you look at it)
In order for a template to be used it needs to be imported

I added

import "./layouts/footer.html”;

to client/templates/index.js and the footer appeared

@ivanthemeh the amount of extra content it needs to serve should be microscopic so I am confused as to why this would need extra anything
Ivanthadev
@ivanthemeh
Oct 16 2016 00:19
@zenweasel well how can I get this to work? Im certain it has to do something with that package consider me removing it and editing the code for errors is the only way Ive been able to get this to work with ssl, if you want I can tell you how to reproduce it on a free ec2 instance.
Brent Hoover
@zenweasel
Oct 16 2016 00:20
Except we have people running this every day without any issues
well, without this issue
Donovan Adams - Hydrotik
@hydrotik
Oct 16 2016 00:22
@zenweasel Thanks Brent! thought i had accounted for that in my original pass at this but missed that here. This should give me some mileage:)
Brent Hoover
@zenweasel
Oct 16 2016 00:23
@ivanthemeh what are you using for your reverse proxy?
Ivanthadev
@ivanthemeh
Oct 16 2016 00:24
@zenweasel im guessing nginx. Im not a devops guy, Im just pretending to be >.>
Brent Hoover
@zenweasel
Oct 16 2016 00:24
aren’t we all :)
Ivanthadev
@ivanthemeh
Oct 16 2016 00:25
lol
I feel like I am much more so than others..
Brent Hoover
@zenweasel
Oct 16 2016 00:25
I would tend to suspect your proxy more than reaction itself just based on the error messaging. Perhaps it’s trying to insert it’s own browser-security
Ivanthadev
@ivanthemeh
Oct 16 2016 00:26
I wouldnt even know how to begin to figure that out..
Brent Hoover
@zenweasel
Oct 16 2016 00:26
so how did you get this set up then?
Ivanthadev
@ivanthemeh
Oct 16 2016 00:26
Im having a hard time forking a docker repo so I can increase the proxy-buffer size of the mup front-end
I created an app using the cli and then I used mupx to push it to aws ec2
Brent Hoover
@zenweasel
Oct 16 2016 00:28
so I am not really familiar with mup, didn’t realize people were still using that
Ivanthadev
@ivanthemeh
Oct 16 2016 00:28
I wasnt able to get the docker image working and Im VERY new to docker and more used to mupx so I gave up.
Brent Hoover
@zenweasel
Oct 16 2016 00:29
well, we need to dig into your reverse proxy (if there is one) somehow
because we have people using the browser-security as-is in production without any issues
and tons of people are using that package
Ivanthadev
@ivanthemeh
Oct 16 2016 00:30
so you think this is specific to me somehow?
Brent Hoover
@zenweasel
Oct 16 2016 00:31
since you are the only person experiencing it, that is what I am going with
Ivanthadev
@ivanthemeh
Oct 16 2016 00:33
so what should I do? Im kinda lost at this point it seems.
Brent Hoover
@zenweasel
Oct 16 2016 00:34
so let me ask you, what are you trying to accomplish right now? Are you trying to evaluate RC or do you have code that you actually want to deploy to an instance or?
our solution to the “I am not a devops” problem is to go with Docker
Ivanthadev
@ivanthemeh
Oct 16 2016 00:35
Im trying to get RC working on a aws instance with ssl so I can build it into a tee shirt shop.
Brent Hoover
@zenweasel
Oct 16 2016 00:36
so you are not making code changes or?
Ivanthadev
@ivanthemeh
Oct 16 2016 00:36
I would love to go with docker considering its the recommended route but it would take me days to figure it out by myself and I feel like im bugging you guys to much already so it seems like a lot.
Brent Hoover
@zenweasel
Oct 16 2016 00:36
I guess I am asking, why are you starting with the hardest part first?
Ivanthadev
@ivanthemeh
Oct 16 2016 00:37
Yes Im going to make code changes, I want to make sure I can deploy it and get ssl working first
I guess I wanna make sure I can do the hard stuff and the rest is easy?
Brent Hoover
@zenweasel
Oct 16 2016 00:37
hmmm yeah, “swallow the frog” as they say
Ivanthadev
@ivanthemeh
Oct 16 2016 00:37
Im weird like that I guess
So can you help me get docker going?
I can ssh into my ec2 instance
and I can follow directions
I will probably have a few questions though since I have used docker like twice before
Brent Hoover
@zenweasel
Oct 16 2016 00:40
To be honest, I am not a hotshot with Docker either. I have deployed stuff but I am no expert. The real expert is @jshimko
maybe we can set up a time for you, me and @jshimko to go through deploying your custom code using Docker. This is actually something I have been meaning to do anyway
but I would also say this, you can get it deployed. People do it every day. We will be here to help you. So you can develop knowing you aren’t going to get stranded
Ivanthadev
@ivanthemeh
Oct 16 2016 00:44
OK when can we set that time up? Im gonna keep messing with the docker and see If I can get it going.
Brent Hoover
@zenweasel
Oct 16 2016 00:45
@jshimko is a workaholic so I would not be surprised if he is around this weekend, but it’s not fair to count on that. So let me ask him and see
do you have a particular reason to go with EC2 as opposed to Digital Ocean?
Ivanthadev
@ivanthemeh
Oct 16 2016 00:47
other than all my other apps being on aws no
Brent Hoover
@zenweasel
Oct 16 2016 00:47
that’s a pretty good reason
Ivanthadev
@ivanthemeh
Oct 16 2016 00:48
lol
I was talking to @jshimko last night and he was telling me that its not that easy to do on aws?
Brent Hoover
@zenweasel
Oct 16 2016 00:50
I don’t know. He’s the guy who knows, but we are doing all of our deployment on AWS
Ivanthadev
@ivanthemeh
Oct 16 2016 00:51
ok so its possible then
Brent Hoover
@zenweasel
Oct 16 2016 00:51
for sure it’s possible
I mean, I feel you on Docker. There’s a lot to take in. Especially since the main sell seems to be “it makes deployment so easy"
and honestly I need to understand how to use it more because this issue comes up a lot and Jeremy can’t answer all those questions himself
Donovan Adams - Hydrotik
@hydrotik
Oct 16 2016 00:52
LOL where are you custom header
Ivanthadev
@ivanthemeh
Oct 16 2016 01:24
Im gonna try to deploy one to DO and then Ill work on the AWS when @jshimko is available
@zenweasel should I just use kitematic and then push the local container to a DO droplet or AWS is that how it works?
Brent Hoover
@zenweasel
Oct 16 2016 01:31
All I have done with DO is launch an instance using the default Reaction container
so just getting a plain vanilla RC running, not pushing my custom code
Ivanthadev
@ivanthemeh
Oct 16 2016 01:37
I would love to get this going and be able to contribute some code to it someday.
Brent Hoover
@zenweasel
Oct 16 2016 01:39
Not sure what I can say here. I know what I know, it’s not like I am holding out on you.
Brent Hoover
@zenweasel
Oct 16 2016 01:45
If you can get your docker image up to docker hub, then you should be able to pull it from there
just substituting the name of your build in for reactiocommerce/reaction:latest
were you able to get the container provisioned?
Ivanthadev
@ivanthemeh
Oct 16 2016 01:52
I got it going in kitematic
Brent Hoover
@zenweasel
Oct 16 2016 01:53
so locally then?
Ivanthadev
@ivanthemeh
Oct 16 2016 01:54
so far yea
looking at this new docker ec2 thing on aws
Brent Hoover
@zenweasel
Oct 16 2016 01:55
it seems you should be able to create your own docker image, push it to dockerhub, and then have you server deploy image from there
Ivanthadev
@ivanthemeh
Oct 16 2016 01:56
I have to learn all of that, Ive never used any of this before
Brent Hoover
@zenweasel
Oct 16 2016 01:57
well, fwiw it’s worth. We are working on a reaction deploy command that should take the pain out of doing this
ECS is probably overkill for a single server deployment
Ivanthadev
@ivanthemeh
Oct 16 2016 02:00
Im not able to connect to the web preview in kitematic..
Maybe I should just go to bed :cry:
Brent Hoover
@zenweasel
Oct 16 2016 02:01
Hmmm, sorry
I always do everything from the command line, I have not really tried kitematic yet
Ivanthadev
@ivanthemeh
Oct 16 2016 02:02
It was still starting up >.>
Jeremy Shimko
@jshimko
Oct 16 2016 02:09
oh man… 10 mins of reading.
Hi guys.
Brent Hoover
@zenweasel
Oct 16 2016 02:13
Howdy Dr. J
your ears burning?
Jeremy Shimko
@jshimko
Oct 16 2016 02:14
I got an email from Gitter that said “73 new messages” and 4 mentions, so yeah, I assumed I missing something
So, my short answer… everything is simpler than you'd think… assuming someone gives you some commands to copy/paste. Here it goes...
Other than deploying to AWS (coming in a sec) this gist has everything you need to know to deploy a Reaction container with Nginx and SSL
https://gist.github.com/jshimko/745ca66748846551692e24c267a56060
To do the same thing on AWS instead, swap out that first docker-machine command with this:
docker-machine create \
  --driver amazonec2 \
  --amazonec2-access-key $AWS_KEY \
  --amazonec2-secret-key $AWS_SECRET \
  --amazonec2-region $AWS_REGION \
  --amazonec2-zone $AWS_AVAILABILITY_ZONE \
  --amazonec2-vpc-id $AWS_VPC \
  --amazonec2-instance-type t2.medium 
  my-reaction-host
and the issues with the header size have a solution in the comments of that gist
(adding lines to the nginx config in a custom dockerfile)
Ivanthadev
@ivanthemeh
Oct 16 2016 02:23
@jshimko so basically I should be able to get this going using the mupx like I have been if I could just edit the proxy_buffer size, thing is I am not a great devops guy and I wasnt able to even find the nginx conf file on my ec2 server, Im assuming thats because its inside the docker container?
Jeremy Shimko
@jshimko
Oct 16 2016 02:24
If you’re not a devops guy, going all cowboy on the server is literally the harder approach.
You don’t need to understand much (if anything) about Docker to use those commands. And the nginx container there doesn’t require those changes for me
Just get your API credentials for AWS and copy/paste those commands. No config file editing. No SSH’ing into servers to set stuff up.
mupx is literally more work and harder to maintain.
I’m going to record a video. Give me 24 hours.
Brent Hoover
@zenweasel
Oct 16 2016 02:27
except that this only deploys the stock reaction
Ivanthadev
@ivanthemeh
Oct 16 2016 02:27
I know what your saying but when I look at the docker code it looks SO confusing to me, I feel like I would have to ask a million questions to get it working, I guess Im trying to stick with the mupx because its what I know >.<
Brent Hoover
@zenweasel
Oct 16 2016 02:27
not custom code, which is pretty much what everybody wants
Jeremy Shimko
@jshimko
Oct 16 2016 02:27
Deploying a custom version is one additional command.
docker build …
otherwise, it’s identical
Ivanthadev
@ivanthemeh
Oct 16 2016 02:28
Ok I just made a fresh ec2 instance... Im going to give it a shot!
Brent Hoover
@zenweasel
Oct 16 2016 02:30
So while having the copy and paste commands is cool, what I feel like I am missing in understanding what’s going on
Jeremy Shimko
@jshimko
Oct 16 2016 02:31
so the last command (docker run) becomes these two steps for a custom build…
docker build -t my-custom-reaction .

docker run -d \
  --name reaction \
  --restart always \
  -e MONGO_URL="mongodb://some-url" \
  -e ROOT_URL="https://yoursite.com" \
  -e VIRTUAL_HOST="yoursite.com" \
  -e LETSENCRYPT_EMAIL="your.email@example.com"
  -e LETSENCRYPT_HOST="yoursite.com"
  my-custom-reaction
Brent Hoover
@zenweasel
Oct 16 2016 02:31
so that if something goes wrong I can try and debug/troubleshoot
Ivanthadev
@ivanthemeh
Oct 16 2016 02:31
@jshimko do I need to be in a reaction directory to run those commands?
Jeremy Shimko
@jshimko
Oct 16 2016 02:32
If you’re making a custom build, yes. That assumes you’re in the root of your custom Reaction project.
(the build command anyway)
Ivanthadev
@ivanthemeh
Oct 16 2016 02:34
lol Im already getting errors Cannot connect to the Docker daemon. Is the docker daemon running on this host?
I just installed it..
Jeremy Shimko
@jshimko
Oct 16 2016 02:34
You did the docker-machine create?
Ivanthadev
@ivanthemeh
Oct 16 2016 02:34
yea
and it gave me that errror
I can use docker tho and it gives me a list of commands
Jeremy Shimko
@jshimko
Oct 16 2016 02:35
check out the gist.
eval "$(docker-machine env servername)"
(line 11 of the gist)
Ivanthadev
@ivanthemeh
Oct 16 2016 02:36
what do I put as servername?
Im on localhost
Jeremy Shimko
@jshimko
Oct 16 2016 02:36
whatever you put as the last line in the docker-machine create command
in my example… my-custom-reaction
Ivanthadev
@ivanthemeh
Oct 16 2016 02:37
It didnt let me run docker-machine create
Jeremy Shimko
@jshimko
Oct 16 2016 02:37
to see a list of your current machines (and their names), you can run
docker-machine ls
Ivanthadev
@ivanthemeh
Oct 16 2016 02:37
I got the error above
actually Im wrong
I got the error when trying to use docker build
Jeremy Shimko
@jshimko
Oct 16 2016 02:38
yep.
;)
docker-machine create..
eval…
docker build…
docker run…
The eval thing sets the docker environment to a specific server so that docker commands are run on that server instead of your local machine. Opening a new terminal resets it back to your local machine again.
Ivanthadev
@ivanthemeh
Oct 16 2016 02:42
How do I find the aws_region?
for example, us-east-1
it all depends on where in the world you want the machine to be
the single biggest reason I used digital ocean as my example in that gist is because of how many more options are required for aws.
Ivanthadev
@ivanthemeh
Oct 16 2016 02:45
I put that in as my zone
my regioon is US West (Oregon)
would the spaces in that mess it up?
Jeremy Shimko
@jshimko
Oct 16 2016 02:45
then you want us-west-2
see the “region” column in those tables
(not "region name”)
This message was deleted
docker-machine create \
  --driver amazonec2 \
  --amazonec2-access-key $AWS_KEY \
  --amazonec2-secret-key $AWS_SECRET \
  --amazonec2-region $AWS_REGION \
  --amazonec2-instance-type t2.medium \
  my-reaction-host
sorry, gitter fail… deleted my message by accident
the above is the minimum required options for the command
Ivanthadev
@ivanthemeh
Oct 16 2016 02:51
Running pre-create checks... Error with pre-create check: "UnauthorizedOperation: You are not authorized to perform this operation.\n\tstatus code: 403, request id: "
Jeremy Shimko
@jshimko
Oct 16 2016 02:51
Sounds like bad credentials or the credentials you used don’t have adequate permissions to launch an EC2 instance
Ivanthadev
@ivanthemeh
Oct 16 2016 02:52
ok sec
@jshimko got past that one... Error with pre-create check: "unable to find a subnet in the zone: us-west-2us-west-2a"
:D
lol
sorry I knew I was going to need some help with this >.<
Jeremy Shimko
@jshimko
Oct 16 2016 02:57
what is the exact command you used (aside from API keys)?
Ivanthadev
@ivanthemeh
Oct 16 2016 02:57
I took out the zone and it looks like its working!! :D
its stuck on waiting for ssh to be avaialable..
Jeremy Shimko
@jshimko
Oct 16 2016 02:58
that’s not stuck. that’s waiting
a server is being launched and configured
Ivanthadev
@ivanthemeh
Oct 16 2016 02:58
oh
Jeremy Shimko
@jshimko
Oct 16 2016 02:58
probably 2-3 mins
Ivanthadev
@ivanthemeh
Oct 16 2016 03:05
OK that worked so now I need to build the app Im currently in?
Jeremy Shimko
@jshimko
Oct 16 2016 03:06
if it’s customized, yes
run the eval command I mentioned so it build on that remote server instead of local
Ivanthadev
@ivanthemeh
Oct 16 2016 03:10
ok its building..so how would I deploy this after adding new code?
Jeremy Shimko
@jshimko
Oct 16 2016 03:10
you have to build again after every code change
which can be automated with tools like CircleCI or TravisCI
(which is how our official images get built)
Ivanthadev
@ivanthemeh
Oct 16 2016 03:12
Ill have to look into that once Im a lil more comfy with docker
Jeremy Shimko
@jshimko
Oct 16 2016 03:12
but generally, you edit code and run it in development for the instant feedback and only rebuild the image when you’re reasonably sure it’s ready to deploy.
Ivanthadev
@ivanthemeh
Oct 16 2016 03:13
the build takes a while?
Jeremy Shimko
@jshimko
Oct 16 2016 03:13
yes, definitely
It’s starting from a completely fresh OS, installing all dependencies, and building/compiling the app
which is why the official image is much faster if you don’t have custom code
There are some changes in the development branch that makes the build a bit faster, but it only shaves a few mins off
Ivanthadev
@ivanthemeh
Oct 16 2016 03:16
I wanted to make sure to have the admin setup in settings.json because I was having issues loging in with admin before, I should have just used the official
Jeremy Shimko
@jshimko
Oct 16 2016 03:16
you can set the default admin with environment variables too
Ivanthadev
@ivanthemeh
Oct 16 2016 03:16
@jshimko just got this Warning: unable to resolve "stage-2" in presets of /var/src/.babelrc and now its been stuck for a few mins
Ivanthadev
@ivanthemeh
Oct 16 2016 03:25
@jshimko yea its definetly stuck
Ivanthadev
@ivanthemeh
Oct 16 2016 03:33
@jshimko where in the ghist you posted does it tell the container to use official version?
Brent Hoover
@zenweasel
Oct 16 2016 03:34
where you see reactioncommerce/reaction:latest
I think it’s a good idea to try with the “official” version first and then try your custom build
Ivanthadev
@ivanthemeh
Oct 16 2016 03:35
I thought it was showing the whole ghist in this app lol , Im tired...
so I thought line 29 was it...
Ivanthadev
@ivanthemeh
Oct 16 2016 03:49
@jshimko Well I was able to get all the steps in the gist completed with no errors using the official and I am unable to connect to the server so I opened ports 80 and 443 in security group and its saying temporarily unavailable now
Jeremy Shimko
@jshimko
Oct 16 2016 03:53
you’ll have to check the container logs to see what’s going on
you can get a list of running containers with docker ps
the container ID will be the first column on the left
Ivanthadev
@ivanthemeh
Oct 16 2016 03:58
@jshimko how can I ssh into my server w/o the pem file? it created one but I dont have access to download it
Jeremy Shimko
@jshimko
Oct 16 2016 04:05
docker-machine ssh machineName
are you sure you need to though?
you don’t need to ssh in to run docker commands
that happens under the hood automatically
Ivanthadev
@ivanthemeh
Oct 16 2016 04:07
@jshimko how can I get it to show me all the logs? Its not giving me any errors but my site is not up
Jeremy Shimko
@jshimko
Oct 16 2016 04:07
is the container running?
Ivanthadev
@ivanthemeh
Oct 16 2016 04:08
I raan the logs command and it returned
it returned all the init messages
Jeremy Shimko
@jshimko
Oct 16 2016 04:08
?
Ivanthadev
@ivanthemeh
Oct 16 2016 04:09
INFO Reaction: Updating domain to ivanthemeh.com 03:45:36.671Z INFO Reaction: Load default data from /private/data/ 03:45:37.042Z INFO Reaction: Modified 2 documents while importing 2 to Shops 03:45:37.142Z INFO Reaction: JobServer started 03:45:37.145Z INFO Reaction: Modified 1 document while importing 1 to Shipping 03:45:37.147Z INFO Reaction: Modified 0 documents while importing 4 to Products 03:45:37.148Z INFO Reaction: Modified 0 documents while importing 2 to Tags
Jeremy Shimko
@jshimko
Oct 16 2016 04:09
looks like it’s running
Ivanthadev
@ivanthemeh
Oct 16 2016 04:09
yea
Jeremy Shimko
@jshimko
Oct 16 2016 04:09
you sure you opened the ports?
Ivanthadev
@ivanthemeh
Oct 16 2016 04:09
but Im getting a temporarily unavaliable
yea 80 and 443
Jeremy Shimko
@jshimko
Oct 16 2016 04:11
Even if the app wasn’t running, you should see nginx returning a result. If that doesn’t happen, it’s eitehr down or blocked
Ivanthadev
@ivanthemeh
Oct 16 2016 04:16
with the ip im getting an nginx error page 503 service temporarily unavailable with the domain name im getting refused
Jeremy Shimko
@jshimko
Oct 16 2016 04:23
what do the nginx logs say?
Ivanthadev
@ivanthemeh
Oct 16 2016 04:27
It looks like it's showing hits to the page by my mac and iPhone
If your talking about nginx-proxy
Jeremy Shimko
@jshimko
Oct 16 2016 04:32
yes
those hits should have status codes though
like the 503
and they usually have a little more detail about the error
Thanh Le
@dainhan90_twitter
Oct 16 2016 11:48
Hi, how i can use standalone Mongodb server?
Brent Hoover
@zenweasel
Oct 16 2016 11:48
just set your MONGO_URL to point to your server
Thanh Le
@dainhan90_twitter
Oct 16 2016 11:49
I try to set MONGO_URL=mongodb://xxxxxxxx
but not working
Brent Hoover
@zenweasel
Oct 16 2016 11:49
how are you setting it?
Thanh Le
@dainhan90_twitter
Oct 16 2016 11:49
i add it in dev.settings.json file
Brent Hoover
@zenweasel
Oct 16 2016 11:50
try setting it as an environment variable
Thanh Le
@dainhan90_twitter
Oct 16 2016 11:51
Ok, i will try now. Thank Brent
Ivanthadev
@ivanthemeh
Oct 16 2016 12:44
@jshimko @zenweasel the error Im getting is the upstream header response
[error] 40#40: *88 upstream sent too big header while reading response header from upstream Im also getting a lets-encrypt msg everytime someone hits the site.
Thanh Le
@dainhan90_twitter
Oct 16 2016 13:04
How i can do when i modified Schema?
Thanh Le
@dainhan90_twitter
Oct 16 2016 14:45
Hi. I deploy reaction to heroku, i get error "No shopId, waiting one second..."
Jeremy Shimko
@jshimko
Oct 16 2016 14:52
@ivanthemeh the gist I posted has instructions for creating a custom nginx image with increased proxy buffer size (it’s in the comments below the code). That should solve that issue.
Valekst3
@Valekst3
Oct 16 2016 15:06
Does here any developers (russian speaking
Optionally who want to develop project under reaction commerce?
Ivanthadev
@ivanthemeh
Oct 16 2016 17:06
@jshimko you are AWESOME man! Im def going to stick with this and eventually contribute! you guys have been super helpful.
@jshimko Im not seeing it or Im missing it, are you talking about this gist the second comment down?https://gist.github.com/jshimko/745ca66748846551692e24c267a56060?
Ivanthadev
@ivanthemeh
Oct 16 2016 18:24
@jshimko Ok so I think I understand this a little bit now. I'm confused on a few things tho. Am I adding this to the Dockerfile in my app dir or using a different Dockerfile in a diff dir?
auBusinessDaD
@auBusinessDaD
Oct 16 2016 22:18
hey all, got it all running - but am unable to get into the admin panel (i set the credentials in dev.settings.json but can't login with it)
Brent Hoover
@zenweasel
Oct 16 2016 23:04
@auBusinessDaD dev.settings.json is just an example file. You will want to copy it to settings.json and make your changes there