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

Build Confidence

Focusing on Information Security 

Info Security Notes

Install Neko (A Self Hosted Virtual Browser Docker) in Low Memory VPS (1GB)

3/17/2021

0 Comments

 
Install Neko (A Self Hosted Virtual Browser Docker) in Low Memory VPS (1GB)
Github project n.eko is a virtual browser based on the docker isolation environment, supports two types of browsers, Chrome and Firefox, and has built-in chat/simple user management functions. The UI design is very beautiful.




Project address: https://github.com/nurdism/neko

The program requires a relatively high configuration, see here for details:https://n.eko.moe/#/quick-start

Here are recommended specs:

Resolution Cores Ram Recommendation
1024×576@30 2 2gb Not Recommended
1280x720@30 4 3gb Good Performance
1280x720@30 6 4gb Recommended
1280x720@30 8 4gb+ Best Performance

To run it in a low resource VPS, such as only 1GB RAM, 1vCPU, we will have to change SWAP size to make it more stable. 


Firewall Ports Open

Please make sure following two firewall rules created on your cloud VPS's firewall.
1. tcp 8080
2. udp 59000-59100



Change SWAP Size

Command (not support OpenVZ) from root user:
wget https://raw.githubusercontent.com/51sec/swap/main/swap.sh && bash swap.sh

When choose add swap, please enter number for size. Default metric is MB。

In screenshot, the priority is showing 0. Script in github has set to 100. 
Github: https://github.com/51sec/swap


Install Docker and Docker-Compose

Install docker:
apt -y update
apt -y install curl
curl -sSL https://get.docker.com/ | sh
systemctl start docker
systemctl enable docker

Install docker-compose:

curl -L https://github.com/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

Create docker-compose.yml and bring Neko docker up

Create a new docker-compose project directory and edit docker-compose.yml.

cd ~
mkdir neko
cd neko
vi docker-compose.yml
Put following code into docker-compose.yml file based on the browser type.

Chrome Image:

version: '3.5'
services:
  neko:
    image: nurdism/neko:chromium
    restart: always
    cap_add:
      - SYS_ADMIN
    ports:
      - "8080:8080"
      - "59000-59100:59000-59100/udp"
    environment:
      DISPLAY: :99.0
      SCREEN_WIDTH: 1024
      SCREEN_HEIGHT: 576
      SCREEN_DEPTH: 24
      NEKO_PASSWORD: neko
      NEKO_ADMIN: admin
      NEKO_BIND: :8080

Firefox Image:

version: '3.5'
services:
  neko:
    image: nurdism/neko:firefox
    restart: always
    shm_size: "1gb"
    ports:
      - "8080:8080"
      - "59000-59100:59000-59100/udp"
    environment:
      DISPLAY: :99.0
      SCREEN_WIDTH: 1024
      SCREEN_HEIGHT: 576
      SCREEN_DEPTH: 24
      NEKO_PASSWORD: neko
      NEKO_ADMIN: admin
      NEKO_BIND: :8080


Notes:

SCREEN_DEPTH can be changed to 16 to save some resource usage on your host VPS. 


docker-compose up -d
Now you should be able to browser to your Neko's web interface with this url : http://<public ip>:8080

Fix Chinese Font Issue


Enter into docker:

docker exec -it neko_1 bash

Install fonts in docker:

apt -y update
apt -y install ttf-wqy-zenhei

exit and restart docker using docker-compose:

exit
docker-compose restart
If you have your own domain, you can using following steps to create https://<Sub Domain> this kind of access to Neko project with Nginx's reverse proxy.
  • DNS sub domain created in your DNS provider, such as this sub domain, neko.51sec.org
  • Create your neko.51sec.org Nginx configuraiton. You can copy other Nginx web app's configuration then modify it.
  • run certbot to get LetsEncrypt cerititicate and modify neko.conf file to use those certificates.
  • test https://<Sub Domain>







via Blogger https://ift.tt/3cK3EJD
March 17, 2021 at 05:49PM 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