Skip to content

Commit

Permalink
Integration/2.0.0 (#69)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
elvece authored Nov 1, 2024
1 parent edef432 commit 86b2d94
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 62 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
19 changes: 5 additions & 14 deletions configurator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T, D::Error> {
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")]
Expand Down Expand Up @@ -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!(
Expand All @@ -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");
}
Expand Down
5 changes: 3 additions & 2 deletions manifest.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
98 changes: 54 additions & 44 deletions scripts/procedures/migrations.ts
Original file line number Diff line number Diff line change
@@ -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)
}
},
"2.0.0"
)(effects, version, ...args);
};

0 comments on commit 86b2d94

Please sign in to comment.