Info Security Memo
  • Blog
  • Sitemap
    • Categories
  • Contact
  • About
  • Resources
  • Tools
  • 51sec.org

Build Confidence

Focusing on Information Security 

Info Security Notes

Create Your Own Bookmark Navigation Website Using Docker

6/13/2021

0 Comments

 
Create Your Own Bookmark Navigation Website Using Docker
This post is to introduce a docker image which can give you a simple and easy way to create your own bookmark navigation website. It is based on XiaoZ blog's onenav. I made a translation for most of web pages and saved into my own docker hub image repository. Still working on but would like to share this excellent Bookmark Management tools to you. 



    Onenav has following features:
    • Support background management
    • Support private link
    • Supports batch import of bookmarks
    • Support multiple theme styles (2 sets of templates are built in by default)
    • Support automatic identification of link information
    • Support API


    Original Github : https://ift.tt/39pPaNr
    You can find more information from the Github page. This post will focus on deployment process and how to use Portainer to do that, also how to integrate with own domain which is managed by Cloudflare. 

    Environment Requirements

    You will need to install Docker and Docker Compose first. Get system update & upgrade it as well. It is also your choice to have portainer installed to manage your Dockers. 

    Please check post: https://blog.51sec.org/2021/05/docker-dockercompose-portainer-nginx.html

    Here are some commands we will need to use: (using Ubuntu 20.04 as an example)

    Check System Public IP:

    [root@OCP1-Ubuntu ~]# curl https://ip.51sec.org/api
    132.145.100.226
    
    
    Update system to latest:

     [root@OCP1-Ubuntu ~]# apt upgrade -y && apt update -y
    
    

    If your host environment memory is less than 1GB, you might also want to add 1024MB swap file size using following command:
    wget https://raw.githubusercontent.com/51sec/swap/main/swap.sh && bash swap.sh
    
    
    Install Docker on Ubuntu 20.04:

    #Ubuntu 20.04
    sudo apt install docker.io
    
    Install Docker Compose on Ubuntu 20.04:

    #Ubuntu 20.04
    sudo apt install docker-compose
    
    Make following firewall ports opened on your VPS's firewall: 80, 443, 8100, 9000. Port 8100 and 9000 can be closed after completed deployment. 

    Deploy it Using Portainer

    Portainer Installation

    Please make sure your VPS's firewall port 80, 443 and 9000 has been opened. We can close 9000 later.

    [root@OCP1-CentOS8-Aria-Rclone-Portainer ~]# docker volume create portainer_data
    portainer_data
    [root@OCP1-CentOS8-Aria-Rclone-Portainer ~]# docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
    
    
    Verify Portainer from Internet by visiting http://<VPS's Public IP>:9000

    Create your own bridge network, and let all of your containers join into it.


    Using Portainer to Deploy











    Docker Run Deployment

    You also can use Docker Run Command to deploy it from command line. You can use your own port to replace 8100, and use your own username and password to replace those configuration in the command.
    docker run -itd --name="onenav" -p 8100:80 \
        -e USER='admin' -e PASSWORD='password' \
        -v /data/onenav:/data/wwwroot/default/data \
        johnyan2/51nav
    
    
    If you have your own bridge network created before, you can use following command to join your own bridge network:
    .
    docker run -itd --name="onenav" -p 8100:80 \
        -e USER='admin' -e PASSWORD='password' \
        -v /data/onenav:/data/wwwroot/default/data \
        --network mybridge
        johnyan2/51nav
    
    
    Dockerhub image is the one I created with WebUI and admin page already translated from Chinese to English : johnyan2/51nav

    Cloudflare DNS Configuration

    From your DNS management platform , add one A record with ip address pointing to your VPS's ip. 



    Nginx Reverse Proxy Configuration

    Use Portainer to install Nginx and make sure Nginx's network joined into the one same as Portainer and other containers, which is not default bridge network.
    Please check post: https://blog.51sec.org/2021/05/docker-dockercompose-portainer-nginx.html#point5

    Configure Nginx as Reverse Proxy
    Please check post: https://blog.51sec.org/2021/05/docker-dockercompose-portainer-nginx.html#point6
    Connect into Nginx console from Portainer portal or command: docker exec -it nginx bin/bash. or docker exec -it nginx sh

    root@ba4a30ab7371:/# apt update -y && apt install nano -y
    
    
    nano /etc/nginx/conf.d/bookmarkconf


    server {
        listen       80;
        server_name  bookmark.51sec.eu.org;
    
    location / {
        proxy_pass       http://onenav;
        proxy_http_version         1.1;
        proxy_read_timeout 300;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Real-PORT $remote_port;
               }
    }
    
    


    Enable HTTPS

    Connect into Nginx console from Portainer portal or command: docker exec -it nginx bin/bash. 


    apt update
    apt install certbot python-certbot-nginx
    certbot --nginx
    
    
    Run Certbot to configure Nginx 

    root@ba4a30ab7371:/# certbot --nginx
    



    Test

    Frontend web GUI:

    Backend admin page:



    Reference
















    via Blogger https://ift.tt/3vp3QW6
    June 13, 2021 at 11:35AM Docker
    0 Comments



    Leave a Reply.

      Categories

      All
      Architecture
      Blog
      Checkpoint
      Cisco
      Cloud
      CyberArk
      F5
      Fortigate
      Guardium
      Juniper
      Linux
      Network
      Others
      Palo Alto
      Qualys
      Raspberry Pi
      Security
      SIEM
      Software
      Vmware
      VPN
      Wireless

      Archives

      March 2024
      February 2024
      January 2024
      December 2023
      November 2023
      October 2023
      September 2023
      August 2023
      July 2023
      June 2023
      May 2023
      April 2023
      March 2023
      February 2023
      January 2023
      December 2022
      November 2022
      October 2022
      September 2022
      August 2022
      July 2022
      June 2022
      May 2022
      April 2022
      March 2022
      February 2022
      January 2022
      December 2021
      November 2021
      October 2021
      September 2021
      August 2021
      July 2021
      June 2021
      May 2021
      April 2021
      March 2021
      February 2021
      January 2021
      December 2020
      November 2020
      October 2020
      September 2020
      August 2020
      July 2020
      October 2019
      September 2019
      June 2019
      July 2018
      May 2018
      December 2017
      August 2017
      April 2017
      March 2017
      January 2017
      December 2016
      November 2016
      October 2016
      September 2016
      August 2016
      July 2016
      June 2016
      May 2016
      April 2016
      March 2016
      February 2016
      January 2016
      December 2015
      November 2015
      October 2015
      September 2015
      August 2015
      July 2015
      June 2015
      May 2015
      April 2015
      March 2015

      Print Page:

      RSS Feed

      Email Subscribe
    Powered by Create your own unique website with customizable templates.
    • Blog
    • Sitemap
      • Categories
    • Contact
    • About
    • Resources
    • Tools
    • 51sec.org