From 4586153aa167d140a1c5ac34c00342ee7b89844a Mon Sep 17 00:00:00 2001 From: PPawlowski Date: Tue, 29 Oct 2024 09:34:44 +0100 Subject: [PATCH] chore: Adjust scripts to run with new docker compose (#58) * Align login script with new docker compose file * Remove flowforge references --- LICENSE | 2 +- README.md | 16 ++--- .../{flowforge => flowfuse}/etc/flowforge.yml | 0 .../{flowforge => flowfuse}/first-login.sh | 68 +++++++++++-------- ...4-ufw-flowforge.sh => 014-ufw-flowfuse.sh} | 0 scripts/{015-flowforge.sh => 015-flowfuse.sh} | 4 +- scripts/016-first-run.sh | 2 +- template.json | 14 ++-- 8 files changed, 58 insertions(+), 48 deletions(-) rename files/opt/{flowforge => flowfuse}/etc/flowforge.yml (100%) rename files/opt/{flowforge => flowfuse}/first-login.sh (51%) rename scripts/{014-ufw-flowforge.sh => 014-ufw-flowfuse.sh} (100%) rename scripts/{015-flowforge.sh => 015-flowfuse.sh} (89%) diff --git a/LICENSE b/LICENSE index 14fbb35..af84376 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright FlowForge Inc, and other contributors, https://flowforge.com/ +Copyright FlowFuse Inc, and other contributors, https://flowfuse.com/ Apache License Version 2.0, January 2004 diff --git a/README.md b/README.md index 06a1b9f..3ff3f0f 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# FlowForge Droplet +# FlowFuse Droplet ## Description -FlowForge's intuitive UI lets you manage your Node-RED instances all in one place. +FlowFuse's intuitive UI lets you manage your Node-RED instances all in one place. Spin up instances of Node-RED in seconds, monitor project health and tear down or suspend projects as required. -### Before you deploy your FlowForge Droplet +### Before you deploy your FlowFuse Droplet #### Get a Domain @@ -14,11 +14,11 @@ Use this [DNS quickstart](https://docs.digitalocean.com/products/networking/dns/ - Why do you need a domain name? - The domain will be used to generate the host names for each FlowForge project you deploy + The domain will be used to generate the host names for each FlowFuse project you deploy #### Setup email -FlowForge needs a way to send email to verify new users and to send invites when users are added to teams. To do this you will need to have details of a SMTP server that will allow you to send email. +FlowFuse needs a way to send email to verify new users and to send invites when users are added to teams. To do this you will need to have details of a SMTP server that will allow you to send email. If you do not have a SMTP server you can set one up using a service like SparkPost, [Sendgrid](https://marketplace.digitalocean.com/apps/sendgrid) or Mailgun. @@ -26,10 +26,10 @@ You can skip this step and configure it later, but the platform works best when ### Getting started after deploying -On your first SSH Login to your droplet or when you connect to the Droplet console you will be greeted by a wizard that will guide you through setting up the domain name and starting your FlowForge instance. +On your first SSH Login to your droplet or when you connect to the Droplet console you will be greeted by a wizard that will guide you through setting up the domain name and starting your FlowFuse instance. Before entering your hostname you will need to add an A record for your domain. -Once the wildcard A record has been created you can enter it into the wizard. The wizard will then update the configuration files and start the FlowForge Application. The final configuration is done via the web interface on the hostname that will be in final message from the wizard. +Once the wildcard A record has been created you can enter it into the wizard. The wizard will then update the configuration files and start the FlowFuse Application. The final configuration is done via the web interface on the hostname that will be in final message from the wizard. -Details of how to complete configuration can be found [here](https://flowforge.com/docs/install/first-run/#--docker-or-kubernetes) \ No newline at end of file +Details of how to complete configuration can be found [here](https://flowfuse.com/docs/install/first-run/#--docker-or-kubernetes) \ No newline at end of file diff --git a/files/opt/flowforge/etc/flowforge.yml b/files/opt/flowfuse/etc/flowforge.yml similarity index 100% rename from files/opt/flowforge/etc/flowforge.yml rename to files/opt/flowfuse/etc/flowforge.yml diff --git a/files/opt/flowforge/first-login.sh b/files/opt/flowfuse/first-login.sh similarity index 51% rename from files/opt/flowforge/first-login.sh rename to files/opt/flowfuse/first-login.sh index 6479b94..210f30f 100755 --- a/files/opt/flowforge/first-login.sh +++ b/files/opt/flowfuse/first-login.sh @@ -1,40 +1,36 @@ #!/bin/bash -myip=$(hostname -I | awk '{print$1}') +# myip=$(hostname -I | awk '{print$1}') +myip=$(curl -s ipinfo.io/ip) modify_config() { DOM=$1 - sed -i "s/example.com/$DOM/" /opt/flowforge/etc/flowforge.yml - sed -i 's/base_url: http/base_url: https/' /opt/flowforge/etc/flowforge.yml - sed -i 's/ public_url: ws/ public_url: wss/' /opt/flowforge/etc/flowforge.yml + cp /opt/flowfuse/.env.example /opt/flowfuse/.env + sed -i "s/^DOMAIN=.*/DOMAIN=$DOM/" /opt/flowfuse/.env + sed -i "s/^TLS_ENABLED=.*/TLS_ENABLED=true/" /opt/flowfuse/.env + echo CREATE_ADMIN=true >> /opt/flowfuse/.env - sed -i "s/example.com/$DOM/" /opt/flowforge/docker-compose.yml - sed -i 's/# //' /opt/flowforge/docker-compose.yml - - #temp fix - sed -i 's!initdb.d/setup-db.sh!initdb.d/01-setup-db.sh!' /opt/flowforge/docker-compose.yml - sed -i 's!initdb.d/setup-context-db.sh!initdb.d/02-setup-context-db.sh!' /opt/flowforge/docker-compose.yml } cat <> /opt/flowforge/etc/flowforge.yml -email: - enabled: true - from: '"FlowForge" ' - smtp: - host: $SMTPHOST - port: $SMTPPORT - secure: $SMTPSECURE - auth: - user: $SMTPUSER - pass: $SMTPPASSWORD -EOF + sed -i "s/^EMAIL_ENABLED=.*/ENAMIL_ENABLED=true/" /opt/flowfuse/.env + sed -i "s/^EMAIL_HOST=.*/EMAIL_HOST=$SMTPHOST/" /opt/flowfuse/.env + sed -i "s/^EMAIL_PORT=.*/EMAIL_PORT=$SMTPPORT/" /opt/flowfuse/.env + sed -i "s/^EMAIL_USER=.*/EMAIL_USER=$SMTPUSER/" /opt/flowfuse/.env + sed -i "s/^EMAIL_PASSWORD=.*/EMAIL_PASSWORD=$SMTPPASSWORD/" /opt/flowfuse/.env + sed -i "s/^EMAIL_SECURE=.*/EMAIL_SECURE=$SMTPSECURE/" /opt/flowfuse/.env + break done -cd /opt/flowforge -docker compose -p flowforge up -d +cd /opt/flowfuse +docker compose --profile autotls up -d --quiet-pull + +cat <&1 | awk '/\[SETUP\] password/ { print $0}' | jq -r .msg | awk '{ print $3 }') cat <> /root/.bashrc \ No newline at end of file +echo "/opt/flowfuse/first-login.sh" >> /root/.bashrc \ No newline at end of file diff --git a/template.json b/template.json index 5536594..009f509 100644 --- a/template.json +++ b/template.json @@ -1,11 +1,11 @@ { "variables": { "do_api_token": "{{env `DIGITALOCEAN_API_TOKEN`}}", - "image_name": "flowforge-{{env `FF_DASH_VERSION`}}-snapshot-{{timestamp}}", + "image_name": "flowfuse-{{env `FF_DASH_VERSION`}}-snapshot-{{timestamp}}", "apt_packages": "apt-transport-https ca-certificates curl jq linux-image-extra-virtual software-properties-common ", - "application_name": "FlowForge", + "application_name": "FlowFuse", "application_version": "{{env `FF_VERSION`}}", - "docker_compose_version": "v2.12.0" + "docker_compose_version": "v2.29.7" }, "sensitive-variables": [ "do_api_token" @@ -69,8 +69,8 @@ "scripts/011-docker-compose.sh", "scripts/012-grub-opts.sh", "scripts/013-docker-dns.sh", - "scripts/014-ufw-flowforge.sh", - "scripts/015-flowforge.sh", + "scripts/014-ufw-flowfuse.sh", + "scripts/015-flowfuse.sh", "scripts/016-first-run.sh", "scripts/020-application-tag.sh", "scripts/900-cleanup.sh", @@ -79,8 +79,8 @@ }, { "type": "file", - "source": "files/opt/flowforge/", - "destination": "/opt/flowforge/" + "source": "files/opt/flowfuse/", + "destination": "/opt/flowfuse/" } ], "post-processors": [