From 86b2d943d326ad5259cd2b09ddfde00e3fab2a16 Mon Sep 17 00:00:00 2001 From: Lucy <12953208+elvece@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:58:47 -0400 Subject: [PATCH] Integration/2.0.0 (#69) * update to upstream 2.0.0 * update to official release and disallow downgrade * cleanup + fixes * remove redundant flag * cleanup * fix migration * fix build * fix build * fix build * fix build * fix build --- Dockerfile | 4 +- configurator/src/main.rs | 19 ++----- manifest.yaml | 5 +- scripts/procedures/migrations.ts | 98 ++++++++++++++++++-------------- 4 files changed, 64 insertions(+), 62 deletions(-) diff --git a/Dockerfile b/Dockerfile index fd009f2..1afe884 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM nicolasdorier/nbxplorer:2.5.5 as nbx-builder +FROM nicolasdorier/nbxplorer:2.5.9 AS nbx-builder FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS actions-builder ARG TARGETARCH @@ -8,7 +8,7 @@ RUN dotnet restore "utils/actions/actions.csproj" -a $TARGETARCH WORKDIR "/actions" RUN dotnet build "utils/actions/actions.csproj" -c Release -a $TARGETARCH -o /actions/build -FROM btcpayserver/btcpayserver:1.13.5 +FROM btcpayserver/btcpayserver:2.0.0 COPY --from=nbx-builder "/app" /nbxplorer COPY --from=actions-builder "/actions/build" /actions diff --git a/configurator/src/main.rs b/configurator/src/main.rs index 868fe91..d5ea2ce 100644 --- a/configurator/src/main.rs +++ b/configurator/src/main.rs @@ -5,18 +5,6 @@ use std::{ }; use anyhow::Context; -use serde::{ - de::{Deserializer, Error as DeserializeError, Unexpected}, - Deserialize, -}; - -fn deserialize_parse<'de, D: Deserializer<'de>, T: std::str::FromStr>( - deserializer: D, -) -> Result { - let s: String = Deserialize::deserialize(deserializer)?; - s.parse() - .map_err(|_| DeserializeError::invalid_value(Unexpected::Str(&s), &"a valid URI")) -} #[derive(serde::Deserialize)] #[serde(rename_all = "kebab-case")] @@ -69,7 +57,7 @@ fn main() -> Result<(), anyhow::Error> { rpc_port = 8332, rpc_password = config.bitcoin_rpc_password, rpc_user = config.bitcoin_rpc_user, - p2p_host= bitcoin_host, + p2p_host = bitcoin_host, p2p_port = 8333 )?; write!( @@ -81,7 +69,10 @@ fn main() -> Result<(), anyhow::Error> { match addr.first() { Some(x) => { print!("{}", format!("export BTCPAY_HOST='https://{}.local/'\n", x)); - print!("{}", format!("export REVERSEPROXY_DEFAULT_HOST='http://{}.local/'\n", x)); + print!( + "{}", + format!("export REVERSEPROXY_DEFAULT_HOST='http://{}.local/'\n", x) + ); print!("{}", format!("export BTCPAY_ADDITIONAL_HOSTS='https://{}.local/,http://{}.local/,http://{}.onion/'\n", x, x, x)); print!("{}", "export BTCPAY_SOCKSENDPOINT='embassy:9050'\n"); } diff --git a/manifest.yaml b/manifest.yaml index 4aa2125..2df0645 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -1,8 +1,9 @@ id: btcpayserver title: BTCPay Server -version: 1.13.5 +version: 2.0.0 release-notes: | - * Updates to the upstream release of [v1.13.5](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.13.5), which adds several improvements from [v1.13.4](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.13.4) as well as bug fixes. + * Major upstream release of [v2.0.0](https://github.com/btcpayserver/btcpayserver/releases/tag/v2.0.0)! This release introduces many new features and some breaking changes. Please see the [blog post](https://blog.btcpayserver.org/btcpay-server-2-0/) for more details. + * Please note: large instances may experience a few minutes of database migration. license: mit wrapper-repo: "https://github.com/Start9Labs/btcpayserver-wrapper" upstream-repo: "https://github.com/btcpayserver/btcpayserver" diff --git a/scripts/procedures/migrations.ts b/scripts/procedures/migrations.ts index 5e335a9..913965f 100644 --- a/scripts/procedures/migrations.ts +++ b/scripts/procedures/migrations.ts @@ -1,53 +1,63 @@ -import { types as T, compat } from "../deps.ts" +import { types as T, compat } from "../deps.ts"; import { migration_up_1_4_7 } from "../migrations/1_4_7_up_migration.ts"; import { migration_down_1_4_7 } from "../migrations/1_4_7_down_migration.ts"; import { migration_up_1_10_3 } from "../migrations/1_10_3_up_migration.ts"; -export const migration: T.ExpectedExports.migration = async (effects, version, ...args) => { +export const migration: T.ExpectedExports.migration = async ( + effects, + version, + ...args +) => { await effects.createDir({ path: "start9", - volumeId: "main" + volumeId: "main", }); - return compat.migrations - .fromMapping( - { - // 1.1.2.5: initial (updated) version released with eOS 0.3.0 - bitcoin config was internal (proxy) or external - "1.4.7.1": { - up: compat.migrations.updateConfig( - (config) => { - return migration_up_1_4_7(config) - }, - false, - { version: "1.4.7.1", type: "up" }, - ), - down: compat.migrations.updateConfig( - (config) => { - return migration_down_1_4_7(config) - }, - true, - { version: "1.4.7.1", type: "down" }, - ), - }, - // 1.4.7.3: JS config/properties conversion occurred - "1.10.2": { - up: compat.migrations.updateConfig( - (config) => { - return migration_up_1_10_3(config) - }, - true, - { version: "1.10.2", type: "up"} - ), - down: compat.migrations.updateConfig( - (_config) => { - throw new Error( - "Cannot downgrade this version" - ) - }, - true, - { version: "1.10.2", type: "down" }, - ), + return compat.migrations.fromMapping( + { + // 1.1.2.5: initial (updated) version released with eOS 0.3.0 - bitcoin config was internal (proxy) or external + "1.4.7.1": { + up: compat.migrations.updateConfig( + (config) => { + return migration_up_1_4_7(config); + }, + false, + { version: "1.4.7.1", type: "up" } + ), + down: compat.migrations.updateConfig( + (config) => { + return migration_down_1_4_7(config); + }, + true, + { version: "1.4.7.1", type: "down" } + ), + }, + // 1.4.7.3: JS config/properties conversion occurred + "1.10.2": { + up: compat.migrations.updateConfig( + (config) => { + return migration_up_1_10_3(config); + }, + true, + { version: "1.10.2", type: "up" } + ), + down: compat.migrations.updateConfig( + (_config) => { + throw new Error("Cannot downgrade this version"); + }, + true, + { version: "1.10.2", type: "down" } + ), + }, + "2.0.0": { + up: compat.migrations.updateConfig((config) => config, true, { + version: "2.0.0", + type: "up", + }), + down: () => { + throw new Error("Cannot downgrade this version"); }, }, - "1.13.5", - )(effects, version, ...args) -} \ No newline at end of file + }, + "2.0.0" + )(effects, version, ...args); +};