diff --git a/.scripts/build.sh b/.scripts/build.sh index 2d8ebd5..73c06a7 100755 --- a/.scripts/build.sh +++ b/.scripts/build.sh @@ -20,7 +20,7 @@ fi echo "πŸ—οΈ Preparing to build edgeapps: $ACTIVE_APPS" -# For each active app, add a `-f /edgebox-compose.yml` argument to the `docker-compose` command +# For each active app, add a `-f /edgebox-compose.yml` argument to the `docker compose` command for app in $ACTIVE_APPS; do DOCKER_COMPOSE_ARGS="$DOCKER_COMPOSE_ARGS -f $app/edgebox-compose.yml" done @@ -29,6 +29,6 @@ DOCKER_COMPOSE_ARGS="$DOCKER_COMPOSE_ARGS -f compose.yml" echo "🐳 Building operations:" echo "" -docker-compose $DOCKER_COMPOSE_ARGS build +docker compose $DOCKER_COMPOSE_ARGS build echo "\n🟒 Operations completed." diff --git a/.scripts/run.sh b/.scripts/run.sh index 12ba291..02df98f 100755 --- a/.scripts/run.sh +++ b/.scripts/run.sh @@ -16,7 +16,7 @@ if [ -n "$1" ]; then ACTIVE_APPS=$1 fi -# For each active app, add a `-f /edgebox-compose.yml` argument to the `docker-compose` command +# For each active app, add a `-f /edgebox-compose.yml` argument to the `docker compose` command DOCKER_COMPOSE_ARGS="$DOCKER_COMPOSE_ARGS -f compose.yml" PUBLISH_DOMAINS="false" hosts_file_content="" @@ -80,8 +80,8 @@ if [ "$PUBLISH_DOMAINS" = "false" ]; then fi echo "🐳 Setting up Containers:\n" -# I want to put a - in front of the first line of output from docker-compose -docker-compose $DOCKER_COMPOSE_ARGS up -d --remove-orphans +# I want to put a - in front of the first line of output from docker compose +docker compose $DOCKER_COMPOSE_ARGS up -d --remove-orphans echo "" # Unpack the domains list as \n - separated string diff --git a/.scripts/status.sh b/.scripts/status.sh index cc85292..206649e 100755 --- a/.scripts/status.sh +++ b/.scripts/status.sh @@ -1,3 +1,3 @@ echo "πŸ—ΊοΈ Status of local edgeapps:" echo "" -docker-compose ps \ No newline at end of file +docker compose ps \ No newline at end of file diff --git a/.scripts/stop.sh b/.scripts/stop.sh index d01dbf8..0925e80 100755 --- a/.scripts/stop.sh +++ b/.scripts/stop.sh @@ -22,7 +22,7 @@ if [ -z "$SERVICES_TO_STOP" ]; then else echo "βœ‹ Stopping local edgeapp services: $SERVICES_TO_STOP" fi -# For each active app, add a `-f /edgebox-compose.yml` argument to the `docker-compose` command +# For each active app, add a `-f /edgebox-compose.yml` argument to the `docker compose` command DOCKER_COMPOSE_ARGS="$DOCKER_COMPOSE_ARGS -f compose.yml" for app in $ACTIVE_APPS; do @@ -31,7 +31,7 @@ done echo "" -# Docker-compose should stop $active_app-* containers for each active app -docker-compose $DOCKER_COMPOSE_ARGS down $SERVICES_TO_STOP +# Docker compose should stop $active_app-* containers for each active app +docker compose $DOCKER_COMPOSE_ARGS down $SERVICES_TO_STOP echo "\n🟒 Operations completed." \ No newline at end of file diff --git a/README.md b/README.md index 885d645..64a2b5f 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ $ ./ws -b > To use WS to build these applications manually without a properly working Edgebox system (that includes the `api` and `edgeboxctl`), you need to manually set the desired environment and lock files for each app prior to starting the build process, otherwise it will not work as expected. Check below for more details on manual configuration of apps πŸ‘‡ This will go through each folder in the `/home/system/components/apps/` folder, and configure the containers for each valid app entry. -After running this command, You should have a `docker-compose.yml` file in the the root of the ws repository (it is git igored) with the final generated configuration which will then be used to spawn the containers via the `docker-compose up -d` command. +After running this command, You should have a `docker-compose.yml` file in the the root of the ws repository (it is git igored) with the final generated configuration which will then be used to spawn the containers via the `docker compose up -d` command. The containers will also automatically start, and be available on the configured `VIRTUAL_HOST` of each app, given you've also setup all the necessary dependencies for `ws`. Check the [ws repository](https://github.com/edgebox-iot/ws) for more information on how `ws` works. diff --git a/campfire/.dockerignore b/campfire/.dockerignore new file mode 100644 index 0000000..bdbeb44 --- /dev/null +++ b/campfire/.dockerignore @@ -0,0 +1 @@ +appdata/* diff --git a/campfire/Dockerfile b/campfire/Dockerfile new file mode 100644 index 0000000..50abe21 --- /dev/null +++ b/campfire/Dockerfile @@ -0,0 +1,4 @@ +FROM ghcr.io/basecamp/once-campfire:latest +LABEL org.opencontainers.image.description="Campfire is a simple, self-hosted team chat application." + +EXPOSE 80 443 diff --git a/campfire/edgeapp.template.env b/campfire/edgeapp.template.env new file mode 100644 index 0000000..bcb91da --- /dev/null +++ b/campfire/edgeapp.template.env @@ -0,0 +1,3 @@ +CAMPFIRE_SECRET_KEY_BASE=string|true|Secret key used for cryptographic signing (generate with: openssl rand -hex 64) +CAMPFIRE_VAPID_PUBLIC_KEY=string|false|VAPID public key for Web Push notifications +CAMPFIRE_VAPID_PRIVATE_KEY=string|false|VAPID private key for Web Push notifications diff --git a/campfire/edgebox-compose.yml b/campfire/edgebox-compose.yml new file mode 100644 index 0000000..57ad348 --- /dev/null +++ b/campfire/edgebox-compose.yml @@ -0,0 +1,21 @@ +version: "3" +services: + ############## + # Campfire EdgeApp + ############## + campfire-ws: + image: ghcr.io/edgebox-iot/apps/campfire:1.0.0 + build: + context: "./" + container_name: '${COMPOSE_PROJECT_NAME-edgebox}-campfire-ws' + environment: + VIRTUAL_HOST: ${LOCAL_URL}${INTERNET_URL} + VIRTUAL_PORT: 80 + DISABLE_SSL: "true" + SECRET_KEY_BASE: '${CAMPFIRE_SECRET_KEY_BASE}' + VAPID_PUBLIC_KEY: '${CAMPFIRE_VAPID_PUBLIC_KEY}' + VAPID_PRIVATE_KEY: '${CAMPFIRE_VAPID_PRIVATE_KEY}' + volumes: + - ./appdata/storage:/rails/storage:rw + - /etc/localtime:/etc/localtime:ro + restart: unless-stopped diff --git a/campfire/edgebox-hosts.txt b/campfire/edgebox-hosts.txt new file mode 100644 index 0000000..8ee347c --- /dev/null +++ b/campfire/edgebox-hosts.txt @@ -0,0 +1 @@ +campfire diff --git a/campfire/edgebox.env b/campfire/edgebox.env new file mode 100644 index 0000000..4c495e1 --- /dev/null +++ b/campfire/edgebox.env @@ -0,0 +1,11 @@ +############################################ +# Edgebox api compose environment variables +############################################ + +EDGEAPP_NAME=Campfire +EDGEAPP_DESCRIPTION=Team Chat +EDGEAPP_EXPERIMENTAL=true +EDGEAPP_VERSION=1.0.0 + +# To determine the name of your containers +COMPOSE_PROJECT_NAME=edgebox diff --git a/collabora/.dockerignore b/collabora/.dockerignore new file mode 100644 index 0000000..c1250f7 --- /dev/null +++ b/collabora/.dockerignore @@ -0,0 +1 @@ +appdata/* \ No newline at end of file diff --git a/collabora/Dockerfile b/collabora/Dockerfile new file mode 100644 index 0000000..425a213 --- /dev/null +++ b/collabora/Dockerfile @@ -0,0 +1,7 @@ + +# Base image to base the app container on +FROM collabora/code +LABEL org.opencontainers.image.description Collabora Office is a powerful office suite that supports all major document, spreadsheet and presentation file formats. + +# Port to expose from the container into the host +EXPOSE 9980 \ No newline at end of file diff --git a/collabora/README.md b/collabora/README.md new file mode 100644 index 0000000..f23b229 --- /dev/null +++ b/collabora/README.md @@ -0,0 +1,31 @@ +# Collabora Office Office Suite + +This is a simple edgeapp template that demonstrates how to create an edgeapp that runs "Collabora Office" when accessed. +It makes use of environment files, configurations and directories to demonstrate the customization capabilities for building and expanding self-hosted apps. + +## Directory Structure + +### Editable Files + +These files make the structure of an edgeapp and can be edited to customize the edgeapp installation, runtime, and configuration. + +- /src -> Source directory +- /src/build/ -> Files to be added to the container images build +- /src/install/ -> Files to be used with edgebox-postinstall.sh (ran after install) +- edgebox.env -> Environment file for the edgeapp, used to set container environment variables and meta data +- edgeapp.template.env -> Template environment file for the edgeapp, used to set Dashboard GUI configuration options +- edgebox-postinstall.sh -> Script ran after the edgeapp is fresh installed +- edgebox-hosts.txt -> Subdomain host names to be published by the edgeapp +- edgebox-compose.yml -> Defines the edgeapp services, containers, build, configuration, volumes, etc. +- Dockerfile - The Docker image used to build the edgeapp container image +- /README.md -> This file + +### Dynamically Managed Files + +These files do not exist initially, but can be created dynamically and are managed by the edgeapp and should not be edited manually. + +- /appdata -> Holds running app data, directory used to hold container volumes +- .run -> Placeholder file to indicate this app should run upon edgebox containers status check +- edgeapp.env -> Environment file for the edgeapp, used to set container environment variables +- myedgeapp.env -> Environment file for the externally accessible domain, used to set container internet connectivity and domain configuration +- edgebox-postinstall.done -> Placeholder file to indicate the edgeapp post-install has ben ran previously \ No newline at end of file diff --git a/collabora/edgebox-compose.yml b/collabora/edgebox-compose.yml new file mode 100644 index 0000000..3931ec5 --- /dev/null +++ b/collabora/edgebox-compose.yml @@ -0,0 +1,24 @@ +services: + ############## + # Collabora Office EdgeApp + ############## + collabora-ws: + image: ghcr.io/edgebox-iot/apps/${COMPOSE_APP_SLUG-collabora}:1.0.0 + build: + context: "./" + container_name: '${COMPOSE_PROJECT_NAME-edgebox}-${COMPOSE_APP_SLUG-collabora}-ws' + restart: unless-stopped + environment: + # WS Proxy control varialbles - Do not change + VIRTUAL_HOST: ${LOCAL_URL-collabora.local}${INTERNET_URL-} + VIRTUAL_PORT: 9980 + # Overridable variables (optional) + # VIRTUAL_PORT: 80 + # VIRTUAL_PROTO: https + # VIRTUAL_PATH: / + # VIRTUAL_DEST: / + + volumes: + # Recommended defaults + - /etc/localtime:/etc/localtime:ro + diff --git a/collabora/edgebox-hosts.txt b/collabora/edgebox-hosts.txt new file mode 100644 index 0000000..f398a3a --- /dev/null +++ b/collabora/edgebox-hosts.txt @@ -0,0 +1 @@ +collabora diff --git a/collabora/edgebox-icon.png b/collabora/edgebox-icon.png new file mode 100644 index 0000000..e07ed52 Binary files /dev/null and b/collabora/edgebox-icon.png differ diff --git a/collabora/edgebox-postinstall.sh b/collabora/edgebox-postinstall.sh new file mode 100755 index 0000000..8052e91 --- /dev/null +++ b/collabora/edgebox-postinstall.sh @@ -0,0 +1,3 @@ +# mkdir -p ./appdata/collabora-ws +echo "πŸ“¦ collabora postinstall script" +echo "- Running in $(pwd)" \ No newline at end of file diff --git a/collabora/edgebox-postinstall.txt b/collabora/edgebox-postinstall.txt new file mode 100644 index 0000000..6dfdaa1 --- /dev/null +++ b/collabora/edgebox-postinstall.txt @@ -0,0 +1 @@ +-T collabora-ws pwd diff --git a/collabora/edgebox.env b/collabora/edgebox.env new file mode 100644 index 0000000..53d9633 --- /dev/null +++ b/collabora/edgebox.env @@ -0,0 +1,14 @@ +############################################ +# Edgebox WS and API environment variables +############################################ + +# Metadata values - Used by edgebox api service for UI and update control purposes +EDGEAPP_NAME=Collabora Office +EDGEAPP_DESCRIPTION=Office Suite +EDGEAPP_VERSION=1.0.0 + +# Compose values - Used by edgebox ws service for containers setup +COMPOSE_PROJECT_NAME=edgebox +COMPOSE_APP_SLUG=collabora + + diff --git a/fizzy/.dockerignore b/fizzy/.dockerignore new file mode 100644 index 0000000..bdbeb44 --- /dev/null +++ b/fizzy/.dockerignore @@ -0,0 +1 @@ +appdata/* diff --git a/fizzy/Dockerfile b/fizzy/Dockerfile new file mode 100644 index 0000000..c14a6cb --- /dev/null +++ b/fizzy/Dockerfile @@ -0,0 +1,4 @@ +FROM ghcr.io/basecamp/fizzy:main +LABEL org.opencontainers.image.description="Fizzy is a simple project management tool using Kanban boards." + +EXPOSE 80 443 diff --git a/fizzy/edgeapp.template.env b/fizzy/edgeapp.template.env new file mode 100644 index 0000000..42820fe --- /dev/null +++ b/fizzy/edgeapp.template.env @@ -0,0 +1,9 @@ +FIZZY_SECRET_KEY_BASE=string|true|Secret key used for cryptographic signing (generate with: openssl rand -hex 64) +FIZZY_BASE_URL=string|false|The public URL of your Fizzy instance (e.g. http://fizzy.local) +FIZZY_VAPID_PUBLIC_KEY=string|false|VAPID public key for Web Push notifications +FIZZY_VAPID_PRIVATE_KEY=string|false|VAPID private key for Web Push notifications +FIZZY_SMTP_ADDRESS=string|false|SMTP server address for sending emails +FIZZY_SMTP_PORT=string|false|SMTP server port +FIZZY_SMTP_USERNAME=string|false|SMTP username +FIZZY_SMTP_PASSWORD=string|false|SMTP password +FIZZY_MAILER_FROM_ADDRESS=string|false|From address for emails sent by Fizzy diff --git a/fizzy/edgebox-compose.yml b/fizzy/edgebox-compose.yml new file mode 100644 index 0000000..670094a --- /dev/null +++ b/fizzy/edgebox-compose.yml @@ -0,0 +1,27 @@ +version: "3" +services: + ############## + # Fizzy EdgeApp + ############## + fizzy-ws: + image: ghcr.io/edgebox-iot/apps/fizzy:1.0.0 + build: + context: "./" + container_name: '${COMPOSE_PROJECT_NAME-edgebox}-fizzy-ws' + environment: + VIRTUAL_HOST: ${LOCAL_URL}${INTERNET_URL} + VIRTUAL_PORT: 80 + DISABLE_SSL: "true" + SECRET_KEY_BASE: '${FIZZY_SECRET_KEY_BASE}' + BASE_URL: '${FIZZY_BASE_URL}' + VAPID_PUBLIC_KEY: '${FIZZY_VAPID_PUBLIC_KEY}' + VAPID_PRIVATE_KEY: '${FIZZY_VAPID_PRIVATE_KEY}' + SMTP_ADDRESS: '${FIZZY_SMTP_ADDRESS}' + SMTP_PORT: '${FIZZY_SMTP_PORT}' + SMTP_USERNAME: '${FIZZY_SMTP_USERNAME}' + SMTP_PASSWORD: '${FIZZY_SMTP_PASSWORD}' + MAILER_FROM_ADDRESS: '${FIZZY_MAILER_FROM_ADDRESS}' + volumes: + - ./appdata/storage:/rails/storage:rw + - /etc/localtime:/etc/localtime:ro + restart: unless-stopped diff --git a/fizzy/edgebox-hosts.txt b/fizzy/edgebox-hosts.txt new file mode 100644 index 0000000..5415328 --- /dev/null +++ b/fizzy/edgebox-hosts.txt @@ -0,0 +1 @@ +fizzy diff --git a/fizzy/edgebox.env b/fizzy/edgebox.env new file mode 100644 index 0000000..3af7e78 --- /dev/null +++ b/fizzy/edgebox.env @@ -0,0 +1,11 @@ +############################################ +# Edgebox api compose environment variables +############################################ + +EDGEAPP_NAME=Fizzy +EDGEAPP_DESCRIPTION=Project Management +EDGEAPP_EXPERIMENTAL=true +EDGEAPP_VERSION=1.0.0 + +# To determine the name of your containers +COMPOSE_PROJECT_NAME=edgebox diff --git a/hello/.dockerignore b/hello/.dockerignore new file mode 100644 index 0000000..c1250f7 --- /dev/null +++ b/hello/.dockerignore @@ -0,0 +1 @@ +appdata/* \ No newline at end of file diff --git a/hello/Dockerfile b/hello/Dockerfile new file mode 100644 index 0000000..921a6ad --- /dev/null +++ b/hello/Dockerfile @@ -0,0 +1,10 @@ + +# Base image to base the app container on +FROM nginxdemos/hello:0.4 +LABEL org.opencontainers.image.description Hello is a scaffolding edgeapp template. + +# Add / Replace Files in the Container +ADD ./src/build/hello.conf /etc/nginx/conf.d/ + +# Port to expose from the container into the host +EXPOSE 80 \ No newline at end of file diff --git a/hello/README.md b/hello/README.md new file mode 100644 index 0000000..af276df --- /dev/null +++ b/hello/README.md @@ -0,0 +1,31 @@ +# Hello World Edgeapp Template + +This is a simple edgeapp template that demonstrates how to create an edgeapp that runs a "Hello World" when accessed. +It makes use of environment files, configurations and directories to demonstrate the customization capabilities for building and expanding self-hosted apps. + +## Directory Structure + +### Editable Files + +These files make the structure of an edgeapp and can be edited to customize the edgeapp installation, runtime, and configuration. + +- /src -> Source directory +- /src/build/ -> Files to be added to the container images build +- /src/install/ -> Files to be used with edgebox-postinstall.sh (ran after install) +- edgebox.env -> Environment file for the edgeapp, used to set container environment variables and meta data +- edgeapp.template.env -> Template environment file for the edgeapp, used to set Dashboard GUI configuration options +- edgebox-postinstall.sh -> Script ran after the edgeapp is fresh installed +- edgebox-hosts.txt -> Subdomain host names to be published by the edgeapp +- edgebox-compose.yml -> Defines the edgeapp services, containers, build, configuration, volumes, etc. +- Dockerfile - The Docker image used to build the edgeapp container image +- /README.md -> This file + +### Dynamically Managed Files + +These files do not exist initially, but can be created dynamically and are managed by the edgeapp and should not be edited manually. + +- /appdata -> Holds running app data, directory used to hold container volumes +- .run -> Placeholder file to indicate this app should run upon edgebox containers status check +- edgeapp.env -> Environment file for the edgeapp, used to set container environment variables +- myedgeapp.env -> Environment file for the externally accessible domain, used to set container internet connectivity and domain configuration +- edgebox-postinstall.done -> Placeholder file to indicate the edgeapp post-install has ben ran previously \ No newline at end of file diff --git a/hello/edgeapp.template.env b/hello/edgeapp.template.env new file mode 100644 index 0000000..668e760 --- /dev/null +++ b/hello/edgeapp.template.env @@ -0,0 +1,2 @@ +HELLO_EXAMPLE_BOOLEAN_OPTION=bool|true|Toggle Example Option +HELLO_EXAMPLE_REQUIRED_FIELD_OPTION=string|true|A Required secret option diff --git a/hello/edgebox-compose.yml b/hello/edgebox-compose.yml new file mode 100644 index 0000000..290eada --- /dev/null +++ b/hello/edgebox-compose.yml @@ -0,0 +1,26 @@ +version: "3" +services: + ############## + # Hello World EdgeApp + ############## + hello-ws: + image: ghcr.io/edgebox-iot/apps/${COMPOSE_APP_SLUG-hello}:1.0.0 + build: + context: "./" + container_name: '${COMPOSE_PROJECT_NAME-edgebox}-${COMPOSE_APP_SLUG-hello}-ws' + restart: unless-stopped + environment: + # WS Proxy control varialbles - Do not change + VIRTUAL_HOST: ${LOCAL_URL}${INTERNET_URL} + # Overridable variables (optional) + # VIRTUAL_PORT: 80 + # VIRTUAL_PROTO: https + # VIRTUAL_PATH: / + # VIRTUAL_DEST: / + + volumes: + # Recommended defaults + - /etc/localtime:/etc/localtime:ro + # Host data volume (Modify as needed by the app) + - ./appdata/${COMPOSE_APP_SLUG-hello}-ws:/usr/share/nginx/html/:rw + diff --git a/hello/edgebox-hosts.txt b/hello/edgebox-hosts.txt new file mode 100644 index 0000000..ce01362 --- /dev/null +++ b/hello/edgebox-hosts.txt @@ -0,0 +1 @@ +hello diff --git a/hello/edgebox-icon.png b/hello/edgebox-icon.png new file mode 100644 index 0000000..e07ed52 Binary files /dev/null and b/hello/edgebox-icon.png differ diff --git a/hello/edgebox-postinstall.sh b/hello/edgebox-postinstall.sh new file mode 100755 index 0000000..98441ce --- /dev/null +++ b/hello/edgebox-postinstall.sh @@ -0,0 +1,5 @@ +# mkdir -p ./appdata/hello-ws +echo "πŸ“¦ Hello World postinstall script" +echo "- Running in $(pwd)" +echo "- Copying files to ./appdata/hello-ws" +cp ./src/install/* ./appdata/hello-ws/ \ No newline at end of file diff --git a/hello/edgebox-postinstall.txt b/hello/edgebox-postinstall.txt new file mode 100644 index 0000000..94b83a3 --- /dev/null +++ b/hello/edgebox-postinstall.txt @@ -0,0 +1 @@ +-T hello-ws pwd diff --git a/hello/edgebox.env b/hello/edgebox.env new file mode 100644 index 0000000..8a825d8 --- /dev/null +++ b/hello/edgebox.env @@ -0,0 +1,14 @@ +############################################ +# Edgebox WS and API environment variables +############################################ + +# Metadata values - Used by edgebox api service for UI and update control purposes +EDGEAPP_NAME=Hello World +EDGEAPP_DESCRIPTION=Edgeapp Template +EDGEAPP_VERSION=1.0.0 + +# Compose values - Used by edgebox ws service for containers setup +COMPOSE_PROJECT_NAME=edgebox +COMPOSE_APP_SLUG=hello + + diff --git a/hello/src/build/hello.conf b/hello/src/build/hello.conf new file mode 100644 index 0000000..e7532f4 --- /dev/null +++ b/hello/src/build/hello.conf @@ -0,0 +1,16 @@ +server { + listen 80; + listen [::]:80; + + root /usr/share/nginx/html; + try_files /index.html =404; + + expires -1; + + sub_filter_once off; + sub_filter 'server_hostname' '$hostname'; + sub_filter 'server_address' '$server_addr:$server_port'; + sub_filter 'server_url' '$request_uri'; + sub_filter 'server_date' '$time_local'; + sub_filter 'request_id' '$request_id'; +} \ No newline at end of file diff --git a/hello/src/install/index.html b/hello/src/install/index.html new file mode 100644 index 0000000..171049f --- /dev/null +++ b/hello/src/install/index.html @@ -0,0 +1,96 @@ + + + +Hello World Edgeapp + + + + + +Edgebox Logo +

This is an example Hello World edgeapp. If you see this page, it means it is running.

+

Developing your app? See docs.edgebox.io for more information.

+
+

Server address: server_address

+

Server name: server_hostname

+

Date: server_date

+

URI: server_url

+
+
Auto Refresh
+ + + diff --git a/immich/Dockerfile b/immich/Dockerfile index d58d4af..cd7f031 100644 --- a/immich/Dockerfile +++ b/immich/Dockerfile @@ -1,3 +1,3 @@ -FROM ghcr.io/immich-app/immich-server:v1.119.1 +FROM ghcr.io/immich-app/immich-server:v2.0.1 EXPOSE 2283 \ No newline at end of file diff --git a/memos/README.md b/memos/README.md new file mode 100644 index 0000000..c9296fd --- /dev/null +++ b/memos/README.md @@ -0,0 +1,30 @@ +# Memos EdgeApp + +A privacy-first, lightweight note-taking service. Easily capture and share your great thoughts. + +## Features + +- Privacy-first and lightweight +- Self-hosted solution +- Simple and intuitive interface +- Markdown support +- Tag-based organization + +## Configuration + +The app runs on port 5230 internally and is accessible via the EdgeBox reverse proxy at `memos.hostname.local`. + +## Data Persistence + +All memos data is stored in `./appdata/memos-ws/` which maps to `/var/opt/memos` inside the container. + +## Environment Variables + +- `MEMOS_MODE`: Set to "prod" for production mode +- `MEMOS_PORT`: Internal port (5230) + +## Access + +After installation, access Memos at: `http://memos.hostname.local` + +For internet access, configure the `INTERNET_URL` in `myedgeapp.env`. \ No newline at end of file diff --git a/memos/edgebox-compose.yml b/memos/edgebox-compose.yml new file mode 100644 index 0000000..7fbb013 --- /dev/null +++ b/memos/edgebox-compose.yml @@ -0,0 +1,21 @@ +version: "3" +services: + ############## + # Memos EdgeApp + ############## + memos-ws: + image: neosmemo/memos:stable + container_name: '${COMPOSE_PROJECT_NAME-edgebox}-${COMPOSE_APP_SLUG-memos}-ws' + restart: unless-stopped + environment: + # WS Proxy control variables - Do not change + VIRTUAL_HOST: ${LOCAL_URL}${INTERNET_URL} + VIRTUAL_PORT: 5230 + # Memos configuration + MEMOS_MODE: prod + MEMOS_PORT: 5230 + volumes: + # Recommended defaults + - /etc/localtime:/etc/localtime:ro + # Host data volume for memos data + - ./appdata/${COMPOSE_APP_SLUG-memos}-ws:/var/opt/memos:rw \ No newline at end of file diff --git a/memos/edgebox-hosts.txt b/memos/edgebox-hosts.txt new file mode 100644 index 0000000..c6f6c75 --- /dev/null +++ b/memos/edgebox-hosts.txt @@ -0,0 +1 @@ +memos diff --git a/memos/edgebox-postinstall.txt b/memos/edgebox-postinstall.txt new file mode 100644 index 0000000..d4446ea --- /dev/null +++ b/memos/edgebox-postinstall.txt @@ -0,0 +1,4 @@ +# Postinstall commands for Memos +# Each line represents a docker exec command to run on the container +# Format: -T +-T memos-ws echo "Memos container started successfully" \ No newline at end of file diff --git a/memos/edgebox.env b/memos/edgebox.env new file mode 100644 index 0000000..1c4a896 --- /dev/null +++ b/memos/edgebox.env @@ -0,0 +1,12 @@ +############################################ +# Edgebox WS and API environment variables +############################################ + +# Metadata values - Used by edgebox api service for UI and update control purposes +EDGEAPP_NAME=Memos +EDGEAPP_DESCRIPTION=Note-taking Service +EDGEAPP_VERSION=1.0.0 + +# Compose values - Used by edgebox ws service for containers setup +COMPOSE_PROJECT_NAME=edgebox +COMPOSE_APP_SLUG=memos \ No newline at end of file diff --git a/rocketchat/.dockerignore b/rocketchat/.dockerignore new file mode 100644 index 0000000..c1250f7 --- /dev/null +++ b/rocketchat/.dockerignore @@ -0,0 +1 @@ +appdata/* \ No newline at end of file diff --git a/rocketchat/Dockerfile b/rocketchat/Dockerfile new file mode 100644 index 0000000..014929e --- /dev/null +++ b/rocketchat/Dockerfile @@ -0,0 +1 @@ +FROM registry.rocket.chat/rocketchat/rocket.chat:latest \ No newline at end of file diff --git a/rocketchat/edgebox-compose.yml b/rocketchat/edgebox-compose.yml new file mode 100644 index 0000000..d3b5514 --- /dev/null +++ b/rocketchat/edgebox-compose.yml @@ -0,0 +1,42 @@ +version: "3" + +volumes: + mongodb_data: { driver: local } + +services: + rocketchat-ws: + container_name: '${COMPOSE_PROJECT_NAME-edgebox}-rocketchat-ws' + image: registry.rocket.chat/rocketchat/rocket.chat:${RELEASE:-latest} + restart: always + environment: + VIRTUAL_HOST: ${LOCAL_URL}${INTERNET_URL} + MONGO_URL: "mongodb://rocketchat-db:27017/\ + rocketchat?replicaSet=rs0" + MONGO_OPLOG_URL: "mongodb://rocketchat-db:27017/\ + local?replicaSet=rs0" + ROOT_URL: http://localhost:3000 + PORT: 3000 + DEPLOY_METHOD: docker + depends_on: + - rocketchat-db + expose: + - 3000 + # ports: + # - "${BIND_IP:-0.0.0.0}:${HOST_PORT:-3000}:${PORT:-3000}" + + rocketchat-db: + image: docker.io/bitnami/mongodb:5.0 + restart: always + user: root + volumes: + - ./appdata/rocketchat-db/mongodb:/bitnami/mongodb:rw + environment: + MONGODB_REPLICA_SET_MODE: "primary" + MONGODB_REPLICA_SET_NAME: "rs0" + MONGODB_PORT_NUMBER: 27017 + MONGODB_INITIAL_PRIMARY_HOST: "rocketchat-db" + MONGODB_INITIAL_PRIMARY_PORT_NUMBER: 27017 + MONGODB_ADVERTISED_HOSTNAME: "rocketchat-db" + MONGODB_ENABLE_JOURNAL: "true" + ALLOW_EMPTY_PASSWORD: "yes" + \ No newline at end of file diff --git a/rocketchat/edgebox-postinstall.txt b/rocketchat/edgebox-postinstall.txt new file mode 100644 index 0000000..2937f76 --- /dev/null +++ b/rocketchat/edgebox-postinstall.txt @@ -0,0 +1,2 @@ +-T rocketchat-ws sleep 90 + diff --git a/rocketchat/edgebox.env b/rocketchat/edgebox.env new file mode 100644 index 0000000..96d01f4 --- /dev/null +++ b/rocketchat/edgebox.env @@ -0,0 +1,12 @@ +############################################ +# Edgebox api compose environment variables +############################################ + +EDGEAPP_NAME=Rocket Chat +EDGEAPP_DESCRIPTION=Chat Service +EDGEAPP_VERSION=1.0.0 + +# To determine the name of your containers +COMPOSE_PROJECT_NAME=edgebox + + diff --git a/syncthing/.vscode/tasks.json b/syncthing/.vscode/tasks.json index e0b4da7..0a0fdd5 100644 --- a/syncthing/.vscode/tasks.json +++ b/syncthing/.vscode/tasks.json @@ -20,7 +20,7 @@ { "label": "WS - Restart edgeapp containers", "type": "shell", - "command": "docker-compose restart syncthing-ws", + "command": "docker compose restart syncthing-ws", "options": { "cwd": "${workspaceFolder}/../../ws", "shell": { @@ -35,7 +35,7 @@ { "label": "WS - All Edgeapp Statuses", "type": "shell", - "command": "docker-compose ps", + "command": "docker compose ps", "options": { "cwd": "${workspaceFolder}/../../ws", "shell": { @@ -50,7 +50,7 @@ { "label": "WS - Edgeapp Container Statuses", "type": "shell", - "command": "docker-compose ps syncthing-ws", + "command": "docker compose ps syncthing-ws", "options": { "cwd": "${workspaceFolder}/../../ws", "shell": { diff --git a/writebook/.dockerignore b/writebook/.dockerignore new file mode 100644 index 0000000..bdbeb44 --- /dev/null +++ b/writebook/.dockerignore @@ -0,0 +1 @@ +appdata/* diff --git a/writebook/Dockerfile b/writebook/Dockerfile new file mode 100644 index 0000000..f196c53 --- /dev/null +++ b/writebook/Dockerfile @@ -0,0 +1,11 @@ +FROM ghcr.io/basecamp/writebook:latest +LABEL org.opencontainers.image.description="Writebook is an easy-to-use application for publishing content on the web." + +USER root +COPY entrypoint.sh /usr/local/bin/edgebox-entrypoint.sh +RUN chmod +x /usr/local/bin/edgebox-entrypoint.sh + +ENTRYPOINT ["/usr/local/bin/edgebox-entrypoint.sh"] +CMD ["bin/boot"] + +EXPOSE 80 443 diff --git a/writebook/edgeapp.template.env b/writebook/edgeapp.template.env new file mode 100644 index 0000000..1fc8ef0 --- /dev/null +++ b/writebook/edgeapp.template.env @@ -0,0 +1 @@ +WRITEBOOK_SECRET_KEY_BASE=string|true|Secret key used for cryptographic signing (generate with: openssl rand -hex 64) diff --git a/writebook/edgebox-compose.yml b/writebook/edgebox-compose.yml new file mode 100644 index 0000000..983cc0c --- /dev/null +++ b/writebook/edgebox-compose.yml @@ -0,0 +1,19 @@ +version: "3" +services: + ############## + # Writebook EdgeApp + ############## + writebook-ws: + image: ghcr.io/edgebox-iot/apps/writebook:1.0.0 + build: + context: "./" + container_name: '${COMPOSE_PROJECT_NAME-edgebox}-writebook-ws' + environment: + VIRTUAL_HOST: ${LOCAL_URL}${INTERNET_URL} + VIRTUAL_PORT: 80 + DISABLE_SSL: "true" + SECRET_KEY_BASE: '${WRITEBOOK_SECRET_KEY_BASE}' + volumes: + - ./appdata/storage:/rails/storage:rw + - /etc/localtime:/etc/localtime:ro + restart: unless-stopped diff --git a/writebook/edgebox-hosts.txt b/writebook/edgebox-hosts.txt new file mode 100644 index 0000000..8538a3a --- /dev/null +++ b/writebook/edgebox-hosts.txt @@ -0,0 +1 @@ +writebook diff --git a/writebook/edgebox.env b/writebook/edgebox.env new file mode 100644 index 0000000..00785f1 --- /dev/null +++ b/writebook/edgebox.env @@ -0,0 +1,11 @@ +############################################ +# Edgebox api compose environment variables +############################################ + +EDGEAPP_NAME=Writebook +EDGEAPP_DESCRIPTION=E-Book Sharing +EDGEAPP_EXPERIMENTAL=true +EDGEAPP_VERSION=1.0.0 + +# To determine the name of your containers +COMPOSE_PROJECT_NAME=edgebox diff --git a/writebook/entrypoint.sh b/writebook/entrypoint.sh new file mode 100755 index 0000000..6e1cd61 --- /dev/null +++ b/writebook/entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash -e + +# Ensure database directory exists in the mounted volume +mkdir -p /rails/storage/db +chown -R 1000:1000 /rails/storage 2>/dev/null || true + +# Enable jemalloc for reduced memory usage and latency +if [ -f /usr/lib/*/libjemalloc.so.2 ]; then + export LD_PRELOAD="$(echo /usr/lib/*/libjemalloc.so.2) $LD_PRELOAD" +fi + +exec "$@"