Community discussions

MikroTik App
 
elico
Member Candidate
Member Candidate
Topic Author
Posts: 143
Joined: Mon Nov 07, 2016 3:23 am

ifconfig.io container is ready

Tue Nov 15, 2022 3:35 am

After a while trying to cross compile couple Golang based server I managed to find the right way to make it work inside a container.
The current build repo is at:
https://github.com/elico/ifconfig.io

The binary and the actual container is separated into two separated processes.
In golang you can simple build for cross platforms and then just embed the binary inside an alpine container(it will not work with a scratch one).

To build and publish this project you will need to just run:
make

assuming you have docker installed and internet access.

After you will install the container you will be able to access:
http://172.17.0.1/
http://172.17.0.1/all.json
http://172.17.0.1/ip
http://172.17.0.1/html

and couple others which are available at https://ifconfig.io/

/
interface/bridge/add name=dockers
/ip/address/add address=172.17.0.254/24 interface=dockers

/interface/veth/add name=veth1 address=172.17.0.1/24 gateway=172.17.0.254
/interface/bridge/port add bridge=dockers interface=veth1

#/container/stop  [ find where tag=elicro/ifconfig.io:latest]
#/container/remove  [ find where tag=elicro/ifconfig.io:latest]

/container config
set registry-url=https://registry-1.docker.io tmpdir=disk1/pull

/container envs
add key=PORT name=ifconfig value=80
add key=GIN_MODE name=ifconfig value=release

/container add dns=172.17.0.254 envlist=ifconfig interface=veth1 logging=yes root-dir=disk1/test remote-image=elicro/ifconfig.io:latest start-on-boot=yes

#/container/start [ find where tag=elicro/ifconfig.io:latest]
 
User avatar
own3r1138
Long time Member
Long time Member
Posts: 680
Joined: Sun Feb 14, 2021 12:33 am
Location: Pleiades
Contact:

Re: ifconfig.io container is ready

Wed Nov 16, 2022 7:41 am

Hi,
Thank you, Any instructions or walkthroughs on establishing an HTTPS connection?

Regards,
 
elico
Member Candidate
Member Candidate
Topic Author
Posts: 143
Joined: Mon Nov 07, 2016 3:23 am

Re: ifconfig.io container is ready

Thu Nov 17, 2022 2:24 am

Hi,
Thank you, Any instructions or walkthroughs on establishing an HTTPS connection?

Regards,
Hey,

It depends on how this would be setup.
You either have a pre-existing certificate and chain and everything or you will use some lets encrypt.
For lets encrypt It would be much smarter to put a simple traefik container as a reverse proxy.

I have been working on another container but for internal use it's pretty safe, as for external it's a whole other story.

I can try to create on the fly a self signed certificate but it would make the container a bit larger.

Let me know what of the options you were thinking about
 
User avatar
own3r1138
Long time Member
Long time Member
Posts: 680
Joined: Sun Feb 14, 2021 12:33 am
Location: Pleiades
Contact:

Re: ifconfig.io container is ready

Thu Nov 17, 2022 3:18 am

Hi,
Well, I have already generated my certificate with let's encrypt. Setting up HTTPS in the speed-test container was pretty easy.
It would be nice to have the same functionality here (IP:443 is used elsewhere). I use this image in my CHR with lots of available resources. Reverse proxy with LE certificates certainly meets my needs.
However, they may limit the MT devices that can host this container.

Regards,

Who is online

Users browsing this forum: phascogale and 5 guests