Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 59ebfbf50f | |||
| bb1b2a75dd | |||
| da3cbe095b | |||
| 12026305d5 | |||
| 257e36ddcb | |||
| ad81c6d27e | |||
| ae52b7b71f | |||
| 854d3cceac | |||
| 1bdf867fdb | |||
| 5a88b5b6a8 | |||
| 5ab4d3c22c | |||
| b529883b81 | |||
| 07f624660c | |||
| 71f8e736d8 | |||
| d3573e78e0 | |||
| 99d8aebea9 | |||
| 0bde4dfc84 | |||
| 3c98c9021e | |||
| 84b6068ac9 |
@@ -5,7 +5,7 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: arc-ubuntu-20.04
|
||||
runs-on: arc-ubuntu-22.04
|
||||
defaults:
|
||||
run:
|
||||
working-directory: documentation/docs
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
- name: Install Python3 modules
|
||||
run: sudo pip3 install pandas tabulate
|
||||
- name: Install rsync
|
||||
run: sudo apt-get install rsync
|
||||
run: sudo apt-get install -y rsync
|
||||
- uses: rlespinasse/github-slug-action@v3.x
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4.0.0
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [arc-ubuntu-20.04]
|
||||
platform: [arc-ubuntu-22.04]
|
||||
|
||||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
|
||||
@@ -10,7 +10,7 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: arc-ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install rsync
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
- uses: rlespinasse/github-slug-action@v3.x
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: 20
|
||||
- name: Setup yarn
|
||||
run: npm install -g yarn
|
||||
- name: Build
|
||||
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [ arc-ubuntu-20.04 ]
|
||||
platform: [ arc-ubuntu-22.04 ]
|
||||
|
||||
runs-on: ${{ matrix.platform }}
|
||||
env:
|
||||
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ arc-ubuntu-20.04, custom-windows-11, custom-runner-mac-m1 ]
|
||||
os: [ arc-ubuntu-22.04, custom-windows-11, custom-runner-mac-m1 ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
@@ -11,7 +11,7 @@ on:
|
||||
jobs:
|
||||
check-schema:
|
||||
name: Generate and check schema
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
steps:
|
||||
|
||||
@@ -11,7 +11,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [ arc-ubuntu-20.04 ]
|
||||
platform: [ arc-ubuntu-22.04 ]
|
||||
|
||||
runs-on: ${{ matrix.platform }}
|
||||
env:
|
||||
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
build:
|
||||
# since it's going to be compiled into wasm, there's absolutely
|
||||
# no point in running CI on different OS-es
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
steps:
|
||||
|
||||
@@ -10,7 +10,7 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: arc-ubuntu-20.04
|
||||
runs-on: arc-ubuntu-22.04
|
||||
env:
|
||||
RUSTUP_PERMIT_COPY_RENAME: 1
|
||||
defaults:
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
- name: Install Python3 modules
|
||||
run: sudo pip3 install pandas tabulate
|
||||
- name: Install rsync
|
||||
run: sudo apt-get install rsync
|
||||
run: sudo apt-get install -y rsync
|
||||
- uses: rlespinasse/github-slug-action@v3.x
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4.0.0
|
||||
|
||||
@@ -15,7 +15,7 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: arc-ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
env:
|
||||
RUSTUP_PERMIT_COPY_RENAME: 1
|
||||
steps:
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: 20
|
||||
- name: Setup yarn
|
||||
run: npm install -g yarn
|
||||
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
name: ci-nym-network-explorer
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- 'explorer/**'
|
||||
- '.github/workflows/ci-nym-network-explorer.yml'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: explorer
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: custom-linux
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install rsync
|
||||
run: sudo apt-get install rsync
|
||||
continue-on-error: true
|
||||
- uses: rlespinasse/github-slug-action@v3.x
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
- name: Setup yarn
|
||||
run: npm install -g yarn
|
||||
continue-on-error: true
|
||||
- name: Build shared packages
|
||||
run: cd .. && yarn && yarn build
|
||||
- name: Set environment from the example
|
||||
run: cp .env.prod .env
|
||||
# - run: yarn test
|
||||
# continue-on-error: true
|
||||
- run: yarn && yarn build
|
||||
continue-on-error: true
|
||||
- run: yarn storybook:build
|
||||
name: Build storybook
|
||||
- name: Deploy branch to CI www
|
||||
continue-on-error: true
|
||||
uses: easingthemes/ssh-deploy@main
|
||||
env:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.CI_WWW_SSH_PRIVATE_KEY }}
|
||||
ARGS: "-rltgoDzvO --delete"
|
||||
SOURCE: "explorer/dist/"
|
||||
REMOTE_HOST: ${{ secrets.CI_WWW_REMOTE_HOST }}
|
||||
REMOTE_USER: ${{ secrets.CI_WWW_REMOTE_USER }}
|
||||
TARGET: ${{ secrets.CI_WWW_REMOTE_TARGET }}/network-explorer-${{ env.GITHUB_REF_SLUG }}
|
||||
EXCLUDE: "/dist/, /node_modules/"
|
||||
- name: Deploy storybook to CI www
|
||||
continue-on-error: true
|
||||
uses: easingthemes/ssh-deploy@main
|
||||
env:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.CI_WWW_SSH_PRIVATE_KEY }}
|
||||
ARGS: "-rltgoDzvO --delete"
|
||||
SOURCE: "explorer/storybook-static/"
|
||||
REMOTE_HOST: ${{ secrets.CI_WWW_REMOTE_HOST }}
|
||||
REMOTE_USER: ${{ secrets.CI_WWW_REMOTE_USER }}
|
||||
TARGET: ${{ secrets.CI_WWW_REMOTE_TARGET }}/ne-sb-${{ env.GITHUB_REF_SLUG }}
|
||||
EXCLUDE: "/dist/, /node_modules/"
|
||||
- name: Matrix - Node Install
|
||||
run: npm install
|
||||
working-directory: .github/workflows/support-files
|
||||
- name: Matrix - Send Notification
|
||||
env:
|
||||
NYM_NOTIFICATION_KIND: network-explorer
|
||||
NYM_PROJECT_NAME: "Network Explorer"
|
||||
NYM_CI_WWW_BASE: "${{ secrets.NYM_CI_WWW_BASE }}"
|
||||
NYM_CI_WWW_LOCATION: "network-explorer-${{ env.GITHUB_REF_SLUG }}"
|
||||
NYM_CI_WWW_LOCATION_STORYBOOK: "ne-sb-${{ env.GITHUB_REF_SLUG }}"
|
||||
GIT_COMMIT_MESSAGE: "${{ github.event.head_commit.message }}"
|
||||
GIT_BRANCH: "${GITHUB_REF##*/}"
|
||||
IS_SUCCESS: "${{ job.status == 'success' }}"
|
||||
MATRIX_SERVER: "${{ secrets.MATRIX_SERVER }}"
|
||||
MATRIX_ROOM: "${{ secrets.MATRIX_ROOM }}"
|
||||
MATRIX_USER_ID: "${{ secrets.MATRIX_USER_ID }}"
|
||||
MATRIX_TOKEN: "${{ secrets.MATRIX_TOKEN }}"
|
||||
MATRIX_DEVICE_ID: "${{ secrets.MATRIX_DEVICE_ID }}"
|
||||
uses: docker://keybaseio/client:stable-node
|
||||
with:
|
||||
args: .github/workflows/support-files/notifications/entry_point.sh
|
||||
- name: Deploy
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
uses: easingthemes/ssh-deploy@main
|
||||
env:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.CD_PROD_NE_SSH_PRIVATE_KEY }}
|
||||
ARGS: "-rltgoDzvO --delete"
|
||||
SOURCE: "explorer/dist/"
|
||||
REMOTE_HOST: ${{ secrets.CD_PROD_NE_REMOTE_HOST }}
|
||||
REMOTE_USER: ${{ secrets.CD_PROD_NE_REMOTE_USER }}
|
||||
TARGET: ${{ secrets.CD_PROD_NE_REMOTE_TARGET }}
|
||||
EXCLUDE: "/dist/, /node_modules/"
|
||||
@@ -11,7 +11,7 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: arc-ubuntu-20.04
|
||||
runs-on: arc-ubuntu-22.04
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
RUSTUP_PERMIT_COPY_RENAME: 1
|
||||
|
||||
@@ -11,7 +11,7 @@ on:
|
||||
|
||||
jobs:
|
||||
wasm:
|
||||
runs-on: arc-ubuntu-20.04
|
||||
runs-on: arc-ubuntu-22.04
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
RUSTUP_PERMIT_COPY_RENAME: 1
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: 20
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
|
||||
@@ -11,7 +11,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
rust: [stable, beta]
|
||||
os: [ubuntu-20.04, windows-latest, macos-latest]
|
||||
os: [ubuntu-22.04, windows-latest, macos-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
|
||||
- name: Install Dependencies (Linux)
|
||||
run: sudo apt-get update && sudo apt-get install -y build-essential curl wget libssl-dev libudev-dev squashfs-tools protobuf-compiler
|
||||
if: matrix.os == 'ubuntu-20.04'
|
||||
if: matrix.os == 'ubuntu-22.04'
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
@@ -59,7 +59,7 @@ jobs:
|
||||
|
||||
# To avoid running out of disk space, skip generating debug symbols
|
||||
- name: Set debug to false (unix)
|
||||
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'macos-latest'
|
||||
if: matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-latest'
|
||||
run: |
|
||||
sed -i.bak 's/\[profile.dev\]/\[profile.dev\]\ndebug = false/' Cargo.toml
|
||||
git diff
|
||||
@@ -106,7 +106,7 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
if: env.WORKFLOW_CONCLUSION == 'failure'
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: 20
|
||||
- name: Matrix - Node Install
|
||||
if: env.WORKFLOW_CONCLUSION == 'failure'
|
||||
run: npm install
|
||||
|
||||
@@ -10,7 +10,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-20.04, macos-latest, windows-latest]
|
||||
os: [ubuntu-22.04, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
|
||||
- name: Install Dependencies (Linux)
|
||||
run: sudo apt-get update && sudo apt-get install -y libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev squashfs-tools
|
||||
if: matrix.os == 'ubuntu-20.04'
|
||||
if: matrix.os == 'ubuntu-22.04'
|
||||
|
||||
- name: Install rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
if: env.WORKFLOW_CONCLUSION == 'failure'
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: 20
|
||||
- name: Matrix - Node Install
|
||||
if: env.WORKFLOW_CONCLUSION == 'failure'
|
||||
run: npm install
|
||||
|
||||
@@ -5,7 +5,7 @@ on:
|
||||
- cron: '5 9 * * *'
|
||||
jobs:
|
||||
cargo-deny:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout repository code
|
||||
uses: actions/checkout@v4
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
- name: install npm
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: 20
|
||||
- name: Matrix - Node Install
|
||||
run: npm install
|
||||
working-directory: .github/workflows/support-files
|
||||
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [custom-ubuntu-20.04]
|
||||
platform: [custom-ubuntu-22.04]
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
outputs:
|
||||
|
||||
@@ -31,10 +31,12 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 21
|
||||
|
||||
- name: Install Rust stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- name: Install the Apple developer certificate for code signing
|
||||
env:
|
||||
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
||||
@@ -70,7 +72,7 @@ jobs:
|
||||
- name: Set Cargo build target to x86_64
|
||||
run: echo "CARGO_BUILD_TARGET=x86_64-apple-darwin" >> $GITHUB_ENV
|
||||
|
||||
- name: yarn cache clean
|
||||
- name: Yarn cache clean
|
||||
shell: bash
|
||||
run: cd .. && yarn cache clean
|
||||
|
||||
@@ -78,7 +80,7 @@ jobs:
|
||||
shell: bash
|
||||
run: cd .. && yarn --network-timeout 100000
|
||||
|
||||
- name: yarn build
|
||||
- name: Yarn build
|
||||
shell: bash
|
||||
run: cd .. && yarn build
|
||||
|
||||
@@ -108,6 +110,7 @@ jobs:
|
||||
if: ${{ always() }}
|
||||
run: |
|
||||
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
|
||||
|
||||
- id: create-release
|
||||
name: Upload to release based on tag name
|
||||
uses: softprops/action-gh-release@v2
|
||||
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [custom-ubuntu-20.04]
|
||||
platform: [custom-ubuntu-22.04]
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
outputs:
|
||||
|
||||
@@ -12,7 +12,7 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
name: Build APK
|
||||
runs-on: custom-ubuntu-20.04
|
||||
runs-on: custom-ubuntu-22.04
|
||||
env:
|
||||
ANDROID_HOME: ${{ github.workspace }}/android-sdk
|
||||
NDK_VERSION: 25.2.9519653
|
||||
|
||||
@@ -4,14 +4,14 @@ on:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: arc-ubuntu-20.04
|
||||
runs-on: arc-ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: 20
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- name: Setup yarn
|
||||
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: 20
|
||||
- uses: nymtech/nym/.github/actions/nym-hash-releases@develop
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -219,7 +219,7 @@ impl Epoch {
|
||||
EpochState::VerificationKeyFinalization { .. } => {
|
||||
time_configuration.verification_key_finalization_time_secs
|
||||
}
|
||||
EpochState::InProgress { .. } => 0,
|
||||
EpochState::InProgress => 0,
|
||||
};
|
||||
finish += adding;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ pub enum NodeType {
|
||||
|
||||
impl NodeType {
|
||||
pub fn is_mixnode(&self) -> bool {
|
||||
matches!(self, NodeType::Mixnode { .. })
|
||||
matches!(self, NodeType::Mixnode)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -403,7 +403,7 @@ pub fn issue(
|
||||
/// * `sk_user` - Secret key of the user.
|
||||
/// * `blind_signature` - Blinded signature received from the authority.
|
||||
/// * `req_info` - Information associated with the request, including the joined commitment hash,
|
||||
/// private attributes openings, v, and expiration date.
|
||||
/// private attributes openings, v, and expiration date.
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
|
||||
@@ -171,6 +171,7 @@ pub fn is_cover(data: &[u8]) -> bool {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use std::iter::repeat_n;
|
||||
|
||||
#[test]
|
||||
fn is_cover_works_for_identical_input() {
|
||||
@@ -182,7 +183,7 @@ mod tests {
|
||||
let input: Vec<_> = LOOP_COVER_MESSAGE_PAYLOAD
|
||||
.iter()
|
||||
.cloned()
|
||||
.chain(std::iter::repeat(42).take(100))
|
||||
.chain(repeat_n(42, 100))
|
||||
.collect();
|
||||
assert!(is_cover(&input))
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ impl NymMessage {
|
||||
bytes
|
||||
.into_iter()
|
||||
.chain(std::iter::once(1u8))
|
||||
.chain(std::iter::repeat(0u8).take(space_left))
|
||||
.chain(std::iter::repeat_n(0u8, space_left))
|
||||
.collect::<Vec<_>>()
|
||||
.into()
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ pub trait FragmentPreparer {
|
||||
/// - compute SURB_ACK
|
||||
/// - generate (x, g^x)
|
||||
/// - obtain key k from the reply-surb which was computed as follows:
|
||||
/// k = KDF(remote encryption key ^ x) this is equivalent to KDF( dh(remote, x) )
|
||||
/// k = KDF(remote encryption key ^ x) this is equivalent to KDF( dh(remote, x) )
|
||||
/// - compute v_b = AES-128-CTR(k, serialized_fragment)
|
||||
/// - compute vk_b = H(k) || v_b
|
||||
/// - compute sphinx_plaintext = SURB_ACK || H(k) || v_b
|
||||
|
||||
Generated
+8
-8
@@ -667,9 +667,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "deranged"
|
||||
version = "0.3.11"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
|
||||
checksum = "28cfac68e08048ae1883171632c2aef3ebc555621ae56fbccce1cbf22dd7f058"
|
||||
dependencies = [
|
||||
"powerfmt",
|
||||
]
|
||||
@@ -1851,9 +1851,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.3.39"
|
||||
version = "0.3.41"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dad298b01a40a23aac4580b67e3dbedb7cc8402f3592d7f49469de2ea4aecdd8"
|
||||
checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40"
|
||||
dependencies = [
|
||||
"deranged",
|
||||
"itoa",
|
||||
@@ -1868,15 +1868,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "time-core"
|
||||
version = "0.1.3"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "765c97a5b985b7c11d7bc27fa927dc4fe6af3a6dfb021d28deb60d3bf51e76ef"
|
||||
checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c"
|
||||
|
||||
[[package]]
|
||||
name = "time-macros"
|
||||
version = "0.2.20"
|
||||
version = "0.2.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e8093bc3e81c3bc5f7879de09619d06c9a5a5e45ca44dfeeb7225bae38005c5c"
|
||||
checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49"
|
||||
dependencies = [
|
||||
"num-conv",
|
||||
"time-core",
|
||||
|
||||
@@ -1 +1 @@
|
||||
Wednesday, April 2nd 2025, 09:44:48 UTC
|
||||
Thursday, April 3rd 2025, 13:40:32 UTC
|
||||
|
||||
@@ -5,7 +5,9 @@ import { MyTab } from 'components/generic-tabs.tsx';
|
||||
|
||||
# Pre-built Binaries
|
||||
|
||||
This page is for operators who prefer to download ready made binaries. The [Github releases page](https://github.com/nymtech/nym/releases) has pre-built binaries which should work on Ubuntu 22.04 and other Debian-based systems, but at this stage cannot be guaranteed to work everywhere.
|
||||
This page is for operators who prefer to download ready made binaries. The [Github releases page](https://github.com/nymtech/nym/releases) has pre-built binaries which work on **Ubuntu 22.04 and Debian 12 upwards**, but at this stage cannot be guaranteed to work everywhere.
|
||||
|
||||
They should work on any distro with `libc` >= v2.33 and above.
|
||||
|
||||
If the pre-built binaries don't work or are unavailable for your system, you will need to build the platform yourself.
|
||||
|
||||
|
||||
@@ -23,13 +23,13 @@ This guide explains how to prepare your server in order to be able to host multi
|
||||
This guide is based on Ubuntu 22.04, in case you prefer another OS, you may have to do a bit of your own research to troubleshoot networking configuration and other parameters.
|
||||
</Callout>
|
||||
|
||||
### Installing KVM on a Server with Ubuntu 22.04
|
||||
## Installing KVM on a Server with Ubuntu 22.04
|
||||
|
||||
**KVM** stands for **Kernel-based Virtual Machine**. It is a virtualization technology for Linux that allows a user to run multiple virtual machines (VMs) on a single physical machine. KVM turns the Linux kernel into a hypervisor, enabling it to manage multiple virtualised systems.
|
||||
|
||||
Follow the steps below to install KVM on Ubuntu 22.04 LTS.
|
||||
|
||||
#### Prerequisites
|
||||
### Prerequisites
|
||||
|
||||
<Callout type="warning">
|
||||
Operators aiming to run Nym node as mixnet [Exit Gateway](../../../community-counsel/exit-gateway) or with wireguard enabled should familiarize themselves with the challenges possibly coming along `nym-node` operation, described in our [community counsel](../../../community-counsel) and follow up with [legal suggestions](../../../community-counsel/legal). Particularly important is to [introduce yourself](../../../community-counsel/legal#introduce-nym-node-to-your-provider) and your intentions to run a Nym node to your provider.
|
||||
@@ -510,16 +510,56 @@ Your KVM installation is now ready to deploy and manage VMs.
|
||||
|
||||
</Steps>
|
||||
|
||||
### Setting Up Virtual Machines
|
||||
## Setting Up Virtual Machines
|
||||
|
||||
After finishing the [installation of KVM](#installing-kvm-on-a-server-with-ubuntu-2204), we can move to the virtualisation configuration.
|
||||
**After finishing the [installation of KVM](#installing-kvm-on-a-server-with-ubuntu-2204), we can move to the virtualisation configuration.**
|
||||
|
||||
> **The steps below will guide you through a setup of one VM, therefore you will have to repeat this process for each VM**. That also means that you have to be mindful of space and memory allocation.
|
||||
> **This tutorial will guide you through a setup of one VM, therefore you will have to repeat this process for each VM**.
|
||||
|
||||
<Callout>
|
||||
A good practice before initialising any VMs, is to calculate space and memory allocation for each of them and your host machine.
|
||||
</Callout>
|
||||
|
||||
You can choose in between using [bash scripts](#setting-up-vm-using-scripts) or [manual steps](#setting-up-vm-step-by-step) approach. While scripts may be faster, they give you much less flexibility. Therefore if you prefer to have room for customisation coming along installing software, do it step by step.
|
||||
|
||||
Remember, that anytime you execute a script on your computer, make sure to read and understand the script first.
|
||||
|
||||
### Seting up VM Using Scripts
|
||||
|
||||
<Callout type="info" emoji="ℹ️">
|
||||
In case you want to initialise and configure your VMs manually - skip this chapter and go directly to the [*step-by-step* part](#setting-up-vm-step-by-step).
|
||||
</Callout>
|
||||
|
||||
Using the scripts is a two-step process. First, initialisation part is done from the host root using [`initialise-vm.sh`](https://github.com/nymtech/nym/blob/develop/scripts/kvm-setup/initialise-vm.sh) and second, configuration part is done from the VM itself using [`configure-vm.sh`](https://github.com/nymtech/nym/blob/develop/scripts/kvm-setup/configure-vm.sh).
|
||||
|
||||
<Steps>
|
||||
##### 1. Initialise VM from the host machine
|
||||
- Log in to your host as `root`
|
||||
- Run this block and follow the prompts carefully:
|
||||
```bash
|
||||
wget "https://raw.githubusercontent.com/nymtech/nym/refs/heads/develop/scripts/kvm-setup/initialise-vm.sh"
|
||||
chmod +x ./initialise-vm.sh
|
||||
./initialise-vm.sh
|
||||
```
|
||||
|
||||
##### 2. Configure VM from within
|
||||
- After logging into your VM run this block and follow the prompts carefully:
|
||||
```bash
|
||||
wget "https://raw.githubusercontent.com/nymtech/nym/refs/heads/develop/scripts/kvm-setup/configure-vm.sh"
|
||||
chmod +x ./configure-vm.sh
|
||||
./configure-vm.sh
|
||||
```
|
||||
</ Steps>
|
||||
|
||||
|
||||
### Setting up VM Step-by-step
|
||||
|
||||
In case you did't use the scripts and prefer manual approach, follow the steps below carefully.
|
||||
|
||||
<Steps>
|
||||
##### 1. Install OS for VMs
|
||||
|
||||
This is the OS on which the nodes themselves will run. You can chose any GNU/Linux of your preference. For this guide we are going to be using Ubuntu 24.04 LTS (Noble Numbat) cloud image from [cloud-images.ubuntu.com](https://cloud-images.ubuntu.com/noble/current/).
|
||||
This is the OS on which the nodes themselves will run. You can chose any GNU/Linux of your preference. For this guide we are going to be using Ubuntu 24.04 LTS (Noble Numbat) cloud image from [cloud-images.ubuntu.com](https://cloud-images.ubuntu.com/noble/current/).
|
||||
|
||||
- Download Ubuntu Cloud image:
|
||||
```bash
|
||||
@@ -651,7 +691,7 @@ network:
|
||||
addresses:
|
||||
- 1.1.1.1 # Cloudflare IPv4 DNS
|
||||
- 8.8.8.8 # Google IPv4 DNS
|
||||
- 8.8.4.4 # Secondary Google IPv4 DNS
|
||||
- 8.8.4.4 # Secondary Google IPv4 DNS
|
||||
- 2606:4700:4700::1111 # Cloudflare IPv6 DNS
|
||||
- 2001:4860:4860::8888 # Google IPv6 DNS
|
||||
```
|
||||
|
||||
Generated
+393
-124
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/nym-wallet-app",
|
||||
"version": "1.2.16",
|
||||
"version": "1.2.17",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nym_wallet"
|
||||
version = "1.2.16"
|
||||
version = "1.2.17"
|
||||
description = "Nym Native Wallet"
|
||||
authors = ["Nym Technologies SA"]
|
||||
license = ""
|
||||
|
||||
@@ -12,10 +12,7 @@ use nym_validator_client::nyxd::contract_traits::MixnetQueryClient;
|
||||
use nym_wallet_types::app::AppEnv;
|
||||
|
||||
fn get_env_as_option(key: &str) -> Option<String> {
|
||||
match ::std::env::var(key) {
|
||||
Ok(res) => Some(res),
|
||||
Err(_e) => None,
|
||||
}
|
||||
::std::env::var(key).ok()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// Copyright 2022 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#![allow(clippy::doc_overindented_list_items)]
|
||||
|
||||
/// The wallet storage file contains a set of logins, each with an associated login ID and an
|
||||
/// encrypted field. Once decrypted, each login contains either an account, or a set of accounts.
|
||||
/// One difference is that the latter have an associated account ID.
|
||||
@@ -2151,7 +2153,7 @@ mod tests {
|
||||
assert!(matches!(acc2, StoredLogin::Mnemonic(_)));
|
||||
|
||||
let expected_acc1 = bip39::Mnemonic::from_str("country mean universe text phone begin deputy reject result good cram illness common cluster proud swamp digital patrol spread bar face december base kick").unwrap();
|
||||
let expected_acc2 = bip39::Mnemonic::from_str("home mansion start quiz dress decide hint second dragon sunny juice always steak real minimum art rival skin draw total pulp foot goddess agent").unwrap();
|
||||
let expected_acc2 = bip39::Mnemonic::from_str("home mansion start quiz dress decide hint second dragon sunny juice always steak real minimum art rival skin draw total pulp foot goddess agent").unwrap();
|
||||
|
||||
assert_eq!(
|
||||
acc1.as_mnemonic_account().unwrap().mnemonic(),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"package": {
|
||||
"productName": "nym-wallet",
|
||||
"version": "1.2.16"
|
||||
"version": "1.2.17"
|
||||
},
|
||||
"build": {
|
||||
"distDir": "../dist",
|
||||
|
||||
+58
-59
@@ -1,61 +1,60 @@
|
||||
{
|
||||
"name": "@nymproject/nymsphere",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"license": "Apache 2.0",
|
||||
"workspaces": [
|
||||
"dist/wasm/**",
|
||||
"dist/node/**",
|
||||
"dist/ts/**",
|
||||
"sdk/typescript/packages/mui-theme",
|
||||
"sdk/typescript/packages/react-components",
|
||||
"sdk/typescript/packages/validator-client",
|
||||
"ts-packages/*",
|
||||
"nym-wallet",
|
||||
"explorer",
|
||||
"explorer-nextjs",
|
||||
"explorer-v2",
|
||||
"types",
|
||||
"clients/validator"
|
||||
],
|
||||
"scripts": {
|
||||
"nuke": "npx rimraf **/node_modules node_modules",
|
||||
"scrub": "npx rimraf **/dist dist",
|
||||
"clean": "lerna run clean",
|
||||
"build": "run-s build:types build:packages",
|
||||
"build:wasm": "make sdk-wasm-build",
|
||||
"build:types": "lerna run --scope @nymproject/types build --stream",
|
||||
"build:packages": "run-s build:packages:theme build:packages:react",
|
||||
"build:packages:theme": "lerna run --scope @nymproject/mui-theme build",
|
||||
"build:packages:react": "lerna run --scope @nymproject/react build",
|
||||
"build:react-example": "lerna run --scope @nymproject/react-webpack-with-theme-example build --stream",
|
||||
"build:playground": "lerna run --scope @nymproject/react storybook:build --stream",
|
||||
"build:ci:storybook": "yarn build && yarn dev:on && run-p build:react-example build:playground && yarn build:ci:storybook:collect-artifacts",
|
||||
"build:ci:storybook:collect-artifacts": "mkdir -p ts-packages/dist && mv sdk/typescript/packages/react-components/storybook-static ts-packages/dist/storybook && mv sdk/typescript/examples/react/mui-theme/dist ts-packages/dist/example",
|
||||
"prebuild:ci": "yarn dev:on && yarn",
|
||||
"build:ci": "run-s build:types build:packages build:wasm build:ci:sdk",
|
||||
"postbuild:ci": "yarn dev:off",
|
||||
"build:ci:sdk": "lerna run --scope '{@nymproject/sdk,@nymproject/node-tester,@nymproject/contract-clients,@nymproject/sdk-react,@nymproject/mix-fetch,@nymproject/nodejs-client,@nymproject/mix-fetch-node}' build --stream",
|
||||
"docs:prod:build": "run-s docs:prod:build:ws",
|
||||
"docs:prod:build:ws": "lerna run docs:prod:build --stream",
|
||||
"sdk:build": "./sdk/typescript/scripts/build-prod-sdk.sh",
|
||||
"sdk:publish": "./sdk/typescript/scripts/publish.sh",
|
||||
"lint": "lerna run lint --stream",
|
||||
"lint:fix": "lerna run lint:fix --stream",
|
||||
"tsc": "lerna run tsc --stream",
|
||||
"types:lint:fix": "lerna run lint:fix --scope @nymproject/types --scope @nymproject/nym-wallet-app",
|
||||
"audit:fix": "npm_config_yes=true npx yarn-audit-fix -- --dry-run",
|
||||
"dev:on": "node sdk/typescript/scripts/dev-mode-add.mjs",
|
||||
"dev:off": "node sdk/typescript/scripts/dev-mode-remove.mjs"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@npmcli/node-gyp": "^3.0.0",
|
||||
"lerna": "^7.3.0",
|
||||
"node-gyp": "^9.3.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"tslog": "3.3.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"lucide-react": "^0.453.0"
|
||||
}
|
||||
"name": "@nymproject/nymsphere",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"license": "Apache 2.0",
|
||||
"workspaces": [
|
||||
"dist/wasm/**",
|
||||
"dist/node/**",
|
||||
"dist/ts/**",
|
||||
"sdk/typescript/packages/mui-theme",
|
||||
"sdk/typescript/packages/react-components",
|
||||
"sdk/typescript/packages/validator-client",
|
||||
"ts-packages/*",
|
||||
"nym-wallet",
|
||||
"explorer-nextjs",
|
||||
"explorer-v2",
|
||||
"types",
|
||||
"clients/validator"
|
||||
],
|
||||
"scripts": {
|
||||
"nuke": "npx rimraf **/node_modules node_modules",
|
||||
"scrub": "npx rimraf **/dist dist",
|
||||
"clean": "lerna run clean",
|
||||
"build": "run-s build:types build:packages",
|
||||
"build:wasm": "make sdk-wasm-build",
|
||||
"build:types": "lerna run --scope @nymproject/types build --stream",
|
||||
"build:packages": "run-s build:packages:theme build:packages:react",
|
||||
"build:packages:theme": "lerna run --scope @nymproject/mui-theme build",
|
||||
"build:packages:react": "lerna run --scope @nymproject/react build",
|
||||
"build:react-example": "lerna run --scope @nymproject/react-webpack-with-theme-example build --stream",
|
||||
"build:playground": "lerna run --scope @nymproject/react storybook:build --stream",
|
||||
"build:ci:storybook": "yarn build && yarn dev:on && run-p build:react-example build:playground && yarn build:ci:storybook:collect-artifacts",
|
||||
"build:ci:storybook:collect-artifacts": "mkdir -p ts-packages/dist && mv sdk/typescript/packages/react-components/storybook-static ts-packages/dist/storybook && mv sdk/typescript/examples/react/mui-theme/dist ts-packages/dist/example",
|
||||
"prebuild:ci": "yarn dev:on && yarn",
|
||||
"build:ci": "run-s build:types build:packages build:wasm build:ci:sdk",
|
||||
"postbuild:ci": "yarn dev:off",
|
||||
"build:ci:sdk": "lerna run --scope '{@nymproject/sdk,@nymproject/node-tester,@nymproject/contract-clients,@nymproject/sdk-react,@nymproject/mix-fetch,@nymproject/nodejs-client,@nymproject/mix-fetch-node}' build --stream",
|
||||
"docs:prod:build": "run-s docs:prod:build:ws",
|
||||
"docs:prod:build:ws": "lerna run docs:prod:build --stream",
|
||||
"sdk:build": "./sdk/typescript/scripts/build-prod-sdk.sh",
|
||||
"sdk:publish": "./sdk/typescript/scripts/publish.sh",
|
||||
"lint": "lerna run lint --stream",
|
||||
"lint:fix": "lerna run lint:fix --stream",
|
||||
"tsc": "lerna run tsc --stream",
|
||||
"types:lint:fix": "lerna run lint:fix --scope @nymproject/types --scope @nymproject/nym-wallet-app",
|
||||
"audit:fix": "npm_config_yes=true npx yarn-audit-fix -- --dry-run",
|
||||
"dev:on": "node sdk/typescript/scripts/dev-mode-add.mjs",
|
||||
"dev:off": "node sdk/typescript/scripts/dev-mode-remove.mjs"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@npmcli/node-gyp": "^3.0.0",
|
||||
"lerna": "^7.3.0",
|
||||
"node-gyp": "^9.3.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"tslog": "3.3.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"lucide-react": "^0.453.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
# detect active network interface
|
||||
INTERFACE=$(ip -o link show | awk -F': ' '{print $2}' | grep -v lo | head -n 1)
|
||||
|
||||
echo "Detected active network interface: $INTERFACE"
|
||||
read -p "Is this correct? (y/n): " CONFIRM
|
||||
if [[ "$CONFIRM" != "y" ]]; then
|
||||
echo "Exiting. Please manually specify the correct network interface."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# prompt for network settings
|
||||
read -p "Enter IPv4 address for VM (leave blank if not used): " IPv4_VM
|
||||
read -p "Enter IPv6 address for VM (leave blank if not used): " IPv6_VM
|
||||
read -p "Enter IPv4 gateway (host server, leave blank if not used): " IPv4_GATEWAY_HOST_SERVER
|
||||
read -p "Enter IPv6 gateway (host server, leave blank if not used): " IPv6_GATEWAY_HOST_SERVER
|
||||
|
||||
# resize partition
|
||||
echo "Expanding partition and resizing filesystem..."
|
||||
growpart /dev/vda 1
|
||||
resize2fs /dev/vda1
|
||||
df -h
|
||||
|
||||
# ask before continuing
|
||||
read -p "Continue with network configuration? (y/n): " CONTINUE
|
||||
if [[ "$CONTINUE" != "y" ]]; then
|
||||
echo "Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# generate Netplan config
|
||||
NETPLAN_CONFIG="/etc/netplan/01-network-config.yaml"
|
||||
echo "Creating Netplan configuration at $NETPLAN_CONFIG..."
|
||||
|
||||
cat <<EOF > $NETPLAN_CONFIG
|
||||
network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
$INTERFACE:
|
||||
dhcp4: false
|
||||
dhcp6: false
|
||||
addresses:
|
||||
EOF
|
||||
|
||||
# append IPv4 address if provided
|
||||
if [[ -n "$IPv4_VM" ]]; then
|
||||
echo " - $IPv4_VM/24" >> $NETPLAN_CONFIG
|
||||
fi
|
||||
|
||||
# append IPv6 address if provided
|
||||
if [[ -n "$IPv6_VM" ]]; then
|
||||
echo " - $IPv6_VM/64" >> $NETPLAN_CONFIG
|
||||
fi
|
||||
|
||||
echo " routes:" >> $NETPLAN_CONFIG
|
||||
|
||||
# append IPv4 route if provided
|
||||
if [[ -n "$IPv4_GATEWAY_HOST_SERVER" ]]; then
|
||||
echo " - to: default" >> $NETPLAN_CONFIG
|
||||
echo " via: $IPv4_GATEWAY_HOST_SERVER" >> $NETPLAN_CONFIG
|
||||
fi
|
||||
|
||||
# append IPv6 route if provided
|
||||
if [[ -n "$IPv6_GATEWAY_HOST_SERVER" ]]; then
|
||||
echo " - to: default" >> $NETPLAN_CONFIG
|
||||
echo " via: $IPv6_GATEWAY_HOST_SERVER" >> $NETPLAN_CONFIG
|
||||
fi
|
||||
|
||||
cat <<EOF >> $NETPLAN_CONFIG
|
||||
nameservers:
|
||||
addresses:
|
||||
- 1.1.1.1 # Cloudflare IPv4 DNS
|
||||
- 8.8.8.8 # Google IPv4 DNS
|
||||
- 2606:4700:4700::1111 # Cloudflare IPv6 DNS
|
||||
- 2001:4860:4860::8888 # Google IPv6 DNS
|
||||
EOF
|
||||
|
||||
# secure Netplan config
|
||||
chmod 600 $NETPLAN_CONFIG
|
||||
|
||||
# generate Netplan configuration
|
||||
netplan generate
|
||||
|
||||
# ask before applying Netplan
|
||||
read -p "Apply Netplan changes? (y/n): " CONTINUE
|
||||
if [[ "$CONTINUE" != "y" ]]; then
|
||||
echo "Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# apply Netplan and verify settings
|
||||
netplan --debug apply
|
||||
|
||||
# show IP configurations
|
||||
ip -4 a
|
||||
ip -6 a
|
||||
ip -4 r
|
||||
ip -6 r
|
||||
|
||||
# test network connectivity
|
||||
echo "Testing IPv4 connectivity for 10 seconds..."
|
||||
timeout 10 ping -4 google.com
|
||||
|
||||
echo "Testing IPv6 connectivity for 10 seconds..."
|
||||
timeout 10 ping -6 google.com
|
||||
|
||||
# ask before updating system
|
||||
read -p "Proceed with system update and upgrade? (y/n): " CONTINUE
|
||||
if [[ "$CONTINUE" != "y" ]]; then
|
||||
echo "Skipping updates."
|
||||
else
|
||||
apt update && apt upgrade -y
|
||||
fi
|
||||
|
||||
# generate SSH host keys without password
|
||||
echo "Generating SSH host keys..."
|
||||
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
|
||||
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
|
||||
ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ""
|
||||
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ""
|
||||
|
||||
# restart SSH service
|
||||
systemctl restart ssh.service
|
||||
|
||||
# ensure ~/.ssh directory exists
|
||||
mkdir -p ~/.ssh
|
||||
|
||||
# Open authorized_keys file for user input
|
||||
echo "# Add your admin SSH keys here, save and exit!" > ~/.ssh/authorized_keys
|
||||
nano ~/.ssh/authorized_keys
|
||||
|
||||
echo "Setup complete! Try to ping and ssh from the outside before killing this console"
|
||||
@@ -0,0 +1,108 @@
|
||||
#!/bin/bash
|
||||
|
||||
# check if noble-server-cloudimg-amd64.img is in working dir - if not, wget it
|
||||
if [[ ! -f noble-server-cloudimg-amd64.img ]]; then
|
||||
echo "Base image not found. Downloading noble-server-cloudimg-amd64.img..."
|
||||
wget https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Error: Failed to download the base image. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# prompt for VM_NAME
|
||||
read -p "Enter VM name: " VM_NAME
|
||||
if [[ -z "$VM_NAME" ]]; then
|
||||
echo "Error: VM_NAME cannot be empty. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# prompt for PASSWORD w silent input
|
||||
read -s -p "Enter password for the VM: " PASSWORD
|
||||
echo
|
||||
if [[ -z "$PASSWORD" ]]; then
|
||||
echo "Error: PASSWORD cannot be empty. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# prompt for number of vCPUs
|
||||
read -p "Enter the number of vCPUs for the VM: " VCPUS
|
||||
if [[ -z "$VCPUS" || ! "$VCPUS" =~ ^[0-9]+$ ]]; then
|
||||
echo "Error: Invalid number of vCPUs. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# prompt for RAM size with suggestions
|
||||
DEFAULT_RAM=4096
|
||||
HALF_RAM=$((DEFAULT_RAM / 2))
|
||||
DOUBLE_RAM=$((DEFAULT_RAM * 2))
|
||||
TRIPLE_RAM=$((DEFAULT_RAM * 3))
|
||||
FOUR_TIMES_RAM=$((DEFAULT_RAM * 4))
|
||||
SIX_TIMES_RAM=$((DEFAULT_RAM * 6))
|
||||
EIGHT_TIMES_RAM=$((DEFAULT_RAM * 8))
|
||||
|
||||
echo "Choose the amount of RAM for the VM:"
|
||||
echo "1) $HALF_RAM MB"
|
||||
echo "2) $DEFAULT_RAM MB (recommended)"
|
||||
echo "3) $DOUBLE_RAM MB"
|
||||
echo "4) $TRIPLE_RAM MB"
|
||||
echo "5) $FOUR_TIMES_RAM MB"
|
||||
echo "6) $SIX_TIMES_RAM MB"
|
||||
echo "7) $EIGHT_TIMES_RAM MB"
|
||||
read -p "Enter your choice (1-7) or specify a custom amount in MB: " RAM_CHOICE
|
||||
|
||||
case $RAM_CHOICE in
|
||||
1) RAM=$HALF_RAM ;;
|
||||
2) RAM=$DEFAULT_RAM ;;
|
||||
3) RAM=$DOUBLE_RAM ;;
|
||||
4) RAM=$TRIPLE_RAM ;;
|
||||
5) RAM=$FOUR_TIMES_RAM ;;
|
||||
6) RAM=$SIX_TIMES_RAM ;;
|
||||
7) RAM=$EIGHT_TIMES_RAM ;;
|
||||
*)
|
||||
if [[ "$RAM_CHOICE" =~ ^[0-9]+$ ]]; then
|
||||
RAM=$RAM_CHOICE
|
||||
else
|
||||
echo "Invalid choice. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# define image path
|
||||
IMAGE_PATH="/var/lib/libvirt/images/${VM_NAME}.img"
|
||||
|
||||
# copy the base image
|
||||
echo "Copying the base image to $IMAGE_PATH..."
|
||||
cp noble-server-cloudimg-amd64.img "$IMAGE_PATH"
|
||||
|
||||
# install guestfs-tools if missing
|
||||
echo "Checking and installing guestfs-tools if needed..."
|
||||
if ! dpkg -l | grep -q guestfs-tools; then
|
||||
sudo apt update && sudo apt install guestfs-tools -y
|
||||
fi
|
||||
|
||||
# set root password inside the image
|
||||
echo "Setting root password inside the VM image..."
|
||||
virt-customize -a "$IMAGE_PATH" --root-password password:"$PASSWORD"
|
||||
|
||||
# resize the image
|
||||
echo "Resizing the image by +100G..."
|
||||
qemu-img resize "$IMAGE_PATH" +100G
|
||||
|
||||
# install the VM and run log in prompt
|
||||
echo "Starting VM installation..."
|
||||
virt-install \
|
||||
--name "$VM_NAME" \
|
||||
--ram="$RAM" \
|
||||
--vcpus="$VCPUS" \
|
||||
--cpu host \
|
||||
--hvm \
|
||||
--disk bus=virtio,path="$IMAGE_PATH" \
|
||||
--network bridge=br0 \
|
||||
--graphics none \
|
||||
--console pty,target_type=serial \
|
||||
--osinfo ubuntunoble \
|
||||
--import
|
||||
|
||||
echo "VM $VM_NAME has been successfully installed!"
|
||||
@@ -1,5 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { App } from './App';
|
||||
import * as React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import { App } from "./App";
|
||||
|
||||
ReactDOM.render(<App />, document.getElementById('app'));
|
||||
const root = ReactDOM.createRoot(document.getElementById("app") as HTMLElement);
|
||||
root.render(<App />);
|
||||
|
||||
+432
-435
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,6 @@
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"serve-handler": "^6.1.5",
|
||||
"puppeteer": "^21.1.1"
|
||||
"puppeteer": "^24.4.0"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user