diff --git a/compose.yml b/compose.yml index 88a53f9..927d403 100644 --- a/compose.yml +++ b/compose.yml @@ -67,40 +67,37 @@ services: database: condition: service_healthy -# ozone: -# ports: -# - 2585:3000 -# build: -# context: ./repos/atproto/ -# dockerfile: services/ozone/Dockerfile -# restart: always -# command: node --enable-source-maps api.js -# volumes: -# - ./data/ozone/:/data/ -# - ./repos/ozone.js:/app/services/ozone/api.js:ro -# env_file: -# - ./envs/ozone -# healthcheck: -# test: "wget -q --spider http://localhost:3000/xrpc/_health" -# interval: 5s -# retries: 20 -# depends_on: -# database: -# condition: service_healthy -# -# ozone-daemon: -# build: -# context: ./repos/atproto/ -# dockerfile: services/ozone/Dockerfile -# restart: always -# command: node --enable-source-maps daemon.js -# env_file: -# - ./envs/ozone -# depends_on: -# ozone: -# condition: service_healthy -# database: -# condition: service_healthy + ozone: + build: + context: ./repos/atproto/ + dockerfile: services/ozone/Dockerfile + ports: + - 2585:3000 + restart: always + command: node --enable-source-maps api.js + volumes: + - ./data/ozone/:/data/ + env_file: + - ./envs/ozone + depends_on: + database: + condition: service_healthy + + ozone-daemon: + build: + context: ./repos/atproto/ + dockerfile: services/ozone/Dockerfile + restart: always + command: node --enable-source-maps daemon.js + volumes: + - ./data/ozone/:/data/ + env_file: + - ./envs/ozone + depends_on: + database: + condition: service_healthy + ozone: + condition: service_healthy social-app: ports: diff --git a/install.zsh b/install.zsh index 51858e6..79bb206 100755 --- a/install.zsh +++ b/install.zsh @@ -15,6 +15,7 @@ function at-repos-env() { https://github.com/bluesky-social/atproto https://github.com/bluesky-social/social-app https://github.com/bluesky-social/feed-generator + https://github.com/bluesky-social/ozone ) d=${0:a:h} dh=${0:a:h:h} @@ -144,6 +145,26 @@ function at-repos-social-app-patch() { popd } +function at-repos-ozone-patch() { + #DOMAIN=syu.is + cd $d/repos + d_=$d/repos/ozone + rm -rf ${d_} + p_=$d/patching/120-ozone-runtimeEnvVars.diff + git clone https://github.com/bluesky-social/ozone + cd ${d_} + pushd ${d_} + echo "applying patch: under ${d_} for ${p_}" + patch -p1 < ${p_} + popd + + p_=$d/patching/122-ozone-enable-daemon.diff + echo "applying patch: under ${d_} for ${p_}" + pushd ${d_} + patch -p1 < ${p_} + popd +} + function at-repos-docker() { cd $d docker compose build && docker compose up -d @@ -157,6 +178,7 @@ at-repos-social-app-icon-origin at-repos-social-app-write at-repos-bsky-patch at-repos-social-app-patch +at-repos-ozone-patch echo "[y]docker compose build && up" read key diff --git a/patching/120-ozone-runtimeEnvVars.diff b/patching/120-ozone-runtimeEnvVars.diff new file mode 100644 index 0000000..4f369a8 --- /dev/null +++ b/patching/120-ozone-runtimeEnvVars.diff @@ -0,0 +1,119 @@ +diff --git a/app/layout.tsx b/app/layout.tsx +index bfc3470..9350629 100644 +--- a/app/layout.tsx ++++ b/app/layout.tsx +@@ -5,6 +5,7 @@ import 'yet-another-react-lightbox/styles.css' + import 'yet-another-react-lightbox/plugins/thumbnails.css' + import 'yet-another-react-lightbox/plugins/captions.css' + import { ToastContainer } from 'react-toastify' ++import { PublicEnvScript } from 'next-runtime-env'; + + import { Shell } from '@/shell/Shell' + import { CommandPaletteRoot } from '@/shell/CommandPalette/Root' +@@ -36,6 +37,7 @@ export default function RootLayout({ + isDarkModeEnabled() ? 'dark' : '' + }`} + > ++
+