diff --git a/services/couchdb/Dockerfile b/services/couchdb/Dockerfile index c990afb..2bbf96a 100644 --- a/services/couchdb/Dockerfile +++ b/services/couchdb/Dockerfile @@ -1,3 +1,3 @@ FROM couchdb:latest HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=5 CMD curl --fail http://localhost:5984 || exit 1 -COPY ./config/* /opt/couchdb/etc/local.d/* \ No newline at end of file +COPY ./config/* /opt/couchdb/etc/local.d/ \ No newline at end of file diff --git a/services/db-migrations/migrations/1732483677017-dbs.js b/services/db-migrations/migrations/1732483677017-dbs.js index 84da04c..6d0f07e 100644 --- a/services/db-migrations/migrations/1732483677017-dbs.js +++ b/services/db-migrations/migrations/1732483677017-dbs.js @@ -79,41 +79,6 @@ export const up = async () => { ); } } - - const corsConfig = { - "chttpd/enable_cors": "true", - "cors/origins": "*", - "cors/credentials": "true", - "cors/methods": "GET, PUT, POST, HEAD, DELETE", - "cors/headers": - "accept, authorization, content-type, origin, referer, x-csrf-token", - }; - - const membership = await fetch(getUrl("_membership"), { headers }).then( - (response) => response.json(), - ); - if (!membership || membership.error) { - throw new Error(`_membership error ${JSON.stringify(membership)}`); - } - - for (const node of membership.cluster_nodes) { - for (const [configPath, value] of Object.entries(corsConfig)) { - const corsURL = `_node/${node}/_config/${configPath}`; - const response = await fetch(getUrl(corsURL), { - method: "PUT", - headers, - body: JSON.stringify(value), - }).then((response) => response.json()); - - if (!response.error) { - console.log(`set ${configPath} ${response}`); - } else { - throw new Error( - `${corsURL} set ${value} error ${JSON.stringify(response)}`, - ); - } - } - } }; export const down = async () => {