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

Build Confidence

Focusing on Information Security 

Info Security Notes

[5 Mins Docker] Deploy A Light Weight Super Fast and Nice Personal Navigation Site - Flame (Docker Run & Fly.io)

2/27/2023

0 Comments

 
[5 Mins Docker] Deploy A Light Weight, Super Fast and Nice Personal Navigation Site - Flame (Docker Run & Fly.io)
Based on Github project page, Flame is self-hosted startpage for your server. Its design is inspired (heavily) by SUI. Flame is very easy to setup and use. With built-in editors, it allows you to setup your very own application hub in no time - no file editing necessary.

There is similar projected , Flare, which is more like a Chinese version of Flame. It does provide quite a few enhancements on features and speed, but one thing it is missing from Flare is the authentication, although Flare seems much nicer and faster. 

In this post, I am going to show you how to get both projects up and running in the cloud, and more specifically, how to run in in Fly.io platform. 

Introduction

Flame: https://github.com/pawelmalak/flame

Flame is self-hosted startpage for your server. Easily manage your apps and bookmarks with built-in editors.



Flare: https://github.com/soulteary/docker-flare

Flare  Lightweight, high performance and fast self-hosted navigation pages, resource utilization rate is <1% CPU, MEM <30 M, Docker Image < 10M




Flare project was inspired from another similar project Flame in Github: https://github.com/pawelmalak/flame

Feature list:


  •  Create, update, delete your applications and bookmarks directly from the app using built-in GUI editors
  •  Pin your favourite items to the homescreen for quick and easy access
  •  Integrated search bar with local filtering, 11 web search providers and ability to add your own
  •  Authentication system to protect your settings, apps and bookmarks
  •  Dozens of options to customize Flame interface to your needs, including support for custom CSS, 15 built-in color themes and custom theme builder
  •  Weather widget with current temperature, cloud coverage and animated weather status
  •  Docker integration to automatically pick and add apps based on their labels

Docker Run & Docker Compose


Flame:



docker run -p 5005:5005 -v /path/to/data:/app/data -e PASSWORD=flame_password pawelmalak/flame

Docker-compose.yml

version: '3.6'

services:
  flare:
    image: soulteary/flare
    restart: always
    # 默认无需添加任何参数,如有特殊需求
    # 可阅读文档 https://github.com/soulteary/docker-flare/blob/main/docs/advanced-startup.md
    command: flare
    # 启用账号登陆模式
    # command: flare --nologin=0
    # environment:
      # 如需开启用户登陆模式,需要先设置 `nologin` 启动参数为 `0`
      # 如开启 `nologin`,未设置 FLARE_USER,则默认用户为 `flare`
      # - FLARE_USER=flare
      # 指定你自己的账号密码,如未设置 `FLARE_USER`,则会默认生成密码并展示在应用启动日志中
      # - FLARE_PASS=your_password
      # 是否开启“使用向导”,访问 `/guide`
      # - FLARE_GUIDE=1
    ports:
      - 5005:5005
    volumes:
      - ./app:/app


docker-compose up -d


Flare:


docker run --rm -it -p 5005:5005 -v `pwd`/app:/app soulteary/flare


Docker-compose.yml

version: '3.6'

services:
  flame:
    image: pawelmalak/flame
    container_name: flame
    volumes:
      - /path/to/host/data:/app/data
      - /var/run/docker.sock:/var/run/docker.sock # optional but required for Docker integration
    ports:
      - 5005:5005
    secrets:
      - password # optional but required for (1)
    environment:
      - PASSWORD=flame_password
      - PASSWORD_FILE=/run/secrets/password # optional but required for (1)
    restart: unless-stopped

# optional but required for Docker secrets (1)
secrets:
  password:
    file: /path/to/secrets/password

docker-compose up -d


Deploy to Fly.io



https://fly.io/docs/getting-started/
https://fly.io/docs/hands-on/

Install flyctl:

Run the Powershell install script:

powershell -Command "iwr https://fly.io/install.ps1 -useb | iex"

  • If this is your first time with Fly.io, your next step will be to Sign up.
  • If you already have a Fly.io account, then your next step is to Sign in to Fly.io.


PS C:\Users\netsec> fly auth login
Opening https://fly.io/app/auth/cli/c41ccd9759be02c0a0dd2d2a096d58 ...
Waiting for session... Done
successfully logged in as [email protected]
PS C:\Users\netsec>
PS C:\Users\netsec>
PS C:\Users\netsec> flyctl launch
Creating app in C:\Users\netsec
Scanning source code
Could not find a Dockerfile, nor detect a runtime or framework from source code. Continuing with a blank app.
? Choose an app name (leave blank to generate one):
? Choose an app name (leave blank to generate one):
? Select Organization: 51Sec (51sec)
Some regions require a paid plan (fra, maa).
See https://fly.io/plans to set up a plan.
? Choose a region for deployment: Toronto, Canada (yyz)
Created app broken-brook-3157 in organization 51sec
Admin URL: https://fly.io/apps/broken-brook-3157
Hostname: broken-brook-3157.fly.dev
Wrote config file fly.toml
PS C:\Users\netsec> notepad fly.toml
PS C:\Users\netsec> fly volumes create flare_data --size 1
Some regions require a paid plan (fra, maa).
See https://fly.io/plans to set up a plan.
? Select region: Toronto, Canada (yyz)
        ID: vol_g67340kkkk2vydxw
      Name: flare_data
       App: broken-brook-3157
    Region: yyz
      Zone: acc6
   Size GB: 1
 Encrypted: true
Created at: 27 Feb 23 03:18 UTC
PS C:\Users\netsec> notepad fly.toml
PS C:\Users\netsec> fly launch
An existing fly.toml file was found for app broken-brook-3157
App is not running, deploy...
==> Building image
Searching for image 'soulteary/flare:0.3.1' remotely...
image found: img_0lq747o9nd5v6x35
==> Creating release
--> release v2 created
--> You can detach the terminal anytime without stopping the deployment
==> Monitoring deployment
Logs: https://fly.io/apps/broken-brook-3157/monitoring
 1 desired, 1 placed, 1 healthy, 0 unhealthy [health checks: 1 total, 1 passing]
--> v0 deployed successfully
PS C:\Users\netsec>


Flame:

Use notepad to edit fly.toml file, which was generated by "flyctl launch" command. 

# fly.toml file generated for broken-brook-3157 on 2023-02-26T19:11:40-08:00
app = "51flame"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[build]
  image = "soulteary/flare:0.3.1"
[env] PASSWORD = "Flare1234!"
[mounts]
  source="flame_data"
  destination="/app/data"
[experimental]
  auto_rollback = true
[[services]]
  http_checks = []
  internal_port = 5005
  processes = ["app"]
  protocol = "tcp"
  script_checks = []
  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"
  [[services.ports]]
    force_https = true
    handlers = ["http"]
    port = 80
  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443
  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"


Flare:

Use notepad to edit fly.toml file, which was generated by "flyctl launch" command. 

# fly.toml file generated for broken-brook-3157 on 2023-02-26T19:11:40-08:00
app = "51flare"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[build]
  image = "soulteary/flare:0.3.1"
[env]
[mounts]
  source="flare_data"
  destination="/app"
[experimental]
  auto_rollback = true
[[services]]
  http_checks = []
  internal_port = 5005
  processes = ["app"]
  protocol = "tcp"
  script_checks = []
  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"
  [[services.ports]]
    force_https = true
    handlers = ["http"]
    port = 80
  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443
  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"



Usage

Flame:

/settings

/applications

/


Authenticated user has access to:

  • all apps
  • all categories
  • all bookmarks
  • all editors
  • all settings

Guest user has access to:

  • all apps set to public (homescreen - only pinned, apps - all public apps)
  • all categories set to public (homescreen - only pinned, bookmarks - all public categories)
  • all bookmarks set to public (homescreen/bookmarks - only if parent category is set to public)
  • Theme and App sections of settings

Flare:


/editor



/config

/guide



/help


Test Performance using Google Chrome Lighthouse:




Flame

 



PS C:\Users\netsec> fly auth login
Opening https://fly.io/app/auth/cli/c41ccd9759be02c0a0dd2d2a096d58 ...
Waiting for session... Done
successfully logged in as [email protected]
PS C:\Users\netsec>
PS C:\Users\netsec>
PS C:\Users\netsec> flyctl launch
Creating app in C:\Users\netsec
Scanning source code
Could not find a Dockerfile, nor detect a runtime or framework from source code. Continuing with a blank app.
? Choose an app name (leave blank to generate one):
? Choose an app name (leave blank to generate one):
? Select Organization: 51Sec (51sec)
Some regions require a paid plan (fra, maa).
See https://fly.io/plans to set up a plan.
? Choose a region for deployment: Toronto, Canada (yyz)
Created app broken-brook-3157 in organization 51sec
Admin URL: https://fly.io/apps/broken-brook-3157
Hostname: broken-brook-3157.fly.dev
Wrote config file fly.toml
PS C:\Users\netsec> notepad fly.toml
PS C:\Users\netsec> fly volumes create flame_data --size 1

PS C:\Users\netsec> notepad fly.toml
PS C:\Users\netsec> fly launch
An existing fly.toml file was found for app broken-brook-3157
App is not running, deploy...
==> Building image
Searching for image 'soulteary/flare:0.3.1' remotely...
image found: img_0lq747o9nd5v6x35
==> Creating release
--> release v2 created
--> You can detach the terminal anytime without stopping the deployment
==> Monitoring deployment
Logs: https://fly.io/apps/broken-brook-3157/monitoring
 1 desired, 1 placed, 1 healthy, 0 unhealthy [health checks: 1 total, 1 passing]
--> v0 deployed successfully
PS C:\Users\netsec>



Use notepad to edit fly.toml file, which was generated by "flyctl launch" command. 

# fly.toml file generated for flare51 on 2023-02-26T20:00:01-08:00
app = "flare51"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[build]
  image = "pawelmalak/flame"
[env]
  PASSWORD = "flame"
[experimental]
  auto_rollback = true
[mounts]
  destination = "/app/data"
  source = "flame_data"
[[services]]
  http_checks = []
  internal_port = 5005
  processes = ["app"]
  protocol = "tcp"
  script_checks = []
  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"
  [[services.ports]]
    force_https = true
    handlers = ["http"]
    port = 80
  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443
  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"





Videos

 







References

  • 【好玩儿的Docker项目】10分钟搭建一个轻量、快速、美观的个人导航页面——Flare
  • Flare 制作记录:应用前后端性能优化









via Blogger http://blog.51sec.org/2023/02/5-mins-docker-deploy-light-weight-super.html
February 27, 2023 at 01:54PM 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