ozone patch
This commit is contained in:
18
install.zsh
18
install.zsh
@@ -214,6 +214,16 @@ function at-repos-social-app-disable-external-services-patch() {
|
|||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function at-repos-atproto-service-ozone-api-patch() {
|
||||||
|
f=$d/repos/atproto/services/ozone/api.js
|
||||||
|
d_=$d/repos/atproto
|
||||||
|
p_=$d/patching/130-atproto-ozone-enable-daemon.patch
|
||||||
|
echo "applying patch: under ${f} for ${p_}"
|
||||||
|
pushd ${d_}
|
||||||
|
patch -p1 < ${p_}
|
||||||
|
popd
|
||||||
|
}
|
||||||
|
|
||||||
function at-repos-ozone-patch() {
|
function at-repos-ozone-patch() {
|
||||||
#DOMAIN=syu.is
|
#DOMAIN=syu.is
|
||||||
cd $d/repos
|
cd $d/repos
|
||||||
@@ -264,9 +274,9 @@ function at-repos-push-reset() {
|
|||||||
function at-repos-push-docker() {
|
function at-repos-push-docker() {
|
||||||
if [ -z "$1" ];then
|
if [ -z "$1" ];then
|
||||||
for ((i=1; i<=${#img}; i++)); do
|
for ((i=1; i<=${#img}; i++)); do
|
||||||
img=${imgs[$i]}
|
img_name=${img[$i]}
|
||||||
docker tag at-${img}:latest localhost:${dport}/${img}:latest
|
docker tag at-${img_name}:latest localhost:${dport}/${img_name}:latest
|
||||||
docker push localhost:${dport}/${img}:latest
|
docker push localhost:${dport}/${img_name}:latest
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
docker tag at-${1}:latest localhost:${dport}/${1}:latest
|
docker tag at-${1}:latest localhost:${dport}/${1}:latest
|
||||||
@@ -301,6 +311,7 @@ case "`cat /etc/hostname`" in
|
|||||||
at-repos-social-app-disable-external-services-patch
|
at-repos-social-app-disable-external-services-patch
|
||||||
at-repos-atproto-service-bsky-api-patch
|
at-repos-atproto-service-bsky-api-patch
|
||||||
at-repos-atproto-service-pds-index-patch
|
at-repos-atproto-service-pds-index-patch
|
||||||
|
at-repos-atproto-service-ozone-api-patch
|
||||||
at-repos-ozone-patch
|
at-repos-ozone-patch
|
||||||
if [ -n "$1" ];then
|
if [ -n "$1" ];then
|
||||||
at-repos-build-docker-atproto $1
|
at-repos-build-docker-atproto $1
|
||||||
@@ -313,4 +324,3 @@ case "`cat /etc/hostname`" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
33
patching/130-atproto-ozone-enable-daemon.patch
Normal file
33
patching/130-atproto-ozone-enable-daemon.patch
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
--- a/services/ozone/api.js
|
||||||
|
+++ b/services/ozone/api.js
|
||||||
|
@@ -20,6 +20,7 @@ const {
|
||||||
|
MultiImageInvalidator,
|
||||||
|
} = require('@atproto/aws')
|
||||||
|
const {
|
||||||
|
Database,
|
||||||
|
OzoneService,
|
||||||
|
+ OzoneDaemon,
|
||||||
|
envToCfg,
|
||||||
|
envToSecrets,
|
||||||
|
httpLogger,
|
||||||
|
@@ -76,10 +77,17 @@ const main = async () => {
|
||||||
|
const ozone = await OzoneService.create(cfg, secrets, { imgInvalidator })
|
||||||
|
|
||||||
|
await ozone.start()
|
||||||
|
|
||||||
|
httpLogger.info('ozone is running')
|
||||||
|
|
||||||
|
+ // Start OzoneDaemon for label events
|
||||||
|
+ httpLogger.info('starting ozone daemon')
|
||||||
|
+ const daemon = await OzoneDaemon.create(cfg, secrets)
|
||||||
|
+ await daemon.start()
|
||||||
|
+ httpLogger.info('ozone daemon is running')
|
||||||
|
+
|
||||||
|
// Graceful shutdown (see also https://aws.amazon.com/blogs/containers/graceful-shutdowns-with-ecs/)
|
||||||
|
process.on('SIGTERM', async () => {
|
||||||
|
httpLogger.info('ozone is stopping')
|
||||||
|
|
||||||
|
+ await daemon.destroy()
|
||||||
|
await ozone.destroy()
|
||||||
|
|
||||||
|
httpLogger.info('ozone is stopped')
|
||||||
Reference in New Issue
Block a user