diff --git a/deploy/umbrelos/docker-compose.yml b/deploy/umbrelos/docker-compose.yml new file mode 100644 index 0000000..0e891d3 --- /dev/null +++ b/deploy/umbrelos/docker-compose.yml @@ -0,0 +1,52 @@ +version: "3.7" + +services: + app_proxy: + environment: + APP_HOST: formicaio-apps-formicaio_nginx_1 + APP_PORT: 52100 + container_name: formicaio-apps-formicaio_app_proxy_1 + nginx: + image: nginx:alpine + volumes: + - ${APP_DATA_DIR}/nginx.conf:/etc/nginx/conf.d/default.conf + extra_hosts: + - host.docker.internal:host-gateway + container_name: formicaio-apps-formicaio_nginx_1 + docker: + image: >- + docker:27.4.1-dind@sha256:3c8fb358b82767a38189e54a89a2ba8d71109f0a17efa87fd009ef8283c46df6 + privileged: true + network_mode: host + stop_grace_period: 1m + restart: on-failure + environment: + DOCKER_ENSURE_BRIDGE: dind0:10.32.0.1/16 + entrypoint: /entrypoint.sh + command: | + dockerd + --bridge dind0 + --data-root /data/data + --exec-root /data/exec + --host unix:///data/docker.sock + --pidfile /data/docker.pid + volumes: + - ${APP_DATA_DIR}/entrypoint.sh:/entrypoint.sh + - ${APP_DATA_DIR}/data/docker:/data + container_name: formicaio-apps-formicaio_docker_1 + formicaio: + image: bochaco/formicaio:latest + privileged: true + network_mode: host + restart: on-failure + stop_grace_period: 5s + environment: + NODE_CONTAINER_IMAGE_TAG: latest + DOCKER_SOCKET_PATH: /var/run/docker.sock + DB_PATH: /data + volumes: + - ${APP_DATA_DIR}/data/formicaio:/data + - ${APP_DATA_DIR}/data/docker:/var/run + devices: + - /dev:/dev + container_name: formicaio-apps-formicaio_formicaio_1 \ No newline at end of file diff --git a/deploy/umbrelos/entrypoint.sh b/deploy/umbrelos/entrypoint.sh new file mode 100755 index 0000000..0874054 --- /dev/null +++ b/deploy/umbrelos/entrypoint.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +# This hack can be removed if https://github.com/docker-library/docker/pull/444 gets merged. + +# Remove docker pidfile if it exists to ensure Docker can start up after a bad shutdown +pidfile="/var/run/docker.pid" +if [[ -f "${pidfile}" ]] +then + rm -f "${pidfile}" +fi + +# Use nftables as the backend for iptables +for command in iptables iptables-restore iptables-restore-translate iptables-save iptables-translate +do + ln -sf /sbin/xtables-nft-multi /sbin/$command +done + +# Ensure that a bridge exists with the given name +ensure_bridge_exists() { + local name="${1}" + local ip_range="${2}" + + # Check if the bridge already exists + if ip link show "${name}" &>/dev/null + then + echo "Bridge '${name}' already exists. Skipping creation." + ip addr show "${name}" + return + fi + + echo "Bridge '${name}' does not exist. Creating..." + ip link add "${name}" type bridge + ip addr add "${ip_range}" dev "${name}" + ip link set "${name}" up + + echo "Bridge '${name}' is now up with IP range '${ip_range}'." + ip addr show "${name}" +} + +if [[ "${DOCKER_ENSURE_BRIDGE}" != "" ]] +then + bridge="${DOCKER_ENSURE_BRIDGE%%:*}" + ip_range="${DOCKER_ENSURE_BRIDGE#*:}" + ensure_bridge_exists "${bridge}" "${ip_range}" +fi + +exec dockerd-entrypoint.sh $@ diff --git a/deploy/umbrelos/icon.svg b/deploy/umbrelos/icon.svg new file mode 100644 index 0000000..7e3663d --- /dev/null +++ b/deploy/umbrelos/icon.svg @@ -0,0 +1,605 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/deploy/umbrelos/nginx.conf b/deploy/umbrelos/nginx.conf new file mode 100644 index 0000000..9104dc4 --- /dev/null +++ b/deploy/umbrelos/nginx.conf @@ -0,0 +1,12 @@ +server { + listen 52100; + server_name localhost; + + location / { + proxy_pass http://host.docker.internal:52100; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } +} \ No newline at end of file diff --git a/deploy/umbrelos/umbrel-app.yml b/deploy/umbrelos/umbrel-app.yml new file mode 100644 index 0000000..4296976 --- /dev/null +++ b/deploy/umbrelos/umbrel-app.yml @@ -0,0 +1,46 @@ +manifestVersion: 1 +id: formicaio +name: Formicaio +tagline: Il potere delle formiche +icon: https://raw.githubusercontent.com/bochaco/formicaio/cc1bb961c97ea6d5042ada43f83ea1bcf4808fd4/public/formicaio.svg +category: social +version: "0.2.3" +port: 52101 # Published version on umbrel app store will run on port 52100 +description: >- + Le formiche sono insetti sociali che vivono in colonie e sono + note per la loro organizzazione e cooperazione. + + Ants are social insects that live in colonies and are + known for their organization and cooperation. + + Simplify your decentralized experience with this intuitive application, + designed to streamline your daily tasks when running nodes from home + on peer-to-peer (P2P) networks. Seamlessly participate in online + communities using the integrated Nostr client, and manage your + digital assets with ease through the built-in wallet. Receive, send, + and store tokens, rewards, and coins earned from running nodes or received + from third-party sources, all within a single, user-friendly interface. +developer: bochaco +website: https://github.com/bochaco/formicaio +submitter: bochaco +submission: https://github.com/getumbrel/umbrel-apps/pull/1565 +dependencies: [] +repo: https://github.com/bochaco/formicaio +support: https://github.com/bochaco/formicaio/issues +gallery: + - https://raw.githubusercontent.com/bochaco/formicaio/refs/heads/main/img/screenshot_01.png + - https://raw.githubusercontent.com/bochaco/formicaio/refs/heads/main/img/screenshot_02.png + - https://raw.githubusercontent.com/bochaco/formicaio/refs/heads/main/img/screenshot_03.png + - https://raw.githubusercontent.com/bochaco/formicaio/refs/heads/main/img/screenshot_04.png + - https://raw.githubusercontent.com/bochaco/formicaio/refs/heads/main/img/screenshot_05.png + - https://raw.githubusercontent.com/bochaco/formicaio/refs/heads/main/img/lcd_00.png + - https://raw.githubusercontent.com/bochaco/formicaio/refs/heads/main/img/lcd_01.png + - https://raw.githubusercontent.com/bochaco/formicaio/refs/heads/main/img/lcd_02.png +releaseNotes: >- + This initial version lays the foundation for future development, + with additional features to be introduced in subsequent updates. + + This first version of the Formicaio app allows to run a few + nodes on the Autonomi P2P network. No other features are still available + in this first version. +path: ""