• 0 Posts
  • 54 Comments
Joined 3 years ago
cake
Cake day: June 26th, 2023

help-circle



  • Ah, what you’re looking for is called udev. It supplies the system with device events from the linux kernel.

    This gist of it is, to use this command

    udevadm monitor --environment --udev
    

    then unplug and plug in your monitor. You should see the events on screen. You then write a rule and place it in /etc/udev/rules.d. To run a script add something like

    ACTION=="change", SUBSYSTEM=="drm", KERNEL=="card0-HDMI-A-1", \
      RUN+="/usr/local/monitor-script.sh"
    

    See the man udev page for more info (☞゚ヮ゚)☞






  • tux7350@lemmy.worldtoSelfhosted@lemmy.worldDocker security
    link
    fedilink
    English
    arrow-up
    5
    ·
    2 months ago

    Course, feel free to DM if you have questions.

    This is a common setup. Have a firewall block all traffic. Use docker to punch a hole through the firewall and expose only 443 to the reverse proxy. Now any container can be routed through the reverse proxy as long as the container is on the same docker network.

    If you define no network, the containers are put into a default bridge network, use docker inspect to see the container ips.

    Here is an example of how to define a custom docker network called “proxy_net” and statically set each container ip.

    networks:
      proxy_net:
        driver: bridge
        ipam:
          config:
            - subnet: 172.28.0.0/16
    
    services:
      app1:
        image: nginx:latest
        container_name: app1
        networks:
          proxy_net:
            ipv4_address: 172.28.0.10
        ports:
          - "8080:80"
    
      whoami:
        image: containous/whoami:latest
        container_name: whoami
        networks:
          proxy_net:
            ipv4_address: 172.28.0.11
    

    Notice how “who am I” is not exposed at all. The nginx container can now serve the whoami container with the proper config, pointing at 172.28.0.11.


  • tux7350@lemmy.worldtoSelfhosted@lemmy.worldDocker security
    link
    fedilink
    English
    arrow-up
    7
    ·
    2 months ago

    Well if your reverse proxy is also inside of a container, you dont need to expose the port at all. As long as the containers are in the same docker network then they can communicate.

    If your reverse proxy is not inside a docker container, then yes this method would work to prevent clients from connecting to a docker container.