From 72003846a15089ed31a5aae02faa86598c8449af Mon Sep 17 00:00:00 2001 From: Marc Went Date: Fri, 6 Nov 2026 22:33:46 +0100 Subject: [PATCH] Floci: add ct and install scripts Builds Floci (local AWS emulator) from the release tarball with Temurin 25 and Maven, since releases carry no standalone binary yet (floci-io/floci#5767). Co-Authored-By: Claude Opus 5.5 Signed-off-by: Marc Went --- ct/floci.sh | 64 ++++++++++++++++++++++++++++++++++++++ install/floci-install.sh | 67 ++++++++++++++++++++++++++++++++++++++++ json/floci.json | 53 +++++++++++++++++++++++++++++++ 3 files changed, 184 insertions(+) create mode 100644 ct/floci.sh create mode 100644 install/floci-install.sh create mode 100644 json/floci.json diff --git a/ct/floci.sh b/ct/floci.sh new file mode 100644 index 0000000000..45bcb6475f --- /dev/null +++ b/ct/floci.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash +_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/DevScripts/main" +_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" +source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") +# Copyright (c) 2021-2026 community-scripts ORG +# Author: Marc Went (Dunky13) +# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE +# Source: https://github.com/floci-io/floci + +APP="Floci" +var_tags="${var_tags:-aws;developer;testing}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-3072}" +var_disk="${var_disk:-6}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_arm64="${var_arm64:-yes}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -d /opt/floci ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + if check_for_gh_release "floci" "floci-io/floci"; then + msg_info "Stopping Floci" + systemctl stop floci + msg_ok "Stopped Floci" + + JAVA_VERSION="25" setup_java + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "floci" "floci-io/floci" "tarball" + + msg_info "Building Floci" + cd /opt/floci + $STD mvn -B clean package -Dmaven.test.skip=true + rm -rf ~/.m2 + msg_ok "Built Floci" + + msg_info "Starting Floci" + systemctl start floci + msg_ok "Started Floci" + msg_ok "Updated successfully!" + fi + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW}Access it using the following URL:${CL}" +echo -e "${GATEWAY}${BGN}http://${IP}:4566${CL}" diff --git a/install/floci-install.sh b/install/floci-install.sh new file mode 100644 index 0000000000..3275a03a6e --- /dev/null +++ b/install/floci-install.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: Marc Went (Dunky13) +# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE +# Source: https://github.com/floci-io/floci + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +JAVA_VERSION="25" setup_java + +# after setup_java, so Temurin satisfies maven's Java dependency instead of pulling in OpenJDK +msg_info "Installing Dependencies" +$STD apt install -y maven +msg_ok "Installed Dependencies" + +fetch_and_deploy_gh_release "floci" "floci-io/floci" "tarball" + +msg_info "Building Floci" +cd /opt/floci +$STD mvn -B clean package -Dmaven.test.skip=true +rm -rf ~/.m2 +msg_ok "Built Floci" + +msg_info "Configuring Floci" +mkdir -p /opt/floci_data +cat </opt/floci_data/.env +QUARKUS_HTTP_HOST=0.0.0.0 +FLOCI_SECURITY_ALLOW_UNSAFE_NETWORK_EXPOSURE=true +FLOCI_BASE_URL=http://${LOCAL_IP}:4566 +FLOCI_STORAGE_MODE=persistent +FLOCI_STORAGE_PERSISTENT_PATH=/opt/floci_data/data +FLOCI_SERVICES_UI_ENABLED=false +EOF +msg_ok "Configured Floci" + +msg_info "Creating Service" +cat </etc/systemd/system/floci.service +[Unit] +Description=Floci +After=network.target + +[Service] +Type=simple +User=root +WorkingDirectory=/opt/floci_data +EnvironmentFile=/opt/floci_data/.env +ExecStart=/usr/bin/java --enable-native-access=ALL-UNNAMED -jar /opt/floci/target/quarkus-app/quarkus-run.jar +SuccessExitStatus=143 +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now floci +msg_ok "Created Service" + +motd_ssh +customize +cleanup_lxc diff --git a/json/floci.json b/json/floci.json new file mode 100644 index 0000000000..ef92456e18 --- /dev/null +++ b/json/floci.json @@ -0,0 +1,53 @@ +{ + "name": "Floci", + "slug": "floci", + "categories": [ + 20 + ], + "date_created": "2026-11-06", + "type": "ct", + "updateable": true, + "privileged": false, + "architectures": [ + "amd64", + "arm64" + ], + "interface_port": 4566, + "documentation": "https://floci.io/floci/", + "website": "https://floci.io/floci/", + "repository": "https://github.com/floci-io/floci", + "logo": "https://cdn.jsdelivr.net/gh/floci-io/floci@main/docs/assets/floci.svg", + "description": "Floci is a free, open source local AWS emulator for development and CI. It serves S3, SQS, SNS, DynamoDB, IAM, Lambda, Secrets Manager and many more services on a single endpoint at port 4566, so the AWS CLI and SDKs work against it by setting an endpoint URL.", + "install_methods": [ + { + "type": "default", + "script": "ct/floci.sh", + "config_path": "/opt/floci_data/.env", + "resources": { + "cpu": 2, + "ram": 3072, + "hdd": 6, + "os": "Debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "Floci has no authentication. Use any non-empty AWS access key and secret (for example test/test), region us-east-1, and set the endpoint URL to http://:4566. Keep it on a trusted network.", + "type": "warning" + }, + { + "text": "Docker is not installed, so services that run containers (Lambda, ECS, RDS, ElastiCache, EKS and similar) are limited or unavailable. S3, SQS, SNS, DynamoDB and the other core services work.", + "type": "info" + }, + { + "text": "Response URLs such as SQS queue URLs use FLOCI_BASE_URL in /opt/floci_data/.env, set to the container IP at install. Update it and restart floci when the IP changes or clients reach Floci through a hostname.", + "type": "info" + } + ] +}