Docker spring boot oauth - spring

I'm hoping that someone can help me out here.
I'll try to give as much information as I can but this is a work project so have to be very careful how much I post.
The situation is this. The user attempts to connect to a web page, as they are not authenticated they are re-directed to an oauth server and are presented with a login page. When the user completes login they are then re-directed back to the original URL and are presented with the landing page.
The projects are spring boot and when I run them locally everything works as intended.
I have created docker images and can run the containers and the projects are connecting to a eureka server with on the correct network with the correct hostname.
The issue that I have is that when I attempt to get to the web page, I can track the logs and see that the re-direct is happening and I can see the re-direct URL in the browser bar but then it seems to stop. The oauth server logs shows that nothing is happening and there is no login page presented. The web UI and the oauth server are both docker images and both use spring boot with java 8.
There isn't a firewall issue as the containers are running on the same subnet. The projects are copies of projects that are already running in another section of the network so I know that they do run ok.
Any pointers would be greatly appreciated.

ok so an update to this, it turns out that the server running the docker engine was running on a unix server but that was actually running inside of a Hyper-V container which was interfering with the network traffic and the redirects, I asked to have the image removed and started working on the windows server directly, I would have preferred to work on unix but there we go. So if you are working remotely where you are deploying docker images to a container engine on a remote server and getting redirect issues, this may be one thing to look at, especially if you can run your system locally without any issues.

Related

SSL_ERROR_INTERNAL_ERROR_ALERT when accessing api platform

API Platform V.2.6.5 with docker-compose downloaded from the official website
Problem : I can't send requests to the API, or access the UI from my browser. I'm facing a SSL_ERROR_INTERNAL_ERROR_ALERT
This is a brand new project I did not edit any file.
Note that i'm using Docker Toolbox for Windows and my docker is running on https://192.168.100.0, not localhost.
I tried on anoter PC where the domain for docker is localhost and it works.
However, the containers start well. I can even create entities and update my database.
Do you have an idea why this error is happening and how to resolve this ?
Most likely it's a caddy thing not having a valid SSL certificate, check at
docker-compose logs caddy
Here is an issue at caddy community: https://caddy.community/t/local-ip-address-creates-ssl-error/11314

Laravel production environment

I've worked on my web app and now it's ready to go on production. For developmnent I used XAMPP on my local machine. I need to deploy the app on a Windows Server 2016 in which other people have access to.
So let's start with some question for you!
1:
I suppose that using XAMPP is not a good idea since it doesn't offer a good level of security.
I want to protect my database, my database storage folders and I want to avoid other people to access any part of my environment.
So I actually want to ask you any suggestion on how to deploy my web app avoiding security issues.
I also would like to ask you the better free local environment I can use for production (something like XAMPP but with improved security).
Keep in mind that my web app should only be visible to the local network.
2:
Is there a way I can set an hostname for my server in order to make everyone who is connected to the lan able to reach my server with that hostname? Writing the IP with the port isn't good for user experience. I know I can use the "name" of the computer itself, but setting a custom hostname would be better.
3:
How should I serve the application? Running the normal command "php artisan serve"? Anyway that way just closing the terminal would result in killing the process so the server will become unavailable.
ANY suggestion would be really appreciated. Is my first approach to deployment so I'm really sorry if my questions are stupid.
Thank you in advance!

How do I go about setting up my Sinatra REST API on a server?

I'm an iOS developer primarily. In building my current app, I needed a server that would have a REST API with a couple of GET requests. I spent a little time learning Ruby, and landed on using Sinatra, a simple web framework. I can run my server script, and access it from a browser at localhost:4567, with a request then being localhost:4567/hello, as an example.
Here's where I feel out of my depth. I setup an Ubuntu droplet at DigitalOcean, and felt my way around to setting up all necessary tools via command line, until I could again run my server, now on this droplet.
The problem then is that I couldn't then access my server via droplet.ip.address:4567, and a bit of research lead me to discovering I need Passenger and an Apache HTTP Server to be setup, and not with simple instructions.
I'm way in over my head here, and I don't feel comfortable. There must be a better way for me to take my small group of ruby files and run this on a server, than me doing this. But I have no idea what I'm doing.
Any help or advice would be greatly appreciated.
bit of research lead me to discovering I need Passenger and an Apache HTTP Server to be setup, and not with simple instructions.
Ignore that for now. Take baby steps first. You should be able to run your Sinatra app from the command line on the DigitalOcean droplet, and then access it via droplet.ip.address:4567. If that doesn't work something very fundamental is wrong.
When you start your app, you will see what address and port the app is listening on. Make sure it's 0.0.0.0 and 4567. If it's 127.0.0.1 or localhost that means it will only service requests originating from the same machine
After you get this working, next step is to make your Sinatra app into a service. Essentially this means the app runs in the background, and auto-starts when the system reboots. Look into Supervisor which is very simple configuration to get this running.
Later you can install Apache or Nginx to put in front of your Sinatra app. These are proxies which simply forward requests from port 80 (default HTTP port) to your sinatra app, but can do additional things such as add SSL support, load balancing, custom error pages etc. - all of which you do not need right now.

Turning laptop into a server to run spring tool suite over the internet

I am trying to run a website from my computer using Spring Tool Suite (STS). Using pivotal tc Server I can access this website that I made by running the server and using localhost:8080 as a url.
My laptop contains other software that is permitted to only run in the laptop and it is needed to run my code in Spring tool suite.(School policy to SSH's into another computer to get access to my database; it is a requirement)
How would I be able to access that website that is running in my laptop that uses pivotal tc Server. Please assume I know nothing about IP address and DNS. Also, assume that I can move my laptop around like a mobile device.
To solve this problem you need to tunnel to your local machine

Set up a simple go server in a webhost

I wanted to set up a simple go server in a webhost. I acquired a domain mydomain.com and hosted it using Bluehost. Now, going through the Go tutorial, I went through this example http://tour.golang.org/#59 and it works fine on my machine. Now, instead, I want to make the HelloWorldServer work when I call mydomain.com:4000 or some other port.
What I did was ssh to my server at bluehost, install go there, then compile the server and run. But then I try to access mydomain.com:4000 and it is not found. I also tried to change "localhost:4000" to just ":4000". any ideas how to make it work ?
Any help or pointers are appreciated. (some more details: it is a shared-hosting account)
This is due to the firewall on your BlueHost server not having ports (including 4000) open on a shared hosting account, Firewall Port Restrictions
If you want to do some simple (and not so simple) web hosting, why don't you look at Google App Engine

Resources