Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerhub #140

Merged
merged 3 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
release:
permissions:
contents: write
id-token: write
attestations: write

runs-on: ubuntu-latest

Expand All @@ -22,19 +24,30 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Install doctl
uses: digitalocean/action-doctl@v2
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Log in to DigitalOcean Container Registry with short-lived credentials
run: doctl registry login --expiry-seconds 14400
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: bitcoinnumeraire/swissknife

- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: |
registry.digitalocean.com/swissknife/swissknife:latest
registry.digitalocean.com/swissknife/swissknife:${{ github.ref_name }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: docker.io/bitcoinnumeraire/swissknife
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
85 changes: 53 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "swissknife"
version = "0.1.2"
version = "0.1.3"
edition = "2021"
authors = ["Dario Anongba Varela <dario.varela@numeraire.tech>"]
rust-version = "1.79"
Expand Down Expand Up @@ -32,13 +32,13 @@ chrono = "0.4.38"
thiserror = "1.0.64"
tower-http = { version = "0.6.1", features = ["timeout", "trace", "cors"] }
regex = "1"
sea-orm = { version = "0.12", features = [
sea-orm = { version = "1.0", features = [
"sqlx-postgres",
"sqlx-sqlite",
"runtime-tokio-rustls",
"macros",
"with-chrono",
"with-uuid",
"debug-print",
] }
strum = "0.26"
strum_macros = "0.26"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ install-tools:
@cargo install cargo-outdated

generate-models:
@sea-orm-cli generate entity --output-dir src/infra/database/sea_orm/models --verbose
@sea-orm-cli generate entity --output-dir src/infra/database/sea_orm/models

generate-certs:
@mkdir -p certs
Expand Down
10 changes: 2 additions & 8 deletions config/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ retry_delay = "5s"

[cln_rest_config]
endpoint = "http://localhost:3010"
ca_cert_path = "certs/lightningd/ca.cert"
rune = "CHANGE_ME"
connect_timeout = "5s"
timeout = "90s"
Expand Down Expand Up @@ -84,18 +85,11 @@ secret = "CHANGE_ME"

# Database
[database]
url = "sqlite://storage/swissknife.db?mode=rwc"
max_lifetime = "30m"
idle_timeout = "5m"
max_connections = 10
min_connections = 0
acquire_timeout = "5s"
connect_timeout = "30s"
sqlx_logging = true

# RGB
[rgb]
data_dir = "storage/rgblib"
media_dir = "storage/media"
electrum_url = "localhost:50001"
proxy_server_url = "rpc://localhost:3030/json-rpc"
min_confirmations = 3
8 changes: 4 additions & 4 deletions migration/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "migration"
version = "0.1.1"
version = "0.1.3"
edition = "2021"
publish = false

Expand All @@ -12,11 +12,11 @@ path = "src/lib.rs"
async-std = { version = "1", features = ["attributes", "tokio1"] }

[dependencies.sea-orm-migration]
version = "0.12.0"
version = "1.0.1"
features = [
# Enable at least one `ASYNC_RUNTIME` and `DATABASE_DRIVER` feature if you want to run migration via CLI.
# View the list of supported features at https://www.sea-ql.org/SeaORM/docs/install-and-config/database-and-async-runtime.
# e.g.
"runtime-tokio-rustls", # `ASYNC_RUNTIME` feature
"sqlx-postgres", # `DATABASE_DRIVER` feature
# "runtime-tokio-rustls", # `ASYNC_RUNTIME` feature
# "sqlx-postgres", # `DATABASE_DRIVER` feature
]
4 changes: 4 additions & 0 deletions migration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ mod m20240420_3_invoice_table;
mod m20240420_4_payment_table;
mod m20241005_5_ln_address_nostr;
mod m20241009_6_api_key_table;
mod m20241028_135908_permissions_as_json;
mod m20241028_154716_dates_without_tz;

pub struct Migrator;

Expand All @@ -19,6 +21,8 @@ impl MigratorTrait for Migrator {
Box::new(m20240420_4_payment_table::Migration),
Box::new(m20241005_5_ln_address_nostr::Migration),
Box::new(m20241009_6_api_key_table::Migration),
Box::new(m20241028_135908_permissions_as_json::Migration),
Box::new(m20241028_154716_dates_without_tz::Migration),
]
}
}
Loading
Loading