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
Flare: https://github.com/soulteary/docker-flare
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
Self Hosted Docker Installation Pre-requirements
Free resources you might need to complete this docker project:
- Server: Oracle Free VPS, Azure Free VPS, Google Cloud Free VPS, and others
- Create a Free Tier Windows/Linux Azure VPS VM
- [Free VPS] GCP (Google Cloud Platform) Tips and Tricks (Free 16G RAM, 4 vCPU VPS)
- System: Cloud Vendor Ubuntu, Debian, or DD an original version
- SWAP size increase: wget https://raw.githubusercontent.com/51sec/swap/main/swap.sh && bash swap.sh
- Enable Password ssh login
- Enable BBR
- systemctl restart docker
- Domain: (Optional) EU.ORG to get a free one, free Cloudflare account to manage your domain
- Confirm port has not been used (you might need to install lsof using command : apt install lsof):
- lsof -i:8088
Pre-installed services:
- Docker,
- apt update
- apt install docker.io
- apt install docker-compose
- apt upgrade docker.io
- mkdir /root/data/docker_data/<docker_name>
- Docker-Compose (Using Ubuntu OS for the commands)
- Docker-compose down
- Optional command : use following command to backup your Docker data. You might need to change your folder name based on your docker configuraiton
- cp -r /root/data/docker_data/<docker_name> /root/data/docker_data_backup/<docker_name>
- docker-compose pull
- docker-compose up -d
- docker image prune
- Portainer (Optional)
- docker volume create portainer_data
- 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
- Install some applications: apt install wget curl sudo vim git (Optional)
- aapanel with Nginx (Optional)
- Nginx Proxy Manager (Optional)
- Install screen (Optional)
- Install screen (Depends on the Linux Distribution if it came pre installed or not) : yum install screen
- Initiate a Screen : screen or screen -S <screen name> <command to execute>
- Detach from the screen : "CTRL+A,D" not "CTRL+A+D"
- List all the screen currently working : screen -ls
- Reattach to a screen : screen -r <session number> or screen -r <screen name>
- Kill specific screen: screen -X -S <screen name> quit
- Kill all screens : pkill screen
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
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
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:
# fly.toml file generated for flame on 2023-03-04T16:22:46-05:00
app = "51flame"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[build]
image = "pawelmalak/flame"
[env]
PASSWORD = "Flame1234!"
[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:
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
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>
# 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"
Custome Domain
Launch Web CLI:1. Download your fly.toml
2. Migrate to Apps v2
The fly migrate-to-v2
command will migrate flame
to v2 of our apps platform, and roll back in case of any issues.
3. Save updated config locally
Now, you need to save the updated fly.toml
locally, and commit it to your git repo. On your local machine, run:
Troubleshooting
In Linux or Mac environment, run the install script to install Fly.io cli:
curl -L https://fly.io/install.sh | sh
If you used curl to install flyctl, then you need to add the flyctl directory to your shell rc file. Check the output of the install script for the entries to copy and paste into the file. Now you can use the flyctl
command from any directory. Or for maximum efficiency, you can use the fly
command!
- /root/.fly/bin/fly launch
Fly.io commands
PS C:\Users\john> fly orgs show freshrss51sec
Organization
Name : freshrss51sec
Slug : freshrss51sec
Type : SHARED
Summary
You have admin permissions on this organizaton
There are 1 members associated with this organization
Organization Members
+------+----------------------+-------+
| NAME | EMAIL | ROLE |
+------+----------------------+-------+
| | [email protected] | ADMIN |
+------+----------------------+-------+
PS C:\Users\john>fly volumes destroy vol_53q80vdpk66vgzy6
Warning! Every volume is pinned to a specific physical host. You should create two or more volumes per application. Deleting this volume will leave you with 1 volume(s) for this application,? Are you sure you want to destroy this volume? Yes
Destroyed volume ID: vol_53q80vdpk66vgzy6 name: freshrss51sec_data
PS C:\Users\john>PS C:\Users\john> fly config save -a freshrss51
Wrote config file fly.toml
PS C:\Users\john> fly volumes list
ID STATE NAME SIZE REGION ZONE ENCRYPTED ATTACHED VM CREATED AT
vol_53q80vdpk66vgzy6 created freshrss51sec_data 1GB yyz 5e29 true 1 year ago
vol_1q85vg3lem8rzdxe created freshrss51sec_data 1GB yyz aeee true e28606eb740486 10 months ago
PS C:\Users\john>
No comments:
Post a Comment