Trying to make browsersync work within vagrant using gulp - gulp

I've been stuck in trying to make browsersync work within vagrant using gulp. I can connect to the UI of browsersync but I can never connect to my development site. If tried connecting using the address http://localhost:3000, I keep getting the error below:
Cannot GET /
Here are my configurations for vagrant:
# IP Address to access the server 10.0.0.3
config.vm.network "private_network", ip: "10.0.0.3"
config.vm.network "forwarded_port", guest: 3000, host: 3000, auto_correct: true
config.vm.network "forwarded_port", guest: 3001, host: 3001, auto_correct: true
# Sync the server timezone to the host machine
config.vm.provision :shell, :inline => "sudo rm /etc/localtime && sudo ln -s /usr/share/zoneinfo/Asia/Manila /etc/localtime", run: "always"
# Sync File
config.vm.synced_folder "./", "/var/www/html", mount_options: ["dmode=777", "fmode=666"]
Configuration when connecting to SQL
Here are my configurations for Gulp:
browserSync.init(["./assets/css/*.css"],{
server: {
proxy: "http://10.0.0.3/globe-gui/",
open: false,
port: "2222",
injectChanges: true,
}
});
I tried searching the net for a solution but can't seem to get an answer.

Browser sync isn't initialized with the correct options.
browserSync.init({
files: ["./assets/css/*.css"],
open: false,
port: "2222",
injectChanges: true,
proxy: "http://10.0.0.3/globe-gui/",
});
Your Vagrantfile configures guest machine (box) to be accessible via IP address 10.0.0.3.
Connect to services running in the box from host through IP address (10.0.0.3).
Set the SSH Host to 10.0.0.3 for a database service running on port 2222 in the box when connecting from host to box, but set localhost when connecting inside of the box.
I take it that BrowserSync is started inside the box.
Configure proxy to have value:
proxy: "http://localhost/globe-gui/",
Connect to BrowserSync from a browser running in the host through private IP address for box (http://10.0.0.3:3000).

Related

Graphhopper server not accessing on a same network

I have successfully deployed graph-hopper on my local server. The problem is that i can access the server using local-host on the server but unable to access it using the server IP locally or from other machine on the same network. For same port if i use docker it works but not the other way around. Here is my configuration:
# Dropwizard server configuration
server:
applicationConnectors:
- type: http
port: 8989
requestLog:
appenders: []
adminConnectors:
- type: http
port: 8991
You need to bind the host, maybe you need to change localhost with the IP address of your server. Avoid using 0.0.0.0.
server:
application_connectors:
- type: http
port: 8989
bind_host: localhost

Vagrantfile with docker provider portfoward error

I want to set up an environment with Vagrant. I defined 2 mysql in Vagrantfile, one for development, and one for integration tests. To differentiate these 2 instance I want to expose different ports.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.network "private_network", ip: "192.168.100.138", nic_type: "82545EM"
config.vm.define "mysql" do |m|
config.vm.provider "docker" do |d|
d.name = "mysql"
d.image = "mysql:8"
d.ports = ["3306:3306"]
d.env = {"MYSQL_DATABASE" => "development", "MYSQL_ROOT_PASSWORD" => "root"}
d.remains_running = true
end
end
config.vm.define "mysql-integration-test" do |mit|
config.vm.provider "docker" do |d|
d.name = "mysql-integration-test"
d.image = "mysql:8"
d.ports = ["3406:3306"]
d.env = {"MYSQL_DATABASE" => "development-it", "MYSQL_ROOT_PASSWORD" => "root"}
d.remains_running = true
end
end
end
The problem is when I started it I got an error than the port is already in use:
jmecsei#jmecsei:~/Work/vagrant$ vagrant up
Bringing machine 'mysql' up with 'docker' provider...
Bringing machine 'mysql-integration-test' up with 'docker' provider...
==> mysql: Creating and configuring docker networks...
==> mysql-integration-test: Creating and configuring docker networks...
==> mysql: Creating the container...
mysql: Name: mysql-integration-test
mysql: Image: mysql:8
mysql: Volume: /home/jmecsei/Work/vagrant:/vagrant
mysql: Port: 3406:3306
mysql:
mysql: Container created: 94c0f18c6938365f
==> mysql-integration-test: Fixed port collision for 22 => 2222. Now on port 2200.
==> mysql-integration-test: An error occurred. The error will be shown after all tasks complete.
==> mysql: Enabling network interfaces...
==> mysql: Starting container...
An error occurred while executing multiple actions in parallel.
Any errors that occurred are shown below.
An error occurred while executing the action on the 'mysql-integration-test'
machine. Please handle this error then try again:
Vagrant cannot forward the specified ports on this VM, since they
would collide with some other application that is already listening
on these ports. The forwarded port to 3406 is already in use
on the host machine.
To fix this, modify your current project's Vagrantfile to use another
port. Example, where '1234' would be replaced by a unique host port:
config.vm.network :forwarded_port, guest: 3306, host: 1234
Sometimes, Vagrant will attempt to auto-correct this for you. In this
case, Vagrant was unable to. This is usually because the guest machine
is in a state which doesn't allow modifying port forwarding. You could
try 'vagrant reload' (equivalent of running a halt followed by an up)
so vagrant can attempt to auto-correct this upon booting. Be warned
that any unsaved work might be lost.

Vagrant up script reports gulp command not found but ssh in and it runs no problem

I'm setting up a vagrant box for my doc dept. and when I attempt to start gulp --gulpfile /vagrant/gulpfile.js serve it reports gulp: command not found. If I vagrant ssh and run the same command everything is okay. I have other boxes that start various tools in the script so I'm at a lost as to why this is failing.
Can anyone tell me why gulp is not found from the vagrant up script?
Vagrant.configure("2") do |config|
config.vm.box = "cabike/MeanXenial"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.network "forwarded_port", guest: 9000, host: 9000
config.vm.provision "deploy",
run: "always",
type: "shell",
inline: <<-SHELL
gulp --gulpfile /vagrant/gulpfile.js serve
SHELL
end
It might really be that gulp is installed for your vagrant user but you're running your script as root user
You can change this behaviour by using the privileged option
privileged (boolean) - Specifies whether to execute the shell script
as a privileged user or not (sudo). By default this is "true".
The provisioning will become
config.vm.provision "deploy",
run: "always",
privileged: false,
type: "shell",
inline: <<-SHELL
gulp --gulpfile /vagrant/gulpfile.js serve
SHELL

Can't expose mysql tcp service running inside kubernetes cluster publicly using nginx-ingress

I ran into a problem exposing a mysql database running inside a kubernetes cluster publicly. The cluster runs with kops on AWS. Im using a helm chart for nginx-ingress: https://github.com/helm/charts/tree/master/stable/nginx-ingress
controller:
config:
use-proxy-protocol: "true"
metrics:
enabled: true
replicaCount: 2
service:
annotations:
service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: '*'
stats:
enabled: true
rbac:
create: true
tcp:
5000: default/cbioportal-prod-db-mysql:3306
From within the cluster I can telnet to the db through nginx over port 5000 :
# telnet eating-dingo-nginx-ingress-controller 5000
J
5.7.14
ke_|c&tc"ui%]}mysql_native_passwordConnection closed by foreign host
But i can't seem to connect from outside using the hostname of the aws load balancer.
telnet xxx.us-east-1.elb.amazonaws.com 5000
Trying x.x.x.x...
When i look in aws ec2 dashboard i see the load balancer's security group allows connections from everywhere on port 5000.
UPDATE
I can connect when I use port 3306 instead of 5000:
tcp:
3306: default/cbioportal-prod-db-mysql:3306
However now that the port is open:
$ nmap --verbose -Pn x.x.x.x
PORT STATE SERVICE
21/tcp open ftp
80/tcp open http
443/tcp open https
3306/tcp open mysql
I am getting an authorization issue:
$ mysql -h x.x.x.x -uroot -pabcdef
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 2
I can connect directly to the nginx controller without issues from within the cluster:
kubectl run -it --rm --image=mysql:5.7 --restart=Never mysql-client -- mysql -h eating-dingo-nginx-ingress-controller -uroot -pabcdef
I'm using this mysql helm chart:
https://github.com/helm/charts/tree/master/stable/mysql

Redmine Email through SES SMTP

Has anybody successfully configured a redmine installation to send mail through Amazon SES SMTP?
My settings are:
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
tls: true
enable_starttls_auto: true
address: email-smtp.us-east-1.amazonaws.com
port: 465
domain: example.com
authentication: :plain
user_name: ***
password: ***
When I try to send a test email through the redmine settings, it just times out, with no clear errors in the log or anything.
Note, this does the same if I remove the enable_starttls_auto: true line.
I've been able to get it working using authentication: :login.
Here is the full setup:
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
enable_starttls_auto: true
address: email-smtp.us-east-1.amazonaws.com
port: 587
domain: mydomain.com
authentication: :login
user_name: credentials_username
password: credentials_password
Just one more note: my Redmine is not set in 'mydomain.com'.
I haven't tried doing that, but if your Redmine runs inside an instance you control, you can setup a local PostFix server that your redmine will talk. Configure it to respond only to local requests (127.0.0.1) and have it forward everything via SES SMTP integration. That should probably do the trick.
I have set this up as you have above and it works Redmine 1.3.2
You need the enable_starttls_auto: true and I made sure the domain is the same the one that the redmine server is setup