mirror of
https://github.com/Retropex/raspiblitz.git
synced 2025-05-12 19:20:48 +02:00
Compare commits
281 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c73c5f022a | ||
![]() |
336a3418e9 | ||
![]() |
27bdcb072c | ||
![]() |
3c71712653 | ||
![]() |
ed675f628d | ||
![]() |
62a34a6105 | ||
![]() |
0f1b1fc433 | ||
![]() |
0134325bfe | ||
![]() |
d2bcb4c34a | ||
![]() |
1e5ea5ff6f | ||
![]() |
1183448f4f | ||
![]() |
cd424ac955 | ||
![]() |
e7bb32a485 | ||
![]() |
d9b091be1a | ||
![]() |
4d4385a840 | ||
![]() |
a68069d3ee | ||
![]() |
544e49ecf8 | ||
![]() |
9f7c479b0d | ||
![]() |
eaeb96ae14 | ||
![]() |
2058903689 | ||
![]() |
40e970d828 | ||
![]() |
9a2de6cad5 | ||
![]() |
b6c8bc17da | ||
![]() |
8a16a8ffe0 | ||
![]() |
22a95cae08 | ||
![]() |
e4c51fe22e | ||
![]() |
c5c984f3e5 | ||
![]() |
13acbe94b0 | ||
![]() |
88168842dc | ||
![]() |
5e732ce67f | ||
![]() |
d746bf3353 | ||
![]() |
b4e38e8741 | ||
![]() |
e74b129f22 | ||
![]() |
0516aa5971 | ||
![]() |
20650fd3e7 | ||
![]() |
36b38d5118 | ||
![]() |
513c759e5c | ||
![]() |
8e6e92b37c | ||
![]() |
0df22b0504 | ||
![]() |
4388da4859 | ||
![]() |
500e26d500 | ||
![]() |
0351d2fb5e | ||
![]() |
1cdfc3e6f6 | ||
![]() |
af85242be5 | ||
![]() |
28bde64e9a | ||
![]() |
770587eee2 | ||
![]() |
d1e57d6bd2 | ||
![]() |
d21348822c | ||
![]() |
c0d07013fc | ||
![]() |
4932495daa | ||
![]() |
45dbdb3b82 | ||
![]() |
4f7ce2b8a7 | ||
![]() |
3de15bed49 | ||
![]() |
bd5f010409 | ||
![]() |
d423c3c2d9 | ||
![]() |
9ff4947021 | ||
![]() |
e174972fe2 | ||
![]() |
8c8b0b2c62 | ||
![]() |
b419daf43a | ||
![]() |
bf9dbc0321 | ||
![]() |
e63326bbea | ||
![]() |
5209508584 | ||
![]() |
425442c248 | ||
![]() |
b6c919a0e8 | ||
![]() |
58d568685e | ||
![]() |
c891c1df7e | ||
![]() |
4d9a4e4dc4 | ||
![]() |
208cd6ab4e | ||
![]() |
c8e555c9b3 | ||
![]() |
e4761966f3 | ||
![]() |
2eed08965c | ||
![]() |
f9ae449ebb | ||
![]() |
c2c710a9d1 | ||
![]() |
4d4762106e | ||
![]() |
3aa0bb42a7 | ||
![]() |
ce80eb5939 | ||
![]() |
8f7f08cea9 | ||
![]() |
81a2a013c8 | ||
![]() |
f0ccc61b05 | ||
![]() |
7eaf68cd41 | ||
![]() |
c8feef9063 | ||
![]() |
c7eb225de4 | ||
![]() |
35b5e8e670 | ||
![]() |
69a18c7375 | ||
![]() |
8b77877d6b | ||
![]() |
6558fb41f1 | ||
![]() |
3b60da7cd4 | ||
![]() |
4325658924 | ||
![]() |
01d3595a83 | ||
![]() |
dd8b195db9 | ||
![]() |
dc5999a3c7 | ||
![]() |
ac9735b8d3 | ||
![]() |
836990aaca | ||
![]() |
c4b8ef5586 | ||
![]() |
5c8d1da6e5 | ||
![]() |
b377858178 | ||
![]() |
ba88e6e17c | ||
![]() |
069005cc29 | ||
![]() |
b34186ff0c | ||
![]() |
6d9e0ae5f5 | ||
![]() |
fa9989bf51 | ||
![]() |
15447780fa | ||
![]() |
f26489d653 | ||
![]() |
655f5cb7b0 | ||
![]() |
45f5539f9c | ||
![]() |
58e7bcd260 | ||
![]() |
19c64497ef | ||
![]() |
5022cfaf37 | ||
![]() |
502782f5ed | ||
![]() |
f8a7af1970 | ||
![]() |
a3b4daba4e | ||
![]() |
da34292f10 | ||
![]() |
870014d879 | ||
![]() |
1093ae3f9b | ||
![]() |
16cbf0ef34 | ||
![]() |
898485adbe | ||
![]() |
7d41e56e02 | ||
![]() |
4ecd33514c | ||
![]() |
e2d9d29164 | ||
![]() |
b7a8731e9c | ||
![]() |
02a5771666 | ||
![]() |
151ba3e15e | ||
![]() |
f4a4800174 | ||
![]() |
0ebc94821d | ||
![]() |
483ca2305b | ||
![]() |
01db973bec | ||
![]() |
01d289cb4f | ||
![]() |
27ff2d63e2 | ||
![]() |
02fca137b3 | ||
![]() |
850f08d37f | ||
![]() |
e4cf6d294a | ||
![]() |
0bb32723e8 | ||
![]() |
a791651366 | ||
![]() |
0e26641158 | ||
![]() |
ff23ede250 | ||
![]() |
e15a02caf1 | ||
![]() |
5d2b4c84fc | ||
![]() |
1b01d920db | ||
![]() |
5e461ff1ce | ||
![]() |
2c56f5248b | ||
![]() |
24a3c06a35 | ||
![]() |
f1342ebcfd | ||
![]() |
588820ff13 | ||
![]() |
9e64abc9d9 | ||
![]() |
7426a3a287 | ||
![]() |
5581a40b2b | ||
![]() |
6a4b33a960 | ||
![]() |
2d701b77e2 | ||
![]() |
77c45141bc | ||
![]() |
ac377df504 | ||
![]() |
083cd12727 | ||
![]() |
14e1201d82 | ||
![]() |
e477377214 | ||
![]() |
522b13e5d4 | ||
![]() |
b3c1a8d937 | ||
![]() |
6918d21639 | ||
![]() |
b4e3a61fe4 | ||
![]() |
0720b0c2a8 | ||
![]() |
0592776504 | ||
![]() |
2f0abcf7fa | ||
![]() |
2de42dc72a | ||
![]() |
87d63e5f32 | ||
![]() |
c5fedf71c2 | ||
![]() |
b02db0b46c | ||
![]() |
003230d137 | ||
![]() |
e70c6863f9 | ||
![]() |
2b70db09fe | ||
![]() |
9283f7fc3d | ||
![]() |
11c2072580 | ||
![]() |
45c5c0ff57 | ||
![]() |
440b788bd5 | ||
![]() |
ec67c362f7 | ||
![]() |
5e283e0cc5 | ||
![]() |
85e6e26f9d | ||
![]() |
b3a14cfc35 | ||
![]() |
85871f325a | ||
![]() |
ffea31dfd6 | ||
![]() |
7cd267c421 | ||
![]() |
449b0a226c | ||
![]() |
be1ec81a58 | ||
![]() |
13ae51c54a | ||
![]() |
1a092f8ee7 | ||
![]() |
26d5e18e7d | ||
![]() |
6d4784bba8 | ||
![]() |
f9cb44982e | ||
![]() |
f67c8fd11c | ||
![]() |
168789c609 | ||
![]() |
e70f4b7197 | ||
![]() |
81e5fae6dc | ||
![]() |
e98bb8d3c0 | ||
![]() |
4719fbd443 | ||
![]() |
2f967e9077 | ||
![]() |
240f28d5dc | ||
![]() |
96bb62a010 | ||
![]() |
81ebfb7902 | ||
![]() |
60c58ec6df | ||
![]() |
6fdf6f747e | ||
![]() |
0635a16d2b | ||
![]() |
91cddd9fb0 | ||
![]() |
970b4dfb5d | ||
![]() |
c2df07efd1 | ||
![]() |
1d3d7a0e75 | ||
![]() |
9afa8101b4 | ||
![]() |
0a215c2476 | ||
![]() |
5f33c94f09 | ||
![]() |
51e1bf4452 | ||
![]() |
c0ab542310 | ||
![]() |
ca88646ad2 | ||
![]() |
3f3b7e429e | ||
![]() |
af65af5e14 | ||
![]() |
ce89ac53fa | ||
![]() |
ccd08a08d1 | ||
![]() |
e6bec47aec | ||
![]() |
186d50dec3 | ||
![]() |
b5c03d509d | ||
![]() |
5321480fb5 | ||
![]() |
00fe2e2c67 | ||
![]() |
4d8776a35c | ||
![]() |
a7ae5162e7 | ||
![]() |
98dfd49f6e | ||
![]() |
eddec30f4a | ||
![]() |
e70263dc30 | ||
![]() |
64e8b706ad | ||
![]() |
5062bfe95a | ||
![]() |
de18ad8b36 | ||
![]() |
1404ac3285 | ||
![]() |
622135c570 | ||
![]() |
40587e4d8e | ||
![]() |
c290205fb9 | ||
![]() |
127d88efcc | ||
![]() |
fac733a0a1 | ||
![]() |
4de59b58b3 | ||
![]() |
1ef72dc481 | ||
![]() |
07cdde07c0 | ||
![]() |
a015d2c399 | ||
![]() |
0a9ce40ff9 | ||
![]() |
275f996226 | ||
![]() |
9bb38ce501 | ||
![]() |
d206bc238d | ||
![]() |
c17066cb07 | ||
![]() |
30d2e69304 | ||
![]() |
d73191099a | ||
![]() |
3f837a2fc2 | ||
![]() |
487ccd45b4 | ||
![]() |
f2d09038d5 | ||
![]() |
252de3b0d4 | ||
![]() |
c8d49b71cb | ||
![]() |
72af1378e4 | ||
![]() |
dee7ec41f5 | ||
![]() |
432a0c720e | ||
![]() |
720771709f | ||
![]() |
16b3afe0ab | ||
![]() |
2896fa398a | ||
![]() |
50769843ba | ||
![]() |
2995282d49 | ||
![]() |
39a94dd4d4 | ||
![]() |
6324c5f97b | ||
![]() |
7e66b82e0e | ||
![]() |
4523db7036 | ||
![]() |
b402ee4c5f | ||
![]() |
6a33cbc6dc | ||
![]() |
16094398d7 | ||
![]() |
9f238868e9 | ||
![]() |
37c8f6f897 | ||
![]() |
624f8ca1a7 | ||
![]() |
df210e6e45 | ||
![]() |
b57aba6acf | ||
![]() |
7a7c7bd97b | ||
![]() |
4f71a73e3f | ||
![]() |
041574a1ee | ||
![]() |
3ca368fbbe | ||
![]() |
c67499b222 | ||
![]() |
5f1df69528 | ||
![]() |
1781062bfe | ||
![]() |
68f21035c1 | ||
![]() |
885be6ccb2 | ||
![]() |
5a2257c445 | ||
![]() |
ee3cc02864 | ||
![]() |
bf9aaa9076 | ||
![]() |
154db3ea90 | ||
![]() |
4a194007a8 |
3
.github/ISSUE_TEMPLATE/config.yml
vendored
3
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1,7 +1,4 @@
|
||||
contact_links:
|
||||
- name: Need help? Ask a question in the Q&A section
|
||||
url: https://github.com/raspiblitz/raspiblitz/discussions/categories/q-a
|
||||
about: Community support for questions
|
||||
- name: Have an idea for a new app in the RaspiBlitz? Make a suggestion in the app ideas section
|
||||
url: https://github.com/raspiblitz/raspiblitz/discussions/categories/feature-app-ideas
|
||||
about: Feature and app ideas
|
||||
|
20
.github/workflows/amd64-fatpack-image.yml
vendored
20
.github/workflows/amd64-fatpack-image.yml
vendored
@ -7,7 +7,7 @@ concurrency:
|
||||
on:
|
||||
workflow_dispatch:
|
||||
#push:
|
||||
# branches: [ "dev", "v1.8", "v1.9" ]
|
||||
# branches: ["dev", "v1.10"]
|
||||
# paths:
|
||||
# - 'build_sdcard.sh'
|
||||
# - 'home.admin/bitcoin.install.sh'
|
||||
@ -28,7 +28,7 @@ on:
|
||||
# - 'home.admin/blitz.display.sh'
|
||||
# - 'ci/amd64/**'
|
||||
#pull_request:
|
||||
# branches: [ "dev", "v1.8", "v1.9" ]
|
||||
# branches: ["dev", "v1.10"]
|
||||
# paths:
|
||||
# - 'build_sdcard.sh'
|
||||
# - 'home.admin/bitcoin.install.sh'
|
||||
@ -53,9 +53,10 @@ jobs:
|
||||
amd64-image-build:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set values
|
||||
id: set_values
|
||||
run: |
|
||||
echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
|
||||
echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV
|
||||
@ -64,15 +65,20 @@ jobs:
|
||||
else
|
||||
echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
|
||||
fi
|
||||
if [[ "${{github.event_name}}" == "pull_request" ]]; then
|
||||
echo "GITHUB_USER=${{github.event.pull_request.head.repo.owner.login}}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "GITHUB_USER=$(echo ${{github.repository}} | cut -d'/' -f1)" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Hello RaspiBlitz
|
||||
- name: Display the build name
|
||||
run: echo "Building the raspiblitz-amd64-debian-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}"
|
||||
|
||||
- name: Run the build script
|
||||
run: |
|
||||
echo "Using the variables: --pack fatpack --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi--desktop gnome"
|
||||
echo "Using the variables: --pack fatpack --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop none"
|
||||
cd ci/amd64
|
||||
bash packer.build.amd64-debian.sh --pack fatpack --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi--desktop gnome
|
||||
bash packer.build.amd64-debian.sh --pack fatpack --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop none
|
||||
|
||||
- name: Compute checksum of the raw image
|
||||
run: |
|
||||
@ -90,7 +96,7 @@ jobs:
|
||||
sha256sum raspiblitz-amd64-debian-fatpack.qcow2.gz > raspiblitz-amd64-debian-fatpack.qcow2.gz.sha256
|
||||
|
||||
- name: Upload the image and checksums
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: raspiblitz-amd64-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}
|
||||
path: |
|
||||
|
55
.github/workflows/amd64-lean-image.yml
vendored
55
.github/workflows/amd64-lean-image.yml
vendored
@ -7,33 +7,40 @@ concurrency:
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: ["dev", "v1.8", "v1.9"]
|
||||
branches: ['dev', 'v1.10']
|
||||
paths:
|
||||
- "build_sdcard.sh"
|
||||
- "home.admin/bitcoin.install.sh"
|
||||
- "home.admin/tor.install.sh"
|
||||
- "home.admin/blitz.i2pd.sh"
|
||||
- "home.admin/blitz.web.sh"
|
||||
- "home.admin/blitz.display.sh"
|
||||
- "ci/amd64/**"
|
||||
- 'build_sdcard.sh'
|
||||
- 'home.admin/bitcoin.install.sh'
|
||||
- 'home.admin/tor.install.sh'
|
||||
- 'home.admin/blitz.i2pd.sh'
|
||||
- 'home.admin/blitz.web.sh'
|
||||
- 'home.admin/blitz.display.sh'
|
||||
- 'ci/amd64/**'
|
||||
pull_request:
|
||||
branches: ["dev", "v1.8", "v1.9"]
|
||||
branches: ['dev', 'v1.10']
|
||||
paths:
|
||||
- "build_sdcard.sh"
|
||||
- "home.admin/bitcoin.install.sh"
|
||||
- "home.admin/tor.install.sh"
|
||||
- "home.admin/blitz.i2pd.sh"
|
||||
- "home.admin/blitz.web.sh"
|
||||
- "home.admin/blitz.display.sh"
|
||||
- "ci/amd64/**"
|
||||
- 'build_sdcard.sh'
|
||||
- 'home.admin/bitcoin.install.sh'
|
||||
- 'home.admin/tor.install.sh'
|
||||
- 'home.admin/blitz.i2pd.sh'
|
||||
- 'home.admin/blitz.web.sh'
|
||||
- 'home.admin/blitz.display.sh'
|
||||
- 'ci/amd64/**'
|
||||
|
||||
jobs:
|
||||
amd64-image-build:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Maximize build space
|
||||
uses: easimon/maximize-build-space@master
|
||||
with:
|
||||
root-reserve-mb: 12288
|
||||
temp-reserve-mb: 12288
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set values
|
||||
id: set_values
|
||||
run: |
|
||||
echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
|
||||
echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV
|
||||
@ -42,14 +49,20 @@ jobs:
|
||||
else
|
||||
echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
|
||||
fi
|
||||
- name: Hello RaspiBlitz
|
||||
if [[ "${{github.event_name}}" == "pull_request" ]]; then
|
||||
echo "GITHUB_USER=${{github.event.pull_request.head.repo.owner.login}}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "GITHUB_USER=$(echo ${{github.repository}} | cut -d'/' -f1)" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Display the build name
|
||||
run: echo "Building the raspiblitz-amd64-debian-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}"
|
||||
|
||||
- name: Run the build script
|
||||
run: |
|
||||
echo "Using the variables: --pack lean --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop gnome"
|
||||
echo "Using the variables: --pack lean --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop gnome"
|
||||
cd ci/amd64
|
||||
bash packer.build.amd64-debian.sh --pack lean --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop gnome
|
||||
bash packer.build.amd64-debian.sh --pack lean --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot uefi --desktop gnome
|
||||
|
||||
- name: Compute checksum of the raw image
|
||||
run: |
|
||||
@ -67,7 +80,7 @@ jobs:
|
||||
sha256sum raspiblitz-amd64-debian-lean.qcow2.gz > raspiblitz-amd64-debian-lean.qcow2.gz.sha256
|
||||
|
||||
- name: Upload the image and checksums
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: raspiblitz-amd64-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}
|
||||
path: |
|
||||
|
@ -7,33 +7,34 @@ concurrency:
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: ["dev", "v1.8", "v1.9"]
|
||||
branches: ['dev', 'v1.10']
|
||||
paths:
|
||||
- "build_sdcard.sh"
|
||||
- "home.admin/bitcoin.install.sh"
|
||||
- "home.admin/tor.install.sh"
|
||||
- "home.admin/blitz.i2pd.sh"
|
||||
- "home.admin/blitz.web.sh"
|
||||
- "home.admin/blitz.display.sh"
|
||||
- "ci/amd64/**"
|
||||
- 'build_sdcard.sh'
|
||||
- 'home.admin/bitcoin.install.sh'
|
||||
- 'home.admin/tor.install.sh'
|
||||
- 'home.admin/blitz.i2pd.sh'
|
||||
- 'home.admin/blitz.web.sh'
|
||||
- 'home.admin/blitz.display.sh'
|
||||
- 'ci/amd64/**'
|
||||
pull_request:
|
||||
branches: ["dev", "v1.8", "v1.9"]
|
||||
branches: ['dev', 'v1.10']
|
||||
paths:
|
||||
- "build_sdcard.sh"
|
||||
- "home.admin/bitcoin.install.sh"
|
||||
- "home.admin/tor.install.sh"
|
||||
- "home.admin/blitz.i2pd.sh"
|
||||
- "home.admin/blitz.web.sh"
|
||||
- "home.admin/blitz.display.sh"
|
||||
- "ci/amd64/**"
|
||||
- 'build_sdcard.sh'
|
||||
- 'home.admin/bitcoin.install.sh'
|
||||
- 'home.admin/tor.install.sh'
|
||||
- 'home.admin/blitz.i2pd.sh'
|
||||
- 'home.admin/blitz.web.sh'
|
||||
- 'home.admin/blitz.display.sh'
|
||||
- 'ci/amd64/**'
|
||||
|
||||
jobs:
|
||||
amd64-image-build:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set values
|
||||
id: set_values
|
||||
run: |
|
||||
echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
|
||||
echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV
|
||||
@ -42,15 +43,20 @@ jobs:
|
||||
else
|
||||
echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
|
||||
fi
|
||||
if [[ "${{github.event_name}}" == "pull_request" ]]; then
|
||||
echo "GITHUB_USER=${{github.event.pull_request.head.repo.owner.login}}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "GITHUB_USER=$(echo ${{github.repository}} | cut -d'/' -f1)" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Hello RaspiBlitz
|
||||
- name: Display the build name
|
||||
run: echo "Building the raspiblitz-amd64-debian-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}"
|
||||
|
||||
- name: Run the build script
|
||||
run: |
|
||||
echo "Using the variables: --pack lean --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot bios --desktop none"
|
||||
echo "Using the variables: --pack lean --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot bios --desktop none"
|
||||
cd ci/amd64
|
||||
bash packer.build.amd64-debian.sh --pack lean --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot bios --desktop none
|
||||
bash packer.build.amd64-debian.sh --pack lean --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}} --preseed_file preseed.cfg --boot bios --desktop none
|
||||
|
||||
- name: Compute checksum of the raw image
|
||||
run: |
|
||||
@ -68,7 +74,7 @@ jobs:
|
||||
sha256sum raspiblitz-amd64-debian-lean.qcow2.gz > raspiblitz-amd64-debian-lean.qcow2.gz.sha256
|
||||
|
||||
- name: Upload the image and checksums
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: raspiblitz-amd64-image-${{env.BUILD_DATE}}-${{env.BUILD_VERSION}}
|
||||
path: |
|
||||
|
93
.github/workflows/arm64-rpi-base-image.yml
vendored
Normal file
93
.github/workflows/arm64-rpi-base-image.yml
vendored
Normal file
@ -0,0 +1,93 @@
|
||||
name: arm64-rpi-base-image-build
|
||||
|
||||
concurrency:
|
||||
group: arm64-rpi-base-image-build-${{ github.head_ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: ['dev', 'v1.10', 'v1.11']
|
||||
paths:
|
||||
- 'build_sdcard.sh'
|
||||
- 'home.admin/config.scripts/bitcoin.install.sh'
|
||||
- 'home.admin/config.scripts/tor.install.sh'
|
||||
- 'home.admin/config.scripts/blitz.i2pd.sh'
|
||||
- 'home.admin/config.scripts/blitz.web.sh'
|
||||
- 'home.admin/config.scripts/blitz.display.sh'
|
||||
- 'ci/arm64-rpi/**'
|
||||
- 'home.admin/config.scripts/bonus.btc-rpc-explorer.sh'
|
||||
- 'home.admin/config.scripts/bonus.btcpayserver.sh'
|
||||
- 'home.admin/config.scripts/bonus.jam.sh'
|
||||
- 'home.admin/config.scripts/bonus.joinmarket.sh'
|
||||
- 'home.admin/config.scripts/bonus.lnbits.sh'
|
||||
- 'home.admin/config.scripts/bonus.mempool.sh'
|
||||
- 'home.admin/config.scripts/bonus.nodejs.sh'
|
||||
- 'home.admin/config.scripts/bonus.rtl.sh'
|
||||
- 'home.admin/config.scripts/bonus.thunderhub.sh'
|
||||
- 'home.admin/config.scripts/blitz.web.api.sh'
|
||||
- 'home.admin/config.scripts/blitz.web.ui'
|
||||
pull_request:
|
||||
branches: ['dev', 'v1.10', 'v1.11']
|
||||
paths:
|
||||
- 'build_sdcard.sh'
|
||||
- 'home.admin/config.scripts/bitcoin.install.sh'
|
||||
- 'home.admin/config.scripts/tor.install.sh'
|
||||
- 'home.admin/config.scripts/blitz.i2pd.sh'
|
||||
- 'home.admin/config.scripts/blitz.web.sh'
|
||||
- 'home.admin/config.scripts/blitz.display.sh'
|
||||
- 'ci/arm64-rpi/**'
|
||||
- 'home.admin/config.scripts/bonus.btc-rpc-explorer.sh'
|
||||
- 'home.admin/config.scripts/bonus.btcpayserver.sh'
|
||||
- 'home.admin/config.scripts/bonus.jam.sh'
|
||||
- 'home.admin/config.scripts/bonus.joinmarket.sh'
|
||||
- 'home.admin/config.scripts/bonus.lnbits.sh'
|
||||
- 'home.admin/config.scripts/bonus.mempool.sh'
|
||||
- 'home.admin/config.scripts/bonus.nodejs.sh'
|
||||
- 'home.admin/config.scripts/bonus.rtl.sh'
|
||||
- 'home.admin/config.scripts/bonus.thunderhub.sh'
|
||||
- 'home.admin/config.scripts/blitz.web.api.sh'
|
||||
- 'home.admin/config.scripts/blitz.web.ui'
|
||||
|
||||
jobs:
|
||||
arm64-rpi-base-image-build:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set values
|
||||
id: set_values
|
||||
run: |
|
||||
echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV
|
||||
if [ -z "$GITHUB_HEAD_REF" ]; then
|
||||
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
|
||||
else
|
||||
echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
|
||||
fi
|
||||
if [[ "${{github.event_name}}" == "pull_request" ]]; then
|
||||
echo "GITHUB_USER=${{github.event.pull_request.head.repo.owner.login}}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "GITHUB_USER=$(echo ${{github.repository}} | cut -d'/' -f1)" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Display the build name
|
||||
run: echo "Building the raspiblitz-arm64-rpi-base-image"
|
||||
|
||||
- name: Run the build script
|
||||
run: |
|
||||
echo "Using the variables: --pack base --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}} --image_size 18G"
|
||||
cd ci/arm64-rpi
|
||||
bash packer.build.arm64-rpi.sh --pack base --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}} --image_size 18G
|
||||
|
||||
- name: Calculate the checksum of the raw image
|
||||
run: |
|
||||
cd ci/arm64-rpi
|
||||
sha256sum raspiblitz-arm64-rpi-base.img > raspiblitz-arm64-rpi-base.img.sha256
|
||||
|
||||
- name: Upload the base image and checksum
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: raspiblitz-arm64-rpi-base-image-${{ env.BUILD_VERSION }}
|
||||
path: |
|
||||
${{ github.workspace }}/ci/arm64-rpi/raspiblitz-arm64-rpi-base.img.sha256
|
||||
${{ github.workspace }}/ci/arm64-rpi/raspiblitz-arm64-rpi-base.img
|
@ -1,77 +0,0 @@
|
||||
name: arm64-rpi-debian12-lean-image-build
|
||||
|
||||
concurrency:
|
||||
group: arm64-rpi-debian12-lean-image-build-${{ github.head_ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: ["dev"]
|
||||
paths:
|
||||
- "build_sdcard.sh"
|
||||
- "home.admin/bitcoin.install.sh"
|
||||
- "home.admin/tor.install.sh"
|
||||
- "home.admin/blitz.i2pd.sh"
|
||||
- "home.admin/blitz.web.sh"
|
||||
- "home.admin/blitz.display.sh"
|
||||
- "ci/arm64-rpi/**"
|
||||
pull_request:
|
||||
branches: ["dev"]
|
||||
paths:
|
||||
- "build_sdcard.sh"
|
||||
- "home.admin/bitcoin.install.sh"
|
||||
- "home.admin/tor.install.sh"
|
||||
- "home.admin/blitz.i2pd.sh"
|
||||
- "home.admin/blitz.web.sh"
|
||||
- "home.admin/blitz.display.sh"
|
||||
- "ci/arm64-rpi/**"
|
||||
|
||||
jobs:
|
||||
arm64-rpi-image-build:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set values
|
||||
run: |
|
||||
echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
|
||||
echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV
|
||||
if [ -z "$GITHUB_HEAD_REF" ]; then
|
||||
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
|
||||
else
|
||||
echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Hello Raspiblitz
|
||||
run: echo "Building the raspiblitz-arm64-rpi-lean-image-${{ env.BUILD_DATE }}-${{ env.BUILD_VERSION }}"
|
||||
|
||||
- name: Run the build script
|
||||
run: |
|
||||
echo "Using the variables: --pack lean --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}} --image_link https://raspi.debian.net/tested/20230612_raspi_4_bookworm.img.xz --image_checksum a68cd2bfe7831c438d8a5d832803ae0db17afec9f3cd370d9e8748c7b5456283"
|
||||
cd ci/arm64-rpi
|
||||
bash packer.build.arm64-rpi.sh --pack lean --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}} --image_link https://raspi.debian.net/tested/20230612_raspi_4_bookworm.img.xz --image_checksum a68cd2bfe7831c438d8a5d832803ae0db17afec9f3cd370d9e8748c7b5456283
|
||||
|
||||
- name: Compute checksum of the raw image
|
||||
run: |
|
||||
cd ci/arm64-rpi
|
||||
sha256sum raspiblitz-arm64-rpi-lean.img > raspiblitz-arm64-rpi-lean.img.sha256
|
||||
|
||||
- name: Compress image
|
||||
run: |
|
||||
cd ci/arm64-rpi
|
||||
gzip -v9 raspiblitz-arm64-rpi-lean.img
|
||||
|
||||
- name: Compute checksum of the compressed image
|
||||
run: |
|
||||
cd ci/arm64-rpi
|
||||
sha256sum raspiblitz-arm64-rpi-lean.img.gz > raspiblitz-arm64-rpi-lean.img.gz.sha256
|
||||
|
||||
- name: Upload the image and checksums
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: raspiblitz-arm64-rpi--debian12-image-${{ env.BUILD_DATE }}-${{ env.BUILD_VERSION }}
|
||||
path: |
|
||||
${{ github.workspace }}/ci/arm64-rpi/raspiblitz-arm64-rpi-lean.img.sha256
|
||||
${{ github.workspace }}/ci/arm64-rpi/raspiblitz-arm64-rpi-lean.img.gz
|
||||
${{ github.workspace }}/ci/arm64-rpi/raspiblitz-arm64-rpi-lean.img.gz.sha256
|
99
.github/workflows/arm64-rpi-fatpack-image.yml
vendored
99
.github/workflows/arm64-rpi-fatpack-image.yml
vendored
@ -1,99 +0,0 @@
|
||||
name: arm64-rpi-fatpack-image-build
|
||||
|
||||
concurrency:
|
||||
group: arm64-rpi-fatpack-image-build-${{ github.head_ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
#push:
|
||||
# branches: [ "dev", "v1.8", "v1.9" ]
|
||||
# paths:
|
||||
# - 'build_sdcard.sh'
|
||||
# - 'home.admin/bitcoin.install.sh'
|
||||
# - 'home.admin/lnd.install.sh'
|
||||
# - 'home.admin/cl.install.sh'
|
||||
# - 'home.admin/cl-plugin.cln-grpc.sh'
|
||||
# - 'home.admin/tor.install.sh'
|
||||
# - 'home.admin/blitz.i2pd.sh'
|
||||
# - 'home.admin/blitz.web.sh'
|
||||
# - 'home.admin/bonus.nodejs.sh'
|
||||
# - 'home.admin/bonus.rtl.sh'
|
||||
# - 'home.admin/bonus.btcpayserver.sh'
|
||||
# - 'home.admin/bonus.thunderhub.sh'
|
||||
# - 'home.admin/bonus.jam.sh install'
|
||||
# - 'home.admin/bonus.mempool.sh'
|
||||
# - 'home.admin/blitz.web.api.sh'
|
||||
# - 'home.admin/blitz.web.ui.sh'
|
||||
# - 'home.admin/blitz.display.sh'
|
||||
# - 'ci/arm64-rpi/**'
|
||||
#pull_request:
|
||||
# branches: [ "dev", "v1.8", "v1.9" ]
|
||||
# paths:
|
||||
# - 'build_sdcard.sh'
|
||||
# - 'home.admin/bitcoin.install.sh'
|
||||
# - 'home.admin/lnd.install.sh'
|
||||
# - 'home.admin/cl.install.sh'
|
||||
# - 'home.admin/cl-plugin.cln-grpc.sh'
|
||||
# - 'home.admin/tor.install.sh'
|
||||
# - 'home.admin/blitz.i2pd.sh'
|
||||
# - 'home.admin/blitz.web.sh'
|
||||
# - 'home.admin/bonus.nodejs.sh'
|
||||
# - 'home.admin/bonus.rtl.sh'
|
||||
# - 'home.admin/bonus.btcpayserver.sh'
|
||||
# - 'home.admin/bonus.thunderhub.sh'
|
||||
# - 'home.admin/bonus.jam.sh install'
|
||||
# - 'home.admin/bonus.mempool.sh'
|
||||
# - 'home.admin/blitz.web.api.sh'
|
||||
# - 'home.admin/blitz.web.ui.sh'
|
||||
# - 'home.admin/blitz.display.sh'
|
||||
# - 'ci/arm64-rpi/**'
|
||||
|
||||
jobs:
|
||||
arm64-rpi-image-build:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set values
|
||||
run: |
|
||||
echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
|
||||
echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV
|
||||
if [ -z "$GITHUB_HEAD_REF" ]; then
|
||||
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
|
||||
else
|
||||
echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Hello Raspiblitz
|
||||
run: echo "Building the raspiblitz-arm64-rpi-fatpack-image-${{ env.BUILD_DATE }}-${{ env.BUILD_VERSION }}"
|
||||
|
||||
- name: Run the build script
|
||||
run: |
|
||||
echo "Using the variables: --pack fatpack --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}}"
|
||||
cd ci/arm64-rpi
|
||||
bash packer.build.arm64-rpi.sh --pack fatpack --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}}
|
||||
|
||||
- name: Compute checksum of the raw image
|
||||
run: |
|
||||
cd ci/arm64-rpi
|
||||
sha256sum raspiblitz-arm64-rpi-fatpack.img > raspiblitz-arm64-rpi-fatpack.img.sha256
|
||||
|
||||
- name: Compress image
|
||||
run: |
|
||||
cd ci/arm64-rpi
|
||||
gzip -v9 raspiblitz-arm64-rpi-fatpack.img
|
||||
|
||||
- name: Compute checksum of the compressed image
|
||||
run: |
|
||||
cd ci/arm64-rpi
|
||||
sha256sum raspiblitz-arm64-rpi-fatpack.img.gz > raspiblitz-arm64-rpi-fatpack.img.gz.sha256
|
||||
|
||||
- name: Upload the image and checksums
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: raspiblitz-arm64-fatpack-rpi-image-${{ env.BUILD_DATE }}-${{ env.BUILD_VERSION }}
|
||||
path: |
|
||||
${{ github.workspace }}/ci/arm64-rpi/raspiblitz-arm64-rpi-fatpack.img.sha256
|
||||
${{ github.workspace }}/ci/arm64-rpi/raspiblitz-arm64-rpi-fatpack.img.gz
|
||||
${{ github.workspace }}/ci/arm64-rpi/raspiblitz-arm64-rpi-fatpack.img.gz.sha256
|
48
.github/workflows/arm64-rpi-lean-image.yml
vendored
48
.github/workflows/arm64-rpi-lean-image.yml
vendored
@ -7,33 +7,34 @@ concurrency:
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: ["dev", "v1.8", "v1.9"]
|
||||
branches: ['dev', 'v1.10']
|
||||
paths:
|
||||
- "build_sdcard.sh"
|
||||
- "home.admin/bitcoin.install.sh"
|
||||
- "home.admin/tor.install.sh"
|
||||
- "home.admin/blitz.i2pd.sh"
|
||||
- "home.admin/blitz.web.sh"
|
||||
- "home.admin/blitz.display.sh"
|
||||
- "ci/arm64-rpi/**"
|
||||
- 'build_sdcard.sh'
|
||||
- 'home.admin/bitcoin.install.sh'
|
||||
- 'home.admin/tor.install.sh'
|
||||
- 'home.admin/blitz.i2pd.sh'
|
||||
- 'home.admin/blitz.web.sh'
|
||||
- 'home.admin/blitz.display.sh'
|
||||
- 'ci/arm64-rpi/**'
|
||||
pull_request:
|
||||
branches: ["dev", "v1.8", "v1.9"]
|
||||
branches: ['dev', 'v1.10']
|
||||
paths:
|
||||
- "build_sdcard.sh"
|
||||
- "home.admin/bitcoin.install.sh"
|
||||
- "home.admin/tor.install.sh"
|
||||
- "home.admin/blitz.i2pd.sh"
|
||||
- "home.admin/blitz.web.sh"
|
||||
- "home.admin/blitz.display.sh"
|
||||
- "ci/arm64-rpi/**"
|
||||
- 'build_sdcard.sh'
|
||||
- 'home.admin/bitcoin.install.sh'
|
||||
- 'home.admin/tor.install.sh'
|
||||
- 'home.admin/blitz.i2pd.sh'
|
||||
- 'home.admin/blitz.web.sh'
|
||||
- 'home.admin/blitz.display.sh'
|
||||
- 'ci/arm64-rpi/**'
|
||||
|
||||
jobs:
|
||||
arm64-rpi-image-build:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set values
|
||||
id: set_values
|
||||
run: |
|
||||
echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
|
||||
echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV
|
||||
@ -42,15 +43,20 @@ jobs:
|
||||
else
|
||||
echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
|
||||
fi
|
||||
if [[ "${{github.event_name}}" == "pull_request" ]]; then
|
||||
echo "GITHUB_USER=${{github.event.pull_request.head.repo.owner.login}}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "GITHUB_USER=$(echo ${{github.repository}} | cut -d'/' -f1)" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Hello Raspiblitz
|
||||
- name: Display the build name
|
||||
run: echo "Building the raspiblitz-arm64-rpi-lean-image-${{ env.BUILD_DATE }}-${{ env.BUILD_VERSION }}"
|
||||
|
||||
- name: Run the build script
|
||||
run: |
|
||||
echo "Using the variables: --pack lean --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}}"
|
||||
echo "Using the variables: --pack lean --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}}"
|
||||
cd ci/arm64-rpi
|
||||
bash packer.build.arm64-rpi.sh --pack lean --github_user $GITHUB_ACTOR --branch ${{env.BRANCH_NAME}}
|
||||
bash packer.build.arm64-rpi.sh --pack lean --github_user ${{steps.set_values.outputs.GITHUB_USER}} --branch ${{env.BRANCH_NAME}}
|
||||
|
||||
- name: Compute checksum of the raw image
|
||||
run: |
|
||||
@ -68,7 +74,7 @@ jobs:
|
||||
sha256sum raspiblitz-arm64-rpi-lean.img.gz > raspiblitz-arm64-rpi-lean.img.gz.sha256
|
||||
|
||||
- name: Upload the image and checksums
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: raspiblitz-arm64-rpi-image-${{ env.BUILD_DATE }}-${{ env.BUILD_VERSION }}
|
||||
path: |
|
||||
|
20
.github/workflows/spelling.yml
vendored
Normal file
20
.github/workflows/spelling.yml
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
name: Spelling
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: ['dev', 'v1.10', 'v1.11']
|
||||
pull_request:
|
||||
branches: ['dev', 'v1.10', 'v1.11']
|
||||
|
||||
jobs:
|
||||
spelling:
|
||||
name: Spell Check with Typos
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Actions Repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Spell Check Repo
|
||||
uses: crate-ci/typos@master
|
||||
with:
|
||||
config: typos.toml
|
38
.github/workflows/test-bats.yml
vendored
Normal file
38
.github/workflows/test-bats.yml
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
name: Test bats
|
||||
|
||||
concurrency:
|
||||
group: test-bats-${{ github.head_ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: ["dev"]
|
||||
paths:
|
||||
- "home.admin/config.scripts/bonus.postgresql.sh"
|
||||
pull_request:
|
||||
branches: ["dev"]
|
||||
paths:
|
||||
- "home.admin/config.scripts/bonus.postgresql.sh"
|
||||
|
||||
jobs:
|
||||
run-bats-tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install bats
|
||||
run: |
|
||||
sudo apt update &>/dev/null
|
||||
sudo apt install -y bats
|
||||
|
||||
- name: Run the bats tests with postgresql 15
|
||||
run: |
|
||||
cd test
|
||||
sudo bats ./bonus.postgresql-15.bats
|
||||
|
||||
- name: Run the bats tests with postgresql 13
|
||||
run: |
|
||||
cd test
|
||||
sudo bats ./bonus.postgresql-13.bats
|
64
CHANGES.md
64
CHANGES.md
@ -1,3 +1,62 @@
|
||||
## What's new in Version 1.11.1 of RaspiBlitz?
|
||||
|
||||
- New: Set Timezone SSHMENU > SYSTEM > TIME [details](https://github.com/raspiblitz/raspiblitz/issues/1712)
|
||||
- New: Labelbase 2.2.1 [details](https://x.com/labelbase_space)
|
||||
- New: Redesign WebUI Setup & Recovery
|
||||
- Update: amd64 base image: debian-12.6.0-amd64-netinst.iso
|
||||
- Update: LNbits 0.12.8 [details](https://github.com/lnbits/lnbits/releases/tag/0.12.8)
|
||||
- Update: Specter Desktop 2.0.4 with reactivated UPDATE option [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v2.0.4)
|
||||
- Update: BTCPayServer 1.13.0 [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.13.0)
|
||||
- Update: acme.sh 3.0.7 (repair duckdns.org dyndns)
|
||||
- Update: show progress of electrs building index on LCD
|
||||
- Update: lndmanage 0.16.0 [details](https://github.com/bitromortac/lndmanage)
|
||||
- Update: Lightning Terminal v0.12.5-alpha [details](https://github.com/lightninglabs/lightning-terminal/releases/tag/v0.12.5-alpha)
|
||||
- Update: PyBlock 2.7.2 [details](https://github.com/curly60e/pyblock/blob/master/README.md)
|
||||
- Update: Bitcoin Core 27.1 (as tested update) [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-27.1.md)
|
||||
- Experimental: charge-lnd install script [details](https://github.com/raspiblitz/raspiblitz/discussions/3955)
|
||||
- Experimental: config.scripts/lnd.signaddress.sh to easy sign messages on addresses on LND [details](https://github.com/raspiblitz/raspiblitz/issues/4540)
|
||||
- Experimental: config.scripts/bonus.elements.sh install elements blockchain platform [details](https://github.com/ElementsProject/elements)
|
||||
- Deprecated: Sphinx-Relay [details](https://github.com/raspiblitz/raspiblitz/issues/2558)
|
||||
- Remove: AutoPilot & Keysend from SSH menus [details](https://github.com/raspiblitz/raspiblitz/issues/1953#issuecomment-1811553602)
|
||||
- Remove: Tallycoin-Connect [see service shutdown](https://x.com/djbooth007/status/1784409117563720082)
|
||||
- Remove: IP2Tor Shoplist [details](https://github.com/raspiblitz/raspiblitz/issues/4589)
|
||||
- Remove: CopyStation Script [details](https://github.com/raspiblitz/raspiblitz/issues/4538)
|
||||
|
||||
## What's new in Version 1.11.0 of RaspiBlitz?
|
||||
|
||||
- New: RaspberryPi5 tested & enabling NVMe PCIe Hats
|
||||
- New: BTCPay Server PostgreSQL database backup and restore options [details](https://github.com/raspiblitz/raspiblitz/pull/4409)
|
||||
- New: Reset option for the self-signed TLS certificate [details](https://github.com/raspiblitz/raspiblitz/pull/4412)
|
||||
- New on WebUI: Electrum Connect Screen
|
||||
- Update: RaspberryOS arm64 base image 2024-03-15 (Debian 12 Bookworm) [details](https://downloads.raspberrypi.com/raspios_full_arm64/release_notes.txt)
|
||||
- Update: amd64 base image: debian-12.5.0-amd64-netinst.iso
|
||||
- Update: Bitcoin Core v26.0 [details](https://bitcoincore.org/en/releases/26.0/)
|
||||
- Update: LND v0.17.3-beta [details](https://github.com/lightningnetwork/lnd/releases/tag/v0.17.3-beta)
|
||||
- Update: Core Lightning v24.02.1 [details](https://github.com/ElementsProject/lightning/releases/tag/v24.02.1)
|
||||
- Update: C-lightningREST v0.10.7 [details](https://github.com/Ride-The-Lightning/c-lightning-REST/releases/tag/v0.10.7)
|
||||
- Update: Electrum Server in Rust (electrs) v0.10.4 [details](https://github.com/romanz/electrs/blob/master/RELEASE-NOTES.md#0104-mar-15-2024)
|
||||
- Update: Fulcrum Electrum server v1.10.0 (CLI install script) [details](https://github.com/cculianu/Fulcrum/releases/tag/v1.10.0)
|
||||
- Update: BTC-RPC-Explorer v3.4.0 [details](https://github.com/janoside/btc-rpc-explorer/blob/master/CHANGELOG.md#v340)
|
||||
- Update: JoinMarket v0.9.11 [details](https://github.com/JoinMarket-Org/joinmarket-clientserver/releases/tag/v0.9.11)
|
||||
- Update: Jam (JoinMarket Web UI) v0.2.0 [details](https://github.com/joinmarket-webui/jam/releases/tag/v0.2.0)
|
||||
- Update: JoininBox v0.8.3 [details](https://github.com/openoms/joininbox/releases/tag/v0.8.3)
|
||||
- Update: RTL v0.14.1 [details](https://github.com/Ride-The-Lightning/RTL/releases/tag/v0.14.1)
|
||||
- Update: Thunderhub v0.13.30 [details](https://github.com/apotdevin/thunderhub/releases/tag/v0.13.30)
|
||||
- Update: CLBOSS 0.13+ (latest master 0673c50) [details](https://github.com/ZmnSCPxj/clboss/releases/tag/v0.13)
|
||||
- Update: BTCPayServer v1.12.5 [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.12.5)
|
||||
- Update: Channel Tools (chantools) v0.12.0 [details](https://github.com/lightninglabs/chantools/releases/tag/v0.12.0)
|
||||
- Update: LNbits 0.11.3 [details](https://github.com/lnbits/lnbits/releases/tag/0.11.3)
|
||||
- Update: Circuitbreaker v0.5.1 [details](https://github.com/lightningequipment/circuitbreaker/blob/master/README.md)
|
||||
- Update: LNDg v1.8.0 [details](https://github.com/cryptosharks131/lndg/releases/tag/v1.8.0)
|
||||
- Update: Balance of Satoshis v17.9.1 [details](https://www.npmjs.com/package/balanceofsatoshis/v/17.9.1)
|
||||
- Experimental: LNDK (runs on top of LND to help forward onion messages (BOLT 12)) [details](https://github.com/lndk-org/lndk)
|
||||
- Fix: PyBlock 2.2.3 [details](https://github.com/curly60e/pyblock/blob/master/README.md)
|
||||
- Refactor: Wifi config with file on sd card
|
||||
- Deactivated for Repair: lnproxy [details](https://github.com/raspiblitz/raspiblitz/issues/4122)
|
||||
- Deprecated: Homer Dashboard (remove from SSH menus, config script will stay with possible future removal)
|
||||
- Deprecated: Bitcoinminds (remove from SSH menus, config script will stay with possible future removal)
|
||||
- Remove: ItchySats (unmaintained project / in consent with dev)
|
||||
|
||||
## What's new in Version 1.10.0 of RaspiBlitz?
|
||||
|
||||
- Update: RaspiOS base image from 2023-05-03
|
||||
@ -12,7 +71,7 @@
|
||||
- Update: Channel Tools (chantools) v0.11.3 [details](https://github.com/guggero/chantools/releases/tag/v0.11.3)
|
||||
- Update: LNDg v1.7.0 [details](https://github.com/cryptosharks131/lndg)
|
||||
- Update: Thunderhub v0.13.19 [details](https://github.com/apotdevin/thunderhub/releases/tag/v0.13.19)
|
||||
- Update: LNbits 0.10.9 [details](https://github.com/lnbits/lnbits/releases/tag/0.10.9)
|
||||
- Update: LNbits 0.10.10 [details](https://github.com/lnbits/lnbits/releases/tag/0.10.10)
|
||||
- Update: BTCPayServer 1.10.3 (postgres by default with sqlite migration) [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.10.3)
|
||||
- Update: Specter Desktop 1.13.1 [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v1.13.1)
|
||||
- Update: Kindle-Display 0.5.1 [details](https://github.com/dennisreimann/kindle-display/)
|
||||
@ -44,7 +103,7 @@
|
||||
- Update: Core Lightning v23.02.2 [details](https://github.com/ElementsProject/lightning/releases/tag/v23.02.2)
|
||||
- Update: C-lightningREST v0.10.2 [details](https://github.com/Ride-The-Lightning/c-lightning-REST/releases/tag/v0.10.2)
|
||||
- Update: Electrum Server in Rust (electrs) v0.9.11 [details](https://github.com/romanz/electrs/blob/master/RELEASE-NOTES.md#0911-jan-5-2023)
|
||||
- Update: Lightning Terminal v0.9.2-alpha [details](https://github.com/lightninglabs/lightning-terminal/releases/tag/v0.9.2-alpha)
|
||||
- Update: Lightning Terminal v0.8.6-alpha [details](https://github.com/lightninglabs/lightning-terminal/releases/tag/v0.8.6-alpha)
|
||||
- Update: RTL v0.13.6 with update option [details](https://github.com/Ride-The-Lightning/RTL/releases/tag/v0.13.6)
|
||||
- Update: Thunderhub v0.13.16 with balance sharing disabled [details](https://github.com/apotdevin/thunderhub/releases/tag/v0.13.16)
|
||||
- Update: LNbits 0.10.6 [details](https://github.com/lnbits/lnbits/releases/tag/0.10.6)
|
||||
@ -426,4 +485,3 @@ Version 1.1 packs some first fixes and enhancements to make the RaspiBlitz more
|
||||
- Removed: FTP download option for blockchain
|
||||
|
||||
For full details see issue list of [Release 1.1 Milestone](https://github.com/rootzoll/raspiblitz/milestone/3?closed=1).
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
# Community development
|
||||
|
||||
Everybody is welcome to join, improve, and extend the RaspiBlitz - it's a work in progress. Check the issues if you wanna help out or add new ideas. You can find the scripts used for RaspiBlitz interactions on the device at /home/admin or in this Git repo's subfolder home.admin.
|
||||
|
||||
## Understanding Blitz project
|
||||
|
||||
RaspiBlitz is inspired by the [RaspiBolt guide](https://raspibolt.github.io/raspibolt/). Tutorial on how to build a lightning node on the RaspberryPi. So much thx to Stadicus :)
|
||||
To start your Deep Dive into the RaspiBlitz project, watch [this video](https://www.youtube.com/watch?v=QXUGg45CWLo).
|
||||
|
||||
@ -12,23 +14,28 @@ To start your Deep Dive into the RaspiBlitz project, watch [this video](https://
|
||||
* Be sure to contribute back, every little help is wanted.
|
||||
|
||||
## Getting started
|
||||
|
||||
Get all details on "How to contribute to RaspiBlitz Development" on [this video](https://www.youtube.com/watch?v=ZVtZepV3OfM).
|
||||
|
||||
### Levels
|
||||
|
||||
All levels are important. Even advanced users help on basic levels for other Blitzers. Every help is welcome.
|
||||
Not all enhancements needs to go through all levels, these are levels of difficulty, scalability depends on your skills.
|
||||
|
||||
#### Basic
|
||||
|
||||
1. **Reporting user side** --> Open an issue to indicate a problem or make a feature request.
|
||||
1. **Community support** --> Solve other people issues.
|
||||
1. **Good first issue** --> The purpose of the good first issue label is to highlight which issues are suitable for a new contributor without a deep understanding of the codebase.
|
||||
|
||||
#### Medium
|
||||
|
||||
1. **Sovereignty** --> Fork the repo to have the changes controlled by you.
|
||||
1. **Experiment** --> Try things out on your RaspiBlitz.
|
||||
1. **Executable** --> Turn your experiment into a basic shell script.
|
||||
|
||||
#### Advanced
|
||||
|
||||
1. **Config script** --> Integrate your executable into the RaspiBlitz environment.
|
||||
1. **SSH-GUI** --> Make it easier for others to use your config script.
|
||||
1. **WEB-GUI** --> Turn your feature into customer ready
|
||||
|
246
FAQ.dev.md
246
FAQ.dev.md
@ -1,246 +0,0 @@
|
||||
## FAQ Development
|
||||
|
||||
### What is the process of creating a new SD card image release?
|
||||
|
||||
Checklist before making a SD card image release:
|
||||
|
||||
* "Versioning" number is upfates in your RaspiBlitz Source Code (_version.info)
|
||||
* Latest code is merged in release branch
|
||||
|
||||
Creating the base minimal sd card:
|
||||
|
||||
* Start [`Ubuntu LIVE`](http://releases.ubuntu.com/18.04.3/ubuntu-18.04.3-desktop-amd64.iso) from USB stick
|
||||
* Under Settings: best to set correct keyboard language & power settings to prevent monitor turn off
|
||||
* Connect to a secure WiFi (hardware switch on) or LAN
|
||||
* Download the latest RaspiOS-64bit (zip/xz & sig file) namend in the [build_sdcard.sh](./build_sdcard.sh) and note the SHA256 checksum
|
||||
* From the browser `Show All Downloads` and from the context menu select `Open Containing Folder`
|
||||
* On that file manager open context (right click) on the white-space and select `Open in Terminal`
|
||||
* Compare the checksum with the one you just made note of, using `shasum -a 256 *.zip`
|
||||
* Check signature: `wget https://www.raspberrypi.org/raspberrypi_downloads.gpg.key && gpg --import ./raspberrypi_downloads.gpg.key && gpg --verify *.sig`
|
||||
* The result should say "correct signature" and the fingerprint should end with `8738 CD6B 956F 460C`
|
||||
* Insert an NTFS formatted USB stick and use the file manager to move all files to the USB
|
||||
* If image is an ZIP file use in file manager context on NTFS USB stick `extract here` to unzip
|
||||
* Download script for later with `curl https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh > pishrink.sh`
|
||||
* Connect SD card reader with a SD card (16GB recommended)
|
||||
* In the file manager open context on the .img-file, select `Open With Disk Image Writer` and write the image to the SD card
|
||||
* In the file manager open context on `boot` drive free space `open in terminal`
|
||||
* Run the commands `touch ssh`
|
||||
* Run the command: `echo "pi:\$6\$TE7HmruYY9EaNiKP\$Vz0inJ6gaoJgJvQrC5z/HMDRMTN2jKhiEnG83tc1Jsw7lli5MYdeA83g3NOVCsBaTVW4mUBiT/1ZRWYdofVQX0" > userconf` and `exit`
|
||||
* Eject the `boot` and the `NTFS` volume
|
||||
* Connect a RaspiBlitz (without HDD) to network, insert sd card and power up
|
||||
* Find the IP of the RaspiBlitz (arp -a or check router)
|
||||
* In terminal `ssh pi@[IP-OF-RASPIBLITZ]`
|
||||
* Password is `raspberry`
|
||||
* Run the following command BUT REPLACE `[BRANCH]` with the branch-string of your latest version
|
||||
* To run the minimal pack: `wget --no-cache https://raw.githubusercontent.com/raspiblitz/raspiblitz/[BRANCH]/build_sdcard.sh && sudo bash build_sdcard.sh -u raspiblitz -b [BRANCH] -f 0 -d headless`
|
||||
* Monitor/Check outputs for warnings/errors
|
||||
* Login new with `ssh admin@[IP-OF-RASPIBLITZ]` (pw: raspiblitz) and run `release`
|
||||
* Disconnect WiFi/LAN on build laptop (hardware switch off) and shutdown
|
||||
* Remove `Ubuntu LIVE` USB stick and cut power from the RaspberryPi
|
||||
|
||||
Creating the image of sd card:
|
||||
|
||||
* Connect USB stick with latest `TAILS` (make it stay offline)
|
||||
* Boot Tails with extra setting of Admin-Passwort and remember (use later for sudo)
|
||||
* Menu > Systemtools > Settings > Energy -> best to set monitor to never turn off
|
||||
* Connect USB stick with GPG signing keys - decrypt drive if needed
|
||||
* Open Terminal and cd into directory of USB Stick under `/media/amnesia`
|
||||
* Run `gpg --import ./sub.key`, check and `exit`
|
||||
* Disconnect USB stick with GPG keys
|
||||
* Take the SD card from the RaspberryPi and connect with an external SD card reader to the laptop
|
||||
* Click on `boot` volume once in the file manger
|
||||
* Connect the NTFS USB stick, open in file manager and delete old files
|
||||
* To make a raw image from sd card - second way (UI with progress):
|
||||
* Search "Laufwerke" or "Drives" on Tails Apps
|
||||
* Create image named `raspiblitz.img` to USB storage
|
||||
* Open Terminal and cd into directory of NTFS USB stick under `/media/amnesia`
|
||||
* `shasum -a 256 ./pishrink.sh` should be `e46e1e1e3c6e3555f9fff5435e2305e99b98aaa8dc28db1814cf861fbb472a69`
|
||||
* `chmod +x ./pishrink.sh | sudo ./pishrink.sh ./raspiblitz.img`
|
||||
* `gzip -c ./raspiblitz.img > ./raspiblitz-min/fat-vX.X.X-YEAR-MONTH-DAY.img.gz`
|
||||
* `shasum -a 256 ./raspiblitz-min/fat-vX.X.X-YEAR-MONTH-DAY.img.gz > ./raspiblitz-min/fat-vX.X.X-YEAR-MONTH-DAY.img.gz.sha`
|
||||
* make analog copy/note of checksum
|
||||
* Sign with `gpg --output raspiblitz-min/fat-vX.X.X-YEAR-MONTH-DAY.img.gz.sig --detach-sign raspiblitz-min/fat-vX.X.X-YEAR-MONTH-DAY.img.gz`
|
||||
|
||||
Prepare template for subversion update later:
|
||||
|
||||
* `mv ./raspiblitz.img ./raspiblitz-min-vX.X.X.img`
|
||||
* `shasum -a 256 ./raspiblitz-min-vX.X.img > ./raspiblitz-min-vX.X.X.img.sha`
|
||||
* make analog copy/note of checksum
|
||||
|
||||
Creating a fatpack sd card from the minimal image:
|
||||
|
||||
* Start TAILS live image
|
||||
* On NTFS USB Stick (Open in Terminal) check hash of raspiblitz-min-vX.X.X.img wit analog note:
|
||||
* `shasum -a 256 ./raspiblitz-min-vX.X.X.img`
|
||||
* Right-Click the file and write to a min 32GB sd card
|
||||
* On `bootfs` in FileManger (Open in Terminal):
|
||||
* `touch stop` & `exit` terminal
|
||||
* Shutdown TAILS & eject sd card
|
||||
* Bootup UBUNTU LIVE
|
||||
* Connect a RaspiBlitz (without HDD) to network, insert sd card and power up
|
||||
* Find the IP of the RaspiBlitz (arp -a or check router)
|
||||
* In terminal `ssh admin@[IP-OF-RASPIBLITZ]`
|
||||
* Update to latest code with `patch code`
|
||||
* the following only if its a `fatpack`:
|
||||
* run command `fatpack`
|
||||
* if it reboot, ssh in again & again run command `fatpack`
|
||||
* check that script ended without errors
|
||||
* do the creation & signing of the image file like in chapter above
|
||||
|
||||
Publishing the images:
|
||||
|
||||
* Connect the NTFS USB stick to MacOS (it is just read-only)
|
||||
* Run tests on the new image
|
||||
* Upload the new image to the Download Server - put sig-file next to it
|
||||
* Copy SHA256-String into GitHub README and update the download link
|
||||
* Create Torrent file from image (for example with Transmission) and place in in the `home.admin/assets` folder & link on README
|
||||
|
||||
This is a recommended tracker list to be used with the torrent:
|
||||
```
|
||||
udp://tracker.coppersurfer.tk:6969/announce
|
||||
http://tracker.yoshi210.com:6969/announce
|
||||
http://open.acgtracker.com:1096/announce
|
||||
http://tracker.skyts.net:6969/announce
|
||||
udp://9.rarbg.me:2780/announce
|
||||
http://tracker2.itzmx.com:6961/announce
|
||||
udp://exodus.desync.com:6969/announce
|
||||
http://pow7.com:80/announce
|
||||
udp://tracker.leechers-paradise.org:6969
|
||||
```
|
||||
|
||||
### Versioning
|
||||
|
||||
* Major Updates: 1.0.0, 2.0.0, 3.0.0, ... are epic updates signaling that the software reached a new era.
|
||||
* Main Updates: 1.1.0, 1.2.0, 1.3.0, ... are release updates - the reflashing of the sd ard is mandatory.
|
||||
* Minor Updates: 1.3.0, 1.3.1, 1.3.2, ... are patch updates - can be done by 'patching' the scripts & code, but new sd card reflash is still advised.
|
||||
|
||||
Every release has its own branch: `v1.9`, `v1.10`, `v1.11` .. this way hot patches can be merged into the release branch and people update with the `patch code` command
|
||||
|
||||
### How can I customize my RaspiBlitz or add other software?
|
||||
|
||||
The RaspiBlitz is your computer to experiment with. Feel free to add your own scripts, edit the system or install further software from the command line. Just keep in mind that after an update/recovery the RaspiBlitz starts with a fresh and clean operating system again. So all your editings and installs might be gone. To prevent this you should do the following:
|
||||
|
||||
- place your own scripts and data that should survive an update/recovery into the `/mnt/hdd/app-data` directory
|
||||
- put all install commands & modification of the system into the script `/mnt/hdd/app-data/custom-installs.sh` which will be started automatically on a recovery/update.
|
||||
|
||||
### GitHub Workflow
|
||||
|
||||
- Development is done on the 'dev' branch, new features should be done on single feature branches and merged into 'dev' once ready.
|
||||
- When a release of a new main-update (see above) comes closer, a new release branch gets created from 'dev' with the first release candidate - the RCs and the final release sd card will be build from this branch.
|
||||
- All minor-releases will basically all work with the same 'build_sdcard.sh' script so that the code could be updated by just calling 'patch'. Emergency updates on lnd & bitcoin may break this guideline, but basic structure & packaging should stay mostly consistent over a main-update version.
|
||||
- Once a release is ready, that release branch will be set as the "default" branch on GitHub (so its shown as main page)
|
||||
- Hot fixes & new features for minor versions will be created as single branches from the release branch, and once ready will be merged back into that release branch as a Pull Request using 'Squash-Merge' AND then, this 'Squash-Merge' (one single commit) will get cherry-picked into the 'dev' branch ('git cherry-pick COMMITHASH' - may call 'git fetch' & 'git pull' before to make a clean cherry-pick into dev).
|
||||
|
||||
### Can I run RaspiBlitz on other computers than RaspberryPi?
|
||||
|
||||
There is an experimental section in this GitHub that tries to build for other SingleBoardComputers. Feel free to try it out and share your experience: [alternative.platforms/README.md](alternative.platforms/README.md)
|
||||
|
||||
### How can I build an SD card from another branch?
|
||||
|
||||
There might be new, but not released features in development that are not yet in the default version branch - but you want to try them out.
|
||||
|
||||
To build a SD card image from another branch than master, you follow the [Build the SD Card Image](README.md#build-the-sd-card-image) from the README, but execute the build script from the other branch and add the name of that branch as a parameter to the build script.
|
||||
|
||||
For example if you want to make a build from the 'dev' branch you execute the following command:
|
||||
|
||||
`wget --no-cache https://raw.githubusercontent.com/raspiblitz/raspiblitz/dev/build_sdcard.sh && sudo bash build_sdcard.sh -b dev`
|
||||
|
||||
If you want to see all the optional parameters for building your sd card, just answere `no` on first question and call `sudo bash build_sdcard.sh --help`.
|
||||
|
||||
### How can I build an SD card from my forked GitHub Repo?
|
||||
|
||||
If you fork the RaspiBlitz repo (much welcome) and you want to run that code on your RaspiBlitz, there are two ways to do that:
|
||||
|
||||
* The quick way: For small changes in a single script, go to `/home/admin` on your running RaspiBlitz, delete the old git with `sudo rm -r raspiblitz` then replace it with your code `git clone [YOURREPO]` and `patch`
|
||||
|
||||
* The long way: If you like to install/remove/change services and system configurations you need to build a SD card from your own code. Prepare like in [Build the SD Card Image](README.md#build-the-sd-card-image) from the README but in the end run the command:
|
||||
|
||||
`wget --no-cache https://raw.githubusercontent.com/[GITHUB-USERNAME]/raspiblitz/[BRANCH]/build_sdcard.sh && sudo bash build_sdcard.sh -b [BRANCH]`
|
||||
|
||||
If you are then working in your forked repo and want to update the scripts on your RaspiBlitz with your latest repo changes, run `patch` - That's OK as long as you don't make changes to the SD card build script - for that you would need to build a fresh SD card again from your repo.
|
||||
|
||||
### How can I checkout a new branch from the RaspiBlitz repo to my forked repo?
|
||||
|
||||
You need to have your forked repo checked-out on your laptop. There your should see your forked repo as `origin` when you run `git remote -v`. If you don't see an additional `upstream` remote yet, then create it with the following command: `git remote add upstream https://github.com/raspiblitz/raspiblitz.git`.
|
||||
|
||||
So, first checkout the new branch named `BRANCH` from the original RaspBlitz repo to your local computer with: `git fetch upstream` and then `git checkout -b BRANCH upstream/BRANCH`.
|
||||
|
||||
Now push the new branch to your forked GitHub repo with `git push -u origin BRANCH`.
|
||||
|
||||
Once the branch is available and synced between the RaspiBlitz GitHub repo, your forked GitHub repo and your local computer git repo, you can start developing.
|
||||
|
||||
### How can I sync a branch of my forked GitHub with my local RaspiBlitz?
|
||||
|
||||
Since v1.5 of RaspiBlitz there has been an easy way thru the SSH menus: Under `MAIN MENU > UPDATE > PATCH` you have the option to change the GitHub repository and and branch to sync with. You change the GitHub Repository by setting the GitHub username where you forked the Repo.
|
||||
|
||||
So for example: If you forked the RaspiBlitz project (raspiblitz/raspiblitz) on GitHub and your GitHub project page is now called: https://github.com/raumi75/raspiblitz ... then just change the repo to sync/patch with to your username `raumi75`.
|
||||
|
||||
Now you can use the `Patch/Sync RaspiBlitz with GitHub Repo` to easily keep your RaspiBlitz in sync with your forked repository and develop your own customizations and features.
|
||||
|
||||
Background info and doing it manually:
|
||||
|
||||
There is a git copy of the original RaspiBlitz GitHub repo on your physical RaspiBlitz in the folder `/home/admin/raspiblitz`. If you change into that folder and run `git remote -v` you can see the set origin repo.
|
||||
|
||||
You need to change that origin repo to your forked repo. You do that with:
|
||||
```
|
||||
git remote set-url origin [THE-URL-OF-YOUR-FORKED-REPO]
|
||||
```
|
||||
|
||||
Now to sync your branch namend BRANCH on your forked repo with your RaspiBlitz, you always just run:
|
||||
```
|
||||
/home/admin/config.scripts/blitz.github.sh BRANCH
|
||||
```
|
||||
|
||||
So your workflow can go like this: You write code on your local computer. Commit to your local repo, push it to your forked repo and use the sync-script above to get the code to your RaspiBlitz.
|
||||
|
||||
### How to add an app to the RaspiBlitz?
|
||||
|
||||
To add your app you can fork the raspiblitz repo, follow the `/home.admin/config.scripts/bonus.template.sh` script [see code](https://github.com/raspiblitz/raspiblitz/blob/dev/home.admin/config.scripts/bonus.template.sh), copy/adapt it, test it on your RaspiBlitz and make a PR back to the main repo.
|
||||
|
||||
### How contribute a feature/change from my forked branch back to the RaspiBlitz repo?
|
||||
|
||||
In the same way as described above, you can build a new feature or test a change. Once you have something ready that you want to contribute back, you make sure it's pushed to your forked GitHub repo, and then start a pull request from your forked repo to the RaspiBlitz repo.
|
||||
|
||||
See more info: https://yangsu.github.io/pull-request-tutorial/
|
||||
|
||||
### How can I help testing a Pull Request?
|
||||
|
||||
Make sure to have the correct base image.
|
||||
Then go to the command line and create a branch for the PR:
|
||||
|
||||
```
|
||||
cd /home/admin/raspiblitz
|
||||
git fetch origin pull/[PRNUMBER]/head:pr[PRNUMBER]
|
||||
git checkout pr[PRNUMBER]
|
||||
cd /home/admin
|
||||
/home/admin/config.scripts/blitz.github.sh -justinstall
|
||||
```
|
||||
|
||||
Now you have the code of the PR active - depending on what scripts are changed you might need to reboot.
|
||||
|
||||
To change back to the code:
|
||||
```
|
||||
/home/admin/config.scripts/blitz.github.sh master
|
||||
```
|
||||
|
||||
### How can I push changes to an existing Pull Request?
|
||||
|
||||
See article: https://tech.sycamore.garden/add-commit-push-contributor-branch-git-github .. only works if your a contributor on raspiblitz repo.
|
||||
|
||||
### How to cherry-pick with branch protections & CODEOWNERS file?
|
||||
|
||||
Chery-picking patch PRs from dev to a release-branch like 'v1.8' (for example) is now a bit more complicated. Either an admin switches temorarly the branch protection "require a pull request before merging" setting off for the `git cherry-pick` OR we create a `p1.8` branch from `v1.8`, cherry-pick the squashed patch PR into that unprotected `p1.8` and then open a PR back to `v1.8`.
|
||||
|
||||
But what we gain is that better branch protection and we can add more contributors to the project that are allowed to manage issues - like adding labels or closing.
|
||||
|
||||
### How to run the automatic amd64 build on a VM on OSX?
|
||||
|
||||
just notes so far:
|
||||
|
||||
https://brew.sh
|
||||
brew install qemu
|
||||
https://github.com/raspiblitz/raspiblitz/actions --> download amd64-lean image
|
||||
double unzip until `qcow2` file
|
||||
convert `qcow2` to `vdi:
|
||||
qemu-img convert -f qcow2 raspiblitz-amd64-debian-lean.qcow2 -O vdi raspiblitz-amd64-debian-lean.vdi
|
||||
https://www.virtualbox.org/wiki/Downloads
|
827
FAQ.md
827
FAQ.md
@ -1,827 +0,0 @@
|
||||
<!-- omit in toc -->
|
||||
# FAQ - Frequently Asked Questions
|
||||
|
||||
---
|
||||
Table of Contents
|
||||
---
|
||||
- [Table of Contents](#table-of-contents)
|
||||
- [Upgrade](#upgrade)
|
||||
- [How to verify the SD card image after download?](#how-to-verify-the-sd-card-image-after-download)
|
||||
- [What changed on every upgrade?](#what-changed-on-every-upgrade)
|
||||
- [How do I upgrade my RaspiBlitz?](#how-do-i-upgrade-my-raspiblitz)
|
||||
- [Why do I need to re-burn my SD card for an update?](#why-do-i-need-to-re-burn-my-sd-card-for-an-update)
|
||||
- [How can I update LND or bitcoind even before the next RaspiBlitz update?](#how-can-i-update-lnd-or-bitcoind-even-before-the-next-raspiblitz-update)
|
||||
- [SSH](#ssh)
|
||||
- [What to do when on SSH I see "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!"](#what-to-do-when-on-ssh-i-see-warning-remote-host-identification-has-changed)
|
||||
- [How do I unplug/shutdown safely without SSH](#how-do-i-unplugshutdown-safely-without-ssh)
|
||||
- [I cannot connect via SSH to my RaspiBlitz. What do I do?](#i-cannot-connect-via-ssh-to-my-raspiblitz-what-do-i-do)
|
||||
- [How to SSH over Tor?](#how-to-ssh-over-tor)
|
||||
- [How to setup port-forwarding with a SSH tunnel?](#how-to-setup-port-forwarding-with-a-ssh-tunnel)
|
||||
- [How do I setup just a port-forwarding user on my public server?](#how-do-i-setup-just-a-port-forwarding-user-on-my-public-server)
|
||||
- [How to reset the ssh config and keys?](#how-to-reset-the-ssh-config-and-keys)
|
||||
- [Display](#display)
|
||||
- [Can I flip the screen?](#can-i-flip-the-screen)
|
||||
- [How to fix my upside down LCD after update?](#how-to-fix-my-upside-down-lcd-after-update)
|
||||
- [Can I run the RaspiBlitz without a display/LCD?](#can-i-run-the-raspiblitz-without-a-displaylcd)
|
||||
- [How do I find the IP address when running without a display?](#how-do-i-find-the-ip-address-when-running-without-a-display)
|
||||
- [Debug](#debug)
|
||||
- [I have the full blockchain on another storage. How do I copy it to the RaspiBlitz?](#i-have-the-full-blockchain-on-another-storage-how-do-i-copy-it-to-the-raspiblitz)
|
||||
- [How do I generate a Debug Report?](#how-do-i-generate-a-debug-report)
|
||||
- [Why is my "final sync" taking so long?](#why-is-my-final-sync-taking-so-long)
|
||||
- [How do I backup my Lightning Node?](#how-do-i-backup-my-lightning-node)
|
||||
- [1) Securing your On-Chain- and Channel-Funds during Operation](#1-securing-your-on-chain--and-channel-funds-during-operation)
|
||||
- [2) Making a complete LND data backup](#2-making-a-complete-lnd-data-backup)
|
||||
- [How can I recover my coins from a failing RaspiBlitz?](#how-can-i-recover-my-coins-from-a-failing-raspiblitz)
|
||||
- [1) Recover LND data](#1-recover-lnd-data)
|
||||
- [2) Recover from Wallet Seed](#2-recover-from-wallet-seed)
|
||||
- [How do I move funds \& channels from RaspiBlitz to LND Lightning Desktop App?](#how-do-i-move-funds--channels-from-raspiblitz-to-lnd-lightning-desktop-app)
|
||||
- [How do I change the Name/Alias of my lightning node](#how-do-i-change-the-namealias-of-my-lightning-node)
|
||||
- [How do I change the public port LND/Lightning node is running on?](#how-do-i-change-the-public-port-lndlightning-node-is-running-on)
|
||||
- [How do I solve a "signature mismatch after caveat verification" error?](#how-do-i-solve-a-signature-mismatch-after-caveat-verification-error)
|
||||
- [Why is my node not routing?](#why-is-my-node-not-routing)
|
||||
- [When using Auto-Unlock, how much security do I lose?](#when-using-auto-unlock-how-much-security-do-i-lose)
|
||||
- [I connected my HDD but it still says 'Connect HDD' on the display?](#i-connected-my-hdd-but-it-still-says-connect-hdd-on-the-display)
|
||||
- [How do I shrink the QR code for connecting my Shango/Zap/Zeus mobile phone?](#how-do-i-shrink-the-qr-code-for-connecting-my-shangozapzeus-mobile-phone)
|
||||
- [Why is my bitcoin IP on the display red?](#why-is-my-bitcoin-ip-on-the-display-red)
|
||||
- [Why is my node address on the display red?](#why-is-my-node-address-on-the-display-red)
|
||||
- [Why is my node address on the display yellow (not green)?](#why-is-my-node-address-on-the-display-yellow-not-green)
|
||||
- [How can I set a fixed IP?](#how-can-i-set-a-fixed-ip)
|
||||
- [How do I fix a displayed Error in my Config?](#how-do-i-fix-a-displayed-error-in-my-config)
|
||||
- [Can I run the RaspiBlitz as Backend for BTCPayServer?](#can-i-run-the-raspiblitz-as-backend-for-btcpayserver)
|
||||
- [I don't have a LAN port on my Laptop - how do I connect to my RaspiBlitz?](#i-dont-have-a-lan-port-on-my-laptop---how-do-i-connect-to-my-raspiblitz)
|
||||
- [Is it possible to connect the Blitz over Wifi instead of using a LAN cable?](#is-it-possible-to-connect-the-blitz-over-wifi-instead-of-using-a-lan-cable)
|
||||
- [Can I directly connect the RaspiBlitz to my laptop?](#can-i-directly-connect-the-raspiblitz-to-my-laptop)
|
||||
- [How to attach the RaspberryPi to the HDD?](#how-to-attach-the-raspberrypi-to-the-hdd)
|
||||
- [What other case options do I have?](#what-other-case-options-do-i-have)
|
||||
- [Are those "Under-Voltage detected" warnings a problem?](#are-those-under-voltage-detected-warnings-a-problem)
|
||||
- [How do I return to the menu after exiting to the command line](#how-do-i-return-to-the-menu-after-exiting-to-the-command-line)
|
||||
- [How do I setup fresh/clean/reset and without going into recovery mode?](#how-do-i-setup-freshcleanreset-and-without-going-into-recovery-mode)
|
||||
- [My blockchain data is corrupted - what can I do?](#my-blockchain-data-is-corrupted---what-can-i-do)
|
||||
- [I have two RaspiBlitz in my network - can they both be public?](#i-have-two-raspiblitz-in-my-network---can-they-both-be-public)
|
||||
- [How can I enforce UASP mode for my SSD controller?](#how-can-i-enforce-uasp-mode-for-my-ssd-controller)
|
||||
- [I am facing maintenance/emergency mode on boot. How do I fix it?](#i-am-facing-maintenanceemergency-mode-on-boot-how-do-i-fix-it)
|
||||
- [Extras](#extras)
|
||||
- [How do I connect a UPS to the RaspiBlitz?](#how-do-i-connect-a-ups-to-the-raspiblitz)
|
||||
- [Can I run my RaspiBlitz on Solar Energy?](#can-i-run-my-raspiblitz-on-solar-energy)
|
||||
- [How to use the Let's Encrypt client](#how-to-use-the-lets-encrypt-client)
|
||||
- [Let's Encrypt - HTTP-01](#lets-encrypt---http-01)
|
||||
- [Let's Encrypt - DNS-01](#lets-encrypt---dns-01)
|
||||
- [Let's Encrypt - eMail Address](#lets-encrypt---email-address)
|
||||
- [Let's Encrypt - Installation details](#lets-encrypt---installation-details)
|
||||
- [What is this mnemonic seed word list?](#what-is-this-mnemonic-seed-word-list)
|
||||
- [How do I set up VNC?](#how-do-i-set-up-vnc)
|
||||
- [Why use BTRFS on RaspiBlitz?](#why-use-btrfs-on-raspiblitz)
|
||||
- [Storing your important Data in RAID1 with a USB Thumb Drive](#storing-your-important-data-in-raid1-with-a-usb-thumb-drive)
|
||||
- [Snapshotting the Blockchain](#snapshotting-the-blockchain)
|
||||
- [How do I use BTRFS on RaspiBlitz?](#how-do-i-use-btrfs-on-raspiblitz)
|
||||
- [How to recover a BTRFS partition?](#how-to-recover-a-btrfs-partition)
|
||||
---
|
||||
|
||||
## Upgrade
|
||||
|
||||
### How to verify the SD card image after download?
|
||||
|
||||
There are two methods, verify the hash (proves integrity) or the signature (proves integrity and authenticity)
|
||||
|
||||
You can do a quick check to verify that the sha256 hash of the file you downloaded is the same as the sha256 hash mentioned below the download link, or use the torrent download which will also check the file for a checksum after download.
|
||||
|
||||
To verify the shasum:
|
||||
|
||||
```
|
||||
shasum -a 256 [DOWNLOADED-FILE-TO-CHECK]
|
||||
```
|
||||
|
||||
But verifying the shasum does not prove to you that the SD card image was actually built by the lead developer of the RaspiBlitz project.
|
||||
|
||||
To verify that the download was actually signed by [rootzoll](https://keybase.io/rootzoll) you need to use GPG and import the following public key:
|
||||
|
||||
```
|
||||
curl --tlsv1.2 --proto '=https' https://keybase.io/rootzoll/pgp_keys.asc | gpg --import
|
||||
```
|
||||
|
||||
Next, download the "signature file" for the SD card image. It's the same download link as for the image file - just added a `.sig` at the end. You should also always find the download link for the signature file in the README right next to the image download link.
|
||||
|
||||
If you now have all the three elements needed - the imported public key, the image signature and the image file itself - you can verify the download with:
|
||||
|
||||
```
|
||||
gpg --verify [SIGNATURE-FILE] [IMAGE-FILE]
|
||||
```
|
||||
|
||||
As a result you should see a "good signature" message with a main fingerprint the same as you can find on the [keybase.io/rootzoll](https://keybase.io/rootzoll) that is ending on `1C73 060C 7C17 6461`. You should also see the sub-key fingerprint ending on `AA9D D1B5 CC56 47DA`, that is used at the moment to sign the sd card image. If those fingerprints shown correctly, the SD card image you downloaded is an original RaspiBlitz release.
|
||||
|
||||
*You can ignore any warning about the key being 'not a trusted signature' or untrusted .. as long you see "good signature" and the correct main & sub fingerprints the download is valid.*
|
||||
|
||||
### What changed on every upgrade?
|
||||
|
||||
See the [CHANGES.md](CHANGES.md) file for details.
|
||||
|
||||
### How do I upgrade my RaspiBlitz?
|
||||
|
||||
The upgrade should be quite simple - you don't need to close any channels:
|
||||
|
||||
- It would be best to get a second 16GB or 32GB SD card - but you can also reuse your old one
|
||||
- In the SSH main menu of you RaspiBlitz choose `UPDATE` & follow the dialogs until shutdown
|
||||
- Download the new RaspiBlitz image file from the [GitHub README](https://github.com/raspiblitz/raspiblitz/blob/dev/README.md#installing-the-software)
|
||||
- Write the new image to the (new) SD card with a tool like [balena etcher](https://www.balena.io/etcher/)
|
||||
- RaspiBlitz with new SD card image - it now goes through a recover/update phase - this may take some time.
|
||||
- Once that's done, login once via SSH and use the password raspiblitz and set a new password A (can be your old one or a new one).
|
||||
|
||||
After the final reboot your RaspiBlitz should be ready, running the new RaspiBlitz version.
|
||||
|
||||
### Why do I need to re-burn my SD card for an update?
|
||||
|
||||
I know it would be nicer to run just an update script and be ready to go. But then the scripts would need to be written in a much more complex way to be able to work with any versions of LND and Bitcoind (they are already complex enough with all the edge cases) and testing would become even more time consuming than it is now. That's not something that a single developer can deliver.
|
||||
|
||||
For some, it might be a pain point to make an update by re-burning a new SD card - especially if you added your own scripts or made changes to the system - but that's by design. It's a way to enforce a "clean state" with every update - the same state that I tested and developed the scripts with. The reason for that pain: I simply cannot write and support scripts that run on every modified system forever - that's simply too much work.
|
||||
|
||||
With the SD card update mechanism I reduce complexity, I deliver a "clean state" OS, LND/Bitcoind and the scripts tightly bundled together exactly in the dependency/combination like I tested them and it's much easier to reproduce bug reports and give support that way.
|
||||
|
||||
Of course, people should modify the system, add own scripts, etc ... but if you want to also have the benefit of the updates of the RaspiBlitz, you have two ways to do it:
|
||||
|
||||
1. Contribute your changes back to the main project as pull requests so that they become part of the next update - the next SD card release.
|
||||
|
||||
2. Make your changes so that they survive an SD card update easily - put all your scripts and extra data onto the HDD, AND document for yourself how to activate them again after an update. The file `/mnt/hdd/app-data/custom-installs.sh` runs with sudo rights after an update/recovery from a fresh SD card. This is the place to put all the install commands, cronjobs or editing of system configs for your personal modifications of RaspiBlitz.
|
||||
|
||||
*BTW there is a beneficial side effect when updating with a new SD card: You also get rid of any malware or system bloat that happened in the past. You start with a fresh system :)*
|
||||
|
||||
### How can I update LND or bitcoind even before the next RaspiBlitz update?
|
||||
|
||||
Try updating before a official RaspiBlitz at your own risk - you can find some info about that here:
|
||||
https://raspibolt.org/bonus/raspberry-pi/odroid-setup.html#bitcoin-core-upgrade
|
||||
|
||||
|
||||
|
||||
## SSH
|
||||
|
||||
### What to do when on SSH I see "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!"
|
||||
|
||||
This means that he public SSH key of the RaspiBlitz has changed to the one you logged in with the last time under that IP.
|
||||
|
||||
It's OK when happening during an update - when you changed the SD card image. If it's really happening out of the blue - check your local network setup for a problem. Maybe the local IP of your RaspiBlitz changed? Is there a second RaspiBlitz connected? It's a security warning, so at least take some time to check if anything is strange. But also don't immediately panic - when it's in your local network, normally it's some network thing - not an intruder.
|
||||
|
||||
To fix this and to be able to login with SSH again, you have to remove the old public key for that IP from your local client computer. Just run the following command (with the replaced IP of your RaspiBlitz): `ssh-keygen -R IP-OF-YOUR-RASPIBLITZ` or remove the line for this IP manually from the known_hosts file (see the path to the file in the warning message).
|
||||
|
||||
After that, you should be able to login with SSH again.
|
||||
|
||||
### How do I unplug/shutdown safely without SSH
|
||||
|
||||
Just removing power from the RaspiBlitz can lead to data corruption if the HDD is right in the middle of a writing process. The safest way is always to SSH into the RaspiBlitz and use the "POWER OFF" option in the main menu.
|
||||
|
||||
But if cannot login with SSH and you need to power off at least remove the LAN cable (network connection)first for sometime (around 10-30 secs - until you can see no more blinking lights on the HDD) and then remove the power cable. This should minimize the risk if data corruption in this situations.
|
||||
|
||||
### I cannot connect via SSH to my RaspiBlitz. What do I do?
|
||||
|
||||
- Check the command again with how it shows on the display - do you have it typed in correctly?
|
||||
- Replace `ssh` with `sudo ssh` and try it (laptop admin password might be required).
|
||||
|
||||
If that doesn't work, try to ping the IP of the RaspiBlitz with `ping [IP-of-RaspiBlitz]`. If you get no response on the ping requests and the device is not reachable, try this check list:
|
||||
|
||||
- Make sure that your RaspiBlitz and your laptop are really on the same local network
|
||||
- Check if you have a VPN running on your laptop - some VPNs block local network
|
||||
- Some Routers have `IP Isolation` switched on - not allowing two devices to connect
|
||||
|
||||
If you've checked those and SSH is still not working: Join the conversation on [GitHub Issue #420](https://github.com/raspiblitz/raspiblitz/issues/420).
|
||||
|
||||
### How to SSH over Tor?
|
||||
|
||||
SSH is already encrypted, why would I want to use it with Tor?
|
||||
* Remote access when away from LAN.
|
||||
* Anonymized access - Someone sniffing the traffic don't know where the server you are establishing a connection is, not the server side knows where the client is.
|
||||
|
||||
Create Hidden Service:
|
||||
`bash /home/admin/config.scripts/tor.onion-service.sh ssh 22 22`
|
||||
|
||||
SSH over Tor:
|
||||
`torsocks ssh admin@HiddenServiceAddress.onion`
|
||||
|
||||
Get the address:
|
||||
`sudo cat /mnt/hdd/tor/ssh/hostname`
|
||||
|
||||
### How to setup port-forwarding with a SSH tunnel?
|
||||
|
||||
To use a public server for port-forwarding thru a SSH tunnel you can use the following experimental script on the RaspiBlitz (since v1.2):
|
||||
|
||||
`/home/admin/config.scripts/internet.sshtunnel.py`
|
||||
|
||||
But first you need to make sure that the public server you are using is supporting SSH reverse-tunneling and authentication by public authorized key. Check the `/etc/ssh/sshd_config` on the public server. It should contain the following settings:
|
||||
|
||||
```
|
||||
RSAAuthentication yes
|
||||
PubkeyAuthentication yes
|
||||
GatewayPorts yes
|
||||
AllowTcpForwarding yes
|
||||
ClientAliveInterval 60
|
||||
ClientAliveCountMax 2
|
||||
```
|
||||
|
||||
*Last two parameters were added as used in the ssh tunnel demo at #GPN19 https://media.ccc.de/v/gpn19-76-einen-server-daheim-ohne-ffentliche-ipv4-adresse#t=911*
|
||||
|
||||
You can add those at the end of the file, save and reboot.
|
||||
|
||||
On the RaspiBlitz you can then setup for example to forward the gRPC port 10009 (internal port) to the port 20009 on the public server (external port) with the user = `test` and server address = `raspiblitz.com` with the following command:
|
||||
|
||||
`/home/admin/config.scripts/internet.sshtunnel.py on test@raspiblitz.com "10009<20009"`
|
||||
|
||||
You can even set multiple port forwardings like with:
|
||||
|
||||
`/home/admin/config.scripts/internet.sshtunnel.py on test@raspiblitz.com "10009<20009" "8080<9090"`
|
||||
|
||||
Please be aware that after you set such a port forwarding you will need to set the domain of the public server as a `DynamicDNS` name (leave update url empty) and then connect mobile wallets fresh, or export the macaroons/certs again. When connecting the mobile wallets you may need to adjust ports manually after QR code scan. And if you SSH tunnel the LND node port `9735` you may also need to set the custom LND port script and maybe also a manual set of the domain in the LND service would be needed. This all is very experimental at the moment ... better integration will come in the future.
|
||||
|
||||
To switch this SSH tunneling off again use:
|
||||
|
||||
`/home/admin/config.scripts/internet.sshtunnel.py off` and also deactivate the DynamicDNS again.
|
||||
|
||||
To check if a tunnel is running on the tunneling server check: `netstat -tulpn`
|
||||
|
||||
### How do I setup just a port-forwarding user on my public server?
|
||||
|
||||
Make sure the `/etc/ssh/sshd_config` has the following lines at the end:
|
||||
|
||||
```
|
||||
RSAAuthentication yes
|
||||
PubkeyAuthentication yes
|
||||
GatewayPorts yes
|
||||
AllowTcpForwarding yes
|
||||
AuthorizedKeysFile /etc/ssh/authorized_keys/%u
|
||||
```
|
||||
|
||||
The last one stores all authorized_keys in one directory with a file per user. See https://serverfault.com/questions/313465/is-a-central-location-for-authorized-keys-a-good-idea#424659 To prepare this run:
|
||||
```
|
||||
mkdir /etc/ssh/authorized_keys
|
||||
groupadd forwardings
|
||||
```
|
||||
|
||||
To add a forwarding user run:
|
||||
```
|
||||
useradd -g forwardings -d /home [USERNAME]
|
||||
echo 'command="date" [CONTENT-OF-RASPIBLITZ-ROOT-SSH-PUBKEY]' > /etc/ssh/authorized_keys/[USERNAME]
|
||||
```
|
||||
|
||||
### How to reset the ssh config and keys?
|
||||
|
||||
- shutdown the RaspiBlitz - if you dont have touchscreen activated, disconnect LAN cable, wait until HDD/SSD activity slows down (no constant blinking) and then cut the power
|
||||
- take out the SD card and connect it to your laptop - it should appear as a `boot` drive
|
||||
- in the root directory of that `boot` drive create a file called `ssh.reset`
|
||||
- that file can be empty or just copy another file on that drive and rename it ()
|
||||
- eject the drive from your laptop safely
|
||||
- put SD card back into the RaspiBlitz (also make sure LAN cable is connected again)
|
||||
- power up - the RaspiBlitz should boot up & reboot again
|
||||
- then try again to SSH login
|
||||
|
||||
If you see a "REMOTE HOST IDENTIFICATION HAS CHANGED!" warning on login, that's what we wanted - the SSH cert of your RaspiBlitz changed - thats good. We just need to remove the old one from our laptop first - on OSX you can use `rm ~/.ssh/known_hosts` (deletes all cached server certs) or remove the line with your RaspiBlitz IP manually from the `~/.ssh/known_hosts` file with a text editor.
|
||||
|
||||
## Display
|
||||
|
||||
### Can I flip the screen?
|
||||
|
||||
There is now an option under `SETTINGS` to rotate the screen.
|
||||
|
||||
To do it manually: For the default 3.5" LCD you need to edit the /boot/config.txt. Run `sudo nano /boot/config.txt`
|
||||
Look for the line `dtoverlay=tft35a:rotate=270` towards the end. To flip the screen with 180 degrees change the line to `dtoverlay=tft35a:rotate=90` and reboot with `sudo reboot`. Reference: https://github.com/goodtft/LCD-show/issues/34
|
||||
|
||||
### How to fix my upside down LCD after update?
|
||||
|
||||
Some displays have a different orientation. To fix this activate/deactivate the LCD-ROTATION option in the MAINMENU > SERVICES and let it reboot. You might need to do this up to 3 times until your display works correctly.
|
||||
|
||||
### Can I run the RaspiBlitz without a display/LCD?
|
||||
|
||||
The display is one of the nice features of the RaspiBlitz but it can run without it. Maybe not all the add-on features can be used to the full extent, but you can get started without the LCD and if you wish, plug it on later.
|
||||
|
||||
If you want to use the HDMI output you can place a file called `hdmi` on the `boot` section of the RaspiBlitz sd card ... just connect the sd card to your laptop, create that file and then boot it up in the RaspberryPi.
|
||||
|
||||
If you are already logged in you can use on the console the commands:
|
||||
|
||||
- `hdmi` --> switch to HDMI
|
||||
- `lcd` --> switch to LCD
|
||||
|
||||
### How do I find the IP address when running without a display?
|
||||
|
||||
If you can login into your local internet router it should show you the IP address assigned to the RaspberryPi.
|
||||
|
||||
Another way is to use [Angry IP Scanner](https://angryip.org/) to find the IP address.
|
||||
|
||||
You can also put an empty file just called `hdmi` (without any ending) onto the sd card when connected to your laptop and then start it up on the RaspberryPi. This will activate the HDMI port and if you connect a HDMI monitor to the RaspberryPi it will show you the RaspiBlitz status screen containing the local IP address.
|
||||
|
||||
## Debug
|
||||
|
||||
### How do I generate a Debug Report?
|
||||
|
||||
If your RaspiBlitz is not working correctly and you like to get help from the community, it's good to provide more debug information, so others can better diagnose your problem.
|
||||
|
||||
When you use the WebUI in the browser than you can follow the steps:
|
||||
|
||||
- Login into the WebUI and enter the Dashboard (needs to be fully snyced)
|
||||
- In the left navigation bar - choose "Settings"
|
||||
- Under "Generate Debug Report" click "Generate"
|
||||
- This might take some minutes, but then a Text-File will be offered for download
|
||||
|
||||
You can also get a debug report thru the SSH menus:
|
||||
|
||||
- SSH into your raspiblitz as admin user with your password A
|
||||
- If you see the menu - use CTRL+C to get to the terminal
|
||||
- To generate debug report run: `debug`, optionally create a link with `debug -l`
|
||||
- Then copy all output beginning with `*** RASPIBLITZ LOGS ***` and share this
|
||||
|
||||
*PLEASE NOTICE: Most private information (like IPs, node IDs, ...) will filtered from debug logs, but this might not catch all sensitive information - so recheck content yourself before you share publicly.*
|
||||
|
||||
### I have the full blockchain on another storage. How do I copy it to the RaspiBlitz?
|
||||
|
||||
Copying a already synced blockchain from another storage (e.g. your Laptop or external hard drive) can be a quick way to get the RaspiBlitz started or replacing a corrupted blockchain with a fresh one. Also that way you have synced and verified the blockchain yourself, and are not trusting the RaspiBlitz Torrent downloads (Don't trust, verify).
|
||||
|
||||
One requirement is that the blockchain is from another bitcoin-core client with version greater or equal to 0.17.1.
|
||||
|
||||
But we don't copy the data via USB to the device, because the HDD needs to be formatted in EXT4 and that is usually not read/writable by Windows or Mac computers. So I will explain a way to copy the data through your local network. This should work from Windows, Mac, Linux and even from another already synced RaspiBlitz.
|
||||
|
||||
Both computers (your RaspberryPi and the other computer with the full blockchain) need to be connected to the same local network. Make sure that bitcoind/bitcoin-qt is stopped on the computer containing the blockchain.
|
||||
If your blockchain source is another RaspiBlitz v1.5 or higher - go to `REPAIR` > `COPY-SOURCE`.
|
||||
If your RaspiBlitz is below v1.5 then on the terminal `sudo systemctl stop bitcoind` and then go to the directory where the blockchain data is with `cd /mnt/hdd/bitcoin` - when the copy/transfer is done later reboot a RaspiBlitz source with `sudo shutdown -r now`.
|
||||
|
||||
If everything described above is in order, start the setup of the new RaspiBlitz with a fresh SD card (like explained in the README) - it's OK that there is no blockchain data on your HDD yet - just follow the setup. When you get to the setup-point `Getting the Blockchain` choose the COPY option. Starting from version 1.0 of the RaspiBlitz this will give you further detailed instructions how to transfer the blockchain data onto your RaspiBlitz. In short: On your computer with the blockchain data source you will execute SCP commands that will copy the data over your local network to your RaspiBlitz.
|
||||
|
||||
Once you finished all the transfers, the Raspiblitz will make a quick-check on the data - but that will not guarantee that everything in detail was OK with the transfer. Check further FAQ answers if you get stuck or see a final sync with a value below 90%.
|
||||
|
||||
### Bitcoind tells me to reindex - how can I do this?
|
||||
|
||||
To find/access information fast in large data sets like the Bitcoin blockchain indexes are needed. Those indexes can get corrupted on your HDD/SSD and to repair them they need to be rebuild - re-indexed. Bitcoind has two different options to do this - a fast way called "reindex-chainstate" (which just rebuilds the UTXO set from the blocks as you have them) and the slow but complete way called just "reindex" that would even recheck all your block data - see for details here: https://bitcoin.stackexchange.com/questions/60709/when-should-i-use-reindex-chainstate-and-when-reindex
|
||||
|
||||
So if you read in your debug logs of bitcoind that you should "reindex" you can try first just to do a fast "reindex-chainstate" and if that didnt worked a slow and full "reindex".
|
||||
|
||||
See the raspiblitz script `./config.scripts/network.reindex.sh` or the REAPIR menu to start these processes.
|
||||
|
||||
### Why is my "final sync" taking so long?
|
||||
|
||||
First of all if you see a final sync over 90% and you can see from time to time small increase - you should be OK ... this can take a looong time to catch up with the network. Only in the case that you actively choose the `SYNC` option in the `Getting the Blockchain` is a final sync under 90% OK. If you did a torrent or a copy from another computer and you are seeing under 90% something went wrong, and the setup process is ignoring your prepared Blockchain and doing a full sync - which can almost take forever on a raspberryPi.
|
||||
|
||||
If something is wrong (like mentioned above) then try again from the beginning. You need to reset your HDD for a fresh start: SSH in as admin user. Abort the final sync info with CTRL+c to get to the terminal. Then run `sudo /home/admin/XXcleanHDD.sh -all` and follow the script to delete all data in HDD. When finished power down with `sudo shutdown now`. Then make a fresh SD card from image and this time try another option to get the blockchain. If you run into trouble the second time, please report an issue on GitHub.
|
||||
|
||||
|
||||
### How do I backup my Lightning Node?
|
||||
|
||||
There are two ways of performing a Backup:
|
||||
|
||||
#### 1) Securing your On-Chain- and Channel-Funds during Operation
|
||||
|
||||
This is best done by auto backing-up the 'channel.backup' file to a remote location. But it just secures the funds you have in your on-chain wallet or in your channels. On recovery the channels will get closed. For details on how to setup see the README:
|
||||
https://github.com/raspiblitz/raspiblitz/blob/v1.2/README.md#backup-for-on-chain---channel-funds
|
||||
|
||||
#### 2) Making a complete LND data backup
|
||||
|
||||
This backups all your LND data - including all open channels. But it's just intended to use when you move your LND data between computers, during update situations, or in rescue recoveries, because replaying out-dated backups can lead to the loss of all channel funds.
|
||||
|
||||
To backup LND data in a rescue situation see next question "How can I recover my coins from a failing RaspiBlitz?".
|
||||
|
||||
### How can I recover my coins from a failing RaspiBlitz?
|
||||
|
||||
On a RaspiBlitz you have coins in your on-chain wallet (bitcoin wallet) and also coins in lightning channels. First we will try to recover all of them while trying to keep your channels open with "Recover LND data". If that is not possible you can fall back to the second option "Recover from Wallet Seed".
|
||||
|
||||
#### 1) Recover LND data
|
||||
|
||||
The best chance to recover all your LND data/channels is when you still can SSH into the RaspiBlitz and the HDD is still usable/reachable (mounted) - even if it shows some errors. If this is not possible anymore you should skip to the second option "Recover from Wallet Seed" or try to recover the LND data from the HDD (directory `lnd`) from another computer.
|
||||
|
||||
If you still can SSH in and HDD is readable, we can try to rescue/export your LND data (funds and channels) from a RaspiBlitz to then be able to restore it back to a fresh one. For this you can use the following procedure ...
|
||||
|
||||
To rescue/export your Lightning data from a RaspiBlitz (since v1.1):
|
||||
|
||||
* SSH into your RaspiBlitz and EXIT to terminal from the menu.
|
||||
* then run: `/home/admin/config.scripts/lnd.backup.sh lnd-export-gui`
|
||||
* follow the instructions of the script.
|
||||
|
||||
This will create a lnd-rescue file (ends on gz.tar) that contains all the data from the LND. The script offers you a command to transfer the lnd-rescue file to your laptop. If the transfer was successful you can now setup a fresh RaspiBlitz. Do all the setup until you have a clean new Lightning node running - just without any funding or channels.
|
||||
|
||||
Then to restore your old LND data and to recover your funds and channels:
|
||||
|
||||
* SSH into your new RaspiBlitz and EXIT to terminal from the menu.
|
||||
* then run: `/home/admin/config.scripts/lnd.backup.sh lnd-import-gui`
|
||||
* follow the instructions of the script.
|
||||
|
||||
This script will offer you a way to transfer the lnd-rescue file from your laptop to the new RaspiBlitz and will restore the old data. LND then gets restarted for you, and after some time it should show you the status screen again with your old funds and channels.
|
||||
|
||||
**Be aware that if backup is some hours old, channels could have been closed by the other party and it may take some time until you see funds back on-chain. If backup is somewhat older then 1 day also the channel counter-parties may have used your offline time to cheat you with an old state. And if your backup was not the latest state it could also be happening that you are posting an old channel state (seen as cheating) and funds of that channel get forfeited as punishment. So again .. this backup method can be risky, use with caution. While it's recommended to try in recover and rescue situations - it's not for regular backups.**
|
||||
|
||||
#### 2) Recover from Wallet Seed
|
||||
|
||||
Remember those 24 words you were writing down during the setup? That's your "cipher seed" - These words are very important for recovering your wallet. If you don't have them anymore: go back to option "Recover LND data" (see above) and check all possible ways to recover data from the HDD. If you still have the word seed: good, but read the following carefully:
|
||||
|
||||
With the word seed you can recover the on-chain funds that LND was managing for you - but it does not contain all the details about the channels you have open - it's mostly the key to your funding wallet. If you were able to close all channels or never opened any, then you should be safe: The best results to recover on-chain funds from wallet seeds have been reported from people installing the Lightning Labs App on laptop and then using the wallet seed (and same wallet passwords): https://github.com/lightninglabs/lightning-app/releases. Other people were successful in this process using the Zap Desktop wallet (OSX, Win, Linux): https://zap.jackmallers.com/download
|
||||
|
||||
If you had open channels it would be best to check if you have also the `channel.backup` file (Static-Channel-Backup feature) that is available since LND 0.6 (RaspiBlitz v1.2) and use it in the process below ... for more details on the `channel.backup` file see [README.md on backups](README.md#backup-for-on-chain---channel-funds).
|
||||
|
||||
- SetUp a fresh RaspiBlitz (fresh SD-Card image and clean HDD).
|
||||
- During the new SetUp, when you get to the point of creating the LND wallet (see image below).
|
||||
- Choose `OLD - I had an old Node I want to recover/restore` option and then
|
||||
- Choose `SEED+SCB - Seed & channel.backup file` option
|
||||
- and follow the instructions to upload your `channel.backup` file and enter your seed
|
||||
|
||||
Then give LND some time to re-scan the blockchain. In the end you will have restored your funding wallet. You maybe need to wait for your old channel counterparts to force close the old channels until you see the coins displayed again.
|
||||
|
||||
If you don't have the `channel.backup` file but only the seed words there is a last hope - read this article:
|
||||
https://medium.com/@guggero/did-you-lose-funds-on-the-lightning-network-because-of-a-disk-crash-8971b6a92494
|
||||
|
||||
*Important: If you see a zero balance for on-chain funds after restoring from seed ... see details discussed [here](https://github.com/raspiblitz/raspiblitz/issues/278) - you might try setup fresh this time with bigger look-ahead number.*
|
||||
|
||||
|
||||
### How do I move funds & channels from RaspiBlitz to LND Lightning Desktop App?
|
||||
|
||||
Before you start - download a LND-data-rescue file from your RaspiBlitz to your laptop `main menu -> UPDATE -> Update Anyway -> Start Update -> Download Backup -> FOLLOW INSTRUCTIONS and press Enter when ready with download -> START UPDATE`. Now your RaspiBlitz will power down.
|
||||
|
||||
Now install the LND Lightning Desktop App for your OS: https://github.com/lightninglabs/lightning-app/releases
|
||||
|
||||
Then start the App and create a new wallet - it's a throw-away wallet (will be deleted afterwards with no funds) - so you don't need to keep seeds safe. To get easily through the setup just make a photo of the seed with your mobile. If you get asked for funding - just click "done" until you reach the basic wallet screen. Then close the LND Desktop App.
|
||||
|
||||
Now find out the path where LND stores the wallet data on your computer.
|
||||
|
||||
Linux: [USER-DIRECTORY]/.config/lightning-app/lnd
|
||||
OSX: [USER-DIRECTORY]/Library/Application Support/lightning-app/lnd
|
||||
Windows: %USERPROFILE%\AppData\Roaming\lightning-app\lnd
|
||||
|
||||
Then open that directory on your local file manager and delete all data in the `lnd` directory.
|
||||
|
||||
Now unpack the lnd-rescue you made before and copy all the data from the `mnt/hdd/lnd` directory (including sub directories) into the LND-Path lnd directory. Delete the "lnd.conf" file.
|
||||
|
||||
Now start the Lightning App again. Your wallet password should now be your RaspIBlitz Password C.
|
||||
|
||||
**If it's working and you have access to your funds/channels on the Desktop App ... don't start the RaspiBlitz anymore. Delete SD card and HDD.**
|
||||
|
||||
### How do I change the Name/Alias of my lightning node
|
||||
|
||||
Use the "Change Name/Alias of Node" option in the Lightning - LND Wallet Options menu. The RaspiBlitz will automatically reboot after this.
|
||||
|
||||
|
||||
### How do I change the public port LND/Lightning node is running on?
|
||||
|
||||
There is a experimental script you can call from the terminal that will make all changes for you ... see details here: https://github.com/raspiblitz/raspiblitz/issues/100#issuecomment-466722712
|
||||
|
||||
### How do I solve a "signature mismatch after caveat verification" error?
|
||||
|
||||
If you get this error by LND it means that something is wrong with the macaroons being used to communicate with LND .. see: https://github.com/lightningnetwork/lnd/blob/master/docs/macaroons.md
|
||||
|
||||
Fixing this depends on where you get this error:
|
||||
|
||||
* If you get it in a mobile wallet, then redo the connection with the RaspiBlitz to get fresh macaroons.
|
||||
* If you get this from RTL or from the scripts of the SSH menus of the RaspiBlitz, then go to "EXPORT Macacroons and TLS.cert" in SSH main menu and choose the the "RESET Macaroons & TLS" option.
|
||||
|
||||
Also make sure to check again on your power supply - it needs to deliver equal or more then 3A and should deliver a stable current. If you think your HDD is degrading - maybe this is a good time to replace it. See for details the FAQ question: [How can I recover my coins from a failing RaspiBlitz?](FAQ.md#how-can-i-recover-my-coins-from-a-failing-raspiblitz)
|
||||
|
||||
### Why is my node not routing?
|
||||
|
||||
1. You don't have inbound liquidity
|
||||
2. Low uptime
|
||||
3. Capital is committed to competitive destinations
|
||||
4. Capital committed to destinations no one wants to send to
|
||||
5. Fees are too high
|
||||
6. Your inbound liquidity doesn't have good inbound liquidity itself
|
||||
|
||||
### When using Auto-Unlock, how much security do I lose?
|
||||
|
||||
The idea of the "wallet lock" in general, is that your private key / seed / wallet is stored in a encrypted way on your HDD. On every restart, you have to input the password once manually (unlock your wallet), so that the LND can read and write to the encrypted wallet again. This improves your security if your RaspiBlitz gets stolen or taken away - it loses power and then your wallet is safe - the attacker cannot access your wallet.
|
||||
|
||||
When you activate the "Auto-Unlock" feature of the RaspiBlitz, the password of the wallet gets stored on the RaspiBlitz. So if an attacker steals the RaspiBlitz physically, it's now possible for them to find the password and unlock the wallet.
|
||||
|
||||
|
||||
### I connected my HDD but it still says 'Connect HDD' on the display?
|
||||
|
||||
Your HDD may have no partitions yet. SSH into the RaspiBlitz as admin (see command and password on display) and you should be offered the option to create a partition. If this is not the case:
|
||||
|
||||
Check/Exchange the USB cable. Connect the HDD to another computer and check if it shows up at all.
|
||||
|
||||
OSX: https://www.howtogeek.com/212836/how-to-use-your-macs-disk-utility-to-partition-wipe-repair-restore-and-copy-drives/
|
||||
|
||||
Windows: https://www.lifewire.com/how-to-open-disk-management-2626080
|
||||
|
||||
Linux/Ubuntu (desktop): https://askubuntu.com/questions/86724/how-do-i-open-the-disk-utility-in-unity
|
||||
|
||||
Linux/Raspbian (command line): https://www.addictivetips.com/ubuntu-linux-tips/manually-partition-a-hard-drive-command-line-linux/
|
||||
|
||||
### How do I shrink the QR code for connecting my Shango/Zap/Zeus mobile phone?
|
||||
|
||||
Make the fonts smaller until the QR code fits into your (fullscreen) terminal. In OSX use `CMD` + `-` key. In LINUX use `CTRL`+ `-` key. On WINDOWS Putty go into the settings and change the font size: https://globedrill.com/change-font-size-putty
|
||||
|
||||
### Why is my bitcoin IP on the display red?
|
||||
|
||||
The bitcoin IP is red when the RaspiBlitz detects that it cannot reach the port of bitcoin node from the outside. This means the bitcoin node can peer with other bitcoin nodes, but other bitcoin nodes cannot initiate a peering with you. Don't worry, you don't need a publicly reachable bitcoin node to run a (public) lightning node. If you want to change this however, you need to forward port 8333 on your router to the RaspiBlitz. How to do this is different on every router.
|
||||
|
||||
Some routers support a feature called UPnP where devices can automatically request a forwarding to be publicly reachable. By turning on `BTC UPnP` in the main menu `SERVICES` section, you can try if your router supports this feature.
|
||||
|
||||
On details how to set port forwarding manually on your router model see: https://portforward.com
|
||||
|
||||
### Why is my node address on the display red?
|
||||
|
||||
The node address is red when the RaspiBlitz detects that it cannot reach the port of the LND node from the outside - when the device is behind a NAT or firewall of the router. Your node is not publicly reachable. This means you can peer+openChannel with other public nodes, but other nodes cannot peer+openChannel with you. To change this you need to forward port 9735 on your router to the RaspiBlitz. How to do this is different on every router.
|
||||
|
||||
Some routers support a feature called UPnP where devices can automatically request a forwarding to be publicly reachable. By turning on `LND UPnP` in the main menu `SERVICES` section, you can try if your router supports this feature.
|
||||
|
||||
On details how to set port forwarding manually on your router model see: https://portforward.com
|
||||
|
||||
Also the self-testing of the RaspiBlitz to see if the port is forwarded or not might not work if your router is not supporting [Hairpinning](https://en.wikipedia.org/wiki/Hairpinning).
|
||||
|
||||
### Why is my node address on the display yellow (not green)?
|
||||
|
||||
Yellow is OK. The RaspiBlitz can detect that it can reach a service on the port 9735 of your public IP - this is in most cases the LND of your RaspiBlitz. But the RaspiBlitz cannot 100% for sure detect that this is its own LND service on that port - that's why it's just yellow, not green.
|
||||
|
||||
For details on how to set port forwarding on your router model see: https://portforward.com
|
||||
|
||||
### How can I set a fixed IP?
|
||||
|
||||
Add an entry called `staticIP` in `raspiblitz.conf` to prevent external IP detection and force a fixed IP for your node.
|
||||
|
||||
### How do I fix a displayed Error in my Config?
|
||||
|
||||
When the LCD display is telling you to do a config check:
|
||||
- go to the RaspiBlitz terminal (X on main menu) and run 'patch'
|
||||
- start reboot with command: 'restart'
|
||||
- go to the RaspiBlitz terminal run the command: 'check'
|
||||
- now edit the RaspiBlitz config and get rid of the errors: 'nano /mnt/hdd/raspiblitz.conf'
|
||||
- save config with: CTRL+o
|
||||
- exit nano editor with: CTRL+x
|
||||
- start reboot with command: 'restart'
|
||||
|
||||
### Can I run the RaspiBlitz as Backend for BTCPayServer?
|
||||
|
||||
BTCPay Server is a solution to be your own payment processor to accept Lightning Payments for your online store: https://github.com/btcpayserver/btcpayserver
|
||||
|
||||
You can find setup instructions for a experimental setup here: https://goo.gl/KnTzLu
|
||||
|
||||
Thanks to @RobEdb (ask on twitter for more details) for running his demo store with RaspiBlitz: https://store.edberg.eu - buy a picture of [him and Andreas](https://store.edberg.eu/produkt/jag-andreas/) :)
|
||||
|
||||
### I don't have a LAN port on my Laptop - how do I connect to my RaspiBlitz?
|
||||
|
||||
You don't need a LAN port on your laptop as long as you can connect over WLAN to the same LAN router/switch the RaspiBlitz is connected to .. and you are on the same local network.
|
||||
|
||||
### Is it possible to connect the Blitz over Wifi instead of using a LAN cable?
|
||||
|
||||
A LAN cable is recommended because it reduces a possible source of error on the network connection side. But how to setup WLAN when you don't have a LAN-Router/Switch available see here:
|
||||
|
||||
Using [Raspberry Pi Imager: ](https://www.raspberrypi.com/software/)
|
||||
https://raspibolt.org/guide/raspberry-pi/operating-system.html#configure-boot-options
|
||||
|
||||
Manually
|
||||
https://github.com/raspibolt/raspibolt/blob/a21788c0518618d17093e3f447f68a53e4efa6e7/raspibolt/raspibolt_20_pi.md#prepare-wifi
|
||||
|
||||
### Can I directly connect the RaspiBlitz to my laptop?
|
||||
|
||||
If you have a LAN port on your laptop - or you have a USB-LAN adapter, you can connect the RaspiBlitz directly (without a router/switch) to your laptop and share the WIFI internet connection. You can follow this [guide for OSX](https://medium.com/@tzhenghao/how-to-ssh-into-your-raspberry-pi-with-a-mac-and-ethernet-cable-636a197d055) and this [guide for Windows](https://www.tomshardware.com/how-to/share-internet-connection-windows-ethernet-wi-fi).
|
||||
|
||||
In short for OSX:
|
||||
|
||||
* make sure all VPNs are off (can interfere with local LAN)
|
||||
* connect with LAN directly
|
||||
* Settings > Sharing/Freigaben > activate "internet sharing" from WLAN to Ethernet
|
||||
* Settings > Network > Ethernet-Adapter > set to DHCP
|
||||
* in terminal > `ifconfig` there you should see the IP of the bridge100
|
||||
* in terminal > `arp -a` and check for an IP of a client to the bridge
|
||||
* in terminal > ssh admin@[clientIP]
|
||||
|
||||
In short for Windows:
|
||||
|
||||
* make sure all VPNs are off (can interfere with local LAN)
|
||||
* connect Raspiblitz with laptop LAN/ethernet directly
|
||||
* Control Panel > Network and Internet > Network and Sharing Centre
|
||||
* Click on your active internet connection highlighted in blue
|
||||
* Properties > Sharing
|
||||
* Check the box titled "Allow other network users to connect through this computer's Internet connection
|
||||
* Select LAN/Ethernet from the "Home networking connection:" dropdown menu
|
||||
* Click OK
|
||||
* Restart the Raspiblitz
|
||||
|
||||
If anyone has experience on doing this in Linux please share.
|
||||
|
||||
### How to attach the RaspberryPi to the HDD?
|
||||
|
||||
Try a rubber band.
|
||||
|
||||
### What other case options do I have?
|
||||
|
||||
You can put the heatsink-case (top-part mentioned in the shopping lists) into a customized 3D printed case for the RaspiBlitz called "Lightning Shell" - great work by @CryptoCloaks
|
||||
|
||||
https://www.cryptocloaks.com/product/lightningshell/ (Delivery from USA)
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Also there is the ZKDS metal case available that also needs some extra hardware (SATA-USB expansion board and USB bridge).
|
||||
|
||||
https://diynodes.com (delivery from UK)
|
||||
|
||||

|
||||
|
||||
|
||||
### Are those "Under-Voltage detected" warnings a problem?
|
||||
|
||||
When your USB power adapter for the RaspiBlitz delivers too low of a power level, those messages with "Under-Voltage detected" (under-voltage) are shown on the display. This can lead to data loss/corruption on the HDD. If you see this just one or two times it's not OK, but can be in a tolerant window. Nevertheless it is important to make sure that your USB power adapter can deliver at least 3A (big and stable is good). If you still see those warnings maybe get a second USB Power adapter just for the HDD, and power the HDD through a Y-Cable - see https://en.wikipedia.org/wiki/Y-cable#USB or put a USB Hub with extra power between the Raspberry and the HDD.
|
||||
|
||||
|
||||
### How do I return to the menu after exiting to the command line
|
||||
|
||||
Type the command `raspiblitz` to return to the main menu if you exited to the command line.
|
||||
|
||||
### How do I setup fresh/clean/reset and without going into recovery mode?
|
||||
|
||||
When you put in a SD card with a new/clean RaspiBlitz image the RaspiBlitz will go into recovery mode because it detects the old data on your HDD and assumes you just want to continue to work with this data.
|
||||
|
||||
But there might be cases where you want to start a totally fresh/clean RaspiBlitz from the beginning. To do so you need to delete the old data from the HDD. Choose the option `RESET-ALL` under `REPAIR` to delete all data and start fresh.
|
||||
|
||||
When the HDD is clean, then flash a new RaspiBlitz sd card and your setup should start fresh.
|
||||
|
||||
### My blockchain data is corrupted - what can I do?
|
||||
|
||||
You could try to re-index, but that can take a very long time - multiple days or even weeks. But there are other options:
|
||||
|
||||
1. Get new Blockchain
|
||||
|
||||
Use `REPAIR` in the SSH main menu and then choose `RESET-CHAIN`. Then you get offered multiple options to get new blockchain data.
|
||||
|
||||
2. Backup LND Data, make fresh Blitz, Replay LND Data
|
||||
|
||||
You can backup your channel and wallet data, make a complete fresh RaspiBlitz and after that is setup, you replace the LND data with your old data. Also make sure to check again on your power supply - it needs to deliver equal or more then 3A, and should deliver a stable current. If you think your HDD or SD card is degrading - maybe this is a good time to replace it. See for details the FAQ question: [How can I recover my coins from a failing RaspiBlitz?](FAQ.md#how-can-i-recover-my-coins-from-a-failing-raspiblitz)*
|
||||
|
||||
### I have two RaspiBlitz in my network - can they both be public?
|
||||
|
||||
Yes but you need to change the port number (for example to 9736) on at least one of your RaspiBlitzes - see how to change a port below. Then you can forward both ports from your home internet router to the matching RaspiBlitzes.
|
||||
|
||||
### How can I enforce UASP mode for my SSD controller?
|
||||
|
||||
By default just tested & selected SSD encasings/controller are running enabled with UASP in RaspiBlitz. UASP brings a speed up for the SSD but also if not well supported by the SSD encasing/controller can lead to system halts. If you know for sure that your SSD encasing/controller is supporting UASP fully you can place a file called `uasp.force` on the sd card boot section after flashing the image with your laptop. See details or report errors on issue [#2488](https://github.com/raspiblitz/raspiblitz/issues/2488)
|
||||
|
||||
### I am facing maintenance/emergency mode on boot. How do I fix it?
|
||||
|
||||
This behavior is caused by either the software that flashes the RaspiBlitz image onto the sd card, or by a faulty sd-card. The only solution is to try switching the software/computer you use for flashing and/or trying another sd card.
|
||||
|
||||
See issues #3039, #1053 & #782
|
||||
|
||||
## Extras
|
||||
|
||||
### How do I connect a UPS to the RaspiBlitz?
|
||||
|
||||
A UPS (Uninterruptible Power Supply) is used to protect the RaspiBlitz against power outages. Normally you put it just between your normal power outlet and your RaspiBlitz and you are set. But some UPS offer a way to communicate with devices. This can be very useful for example if on a longer power outage the battery of the UPS runs low the RaspiBlitz could detect this and power down in a clean way - instead of a sudden stop that risks data loss or corruption.
|
||||
|
||||
- There is an experimental script to connect the RaspiBlitz to a UPS over USB cable build by APC - the Model tested with was [APC Back-UPS BX - BX700U-GR](https://www.amazon.de/APC-Back-UPS-Unterbrechungsfreie-Stromversorgung-BX700U-GR/dp/B00T7BYRCK) but it should work with every APC model offering a USB port. \
|
||||
To turn it on run from terminal: `/home/admin/config.scripts/blitz.ups.sh on apcusb`
|
||||
|
||||
- There is also a script dealing with Geekworm/Suptronics [X708 UPS HAT](https://www.amazon.com/Geekworm-Raspberry-Management-Detection-Shutdown/dp/B08DNRYM4Y/). The tested model was x708v1.2. \
|
||||
To turn it on run from terminal: `/home/admin/config.scripts/blitz.ups.sh on x708`
|
||||
|
||||
If you have other UPS models or ways to connect ... feel free to extend this script.
|
||||
|
||||
### Can I run my RaspiBlitz on Solar Energy?
|
||||
|
||||
Yes - take a look at the project of [Chimezie Chuta](https://twitter.com/mezie16/status/1264513274080636928?s=20)
|
||||
|
||||

|
||||
|
||||
More details in his book ["A-Z of Building your own Full Bitcoin Lightning Node: A hand Book for Enthusiasts"](https://blockspace.shop/products/a-z-of-building-your-own-full-bitcoin-lightning-node-a-hand-book-for-enthusiasts)
|
||||
|
||||
### How to use the Let's Encrypt client
|
||||
|
||||
The [Let's Encrypt](https://letsencrypt.org/) client software [acme.sh](https://github.com/acmesh-official/acme.sh) is
|
||||
included (since v1.6) and can be used to create TLS certificates that are signed by the Certificate Authority (*Root
|
||||
CA*) **Let's Encrypt** and which are therefore trusted on all modern platforms.
|
||||
|
||||
In order to successfully get a signed certificate you need to **verify ownership** over a **DNS domain** or a **full
|
||||
qualified domain name** (**FQDN**). Currently Let's Encrypt **doesn't** issue certificates for IP addresses. The two
|
||||
most common standards for verification of control are `HTTP-01` and `DNS-01`.
|
||||
|
||||
The **acme.sh** client supports both modes and has a large number of DNS services (more than 50) it can interact with.
|
||||
More details can be found on the [acme.sh wiki](https://github.com/acmesh-official/acme.sh/wiki).
|
||||
|
||||
#### Let's Encrypt - HTTP-01
|
||||
|
||||
To use `HTTP-01` your RaspiBlitz needs to be accessible directly from the Internet on a **public IP address** on **port
|
||||
80**. If you don't have a public IPv4/IPv6 IP on either `eth0` or `wlan0` then it might be possible to use **NAT port
|
||||
forwarding** or an **autossh-tunnel** to fulfill this requirement.
|
||||
|
||||
If everything (this includes creating a `DNS A` or `DNS CNAME` record that points to a static or dynamic IP address) is
|
||||
set up so that the Let's Encrypt servers can reach your RaspiBlitz on port 80 then the following command will perform
|
||||
the initial creation of a signed certificate and will also store the configuration data needed to regularly refresh it.
|
||||
Just run this once and then lean back and forget about it. :-D
|
||||
|
||||
```
|
||||
~/.acme.sh/acme.sh --keylength ec-256 --issue -d hostname.example.com -w /var/www/letsencrypt/
|
||||
```
|
||||
|
||||
#### Let's Encrypt - DNS-01
|
||||
|
||||
The `DNS-01` standard **proves ownership** by creating `DNS TXT` records on the domain or subdomain you want to use.
|
||||
This requires interaction with and access to a dns server but comes with the benefit that `wildcard certificates`
|
||||
can be issued.
|
||||
|
||||
It is beyond the scope of this FAQ entry to explain all details of this - please refer to the official documentation.
|
||||
Assuming you are using the [DuckDNS](https://www.duckdns.org/) dynamic DNS service then the following command will
|
||||
get a certificate (including a wildcard subject alternative name (**SAN**) listing). It will also take care of continuous
|
||||
renewals.
|
||||
|
||||
```
|
||||
export DuckDNS_Token="abcdefgh-0123-56ij-78kl-abcd9012efgh"
|
||||
~/.acme.sh/acme.sh --issue --keylength ec-256 --dns dns_duckdns -d hostname.duckdns.org -d *.hostname.duckdns.org
|
||||
```
|
||||
|
||||
As mentioned, more that 50 other services (including self-hosted options like e.g. `nsupdate` or `PowerDNS`) are supported.
|
||||
|
||||
#### Let's Encrypt - eMail Address
|
||||
|
||||
The installation process of the `acme.sh` client includes a prompt for an eMail address. The data entered there is
|
||||
stored in the `accounts.conf` file as `ACCOUNT_EMAIL`. This address is used by Let's Encrypt to notify you about
|
||||
the expiry of certificates (which is not really needed as renewals are automated) and also about changes to their
|
||||
**Terms of Service**. For more details please check their [privacy policy](https://letsencrypt.org/privacy/).
|
||||
|
||||
It is currently considered completely fine to leave this field empty and not provide an eMail address.
|
||||
|
||||
#### Let's Encrypt - Installation details
|
||||
|
||||
The `acme.sh` script is installed in `/home/admin/.acme.sh/` - the configuration and the certificates are stored on the
|
||||
external hard disk in `/mnt/hdd/app-data/letsencrypt`.
|
||||
|
||||
### What is this mnemonic seed word list?
|
||||
|
||||
With the 24 word list given you by LND upon wallet creation you can recover your private key. You should write it down and store it at a safe place. Bear in mind that *this 24 word mnemonic seed is not based on the BIP 39* and therefore cannot be recovered using a Bitcoin wallet.
|
||||
|
||||
For more background on the LND mnemonic seed [read this article](https://github.com/lightningnetwork/lnd/blob/master/docs/recovery.md#recovering-funds-from-lnd-funds-are-safu).
|
||||
|
||||
### How do I set up VNC?
|
||||
|
||||
Enter the Console/Terminal by selecting the last option from the Raspiblitz menu.
|
||||

|
||||
|
||||
Enable the VNC server using raspi-config:
|
||||
|
||||
`sudo raspi-config`
|
||||
|
||||
In the menu, go to
|
||||
*Interfacing Options > VNC > Enable*
|
||||

|
||||
|
||||
After that reboot the Raspiblitz. You can do this easily from the Raspiblitz menu.
|
||||
In the command line, type:
|
||||
`menu`
|
||||
The Raspiblitz menu has a reboot option if you scroll down. Select it and reboot.
|
||||
|
||||

|
||||
|
||||
|
||||
After the Raspiblitz is rebooted, set a password for the VNC Server:
|
||||
`sudo vncpasswd -service`
|
||||
|
||||
Set the Authentication parameter:
|
||||
`sudo echo "Authentication=VncAuth" > /etc/vnc/config.d/common.custom`
|
||||
|
||||
Restart the VNC Server for settings to take effect:
|
||||
`sudo systemctl restart vncserver-x11-serviced`
|
||||
|
||||
Open the relevant port in the firewall (ufw):
|
||||
`sudo ufw allow vnc`
|
||||
|
||||
Start the VNC server from the Raspiblitz:
|
||||
`vncserver`
|
||||
This will run by default in the display number '1'. If you want to specify another number, run this (change *\<display-number\>* to whatever you prefer):
|
||||
`vncserver :<display-number>`
|
||||
|
||||

|
||||
|
||||
From the VNC client (e.g. your PC, laptop), connect to the IP that the previous command has displayed in the screen (I covered it in pink in the screenshot). If everything is alright, you can see the display from the VNC client now.
|
||||
|
||||
In order to stop broadcasting your display, stop the server from the Raspiblitz with this:
|
||||
`vncserver -kill :<display-number>`
|
||||
|
||||
For example:
|
||||
`vncserver -kill :1`
|
||||
|
||||
|
||||
**Note**: You may have to set the resolution through raspi-config in certain situations:
|
||||
`sudo raspi-config`
|
||||
*Advanced Options > Resolution*
|
||||
|
||||
**Hint**: From macOS, there is a built in VNC client hidden away at: /System/Library/CoreServices/Applications/Screen\ Sharing.app
|
||||
|
||||
**Hint 2**: Find more info about VNC in Raspberry [here](https://www.raspberrypi.org/documentation/remote-access/vnc/).
|
||||
|
||||
|
||||
### Why use BTRFS on RaspiBlitz?
|
||||
|
||||
The file system [BTRFS](https://de.wikipedia.org/wiki/Btrfs) for your HDD/SSD provides two new features to make the data storage more resilient:
|
||||
|
||||
#### Storing your important Data in RAID1 with a USB Thumb Drive
|
||||
|
||||
BTRFS comes with build in RAID features - that means that data can be stored on two physical drives at the same time and if one is failing the other one can be used to heal the other one or its replacement.
|
||||
|
||||
For the Raspiblitz this means that you can connect an additional 32GB USB3 Thumb Drive (under 10 USD) and have it running in a RAID with your HDD/SSD - keeping your LND channel data and all other important data of your RaspiBlitz double-safe.
|
||||
|
||||
#### Snapshotting the Blockchain
|
||||
|
||||
BTRFS comes with a build in snapshot feature - that means that your RaspiBlitz can make every day a backup of the blockchain data and if a blockchain corruption occurs (example thru a power outage) there is no need to sync the complete chain again. Just switch back to the last backup state and quickly sync up from there. On BTRFS such backups can be done as snapshots that dont need much more space on the drive and are quickly done - no need to buy a bigger SSD or wait for copying over 200GB.
|
||||
|
||||
#### How do I use BTRFS on RaspiBlitz?
|
||||
|
||||
Because the BTRFS is still experimental it's a bit hidden. There are two ways to activate:
|
||||
|
||||
- When you start a fresh setup just connect a 32GB Thumb Drive on the second USB3 port from the beginning and you should be asked during HDD setup if you want to try out BTRFS and gave the Thumb Drive as RAID1.
|
||||
|
||||
- If you have a existing RaspiBlitz and you want to switch to BTRFS then you need to export a Migration File (MAINMENU > REPAIR > MIGRATION) an then format your HDD/SSD clean. When you import a Migration File during a fresh Setup (see above) you will get the option to format the HDD/SSD with BTRFS.
|
||||
|
||||
Once the Blitz is running on BTRFS you can use the '/home/admin/config.scripts/blitz.datadrive.sh' script to add a RAID drive or make a snapshot.
|
||||
|
||||
#### How to recover a BTRFS partition?
|
||||
|
||||
This articles goes thru the usual options:
|
||||
https://ownyourbits.com/2019/03/03/how-to-recover-a-btrfs-partition/
|
||||
https://seravo.fi/2015/using-raid-btrfs-recovering-broken-disks
|
@ -1,44 +0,0 @@
|
||||
Some good practices for assembling your node's hardware can be found below.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Setup with Metal Case](#setup-with-metal-case)
|
||||
- [Setup with Heatsink Case](#setup-with-heatsink-case)
|
||||
|
||||
|
||||
## Setup with Metal Case
|
||||
|
||||
1. Apply thermal pads.
|
||||
2. Close the case.
|
||||
3. Make sure you use the right pins when mounting the display.
|
||||
4. Connect the SSD with the raspberry pi.
|
||||
5. Plug your device into power and give it internet access to check if
|
||||
everything is working as expected.
|
||||
|
||||

|
||||
|
||||
|
||||
## Setup with Heatsink Case
|
||||
|
||||
1. Put screw mounts on the SSD shield.
|
||||
2. Prepare screws for mounting the Raspberry PI and corresponding heat sink.
|
||||
3. Apply thermal pads.
|
||||
4. Attach the heat sink and raspberry pi.
|
||||
5. Attach the foot that will later hold things in place.
|
||||
6. Make sure you use the right pins when mounting the display.
|
||||
7. Fasten the SSD so that it doesn't shake.
|
||||
|
||||

|
||||
|
||||
|
||||
8. Open the SD card slot.
|
||||
9. Attach everything to the case.
|
||||
10. Close the case.
|
||||
11. Connect the SSD with the raspberry pi.
|
||||
12. Insert the flashed SD card.
|
||||
13. Remember to use a tamper evident bag before entrusting a third party
|
||||
with physical access to the device.
|
||||
|
||||

|
||||
|
||||
|
12
Makefile
12
Makefile
@ -5,12 +5,12 @@ GITHUB_HEAD_REF = $(shell git rev-parse --abbrev-ref HEAD)
|
||||
amd64-lean-desktop-uefi-image:
|
||||
# Run the build script
|
||||
cd ci/amd64 && \
|
||||
bash packer.build.amd64-debian.sh \
|
||||
sudo bash packer.build.amd64-debian.sh \
|
||||
--pack lean \
|
||||
--github_user $(GITHUB_ACTOR) \
|
||||
--branch $(GITHUB_HEAD_REF) \
|
||||
--preseed_file preseed.cfg \
|
||||
--boot uefi\
|
||||
--boot uefi \
|
||||
--desktop gnome
|
||||
|
||||
# Compute the checksum of the qemu image
|
||||
@ -31,7 +31,7 @@ amd64-lean-desktop-uefi-image:
|
||||
amd64-lean-server-legacyboot-image:
|
||||
# Run the build script
|
||||
cd ci/amd64 && \
|
||||
bash packer.build.amd64-debian.sh \
|
||||
sudo bash packer.build.amd64-debian.sh \
|
||||
--pack lean \
|
||||
--github_user $(GITHUB_ACTOR) \
|
||||
--branch $(GITHUB_HEAD_REF) \
|
||||
@ -57,12 +57,12 @@ amd64-lean-server-legacyboot-image:
|
||||
amd64-fatpack-desktop-uefi-image:
|
||||
# Run the build script
|
||||
cd ci/amd64 && \
|
||||
bash packer.build.amd64-debian.sh \
|
||||
sudo bash packer.build.amd64-debian.sh \
|
||||
--pack fatpack \
|
||||
--github_user $(GITHUB_ACTOR) \
|
||||
--branch $(GITHUB_HEAD_REF) \
|
||||
--preseed_file preseed.cfg \
|
||||
--boot uefi\
|
||||
--boot uefi \
|
||||
--desktop gnome
|
||||
|
||||
# Compute the checksum of the qemu image
|
||||
@ -83,7 +83,7 @@ amd64-fatpack-desktop-uefi-image:
|
||||
arm64-rpi-lean-image:
|
||||
# Run the build script
|
||||
cd ci/arm64-rpi && \
|
||||
bash packer.build.arm64-rpi.local.sh \
|
||||
sudo bash packer.build.arm64-rpi.local.sh \
|
||||
--pack lean \
|
||||
--github_user $(GITHUB_ACTOR) \
|
||||
--branch $(GITHUB_HEAD_REF)
|
||||
|
91
SECURITY.md
91
SECURITY.md
@ -1,91 +0,0 @@
|
||||
# Security Policy
|
||||
|
||||
*NOTE: This document is just a first draft and still under construction.*
|
||||
|
||||
Only use this software with funds you could afford to lose. Especially a lightning wallet that is a hot wallet, which has constant connection to the internet and can be target of exploitation.
|
||||
|
||||
Just because the software is OpenSource does not mean its free of errors. Especially if you run additional apps, the RaspiBlitz team cannot review all the code of those external projects.
|
||||
|
||||
The software is provided "AS IS", without warranty of any kind. In no event shall the authors or copyright holders be liable for any claim, damages or other
|
||||
liability. [details on legal license](LICENSE.md)
|
||||
|
||||
## Minimal SD Card Build
|
||||
|
||||
To improve the UX for beginners & casual users we decided to preinstall & activate lots of features like LCD, API & WebUI of RaspiBlitz from the beginning and even preinstall/compile a selection of additional apps in the default `fatpack` sd card image. This creates a bigger attack surface and more trusted dependencies on the security side. For more advanced users we also provide a `minimal` sd card image in the download section - which aims to install just the basics and every else will be just installed/compiled on-demand - this is recommended for users (especially on updates) that already know what features they want/need from their RaspiBlitz to run it with the reduced attack surface. To create a minimal sd card yourself run the `build_sdcard.sh` script with the options `-f 0` (fatpack off) & `-d headless` (to not preinstall external LCD drivers).
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Updates are made only for the latest version.
|
||||
|
||||
Security patches can be done with `MAINMENU > UPDATE > PATCH` for the current branch in the case of a high risk issue before next release.
|
||||
|
||||
The latest version always have the `latest` tag. To make sure you are using the latest version, run:
|
||||
```
|
||||
curl -s https://api.github.com/repos/rootzoll/raspiblitz/releases/latest|grep tag_name|head -1|cut -d '"' -f4
|
||||
```
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
To report security issues send an email to christian@rotzoll.de (not for support).
|
||||
|
||||
The following keys may be used to communicate sensitive information to developers:
|
||||
|
||||
| Name | Fingerprint | 64-bit |
|
||||
|------|-------------|--------|
|
||||
|Rootzoll|92A7 46AE 33A3 C186 D014 BF5C 1C73 060C 7C17 6461|1C73 060C 7C17 6461|
|
||||
|Openoms|13C6 88DB 5B9C 745D E4D2 E454 5BFB 7760 9B08 1B65|5BFB 7760 9B08 1B65|
|
||||
|
||||
You can import a key by running the following command with that individual’s fingerprint:
|
||||
```
|
||||
curl https://keybase.io/rootzoll/pgp_keys.asc | gpg --import
|
||||
curl https://keybase.io/oms/pgp_keys.asc | gpg --import
|
||||
```
|
||||
Ensure that you put quotes around fingerprints containing spaces if importing with other methods.
|
||||
|
||||
# Privacy Protection
|
||||
|
||||
When you call `debug` on the command line you get basic system & services logs that can be used if you need to report details for support by other users. There is already a basic redaction of private data (nodeids, IPv4s, .onion-addresses, balances) for that debug report BUT always check the data you post in DMs or public before sending. If you find further private data that needs redaction, please report as an issue on the github repo.
|
||||
|
||||
# Network Security
|
||||
|
||||
* Limit attack surface: Wi-fi and Bluetooth is disabled by default in the build script.
|
||||
* Firewall: UFW is active and only specific ports are open, closing ports and removing hidden services when services are uninstalled.
|
||||
* Password brute forcing protection: Fail-2-Ban is protecting the SSH login against brute-force-attacks.
|
||||
|
||||
# Software security
|
||||
|
||||
* The `admin` (and the `joinmarket` [optional]) users have passwordless sudo access to be able to perform installations and read password without much user interaction.
|
||||
|
||||
* Downloaded binaries and source code is verified with the authors' PGP keys by either:
|
||||
* signed shasum files and checking the hash of each downloaded binary
|
||||
* verifying the signature on the source code changes utilising the `git verify-commit` or `git verify-tag` commands
|
||||
|
||||
# Physical Security
|
||||
|
||||
* The lightning wallet and user interfaces are password protected by default so this has more privacy implications (in the case of physical theft) than security.
|
||||
* Basic hardening measures are applied to all non-root systemd services
|
||||
* Optional log in through SSH using a hardware wallet.
|
||||
* LUKS encryption would be welcome in the future.
|
||||
|
||||
# On-chain Funds
|
||||
|
||||
Please keep in mind that there can be two different on-chain wallets on the RaspiBlitz:
|
||||
|
||||
## Lightning Wallet (default)
|
||||
|
||||
The default is the on-chain lightning wallet - that's the wallet where you normally send your funds before opening a channel & where your funds return to when you close a channel. With the initial word seed you get during RaspiBlitz setup, you can get access again to this on-chain wallet. Keep the seed words secure in a off-line location.
|
||||
|
||||
## Bitcoin Core Wallet (deactivated by default)
|
||||
|
||||
Beside lightning you have a Bitcoin core installed. Normally, Bitcoin core acts just as a blockchain informational service to the lightning wallet and its internal separate on-chain wallet is deactivated.
|
||||
|
||||
Some apps (like Fully Noded or JoinMarket) activate the Bitcoin core wallet and use it for their own needs. This on-chain balance will not be reflected in the rest of the RaspiBlitz software and is NOT backed up by the seed words from the RaspiBlitz setup. If you make use of the Bitcoin core wallet please take care of these funds.
|
||||
|
||||
# Off-chain Funds (Lightning Channels)
|
||||
|
||||
Please note that there is no perfect backup concept for the funds in your lightning channels yet. We strongly recommend using the `Static Channel Backup` provided by LND and consider off-line location backup of that file to have the best chances to recover Lightning funds in a case of recovering from a disaster.
|
||||
|
||||
The C-lightning lightning.sqlite3 is replicated on the SDcard from the disk in real time. See more details in the [Core Lightning FAQ](FAQ.cl.md#backups)
|
||||
|
||||
|
||||
For more practical information on this topic see: [Backup Channel Funds](README.md#backup-for-on-chain---channel-funds)
|
228
WORKSHOP.md
228
WORKSHOP.md
@ -1,228 +0,0 @@
|
||||
# RaspiBlitz Workshop Tutorial
|
||||
|
||||
One goal of the RaspiBlitz project is to provide an open DIY platform for workshops - to setup your own lightning node and learn to manage it. This tutorial is collecting best practices on how to organise a RaspiBlitz workshop.
|
||||
|
||||
<br/>
|
||||
|
||||
# Time Planning
|
||||
|
||||
First thing on planning a RaspiBlitz workshop is to calculate the time needed correctly. For example, the setup from scratch with no further support is still a weekend project - mostly because downloading and syncing the blockchain takes a lot of time.
|
||||
|
||||
|
||||
So the time required for the workshop all depends on the preparation you as a workshop organizer are interested to provide ahead of the workshop. This document outlines three starting configurations... going from most preparation required to least.
|
||||
|
||||
Note that the time estimates below are about getting a node to a "clean setup". They do not include the funding & setting up channels process - which is adding an additional 30 min to 1 hour to the calculation.
|
||||
|
||||
|
||||
Also, if your group is lager then 5 participants, calculate some extra time for individual support. You can compensate for that if you let two participants work together on one RaspiBlitz setup; this way you limit individual support and let them help each other.
|
||||
|
||||
|
||||
## Workshop Scenario A) Provide a Ready-2-Go RaspiBlitz
|
||||
|
||||
_Estimated Duration: 2 Hours_
|
||||
|
||||
Sure, one part of the fun for participants is to assemble the hardware themselves. But if you aim for the shortest workshop possible, then this is the way to go (around 2 hours length). If you have the RaspiBlitz already assembled to be operational at the workshop you should already set them up with a basic setup, maybe even transfer a small amount of coins onto them. This way you can give the workshop participants the A.B.C.D passwords on a sheet of paper and let them jump right into learning how to manage a node. While waiting for confirmations on the first channel opening you can use the time to explain how to build a RaspiBlitz from scratch and some Lightning basics.
|
||||
|
||||
These are the following steps you need to prepare (follow links for details):
|
||||
|
||||
- [Buy all the Hardware](WORKSHOP.md#buy-all-the-hardware)
|
||||
- [Assemble all the Hardware](WORKSHOP.md#assemble-all-the-hardware)
|
||||
- [Prepare HDDs with Blockchain Data](WORKSHOP.md#prepare-hdds-with-blockchain-data)
|
||||
- [Prepare SD cards with latest RaspiBlitz image](WORKSHOP.md#prepare-sd-cards-with-latest-raspiblitz-image)
|
||||
- Run Basic Node Setup
|
||||
- [Setup Workshop Environment](WORKSHOP.md#setup-workshop-environment)
|
||||
|
||||
_NOTE: Make sure that the blockchain of the RaspiBlitzes are synced before the workshop begins._
|
||||
|
||||
## Workshop Scenario B) Provide a RaspiBlitz Hardware-Kit
|
||||
|
||||
_Estimated Duration: 3 Hours_
|
||||
|
||||
|
||||
In this workshop scenario you buy all the hardware but let participants assemble the RaspiBlitz themselves - that's half the fun and people get a feel for the gear. But to keep the blockchain sync time short and be able to keep in a 3 hour timeframe you need to prepare the HDDs with blockchain data not much older than one day. Start ordering the parts at least one week before the workshop (budget as needed) and plan the day before completely for copying blockchain data to all those HDDs.
|
||||
|
||||
|
||||
These are the following steps you need to prepare (follow links for details):
|
||||
|
||||
- [Buy all the Hardware](WORKSHOP.md#buy-all-the-hardware)
|
||||
- [Prepare HDDs with Blockchain Data](WORKSHOP.md#prepare-hdds-with-blockchain-data)
|
||||
- [Prepare SD cards with latest RaspiBlitz image](WORKSHOP.md#prepare-sd-cards-with-latest-raspiblitz-image)
|
||||
- [Setup Workshop Environment](WORKSHOP.md#setup-workshop-environment)
|
||||
|
||||
Variation: If you don't have a big bugdet to prefinance the parts or people have already hardware they want to bring you can just buy the HDDs and SD cards and prepare them to run this scenario.
|
||||
|
||||
|
||||
## Workshop Scenario C) Bring your own Hardware
|
||||
|
||||
|
||||
_Estimated Duration: 4–6 Hours_
|
||||
|
||||
This scenario is advised only for small groups, or you'll need to bring multiple blockchain copy stations - see details on "Prepare HDDs with Blockchain Data". Otherwise it needs the least preparation time and prefinance and can be announced to participants about 5 days beforehand, so that they have time to order all the parts online.
|
||||
|
||||
|
||||
- [Instruct Participants to bring Hardware](WORKSHOP.md#instruct-participants-to-bring-hardware)
|
||||
- [Prepare Blockchain Copy Station](WORKSHOP.md#prepare-blockchain-copy-station)
|
||||
- [Setup Workshop Environment](WORKSHOP.md#setup-workshop-environment)
|
||||
|
||||
|
||||
As soon as the participants arrive at the workhop, make sure to check their hardware list. We also suggest taking their HDDs and starting the blockchain copy process before official starting time.
|
||||
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
# Checklist for Running a Workshop
|
||||
|
||||
Make sure you have the following hardware and infrastructure ready for the workshop:
|
||||
|
||||
- Lots of 'multiple power outlets/extensions' (min. 2 per participants - RaspiBlitz + Laptop)
|
||||
- Network-Switch with enough ports (min. 1 per RaspiBlitz)
|
||||
- Enough LAN network cables (short ones to connect the RaspiBlitzes)
|
||||
- Good internet connection at location with LAN port (or a WLAN to LAN adapter)
|
||||
- Extra WLAN Router (if you are not sure if LAN & WLAN is not on the same network at location)
|
||||
- One or two USB SD card adapters
|
||||
- One or two USB-C to USB-A adapters
|
||||
- Some Tape, Markers & Pens always come in handy (also for participants to write down seeds & passwords)
|
||||
- Potentially some bitcoin funds (if people dont have their own to start funding channels)
|
||||
|
||||
Participants need to bring at least their laptops.
|
||||
|
||||
<br/>
|
||||
|
||||
# Running of the Workshop
|
||||
|
||||
_The basic structure of the workshop is set by the RaspiBlitz setup process. Simply follow that. The following parts should share some experiences and suggestions on how you can optimize the time and mentoring during this process. Feel free to share your experience here._
|
||||
|
||||
## Welcome and Intro
|
||||
|
||||
In the beginning, it's great to give a small introduction to the Lightning Network and show the RaspiBlitz GitHub page to let everybody know where to find the basic info. But try to keep it around 10 min, in order to not waste time.
|
||||
|
||||
|
||||
Also, even before the intro, take care of the blockchain preparation. If people bring clean HDDs, hook them up to your blockchain copy station as soon as possible. If you have to copy on location, plan to spend time for some deeper educational intro while the HDDs get prepared.
|
||||
|
||||
## Assembling
|
||||
|
||||
If you hand out hardware kits or people bring their own hardware, it's time to put it together. If you are in a ready-2-go scenario, of course skip this and just hand them out.
|
||||
|
||||
## Basic Setup
|
||||
|
||||
|
||||
Connect everybody's laptop to the same local network the RaspiBlitzes are connected to. Be prepared to explain how to open a terminal - Windows' users especially need some help here (see README on this).
|
||||
|
||||
|
||||
Then everybody is SSHing into the RaspiBlitz and is following the setup dialog. Hand out paper and pens for people to write down their passwords and wallet seeds.
|
||||
|
||||
## Waiting Time
|
||||
|
||||
After the lightning wallet setup comes the longest waiting time during the workshop - around 30 min. When you have a presynced ready-2-go or up to 1 hour for the other scenarios. It's the time when the node is syncing up the blockchain and LND is scanning. If you see someone's blockchain progress under 97%, something is wrong - possibly the HDD was not correctly prepared or the blockchain data is way too old to finish during workshop time if you work with old RaspberryPi3. The new RaspberryPi4 with SSD can catch up much faster.
|
||||
|
||||
|
||||
Use this time for a more in-depth educational segment on lightning in general. This time can also be used to demo with one RaspiBlitz that is already on clean-setup (you prepared before the workshop) how the funding, setting up channels and the other features of the RaspiBlitz work. That way people see what are the next steps once their node is ready and even if your workshop time is over by then they can know the next steps to do at home.
|
||||
|
||||
Also this time is good for troubleshooting in individual sessions. If someone is not able to finish the sync on location in time shutdown the Raspiblitz from SSH terminal with CTRL+C and then `shutdown now`. If the device gets connected back up at home it should pickup the sync/scan process (let people know about the wallet unlock).
|
||||
|
||||
|
||||
## Finalizing Setup
|
||||
|
||||
Once the RaspiBlitz is ready (LCD shows status screen) and people can SSH into the main menu, let them go into the `SERVICES` section and activate the `RTL WebUI`. It's the best interface to then continue with the peering, funding and channel opening.
|
||||
|
||||
## Funding, Channels, API
|
||||
|
||||
Check how much time is left to go thru the next steps of connecting to peers, funding and opening channels. While you wait on funding or channel opening confirmations, its a good moment to try to connect users mobile wallets with the device. But just so that on the local network for demo - dynamicDNS is something people then can try at home with port forwarding on their routers.
|
||||
|
||||
Its also nice to add casual social open-end segment to the end of the workshop. So people can already go into personal conversations, music and beverages while some last nodes sync up, confirmations come in and people sending their first satoshis on some lightning chess or from node to node.
|
||||
|
||||
Here are some videos that show what else is possible with the RaspiBlitz:
|
||||
|
||||
- [Lightning Network LND API - Buying Stickers using Commandline](https://youtu.be/tocJFPU8sAc) 24min
|
||||
|
||||
<br/>
|
||||
|
||||
# Organisation Tasks
|
||||
|
||||
|
||||
*Which of the following organisation tasks are relevant for you depends on which starting scenario you choose (see above). Here is the complete possible list with details:*
|
||||
|
||||
|
||||
## Buy all the Hardware
|
||||
|
||||
See the shopping list on the RaspiBlitz Github README. You need to buy all of those, and every participant also needs a short (about 1m) network cable.
|
||||
|
||||
|
||||
From experience start ordering two weeks before the workshop (if you need to assemble) and minimum one week if you're handing out hardware kits - even if you have Amazon Prime. There is always a shipment coming late, and it's a lot of packages.
|
||||
|
||||
|
||||
If you like to support the RaspiBlitz project you can order a ready-2-go RaspiBlitz or a all-you-need-hardwareset for your RaspiBlitz workshop from [raspiblitz.com](https://raspiblitz.com)
|
||||
|
||||
## Instruct Participants to Bring Hardware
|
||||
|
||||
This is for the scenario where people bring their own hardware. Make sure to let them know at least a week before the event so that there is enough time for online ordering. Also make sure that especially the power supply needs to provide 3A and a stable current (big fat with a thick cable is good) because that's the most often error source if people just reuse some old weak power supply.
|
||||
|
||||
In all scenarios make sure people bring their laptops.
|
||||
|
||||
## Assemble all the Hardware
|
||||
|
||||
|
||||
Basically you follow the assembly instructions on the RaspiBlitz GitHUb README. Think of a safe way to transport the assembled devices to the workshop location - HDDs like it soft.
|
||||
|
||||
|
||||
## Prepare HDDs with Blockchain Data
|
||||
|
||||
This is the most time consuming part of the preparation. Try it once to get a feel for how much time you need to prepare one HDD. If you prepare more than one HDD check out the "Copystation" script below.
|
||||
|
||||
A prepared HDD is formatted in EXT4 and named "BLOCKCHAIN". In a folder called `bitcoin` it contains a copy of the following data folders from a running Bitcoin core client (same version on RaspiBlitz).
|
||||
|
||||
```
|
||||
/bitcoin/blocks
|
||||
/bitcoin/chainstate
|
||||
```
|
||||
|
||||
The bitcoin core client (0.17.1 or higher) needs to be stopped while the data is copied to the HDD.
|
||||
|
||||
The easiest way to get a "template" of such HDD is to setup a fresh RaspiBlitz (without channel and fundings) and then run the script `/home/admin/XXcleanHDD.sh` and manually delete all rest data from the HDD and just leave those folders.
|
||||
|
||||
|
||||
Once you have that "template" you can make an image from that and write that image to the other HDDs.
|
||||
|
||||
|
||||
|
||||
## Prepare Blockchain Copy Station
|
||||
|
||||
In the RaspiBlitz GitHub repo and also on every RaspiBlitz (since v1.3) you can find the script:
|
||||
`/home/admin/XXcopyStation.sh`
|
||||
|
||||
This can be used to prepare and keep multiple HDDs in sync with blockchain data in preparation of a workshop. You can start it directly on a RaspiBlitz and turn it into "Copy Station Mode" by executing on the command line:
|
||||
|
||||
`sudo /home/admin/XXcopyStation.sh`
|
||||
|
||||
_Beware that it will not run as a Lightning Node during that time (LND is stopped). And to reset it back into normal mode you need to stop the script with `CTLR+c` and the reboot with `sudo shutdown -r now`._
|
||||
|
||||
|
||||
In "Copy Station Mode" the RaspiBlitz will just run the bitcoind (so it needs network connection), copy fresh blockchain data over to a template folder on the HDD called `/mnt/hdd/templateHDD` and from there sync it to further HDDs that get connected to it.
|
||||
|
||||
If you run it in a setup like on this photo with an extra powered USB hub, you can connect up to 10 HDDs at once to be synced with an almost up-to-date blockchain.
|
||||
|
||||
At the moment the "Blockchain Copy Station" is just a computer (laptop - not a RaspberryPi) having an image of a "template" HDD (see above) and you can attach (with a USB3.0 Hub) multiple fresh HHDs to it and start writing in the template image to that.
|
||||
|
||||
To update the "template" HDD for the next workshop use it for a fresh clean RaspiBllitz setup just days before, sync the blockchain to 100% and repeat the process above.
|
||||
|
||||
_This version is not tested, but seems like the easiest to setup so far. Images can have the problem of being too large when some 1TB HDDs are just some bytes smaller. So for the template HDD it would be best to find the smallest 1TB HDD possible or just writing the image to HDDs of the same brand & model._
|
||||
|
||||
Copying the blockchain between RaspberryPis during the workshop is not an option, because the network and its USB2 is too slow and will take 3 to 4 hours.
|
||||
|
||||
For former workshops I had a laptop just with the data and had a script that was formatting and rsyning that data over to a fresh HDD. That took around 1,5 hours per HDD.
|
||||
|
||||
_If someone has a better idea for a 'Blockchain Copy Station', please feel free to contribute._
|
||||
|
||||
## Prepare SD Cards with Latest RaspiBlitz Image
|
||||
|
||||
Download the latest RaspiBlitz SD card image from the README page. `Balena Etcher` is the best image writing software for this use case because if you have multiple sd card adapters, you can write multiple cards at once,cutting down your preparation time.
|
||||
|
||||
## Setup Workshop Environment
|
||||
|
||||
See hardware checklist for what to bring to the workshop in the earlier chapter.
|
||||
|
||||
Setup power outlets for everybody. Its always good to be way early at the workshop location for setup, especially if you run the "pre-sync" of the ready-2-go scenario.
|
||||
|
||||
Most important is the network setup. Every RaspiBlitz needs a LAN port in the switch and that switch needs to be on the same local network as the WLAN so that participants laptop can SSH into the RaspiBlitz. If that is not the case or you cannot confirm that before the event its best to bring an additional WLAN router. Then you give the WLAN router internet uplink thru the available LAN cable and you put the network switch for the Raspiblitzes behind that router and open an additional WLAN on that WLAN router for everybody to connect to. It's OK to be behind a NAT; it's just important for everybody to be behind the same NAT.
|
||||
|
@ -78,23 +78,26 @@ Tested with:
|
||||
These not need installation, password: `osboxes.org`
|
||||
|
||||
### Building the Raspiblitz scripts
|
||||
* Run the build script in the terminal of the guest OS (with sudo access):
|
||||
* Run the build script in the terminal of the base OS (with sudo access):
|
||||
|
||||
```bash
|
||||
# download the build script
|
||||
wget https://raw.githubusercontent.com/rootzoll/raspiblitz/dev/build_sdcard.sh
|
||||
# run
|
||||
sudo bash build_sdcard.sh -f true -b dev -d headless -t false -w off
|
||||
# Options:
|
||||
# -h, --help this help info
|
||||
# -i, --interaction [0|1] interaction before proceeding with execution (default: 1)
|
||||
# -f, --fatpack [0|1] fatpack mode (default: 1)
|
||||
# -u, --github-user [rootzoll|other] github user to be checked from the repo (default: rootzoll)
|
||||
# -b, --branch [v1.7|v1.8] branch to be built on (default: v1.7)
|
||||
# -d, --display [lcd|hdmi|headless] display class (default: lcd)
|
||||
# -t, --tweak-boot-drive [0|1] tweak boot drives (default: 1)
|
||||
# -w, --wifi-region [off|US|GB|other] wifi iso code (default: US) or 'off'
|
||||
```
|
||||
```bash
|
||||
# download the build script
|
||||
wget https://raw.githubusercontent.com/rootzoll/raspiblitz/dev/build_sdcard.sh
|
||||
# run
|
||||
sudo bash build_sdcard.sh -f false -b dev -d headless -t false -w off
|
||||
```
|
||||
```
|
||||
Options:
|
||||
-EXPORT just print build parameters & exit'
|
||||
-h, --help this help info
|
||||
-i, --interaction [0|1] interaction before proceeding with execution (default: 1)
|
||||
-f, --fatpack [0|1] fatpack mode (default: 1)
|
||||
-u, --github-user [raspiblitz|other] github user to be checked from the repo (default: raspiblitz)
|
||||
-b, --branch [v1.7|v1.8] branch to be built on (default: v1.10)
|
||||
-d, --display [lcd|hdmi|headless] display class (default: lcd)
|
||||
-t, --tweak-boot-drive [0|1] tweak boot drives (default: 1)
|
||||
-w, --wifi-region [off|US|GB|other] wifi iso code (default: US) or 'off'
|
||||
```
|
||||
|
||||
* Switch off when ready
|
||||
* Attach an other disk (can be even small if you prune or [stop bitcoind](https://github.com/rootzoll/raspiblitz/issues/1500#issuecomment-982779830) manually.
|
||||
|
@ -21,18 +21,8 @@
|
||||
"ssh_username": "vagrant",
|
||||
"type": "virtualbox-iso",
|
||||
"vboxmanage": [
|
||||
[
|
||||
"modifyvm",
|
||||
"{{.Name}}",
|
||||
"--memory",
|
||||
"1024"
|
||||
],
|
||||
[
|
||||
"modifyvm",
|
||||
"{{.Name}}",
|
||||
"--cpus",
|
||||
"1"
|
||||
]
|
||||
["modifyvm", "{{.Name}}", "--memory", "1024"],
|
||||
["modifyvm", "{{.Name}}", "--cpus", "1"]
|
||||
],
|
||||
"vm_name": "raspiblitz-amd64"
|
||||
}
|
||||
@ -63,10 +53,9 @@
|
||||
],
|
||||
"variables": {
|
||||
"branch": "dev",
|
||||
"github_user": "rootzoll",
|
||||
"iso_checksum": "3b0e9718e3653435f20d8c2124de6d363a51a1fd7f911b9ca0c6db6b3d30d53e",
|
||||
"github_user": "raspiblitz",
|
||||
"iso_checksum": "23ab444503069d9ef681e3028016250289a33cc7bab079259b73100daee0af66",
|
||||
"iso_checksum_type": "sha256",
|
||||
"iso_url": "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.0.0-amd64-netinst.iso"
|
||||
"iso_url": "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.2.0-amd64-netinst.iso"
|
||||
}
|
||||
}
|
||||
|
||||
|
263
build_sdcard.sh
263
build_sdcard.sh
@ -1,16 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#########################################################################
|
||||
# Build your SD card image based on: 2022-04-04-raspios-bullseye-arm64.img.xz
|
||||
# https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2023-05-03/
|
||||
# SHA256: e7c0c89db32d457298fbe93195e9d11e3e6b4eb9e0683a7beb1598ea39a0a7aa
|
||||
# PGP fingerprint: 8738CD6B956F460C
|
||||
# PGP key: https://www.raspberrypi.org/raspberrypi_downloads.gpg.key
|
||||
# setup fresh SD card with image above - login per SSH and run this script:
|
||||
# Build your SD card image based on: 2023-12-05-raspios-bookworm-arm64.img.xz
|
||||
# https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2024-03-15/
|
||||
# SHA256: 7e53a46aab92051d523d7283c080532bebb52ce86758629bf1951be9b4b0560f
|
||||
# also change in: raspiblitz/ci/arm64-rpi/build.arm64-rpi.pkr.hcl
|
||||
# PGP fingerprint: 8738CD6B956F460C - to check signature:
|
||||
# curl -O https://www.raspberrypi.org/raspberrypi_downloads.gpg.key && gpg --import ./raspberrypi_downloads.gpg.key && gpg --verify *.sig
|
||||
# setup fresh SD card with image above - login via SSH and run this script:
|
||||
##########################################################################
|
||||
|
||||
defaultRepo="raspiblitz" #user that hosts a `raspiblitz` repo
|
||||
defaultBranch="v1.10"
|
||||
defaultRepo="raspiblitz" # user that hosts a `raspiblitz` repo
|
||||
defaultBranch="v1.11" # latest version branch
|
||||
|
||||
defaultAPIuser="fusion44"
|
||||
defaultAPIrepo="blitz_api"
|
||||
@ -30,9 +31,9 @@ usage(){
|
||||
Options:
|
||||
-EXPORT just print build parameters & exit'
|
||||
-h, --help this help info
|
||||
-i, --interaction [0|1] interaction before proceeding with exection (default: 1)
|
||||
-i, --interaction [0|1] interaction before proceeding with execution (default: 1)
|
||||
-f, --fatpack [0|1] fatpack mode (default: 1)
|
||||
-u, --github-user [raspiblitz|other] github user to be checked from the repo (default: ${defaultRepo})
|
||||
-u, --github-user [raspiblitz|other] github user to be checked from the repo (default: ${defaultRepo})
|
||||
-b, --branch [v1.7|v1.8] branch to be built on (default: ${defaultBranch})
|
||||
-d, --display [lcd|hdmi|headless] display class (default: lcd)
|
||||
-t, --tweak-boot-drive [0|1] tweak boot drives (default: 1)
|
||||
@ -55,8 +56,8 @@ if [ "$EUID" -ne 0 ]; then
|
||||
fi
|
||||
|
||||
if [ "$1" = "-EXPORT" ] || [ "$1" = "EXPORT" ]; then
|
||||
cd /home/admin/raspiblitz 2>/dev/null
|
||||
activeBranch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
|
||||
activeBranch=$(git -C /home/admin/raspiblitz branch --show-current 2>/dev/null)
|
||||
echo "activeBranch='${activeBranch}'"
|
||||
if [ "${activeBranch}" == "" ]; then
|
||||
activeBranch="${defaultBranch}"
|
||||
fi
|
||||
@ -106,7 +107,7 @@ get_arg(){
|
||||
}
|
||||
|
||||
## hacky getopts
|
||||
## 1. if the option requires argument, and the option is preceeded by single or double dash and it
|
||||
## 1. if the option requires an argument, and the option is preceeded by single or double dash and it
|
||||
## can be it can be specified with '-s=ssh' or '-s ssh' or '--service=ssh' or '--service ssh'
|
||||
## use: get_arg variable_name "${opt}" "${arg}"
|
||||
## 2. if a bunch of options that does different things are to be assigned to the same variable
|
||||
@ -150,23 +151,23 @@ range_argument(){
|
||||
|
||||
apt_install() {
|
||||
for package in "$@"; do
|
||||
apt install -y -q "$package"
|
||||
apt-get install -y -q "$package"
|
||||
if [ $? -eq 100 ]; then
|
||||
echo "FAIL! apt failed to install package: $package"
|
||||
echo "FAIL! apt-get failed to install package: $package"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
general_utils="curl"
|
||||
## loop all general_utils to see if program is installed (placed on PATH) and if not, add to the list of commands to be installed
|
||||
## loop through all general_utils to see if program is installed (placed on PATH) and if not, add to the list of commands to be installed
|
||||
for prog in ${general_utils}; do
|
||||
! command -v ${prog} >/dev/null && general_utils_install="${general_utils_install} ${prog}"
|
||||
done
|
||||
## if any of the required programs are not installed, update and if successfull, install packages
|
||||
if [ -n "${general_utils_install}" ]; then
|
||||
echo -e "\n*** SOFTWARE UPDATE ***"
|
||||
apt update -y || exit 1
|
||||
apt-get update -y || exit 1
|
||||
apt_install ${general_utils_install}
|
||||
fi
|
||||
|
||||
@ -237,10 +238,14 @@ done
|
||||
# AUTO-DETECTION: CPU-ARCHITECTURE
|
||||
# ---------------------------------------
|
||||
cpu="$(uname -m)" && echo "cpu=${cpu}"
|
||||
architecture="$(dpkg --print-architecture 2>/dev/null)" && echo "architecture=${architecture}"
|
||||
case "${cpu}" in
|
||||
arm*|aarch64|x86_64|amd64);;
|
||||
*) echo -e "# FAIL #\nCan only build on ARM, aarch64, x86_64 not on: cpu=${cpu}"; exit 1;;
|
||||
aarch64|x86_64);;
|
||||
*) echo -e "# FAIL #\nCan only build on aarch64 or x86_64 not on: cpu=${cpu}"; exit 1;;
|
||||
esac
|
||||
architecture="$(dpkg --print-architecture 2>/dev/null)" && echo "architecture=${architecture}"
|
||||
case "${architecture}" in
|
||||
arm*|amd64);;
|
||||
*) echo -e "# FAIL #\nCan only build on arm* or amd64 not on: architecture=${cpu}"; exit 1;;
|
||||
esac
|
||||
|
||||
# AUTO-DETECTION: OPERATINGSYSTEM
|
||||
@ -265,6 +270,17 @@ else
|
||||
fi
|
||||
echo "baseimage=${baseimage}"
|
||||
|
||||
# AUTO-DETECTION: CONFIGFILES
|
||||
# ---------------------------------------
|
||||
raspi_configfile="/boot/config.txt"
|
||||
raspi_commandfile="/boot/cmdline.txt"
|
||||
if [ -d /boot/firmware ];then
|
||||
raspi_configfile="/boot/firmware/config.txt"
|
||||
raspi_commandfile="/boot/firmware/cmdline.txt"
|
||||
fi
|
||||
echo "raspi_configfile=${raspi_configfile}"
|
||||
echo "raspi_commandfile=${raspi_commandfile}"
|
||||
|
||||
# USER-CONFIRMATION
|
||||
if [ "${interaction}" = "true" ]; then
|
||||
echo -n "# Do you agree with all parameters above? (yes/no) "
|
||||
@ -289,15 +305,25 @@ echo "[Login]
|
||||
HandleLidSwitch=ignore
|
||||
HandleLidSwitchDocked=ignore" | tee /etc/systemd/logind.conf.d/nosuspend.conf
|
||||
|
||||
# check if /etc/hosts already has debian entry
|
||||
# prevent "unable to resolve host debian" error
|
||||
isDebianInHosts=$(grep -c "debian" /etc/hosts)
|
||||
if [ ${isDebianInHosts} -eq 0 ]; then
|
||||
echo "# Adding debian to /etc/hosts"
|
||||
echo "127.0.1.1 debian" | tee -a /etc/hosts > /dev/null
|
||||
systemctl restart networking
|
||||
fi
|
||||
|
||||
# FIXING LOCALES
|
||||
# https://github.com/rootzoll/raspiblitz/issues/138
|
||||
# https://daker.me/2014/10/how-to-fix-perl-warning-setting-locale-failed-in-raspbian.html
|
||||
# https://stackoverflow.com/questions/38188762/generate-all-locales-in-a-docker-image
|
||||
if [ "${baseimage}" = "raspios_arm64" ] || [ "${baseimage}" = "debian" ]; then
|
||||
if [ "${cpu}" = "aarch64" ] && { [ "${baseimage}" = "raspios_arm64" ] || [ "${baseimage}" = "debian" ]; }; then
|
||||
echo -e "\n*** FIXING LOCALES FOR BUILD ***"
|
||||
sed -i "s/^# en_US.UTF-8 UTF-8.*/en_US.UTF-8 UTF-8/g" /etc/locale.gen
|
||||
sed -i "s/^# en_US ISO-8859-1.*/en_US ISO-8859-1/g" /etc/locale.gen
|
||||
locale-gen
|
||||
export LC_ALL=C
|
||||
export LANGUAGE=en_US.UTF-8
|
||||
export LANG=en_US.UTF-8
|
||||
if [ ! -f /etc/apt/sources.list.d/raspi.list ]; then
|
||||
@ -307,13 +333,21 @@ if [ "${baseimage}" = "raspios_arm64" ] || [ "${baseimage}" = "debian" ]; then
|
||||
fi
|
||||
|
||||
echo "*** Remove unnecessary packages ***"
|
||||
apt remove --purge -y libreoffice* oracle-java* chromium-browser nuscratch scratch sonic-pi plymouth python2 vlc* cups
|
||||
apt clean -y
|
||||
apt autoremove -y
|
||||
unnecessary_packages=(libreoffice* oracle-java* chromium-browser nuscratch scratch sonic-pi plymouth python2 vlc* cups)
|
||||
for pkg in "${unnecessary_packages[@]}"; do
|
||||
if dpkg-query -W -f='${Status}' $pkg 2>/dev/null | grep -q "ok installed"; then
|
||||
echo "Removing $pkg..."
|
||||
apt-get remove --purge -y $pkg
|
||||
else
|
||||
echo "$pkg is not installed."
|
||||
fi
|
||||
done
|
||||
apt-get clean -y
|
||||
apt-get autoremove -y
|
||||
|
||||
echo -e "\n*** UPDATE Debian***"
|
||||
apt update -y
|
||||
apt upgrade -f -y
|
||||
apt-get update -y
|
||||
apt-get upgrade -f -y
|
||||
|
||||
echo -e "\n*** SOFTWARE UPDATE ***"
|
||||
# based on https://raspibolt.org/system-configuration.html#system-update
|
||||
@ -335,7 +369,7 @@ echo -e "\n*** SOFTWARE UPDATE ***"
|
||||
# sqlite3 -> database
|
||||
# fdisk -> create partitions
|
||||
# lsb-release -> needed to know which distro version we're running to add APT sources
|
||||
general_utils="policykit-1 htop git curl bash-completion vim jq dphys-swapfile bsdmainutils autossh telnet vnstat parted dosfstools fbi sysbench build-essential dialog bc python3-dialog unzip whois fdisk lsb-release smartmontools"
|
||||
general_utils="sudo policykit-1 htop git curl bash-completion vim jq dphys-swapfile bsdmainutils autossh telnet vnstat parted dosfstools fbi sysbench build-essential dialog bc python3-dialog unzip whois fdisk lsb-release smartmontools rsyslog resolvconf"
|
||||
# add btrfs-progs if not bookworm on aarch64
|
||||
[ "${architecture}" = "aarch64" ] && ! grep "12 (bookworm)" < /etc/os-release && general_utils="${general_utils} btrfs-progs"
|
||||
# python3-mako --> https://github.com/rootzoll/raspiblitz/issues/3441
|
||||
@ -344,9 +378,9 @@ server_utils="rsync net-tools xxd netcat-openbsd openssh-client openssh-sftp-ser
|
||||
[ "${baseimage}" = "armbian" ] && armbian_dependencies="armbian-config" # add armbian-config
|
||||
[ "${architecture}" = "amd64" ] && amd64_dependencies="network-manager" # add amd64 dependency
|
||||
|
||||
apt_install ${general_utils} ${python_dependencies} ${server_utils} ${amd64_dependencies}
|
||||
apt clean -y
|
||||
apt autoremove -y
|
||||
apt_install ${general_utils} ${python_dependencies} ${server_utils} ${amd64_dependencies} ${armbian_dependencies}
|
||||
apt-get clean -y
|
||||
apt-get autoremove -y
|
||||
|
||||
echo -e "\n*** Python DEFAULT libs & dependencies ***"
|
||||
|
||||
@ -377,27 +411,30 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# remove any debian python protection from pip installing modules
|
||||
if [ -f rm /usr/lib/python3.*/EXTERNALLY-MANAGED ]; then
|
||||
rm /usr/lib/python3.*/EXTERNALLY-MANAGED
|
||||
fi
|
||||
# don't protect system packages from pip install
|
||||
# tracking issue: https://github.com/raspiblitz/raspiblitz/issues/4170
|
||||
for PYTHONDIR in /usr/lib/python3.*; do
|
||||
if [ -f "$PYTHONDIR/EXTERNALLY-MANAGED" ]; then
|
||||
rm "$PYTHONDIR/EXTERNALLY-MANAGED"
|
||||
fi
|
||||
done
|
||||
|
||||
# make sure /usr/bin/pip exists (and calls pip3 in Debian Buster)
|
||||
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
|
||||
# 1. libs (for global python scripts)
|
||||
# grpcio==1.42.0 googleapis-common-protos==1.53.0 toml==0.10.2 j2cli==0.3.10 requests[socks]==2.21.0
|
||||
# grpcio==1.59.3 googleapis-common-protos==1.61.0 toml==0.10.2 j2cli==0.3.10 requests[socks]==2.21.0 protobuf==4.25.1 pathlib2==2.3.7.post1
|
||||
# 2. For TorBox bridges python scripts (pip3) https://github.com/radio24/TorBox/blob/master/requirements.txt
|
||||
# pytesseract mechanize PySocks urwid Pillow requests
|
||||
# 3. Nyx
|
||||
# setuptools
|
||||
sudo -H python3 -m pip install --upgrade pip
|
||||
sudo -H python3 -m pip install grpcio==1.42.0 googleapis-common-protos==1.53.0 toml==0.10.2 j2cli==0.3.10 requests[socks]==2.21.0 protobuf==3.20.1 pathlib2==2.3.7.post1
|
||||
sudo -H python3 -m pip install grpcio==1.59.3 googleapis-common-protos==1.61.0 toml==0.10.2 j2cli==0.3.10 requests[socks]==2.21.0 protobuf==4.25.1 pathlib2==2.3.7.post1
|
||||
sudo -H python3 -m pip install pytesseract mechanize PySocks urwid Pillow requests setuptools
|
||||
|
||||
echo -e "\n*** PREPARE ${baseimage} ***"
|
||||
|
||||
# make sure the pi user is present
|
||||
if [ "$(compgen -u | grep -c pi)" -eq 0 ];then
|
||||
if ! compgen -u pi; then
|
||||
echo "# Adding the user pi"
|
||||
adduser --system --group --shell /bin/bash --home /home/pi pi
|
||||
# copy the skeleton files for login
|
||||
@ -405,30 +442,44 @@ if [ "$(compgen -u | grep -c pi)" -eq 0 ];then
|
||||
adduser pi sudo
|
||||
fi
|
||||
|
||||
# special prepare when Raspbian
|
||||
# activate watchdog if ls /dev/watchdog exists - see #4534
|
||||
if [ -e /dev/watchdog ]; then
|
||||
echo "Activating watchdog ..."
|
||||
if [ "${baseimage}" = "raspios_arm64" ]; then
|
||||
echo "dtparam=watchdog=on" | tee -a $raspi_configfile
|
||||
fi
|
||||
sed -i "s/^#RuntimeWatchdogSec=.*/RuntimeWatchdogSec=600s/g" /etc/systemd/system.conf
|
||||
sed -i "s/^#RebootWatchdogSec=.*/RebootWatchdogSec=3min/g" /etc/systemd/system.conf
|
||||
sed -i "s/^#WatchdogDevice=.*/WatchdogDevice=\/dev\/watchdog/g" /etc/systemd/system.conf
|
||||
else
|
||||
echo "No watchdog device /dev/watchdog found - keep watchdog like default"
|
||||
fi
|
||||
|
||||
# special prepare when RaspberryPi OS
|
||||
if [ "${baseimage}" = "raspios_arm64" ]; then
|
||||
|
||||
echo -e "\n*** PREPARE RASPBERRY OS VARIANTS ***"
|
||||
apt_install raspi-config
|
||||
# do memory split (16MB)
|
||||
raspi-config nonint do_memory_split 16
|
||||
# set to wait until network is available on boot (0 seems to yes)
|
||||
raspi-config nonint do_boot_wait 0
|
||||
# set WIFI country so boot does not block
|
||||
# this will undo the softblock of rfkill on RaspiOS
|
||||
[ "${wifi_region}" != "off" ] && raspi-config nonint do_wifi_country $wifi_region
|
||||
# see https://github.com/rootzoll/raspiblitz/issues/428#issuecomment-472822840
|
||||
|
||||
configFile="/boot/config.txt"
|
||||
max_usb_current="max_usb_current=1"
|
||||
max_usb_currentDone=$(grep -c "$max_usb_current" $configFile)
|
||||
|
||||
if [ ${max_usb_currentDone} -eq 0 ]; then
|
||||
echo | tee -a $configFile
|
||||
echo "# Raspiblitz" | tee -a $configFile
|
||||
echo "$max_usb_current" | tee -a $configFile
|
||||
if ! grep "Raspiblitz" $raspi_configfile; then
|
||||
echo "# Adding Raspiblitz Edits to $raspi_configfile"
|
||||
echo | tee -a $raspi_configfile
|
||||
echo "# Raspiblitz" | tee -a $raspi_configfile
|
||||
# ensure that kernel8.img is used to set PAGE_SIZE to 4K
|
||||
# https://github.com/raspiblitz/raspiblitz/issues/4346
|
||||
if [ -f /boot/kernel8.img ] || [ -f /boot/firmware/kernel8.img ]; then
|
||||
echo 'kernel=kernel8.img' | tee -a $raspi_configfile
|
||||
fi
|
||||
echo "max_usb_current=1" | tee -a $raspi_configfile
|
||||
echo "dtparam=nvme" | tee -a $raspi_configfile
|
||||
echo 'dtoverlay=pi3-disable-bt' | tee -a $raspi_configfile
|
||||
echo 'dtoverlay=disable-bt' | tee -a $raspi_configfile
|
||||
else
|
||||
echo "$max_usb_current already in $configFile"
|
||||
echo "# Raspiblitz Edits are already in $raspi_configfile"
|
||||
fi
|
||||
|
||||
# run fsck on sd root partition on every startup to prevent "maintenance login" screen
|
||||
@ -443,24 +494,34 @@ if [ "${baseimage}" = "raspios_arm64" ]; then
|
||||
fi
|
||||
|
||||
# edit kernel parameters
|
||||
kernelOptionsFile=/boot/cmdline.txt
|
||||
fsOption1="fsck.mode=force"
|
||||
fsOption2="fsck.repair=yes"
|
||||
fsOption1InFile=$(grep -c ${fsOption1} ${kernelOptionsFile})
|
||||
fsOption2InFile=$(grep -c ${fsOption2} ${kernelOptionsFile})
|
||||
fsOption1InFile=$(grep -c ${fsOption1} ${raspi_commandfile})
|
||||
fsOption2InFile=$(grep -c ${fsOption2} ${raspi_commandfile})
|
||||
|
||||
if [ ${fsOption1InFile} -eq 0 ]; then
|
||||
sed -i "s/^/$fsOption1 /g" "$kernelOptionsFile"
|
||||
echo "$fsOption1 added to $kernelOptionsFile"
|
||||
sed -i "s/^/$fsOption1 /g" "${raspi_commandfile}"
|
||||
echo "$fsOption1 added to ${raspi_commandfile}"
|
||||
else
|
||||
echo "$fsOption1 already in $kernelOptionsFile"
|
||||
echo "$fsOption1 already in ${raspi_commandfile}"
|
||||
fi
|
||||
if [ ${fsOption2InFile} -eq 0 ]; then
|
||||
sed -i "s/^/$fsOption2 /g" "$kernelOptionsFile"
|
||||
echo "$fsOption2 added to $kernelOptionsFile"
|
||||
sed -i "s/^/$fsOption2 /g" "${raspi_commandfile}"
|
||||
echo "$fsOption2 added to ${raspi_commandfile}"
|
||||
else
|
||||
echo "$fsOption2 already in $kernelOptionsFile"
|
||||
echo "$fsOption2 already in ${raspi_commandfile}"
|
||||
fi
|
||||
|
||||
# *** SAFE SHUTDOWN ***
|
||||
# logind
|
||||
echo "[Login]" | tee /etc/systemd/logind.conf.d/safeshutdown.conf
|
||||
echo "HandlePowerKey=ignore" | tee -a /etc/systemd/logind.conf.d/safeshutdown.conf
|
||||
# sudoers
|
||||
echo 'nobody ALL=(ALL) NOPASSWD: /home/admin/config.scripts/blitz.shutdown.sh' |
|
||||
tee -a /etc/sudoers
|
||||
# triggerhappy
|
||||
echo 'KEY_POWER 1 sudo /home/admin/config.scripts/blitz.shutdown.sh' |
|
||||
tee /etc/triggerhappy/triggers.d/powerbutton.conf
|
||||
fi
|
||||
|
||||
# special prepare when Nvidia Jetson Nano
|
||||
@ -469,6 +530,10 @@ if [ $(uname -a | grep -c 'tegra') -gt 0 ] ; then
|
||||
systemctl set-default multi-user.target
|
||||
fi
|
||||
|
||||
# remove rpi-first-boot-wizard
|
||||
apt purge piwiz -y
|
||||
userdel -r rpi-first-boot-wizard
|
||||
|
||||
echo -e "\n*** CONFIG ***"
|
||||
# based on https://raspibolt.github.io/raspibolt/raspibolt_20_pi.html#raspi-config
|
||||
|
||||
@ -485,7 +550,7 @@ if [ "${baseimage}" = "raspios_arm64" ] || [ "${baseimage}" = "debian" ] || [ "$
|
||||
# run as exec to dont allow easy physical access by keyboard
|
||||
# see https://github.com/rootzoll/raspiblitz/issues/54
|
||||
bash -c 'echo "# automatic start the LCD info loop" >> /home/pi/.bashrc'
|
||||
bash -c 'echo "SCRIPT=/home/admin/00infoLCD.sh" >> /home/pi/.bashrc'
|
||||
bash -c 'echo "SCRIPT=\"sudo /home/admin/00infoLCD.sh\"" >> /home/pi/.bashrc'
|
||||
bash -c 'echo "# replace shell with script => logout when exiting script" >> /home/pi/.bashrc'
|
||||
bash -c 'echo "exec \$SCRIPT" >> /home/pi/.bashrc'
|
||||
echo "autostart LCD added to $homeFile"
|
||||
@ -548,9 +613,9 @@ service rsyslog restart
|
||||
echo -e "\n*** ADDING MAIN USER admin ***"
|
||||
# based on https://raspibolt.org/system-configuration.html#add-users
|
||||
# using the default password 'raspiblitz'
|
||||
adduser --system --group --shell /bin/bash --home /home/admin admin
|
||||
# copy the skeleton files for login
|
||||
sudo -u admin cp -r /etc/skel/. /home/admin/
|
||||
adduser --disabled-password --gecos "" admin
|
||||
# make the home folder world readable
|
||||
chmod 0755 /home/admin
|
||||
echo "admin:raspiblitz" | chpasswd
|
||||
adduser admin sudo
|
||||
chsh admin -s /bin/bash
|
||||
@ -599,18 +664,19 @@ echo -e "\n*** ADDING GROUPS FOR CREDENTIALS STORE ***"
|
||||
echo -e "\n*** SHELL SCRIPTS & ASSETS ***"
|
||||
# copy raspiblitz repo from github
|
||||
cd /home/admin/ || exit 1
|
||||
sudo -u admin git config --global user.name "${github_user}"
|
||||
sudo -u admin git config --global user.email "johndoe@example.com"
|
||||
sudo -u admin git config --global user.name "${github_user}" || exit 1
|
||||
sudo -u admin git config --global user.email "johndoe@example.com" || exit 1
|
||||
sudo -u admin git config --global http.postBuffer 524288000 || exit 1
|
||||
sudo -u admin rm -rf /home/admin/raspiblitz
|
||||
sudo -u admin git clone -b "${branch}" https://github.com/${github_user}/raspiblitz.git
|
||||
sudo -u admin cp -r /home/admin/raspiblitz/home.admin/*.* /home/admin
|
||||
sudo -u admin cp /home/admin/raspiblitz/home.admin/.tmux.conf /home/admin
|
||||
sudo -u admin cp -r /home/admin/raspiblitz/home.admin/assets /home/admin/
|
||||
sudo -u admin chmod +x *.sh
|
||||
sudo -u admin cp -r /home/admin/raspiblitz/home.admin/config.scripts /home/admin/
|
||||
sudo -u admin chmod +x /home/admin/config.scripts/*.sh
|
||||
sudo -u admin cp -r /home/admin/raspiblitz/home.admin/setup.scripts /home/admin/
|
||||
sudo -u admin chmod +x /home/admin/setup.scripts/*.sh
|
||||
sudo -u admin git clone -b "${branch}" https://github.com/${github_user}/raspiblitz.git || exit 1
|
||||
sudo -u admin cp -r /home/admin/raspiblitz/home.admin/*.* /home/admin || exit 1
|
||||
sudo -u admin cp /home/admin/raspiblitz/home.admin/.tmux.conf /home/admin || exit 1
|
||||
sudo -u admin cp -r /home/admin/raspiblitz/home.admin/assets /home/admin/ || exit 1
|
||||
sudo -u admin chmod +x *.sh || exit 1
|
||||
sudo -u admin cp -r /home/admin/raspiblitz/home.admin/config.scripts /home/admin/ || exit 1
|
||||
sudo -u admin chmod +x /home/admin/config.scripts/*.sh || exit 1
|
||||
sudo -u admin cp -r /home/admin/raspiblitz/home.admin/setup.scripts /home/admin/ || exit 1
|
||||
sudo -u admin chmod +x /home/admin/setup.scripts/*.sh || exit 1
|
||||
|
||||
# install newest version of BlitzPy
|
||||
blitzpy_wheel=$(ls -tR /home/admin/raspiblitz/home.admin/BlitzPy/dist | grep -E "any.whl" | tail -n 1)
|
||||
@ -707,11 +773,15 @@ bash -c "echo 'vm.overcommit_memory=1' >> /etc/sysctl.conf"
|
||||
# based on https://raspibolt.org/security.html#fail2ban
|
||||
echo "*** HARDENING ***"
|
||||
apt_install --no-install-recommends python3-systemd fail2ban
|
||||
# https://github.com/raspiblitz/raspiblitz/issues/4044
|
||||
if [ ! -f /var/log/auth.log ]; then
|
||||
touch /var/log/auth.log
|
||||
fi
|
||||
|
||||
# *** CACHE DISK IN RAM & KEYVALUE-STORE***
|
||||
echo "Activating CACHE RAM DISK ... "
|
||||
/home/admin/_cache.sh ramdisk on
|
||||
/home/admin/_cache.sh keyvalue on
|
||||
/home/admin/_cache.sh ramdisk on || exit 1
|
||||
/home/admin/_cache.sh keyvalue on || exit 1
|
||||
|
||||
# *** Wifi, Bluetooth & other RaspberryPi configs ***
|
||||
if [ "${baseimage}" = "raspios_arm64" ] || [ "${baseimage}" = "debian" ]; then
|
||||
@ -722,40 +792,25 @@ if [ "${baseimage}" = "raspios_arm64" ] || [ "${baseimage}" = "debian" ]; then
|
||||
ifconfig wlan0 down
|
||||
fi
|
||||
|
||||
echo -e "\n*** DISABLE BLUETOOTH ***"
|
||||
configFile="/boot/config.txt"
|
||||
disableBT="dtoverlay=disable-bt"
|
||||
disableBTDone=$(grep -c "$disableBT" $configFile)
|
||||
|
||||
if [ "${disableBTDone}" -eq 0 ]; then
|
||||
# disable bluetooth module
|
||||
echo "" | tee -a $configFile
|
||||
echo "# Raspiblitz" | tee -a $configFile
|
||||
echo 'dtoverlay=pi3-disable-bt' | tee -a $configFile
|
||||
echo 'dtoverlay=disable-bt' | tee -a $configFile
|
||||
else
|
||||
echo "disable BT already in $configFile"
|
||||
fi
|
||||
|
||||
# remove bluetooth services
|
||||
systemctl disable bluetooth.service
|
||||
systemctl disable hciuart.service
|
||||
|
||||
# remove bluetooth packages
|
||||
apt remove -y --purge pi-bluetooth bluez bluez-firmware
|
||||
apt-get remove -y --purge pi-bluetooth bluez bluez-firmware
|
||||
|
||||
# disable audio
|
||||
echo -e "\n*** DISABLE AUDIO (snd_bcm2835) ***"
|
||||
sed -i "s/^dtparam=audio=on/# dtparam=audio=on/g" /boot/config.txt
|
||||
sed -i "s/^dtparam=audio=on/# dtparam=audio=on/g" ${raspi_configfile}
|
||||
|
||||
# disable DRM VC4 V3D
|
||||
echo -e "\n*** DISABLE DRM VC4 V3D driver ***"
|
||||
dtoverlay=vc4-fkms-v3d
|
||||
sed -i "s/^dtoverlay=${dtoverlay}/# dtoverlay=${dtoverlay}/g" /boot/config.txt
|
||||
sed -i "s/^dtoverlay=${dtoverlay}/# dtoverlay=${dtoverlay}/g" ${raspi_configfile}
|
||||
|
||||
# I2C fix (make sure dtparam=i2c_arm is not on)
|
||||
# see: https://github.com/rootzoll/raspiblitz/issues/1058#issuecomment-739517713
|
||||
sed -i "s/^dtparam=i2c_arm=.*//g" /boot/config.txt
|
||||
sed -i "s/^dtparam=i2c_arm=.*//g" ${raspi_configfile}
|
||||
fi
|
||||
|
||||
# *** BOOTSTRAP ***
|
||||
@ -771,7 +826,7 @@ cp /home/admin/assets/background.service /etc/systemd/system/background.service
|
||||
systemctl enable background
|
||||
|
||||
# *** BACKGROUND SCAN ***
|
||||
/home/admin/_background.scan.sh install
|
||||
/home/admin/_background.scan.sh install || exit 1
|
||||
|
||||
#######
|
||||
# TOR #
|
||||
@ -803,7 +858,7 @@ else
|
||||
echo "* skipping FATPACK"
|
||||
fi
|
||||
|
||||
# check fallback list bitnodes
|
||||
# check fallback list bitnodes
|
||||
# update on releases manually in asset folder with:
|
||||
# curl -H "Accept: application/json; indent=4" https://bitnodes.io/api/v1/snapshots/latest/ -o ./fallback.bitnodes.nodes
|
||||
byteSizeList=$(sudo -u admin stat -c %s /home/admin/fallback.bitnodes.nodes)
|
||||
@ -834,19 +889,19 @@ echo -e "\n**********************************************"
|
||||
echo "BASIC SD CARD BUILD DONE"
|
||||
echo -e "**********************************************\n"
|
||||
echo "Your SD Card Image for RaspiBlitz is ready (might still do display config)."
|
||||
echo "Take the chance & look thru the output above if you can spot any errors or warnings."
|
||||
echo -e "\nIMPORTANT IF WANT TO MAKE A RELEASE IMAGE FROM THIS BUILD:"
|
||||
echo "Take the chance & look through the output above if you can spot any errors or warnings."
|
||||
echo -e "\nIMPORTANT IF YOU WANT TO MAKE A RELEASE IMAGE FROM THIS BUILD:"
|
||||
echo "1. login fresh --> user:admin password:raspiblitz"
|
||||
echo -e "2. run --> release\n"
|
||||
|
||||
# make sure that at least the code is available (also if no internet)
|
||||
/home/admin/config.scripts/blitz.display.sh prepare-install
|
||||
# (do last - because might trigger reboot)
|
||||
/home/admin/config.scripts/blitz.display.sh prepare-install || exit 1
|
||||
# (do last - because it might trigger reboot)
|
||||
if [ "${display}" != "headless" ] || [ "${baseimage}" = "raspios_arm64" ]; then
|
||||
echo "*** ADDITIONAL DISPLAY OPTIONS ***"
|
||||
echo "- calling: blitz.display.sh set-display ${display}"
|
||||
/home/admin/config.scripts/blitz.display.sh set-display ${display}
|
||||
/home/admin/config.scripts/blitz.display.sh rotate 1
|
||||
/home/admin/config.scripts/blitz.display.sh set-display ${display} || exit 1
|
||||
/home/admin/config.scripts/blitz.display.sh rotate 1 || exit 1
|
||||
fi
|
||||
|
||||
echo "# BUILD DONE - see above"
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,9 +0,0 @@
|
||||
# Raspiblitz Case: Standard
|
||||
|
||||
This is a raspiblitz case prototype. The standard file (Raspiblitz_standard.stl) should be modified to fit your HDD.
|
||||
|
||||
#### To Do
|
||||
|
||||
* Update the HDD container to fit the standard HDD model from the raspiblitz amazon buylist. (Toshiba HDTB420EK3AA 2TB Canvio Basics 2.5-Inch USB 3.0 Portable External Hard Drive - Black)
|
||||
|
||||
* Add a cool lightning bolt to improve the design.
|
76
ci/README.md
76
ci/README.md
@ -4,17 +4,16 @@
|
||||
<details>
|
||||
<summary>Table of Contents</summary>
|
||||
|
||||
- [Ready made images](#ready-made-images)
|
||||
- [Write the image to a disk connected with USB](#write-the-image-to-a-disk-connected-with-usb)
|
||||
- [Option 1 - requires less disk space](#option-1---requires-less-disk-space)
|
||||
- [Write the .qcow2 file directly to disk with `qemu-image dd`](#write-the-qcow2-file-directly-to-disk-with-qemu-image-dd)
|
||||
- [Option 2 - convert to a raq disk image first](#option-2---convert-to--a-raq-disk-image-first)
|
||||
- [Convert the .qcow2 volume to a raw disk image](#convert-the-qcow2-volume-to-a-raw-disk-image)
|
||||
- [Write the .img to the disk](#write-the-img-to-the-disk)
|
||||
- [The first boot](#the-first-boot)
|
||||
- [Lean image with Gnome desktop (default image)](#lean-image-with-gnome-desktop-default-image)
|
||||
- [Extend the root partition (optional - recommended)](#extend-the-root-partition-optional---recommended)
|
||||
- [Add wifi driver (optional)](#add-wifi-driver-optional)
|
||||
- [Ready made images for arm64-rpi](#ready-made-images-for-arm64-rpi)
|
||||
- [Ready made images for amd64 (x86)](#ready-made-images-for-amd64-x86)
|
||||
- [Write the image to a disk connected with USB](#write-the-image-to-a-disk-connected-with-usb)
|
||||
- [Prepare the disk](#prepare-the-disk)
|
||||
- [Option 1 - rite the .qcow2 file directly to disk with `qemu-image dd`](#option-1---rite-the-qcow2-file-directly-to-disk-with-qemu-image-dd)
|
||||
- [Option 2 - convert the .qcow2 volume to a raw disk image](#option-2---convert-the-qcow2-volume-to-a-raw-disk-image)
|
||||
- [The first boot](#the-first-boot)
|
||||
- [Lean image with Gnome desktop (default image)](#lean-image-with-gnome-desktop-default-image)
|
||||
- [Extend the root partition (optional - recommended)](#extend-the-root-partition-optional---recommended)
|
||||
- [Add wifi driver (optional)](#add-wifi-driver-optional)
|
||||
- [Local build](#local-build)
|
||||
- [Generate an arm64-rpi image](#generate-an-arm64-rpi-image)
|
||||
- [Generate an amd64 image](#generate-an-amd64-image)
|
||||
@ -32,7 +31,19 @@
|
||||
|
||||
</details>
|
||||
|
||||
## Ready made images
|
||||
## Ready made images for arm64-rpi
|
||||
* The images are built in GitHub actions
|
||||
* To see the downloadable artifacts will need to log in to GitHub
|
||||
* Find the latest successful build of the default amd64 image:
|
||||
https://github.com/raspiblitz/raspiblitz/actions/workflows/arm64-rpi-lean-image.yml?query=workflow%3Aarm64-rpi-lean-image-build+is%3Asuccess+branch%3Adev
|
||||
* unpack the artifact to the same directory
|
||||
```
|
||||
unzip ./raspiblitz-arm64-rpi-image-*.zip
|
||||
```
|
||||
* The resulting `raspiblitz-arm64-rpi-lean.img.gz` can be written to an SDcard directly with Balena Etcher
|
||||
|
||||
|
||||
## Ready made images for amd64 (x86)
|
||||
* The images are built in GitHub actions
|
||||
* To see the downloadable artifacts will need to log in to GitHub
|
||||
* Find the latest successful build of the default amd64 image:
|
||||
@ -45,40 +56,53 @@ https://github.com/rootzoll/raspiblitz/actions/workflows/amd64-lean-image.yml?qu
|
||||
# install qemu-utils
|
||||
sudo apt install -y qemu-utils
|
||||
```
|
||||
## Write the image to a disk connected with USB
|
||||
### Option 1 - requires less disk space
|
||||
#### Write the .qcow2 file directly to disk with `qemu-image dd`
|
||||
* the .qcow2 volume is 8.1 GB
|
||||
### Write the image to a disk connected with USB
|
||||
|
||||
#### Prepare the disk
|
||||
* identify the connected disk with `lsblk` e.g., `/dev/sdk`
|
||||
* set the disk variable
|
||||
```
|
||||
# identify the USB connected disk
|
||||
lsblk
|
||||
# set the disk variable
|
||||
disk=/dev/sdk
|
||||
```
|
||||
* clean the existing partitions:
|
||||
```
|
||||
# unmount all partitions
|
||||
sudo umount ${disk}*
|
||||
# wipe the partition table
|
||||
sudo wipefs --all ${disk}
|
||||
```
|
||||
|
||||
#### Option 1 - rite the .qcow2 file directly to disk with `qemu-image dd`
|
||||
* requires less disk space - the .qcow2 volume is 8.1 GB
|
||||
```
|
||||
disk="/dev/sdk"
|
||||
sudo qemu-img dd if=./raspiblitz-amd64-debian-lean.qcow2 of=${disk} bs=4M
|
||||
```
|
||||
### Option 2 - convert to a raq disk image first
|
||||
#### Convert the .qcow2 volume to a raw disk image
|
||||
|
||||
#### Option 2 - convert the .qcow2 volume to a raw disk image
|
||||
* the raw .img is 30GB
|
||||
```
|
||||
# convert
|
||||
qemu-img convert ./raspiblitz-amd64-debian-lean.qcow2 ./raspiblitz-amd64-debian-lean.img
|
||||
```
|
||||
#### Write the .img to the disk
|
||||
* identify the connected disk with `lsblk` e.g., `/dev/sdk`
|
||||
* use [Balena Etcher](https://www.balena.io/etcher/)
|
||||
* or `dd` to write the .img to disk
|
||||
```
|
||||
disk="/dev/sdk"
|
||||
sudo dd if=./raspiblitz-amd64-debian-lean.img of=${disk} bs=4M status=progress
|
||||
```
|
||||
|
||||
## The first boot
|
||||
### Lean image with Gnome desktop (default image)
|
||||
### The first boot
|
||||
#### Lean image with Gnome desktop (default image)
|
||||
* log in on screen:
|
||||
* username: `admin`
|
||||
* password: `raspiblitz`
|
||||
* start a terminal for guidance
|
||||
* alternatively connect with ssh over the LAN with the same username and password
|
||||
|
||||
### Extend the root partition (optional - recommended)
|
||||
#### Extend the root partition (optional - recommended)
|
||||
* The default image is 30GB. The partition can be extended to the full size of the disk.
|
||||
* The lvm partition can be extended while mounted so this step can be done later as well while the system is running.
|
||||
* CLI (recommended)
|
||||
@ -109,7 +133,7 @@ https://github.com/rootzoll/raspiblitz/actions/workflows/amd64-lean-image.yml?qu
|
||||
sudo lvextend -r -l +100%FREE /dev/mapper/raspiblitz--amd64--vg-root
|
||||
```
|
||||
|
||||
### Add wifi driver (optional)
|
||||
#### Add wifi driver (optional)
|
||||
* as in https://wiki.debian.org/iwlwifi
|
||||
* add the component `non-free` after `deb http://deb.debian.org/debian bullseye main` in `/etc/apt/sources.list`
|
||||
* install the wifi driver for the mentioned cards:
|
||||
@ -146,7 +170,7 @@ with the [Makefile](https://github.com/rootzoll/raspiblitz/blob/dev/Makefile)
|
||||
### Generate an arm64-rpi image
|
||||
* The workflow locally and in github actions generates a .img raw format image for the Raspberry Pi.
|
||||
```
|
||||
make arm-rpi-lean-image
|
||||
make arm64-rpi-lean-image
|
||||
```
|
||||
* find the image and sha256 hashes in the `ci/arm64-rpi/packer-builder-arm` directory
|
||||
* the .img.gz file can be written to an SDcard directly with Balena Etcher
|
||||
|
@ -1,13 +1,5 @@
|
||||
packer {
|
||||
required_version = ">= 1.7.0, < 2.0.0"
|
||||
|
||||
required_plugins {
|
||||
qemu = {
|
||||
source = "github.com/hashicorp/qemu"
|
||||
version = ">= 1.0.0, < 2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
variable "iso_name" { default = "debian-12.6.0-amd64-netinst.iso" }
|
||||
variable "iso_checksum" { default = "ade3a4acc465f59ca2496344aab72455945f3277a52afc5a2cae88cdc370fa12" }
|
||||
|
||||
variable "pack" { default = "lean" }
|
||||
variable "github_user" { default = "raspiblitz" }
|
||||
@ -18,9 +10,6 @@ variable "boot" { default = "uefi" }
|
||||
variable "preseed_file" { default = "preseed.cfg" }
|
||||
variable "hostname" { default = "raspiblitz-amd64" }
|
||||
|
||||
variable "iso_name" { default = "debian-12.1.0-amd64-netinst.iso" }
|
||||
variable "iso_checksum" { default = "9f181ae12b25840a508786b1756c6352a0e58484998669288c4eec2ab16b8559" }
|
||||
|
||||
variable "disk_size" { default = "30000" }
|
||||
variable "memory" { default = "4096" }
|
||||
variable "cpus" { default = "4" }
|
||||
@ -65,7 +54,7 @@ source "qemu" "debian" {
|
||||
disk_size = var.disk_size
|
||||
http_directory = "./http"
|
||||
iso_checksum = var.iso_checksum
|
||||
iso_url = "http://cdimage.debian.org/cdimage/release/current/amd64/iso-cd/${var.iso_name}"
|
||||
iso_url = "https://cdimage.debian.org/cdimage/release/current/amd64/iso-cd/${var.iso_name}"
|
||||
memory = var.memory
|
||||
output_directory = "../builds/${local.name_template}-qemu"
|
||||
shutdown_command = "echo 'raspiblitz' | sudo /sbin/shutdown -hP now"
|
||||
@ -113,3 +102,14 @@ build {
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
packer {
|
||||
required_version = ">= 1.7.0, < 2.0.0"
|
||||
|
||||
required_plugins {
|
||||
qemu = {
|
||||
source = "github.com/hashicorp/qemu"
|
||||
version = ">= 1.0.0, < 2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,14 @@
|
||||
#!/bin/sh -eux
|
||||
|
||||
# Disable Predictable Network Interface names and use eth0
|
||||
sed -i 's/en[[:alnum:]]*/eth0/g' /etc/network/interfaces;
|
||||
sed -i 's/GRUB_CMDLINE_LINUX="\(.*\)"/GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 \1"/g' /etc/default/grub;
|
||||
update-grub;
|
||||
sed -i 's/en[[:alnum:]]*/eth0/g' /etc/network/interfaces
|
||||
sed -i 's/GRUB_CMDLINE_LINUX="\(.*\)"/GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 \1"/g' /etc/default/grub
|
||||
update-grub
|
||||
|
||||
# Adding a 2 sec delay to the interface up, to make the dhclient happy
|
||||
echo "pre-up sleep 2" >> /etc/network/interfaces
|
||||
echo "pre-up sleep 2" >>/etc/network/interfaces
|
||||
|
||||
# needed for resolvconf installed in build_sdcard.sh
|
||||
apt-get install resolvconf -y
|
||||
echo 'nameserver 1.1.1.1' >/etc/resolv.conf
|
||||
echo 'nameserver 8.8.8.8' >>/etc/resolv.conf
|
||||
|
@ -5,7 +5,7 @@ sudo apt-get update
|
||||
# install packer
|
||||
if ! packer version 2>/dev/null; then
|
||||
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
|
||||
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
|
||||
sudo apt-add-repository -y "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
|
||||
sudo apt-get update
|
||||
echo -e "\nInstalling packer..."
|
||||
sudo apt-get install -y packer
|
||||
@ -13,14 +13,13 @@ else
|
||||
echo "# Packer is installed"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# install qemu
|
||||
echo "# Install qemu ..."
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y qemu-system
|
||||
|
||||
# set vars
|
||||
echo "# Setting the variables: $*"
|
||||
source ../set_variables.sh
|
||||
set_variables "$@"
|
||||
|
||||
|
@ -1,8 +1,9 @@
|
||||
variable "pack" { default = "lean" }
|
||||
variable "github_user" { default = "raspiblitz" }
|
||||
variable "branch" { default = "dev" }
|
||||
variable "image_link" { default = "https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2023-05-03/2023-05-03-raspios-bullseye-arm64.img.xz" }
|
||||
variable "image_checksum" { default = "e7c0c89db32d457298fbe93195e9d11e3e6b4eb9e0683a7beb1598ea39a0a7aa" }
|
||||
variable "image_link" { default = "https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64.img.xz" }
|
||||
variable "image_checksum" { default = "7e53a46aab92051d523d7283c080532bebb52ce86758629bf1951be9b4b0560f" }
|
||||
variable "image_size" { default = "20G" }
|
||||
|
||||
source "arm" "raspiblitz-arm64-rpi" {
|
||||
file_checksum_type = "sha256"
|
||||
@ -29,7 +30,7 @@ source "arm" "raspiblitz-arm64-rpi" {
|
||||
type = "83"
|
||||
}
|
||||
image_path = "raspiblitz-arm64-rpi-${var.pack}.img"
|
||||
image_size = "28G"
|
||||
image_size = var.image_size
|
||||
image_type = "dos"
|
||||
qemu_binary_destination_path = "/usr/bin/qemu-arm-static"
|
||||
qemu_binary_source_path = "/usr/bin/qemu-arm-static"
|
||||
@ -47,6 +48,8 @@ build {
|
||||
"apt-get install -y sudo wget",
|
||||
"apt-get -y autoremove",
|
||||
"apt-get -y clean",
|
||||
"touch /boot/ssh",
|
||||
"echo 'pi:$6$TE7HmruYY9EaNiKP$Vz0inJ6gaoJgJvQrC5z/HMDRMTN2jKhiEnG83tc1Jsw7lli5MYdeA83g3NOVCsBaTVW4mUBiT/1ZRWYdofVQX0' > /boot/userconf"
|
||||
]
|
||||
}
|
||||
|
||||
@ -66,4 +69,10 @@ build {
|
||||
"echo 'OK'",
|
||||
]
|
||||
}
|
||||
|
||||
provisioner "shell" {
|
||||
inline = [
|
||||
"if [ \"${var.pack}\" = \"base\" ]; then echo 'Adding stop file to /boot/'; touch /boot/stop; fi"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -5,11 +5,14 @@ wget https://raw.githubusercontent.com/${github_user}/raspiblitz/${branch}/build
|
||||
|
||||
if [ "${pack}" = "fatpack" ]; then
|
||||
fatpack="1"
|
||||
# make /dev/shm world writable for qemu
|
||||
sudo chmod 777 /dev/shm
|
||||
display="lcd"
|
||||
else
|
||||
fatpack="0"
|
||||
display="headless"
|
||||
fi
|
||||
|
||||
# make /dev/shm world writable for qemu
|
||||
sudo chmod 777 /dev/shm
|
||||
|
||||
echo 'Build RaspiBlitz ...'
|
||||
bash build_sdcard.sh -f ${fatpack} -u ${github_user} -b ${branch} -d headless -t false -w off -i false
|
||||
bash build_sdcard.sh -f ${fatpack} -u ${github_user} -b ${branch} -t false -w off -i false -d ${display}
|
||||
|
@ -58,7 +58,9 @@ go mod download
|
||||
go build || exit 1
|
||||
|
||||
# set vars
|
||||
source ../set_variables.sh
|
||||
echo "# Setting the variables: $*"
|
||||
# running from the ci/arm64-rpi/packer-builder-arm directory
|
||||
source ../../set_variables.sh
|
||||
set_variables "$@"
|
||||
|
||||
cp ../build.arm64-rpi.pkr.hcl ./
|
||||
|
@ -1,6 +1,7 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
# set vars
|
||||
echo "# Setting the variables: $*"
|
||||
source ../set_variables.sh
|
||||
set_variables "$@"
|
||||
|
||||
|
300
ci/packer.sh
Normal file
300
ci/packer.sh
Normal file
@ -0,0 +1,300 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#########################################################################
|
||||
# script to trigger packer image build on a debian LIVE system
|
||||
# see FAQ.dev.md for instructions
|
||||
##########################################################################
|
||||
|
||||
# YOUR REPO (REPLACE WITH YOUR OWN FORK IF NEEDED)
|
||||
REPO="https://github.com/raspiblitz/raspiblitz"
|
||||
|
||||
# folders to store the build results
|
||||
BUILDFOLDER="images"
|
||||
|
||||
# check if started with sudo
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "error='run as root / may use sudo'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# usage info
|
||||
echo "packer.sh [BRANCH] [arm|x86] [min|fat] [?lastcommithash]"
|
||||
echo "Build RaspiBlitz install images on a Debian LIVE system"
|
||||
echo "From repo (change in script is needed):"
|
||||
echo $REPO
|
||||
echo "Results will be stored in:"
|
||||
echo $BUILDFOLDER
|
||||
echo "Start this script in the root of an writable 128GB NTFS formatted USB drive."
|
||||
|
||||
# check if internet is available
|
||||
if ping -c 1 "1.1.1.1" &> /dev/null; then
|
||||
echo "# checking internet"
|
||||
else
|
||||
echo "error='script needs internet connection to run'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# get parameters
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
|
||||
# by input
|
||||
read -p "Press ENTER to continue or CTRL+C to exit"
|
||||
read -p "Enter the branch to build: " BRANCH
|
||||
read -p "Enter the architecture to build (arm|x86): " ARCH
|
||||
read -p "Enter the type to build (min|fat): " TYPE
|
||||
read -p "Enter the last commit hash to check (optional): " COMMITHASH
|
||||
|
||||
else
|
||||
|
||||
# by command line
|
||||
BRANCH=$1
|
||||
ARCH=$2
|
||||
TYPE=$3
|
||||
COMMITHASH=$4
|
||||
|
||||
fi
|
||||
|
||||
# check if branch is set
|
||||
if [ ${#BRANCH} -eq 0 ]; then
|
||||
echo "error='branch not set'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check if arch is set
|
||||
if [ ${#ARCH} -eq 0 ]; then
|
||||
echo "error='ARCH not set'"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$ARCH" != "arm" ] && [ "$ARCH" != "x86" ]; then
|
||||
echo "error='ARCH not supported'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check if type is set
|
||||
if [ ${#TYPE} -eq 0 ]; then
|
||||
echo "error='TYPE not set'"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$TYPE" != "min" ] && [ "$TYPE" != "fat" ]; then
|
||||
echo "error='TYPE not supported'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# install git and make
|
||||
apt update && apt install -y git make
|
||||
|
||||
# clean old repo
|
||||
rm -rf raspiblitz 2>/dev/null
|
||||
|
||||
# download the repo
|
||||
git clone $REPO
|
||||
if [ $? -gt 0 ]; then
|
||||
echo "# REPO: ${REPO}"
|
||||
echo "error='git clone failed'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd raspiblitz
|
||||
|
||||
# checkout the desired branch
|
||||
git checkout $BRANCH
|
||||
if [ $? -gt 0 ]; then
|
||||
cd ..
|
||||
rm -rf raspiblitz 2>/dev/null
|
||||
echo "# BRANCH: ${BRANCH}"
|
||||
echo "error='git checkout BRANCH failed'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check commit hash if set
|
||||
if [ ${#COMMITHASH} -gt 0 ]; then
|
||||
echo "# CHECKING COMMITHASH"
|
||||
actualCOMMITHASH=$(git log -1 --format=%H)
|
||||
echo "# actual(${actualCOMMITHASH}) ?= wanted(${COMMITHASH})"
|
||||
matches=$(echo "${actualCOMMITHASH}" | grep -c "${COMMITHASH}")
|
||||
if [ ${matches} -eq 0 ]; then
|
||||
cd ..
|
||||
rm -rf raspiblitz 2>/dev/null
|
||||
echo "error='COMMITHASH of branch does not match'"
|
||||
exit 1
|
||||
fi
|
||||
echo "# COMMITHASH CHECK OK"
|
||||
else
|
||||
echo "# NO COMMITHASH CHECK"
|
||||
fi
|
||||
|
||||
# make sure make build runs thru
|
||||
safedir=$(realpath ./ci/arm64-rpi/packer-builder-arm)
|
||||
echo "# Setting safe.directory to: ${safedir}"
|
||||
git config --global --add safe.directory "${safedir}"
|
||||
|
||||
# get code version
|
||||
codeVersion=$(cat ./home.admin/_version.info | grep 'codeVersion="' | cut -d'"' -f2)
|
||||
if [ ${#codeVersion} -eq 0 ]; then
|
||||
echo "error='codeVersion not found'"
|
||||
exit 1
|
||||
fi
|
||||
echo "# RaspiBlitz Version: ${codeVersion}"
|
||||
|
||||
# get date as string formatted like YEAR-MONTH-DAY
|
||||
dateString=$(date +%Y-%m-%d)
|
||||
echo "# Date: ${dateString}"
|
||||
|
||||
if [ "${ARCH}" == "arm" ] && [ "${TYPE}" == "min" ]; then
|
||||
PACKERTARGET="arm64-rpi-lean-image"
|
||||
PACKERBUILDPATH="./raspiblitz/ci/arm64-rpi/packer-builder-arm/raspiblitz-arm64-rpi-lean.img"
|
||||
PACKERFINALFILE="raspiblitz-min-v${codeVersion}-${dateString}.img"
|
||||
elif [ "${ARCH}" == "arm" ] && [ "${TYPE}" == "fat" ]; then
|
||||
PACKERTARGET="arm64-rpi-fatpack-image"
|
||||
PACKERBUILDPATH="./raspiblitz/ci/arm64-rpi/packer-builder-arm/TODO" #TODO
|
||||
PACKERFINALFILE="raspiblitz-fat-v${codeVersion}-${dateString}.img"
|
||||
elif [ "${ARCH}" == "x86" ] && [ "${TYPE}" == "min" ]; then
|
||||
PACKERTARGET="amd64-lean-server-legacyboot-image"
|
||||
PACKERBUILDPATH="./raspiblitz/ci/amd64/builds/raspiblitz-amd64-debian-lean-qemu/raspiblitz-amd64-debian-lean.qcow2"
|
||||
PACKERFINALFILE="raspiblitz-amd64-min-v${codeVersion}-${dateString}.qcow2"
|
||||
else
|
||||
echo "error='$ARCH-$TYPE not supported'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "# PACKER TARGET: ${PACKERTARGET}"
|
||||
echo "# PACKER BUILD PATH: ${PACKERBUILDPATH}"
|
||||
echo "# PACKER FINAL FILE: ${PACKERFINALFILE}"
|
||||
|
||||
# check if file already exists
|
||||
if [ -f "./${BUILDFOLDER}/${PACKERFINALFILE}.img.gz" ]; then
|
||||
echo "error='image already exists'"
|
||||
echo "# delete ./${BUILDFOLDER}/${PACKERFINALFILE}.img.gz (and all .sha256 & .sig) before trying again"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# prevent monitor to go to sleep during long non-interactive build
|
||||
xset s off
|
||||
gsettings set org.gnome.desktop.screensaver idle-activation-enabled false
|
||||
|
||||
echo "# BUILDING '${PACKERTARGET}' ###########################################"
|
||||
make $PACKERTARGET
|
||||
|
||||
# check if build was successful
|
||||
if [ $? -gt 0 ]; then
|
||||
echo "# BUILDING FAILED ###########################################"
|
||||
echo "# Check the output above for errors."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "# BUILDING SUCCESS ###########################################"
|
||||
|
||||
echo "# moving build to timestamped folder ./${BUILDFOLDER}"
|
||||
cd ..
|
||||
mkdir "${BUILDFOLDER}" 2>/dev/null
|
||||
|
||||
#check that Build folder exists
|
||||
if [ ! -d "./${BUILDFOLDER}" ]; then
|
||||
echo "# FAILED CREATING BUILD FOLDER: ./${BUILDFOLDER}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# move .gz file to build folder
|
||||
mv "${PACKERBUILDPATH}.gz" "./${BUILDFOLDER}/${PACKERFINALFILE}.gz"
|
||||
if [ $? -gt 0 ]; then
|
||||
echo "# FAILED MOVING .gz"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# move gz.sha256 file to build folder
|
||||
mv "${PACKERBUILDPATH}.gz.sha256" "./${BUILDFOLDER}/${PACKERFINALFILE}.gz.sha256"
|
||||
if [ $? -gt 0 ]; then
|
||||
echo "# FAILED MOVING .gz.sha256"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# move sha256 file to build folder
|
||||
mv "${PACKERBUILDPATH}.sha256" "./${BUILDFOLDER}/${PACKERFINALFILE}.sha256"
|
||||
if [ $? -gt 0 ]; then
|
||||
echo "# FAILED MOVING .sha256"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# special handling for qcow2
|
||||
if [ "${ARCH}" == "x86" ]; then
|
||||
echo "# decompressing qcow2"
|
||||
gunzip "./${BUILDFOLDER}/${PACKERFINALFILE}.gz"
|
||||
echo "# converting qcow2 to raw"
|
||||
qemu-img convert -f qcow2 -O raw "./${BUILDFOLDER}/${PACKERFINALFILE}.qcow2" "./${BUILDFOLDER}/${PACKERFINALFILE}.img"
|
||||
if [ $? -gt 0 ]; then
|
||||
echo "# FAILED CONVERTING qcow2 to raw"
|
||||
exit 1
|
||||
fi
|
||||
echo "# compressing raw"
|
||||
gzip -9 "./${BUILDFOLDER}/${PACKERFINALFILE}.img"
|
||||
if [ $? -gt 0 ]; then
|
||||
echo "# FAILED COMPRESSING raw"
|
||||
exit 1
|
||||
fi
|
||||
echo "# removing raw"
|
||||
rm "./${BUILDFOLDER}/${PACKERFINALFILE}.img"
|
||||
if [ $? -gt 0 ]; then
|
||||
echo "# FAILED REMOVING raw"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
echo "# clean up"
|
||||
rm -rf ./../raspiblitz 2>/dev/null
|
||||
|
||||
echo "# SIGN & SECURE IMAGE ###########################################"
|
||||
echo
|
||||
|
||||
# security check that internet is cut
|
||||
echo "# MANUAL ACTION NEEDED:"
|
||||
echo "# Cut the connection to the internet before signing the image."
|
||||
echo
|
||||
echo "# Press RETURN to continue..."
|
||||
read -r -p "" key
|
||||
if ping -c 1 "1.1.1.1" &> /dev/null; then
|
||||
echo "# FAIL - Internet connection is up - EXITING SCRIPT"
|
||||
exit 1
|
||||
else
|
||||
echo "# OK - Internet connection is cut"
|
||||
fi
|
||||
echo
|
||||
|
||||
# Note down the SHA256 checksum of the image
|
||||
echo "# MANUAL ACTION NEEDED:"
|
||||
echo "# Note down the SHA256 checksum of the image:"
|
||||
echo
|
||||
cat ./${BUILDFOLDER}/${PACKERFINALFILE}.gz.sha256
|
||||
echo
|
||||
echo "# Press RETURN to continue..."
|
||||
read -r -p "" key
|
||||
|
||||
# import the signer keys
|
||||
echo "# MANUAL ACTION NEEDED:"
|
||||
echo "# Keep this terminal open and the 128GB stick connected."
|
||||
echo "# Additionalley connect and unlock the USB device with the signer keys."
|
||||
echo "# Open in Filemanager and use right-click 'Open in Termonal' and run:"
|
||||
echo "# sudo gpg --import ./sub.key"
|
||||
echo "# Close that second terminal and remove USB device with signer keys."
|
||||
echo
|
||||
echo "# Press RETURN to continue..."
|
||||
read -r -p "" key
|
||||
|
||||
# signing instructions
|
||||
echo "# MANUAL ACTION NEEDED:"
|
||||
echo "# Please wait infront of the screen until the signing process is asks you for the password."
|
||||
echo
|
||||
cd "${BUILDFOLDER}"
|
||||
gpg --output ${PACKERFINALFILE}.gz.sig --detach-sign ${PACKERFINALFILE}.gz
|
||||
if [ $? -gt 0 ]; then
|
||||
echo "# !!!!!!! SIGNING FAILED - redo manual before closing this terminbal !!!!!!!"
|
||||
echo "gpg --output ${PACKERFINALFILE}.gz.sig --detach-sign ${PACKERFINALFILE}.gz"
|
||||
else
|
||||
echo "# OK Signing successful."
|
||||
fi
|
||||
|
||||
# last notes
|
||||
echo
|
||||
echo "Close this terminal and eject your 128GB usb device."
|
||||
echo "Have fun with your build image on it under:"
|
||||
echo "${BUILDFOLDER}/${PACKERFINALFILE}.gz"
|
@ -45,6 +45,10 @@ function set_variables() {
|
||||
params[desktop]="$2"
|
||||
shift 2
|
||||
;;
|
||||
--image_size)
|
||||
params[image_size]="$2"
|
||||
shift 2
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
|
@ -19,6 +19,7 @@ source <(/home/admin/_cache.sh get \
|
||||
system_ups_status \
|
||||
system_ups_battery \
|
||||
system_cpu_load \
|
||||
system_up_text \
|
||||
system_temp_celsius \
|
||||
system_temp_fahrenheit \
|
||||
runBehindTor \
|
||||
@ -311,7 +312,8 @@ if [ "${blitzapi}" == "on" ]; then
|
||||
webuiinfo="Web Admin --> http://${internet_localip}"
|
||||
fi
|
||||
|
||||
datetime=$(date -R)
|
||||
datetime=$(date +"%d %b %T %z")
|
||||
datetime="${datetime} up ${system_up_text}"
|
||||
|
||||
stty sane
|
||||
sleep 1
|
||||
@ -326,7 +328,7 @@ ${color_yellow} ${color_gray}${network^} Fullnode${LNinfo} ${torIn
|
||||
${color_yellow} ,/ ${color_yellow}%s
|
||||
${color_yellow} ,'/ ${color_gray}%s
|
||||
${color_yellow} ,' / ${color_gray}%s, temp %s°C %s°F
|
||||
${color_yellow} ,' /_____ ${color_gray}Free Mem ${color_ram}${ram} ${color_gray} HDDuse ${color_hdd}%s${color_gray}
|
||||
${color_yellow} ,' /_____ ${color_gray}Free Mem ${color_ram}${ram} ${color_gray} HDD ${color_hdd}%s${color_gray}
|
||||
${color_yellow},'_____ ,' ${color_gray}SSH admin@${internet_localip}${color_gray} d${internet_rx} u${internet_tx}
|
||||
${color_yellow} / ,' ${color_gray}${webuiinfo}
|
||||
${color_yellow} / ,' ${color_gray}${network} ${color_green}${networkVersion}${color_gray}${chain}net ${networkConnectionsInfo}
|
||||
@ -353,14 +355,25 @@ else
|
||||
appInfoLine=""
|
||||
|
||||
# Electrum Server - electrs
|
||||
if [ "${ElectRS}" == "on" ]; then
|
||||
fileFlagExists=$(sudo ls /mnt/hdd/app-storage/electrs/initial-sync.done 2>/dev/null | grep -c 'initial-sync.done')
|
||||
if [ "${ElectRS}" == "on" ] && [ $fileFlagExists -eq 0 ]; then
|
||||
error=""
|
||||
source <(sudo /home/admin/config.scripts/bonus.electrs.sh status-sync 2>/dev/null)
|
||||
source <(/home/admin/config.scripts/bonus.electrs.sh status-sync 2>/dev/null)
|
||||
if [ ${#infoSync} -gt 0 ]; then
|
||||
appInfoLine="Electrum: ${infoSync}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Electrum Server - fulcrum
|
||||
fileFlagExists=$(sudo ls /mnt/hdd/app-storage/fulcrum/initial-sync.done 2>/dev/null | grep -c 'initial-sync.done')
|
||||
if [ "${fulcrum}" == "on" ] && [ $fileFlagExists -eq 0 ]; then
|
||||
error=""
|
||||
source <(/home/admin/config.scripts/bonus.fulcrum.sh status-sync 2>/dev/null)
|
||||
if [ ${#infoSync} -gt 0 ]; then
|
||||
appInfoLine="Fulcrum: ${infoSync}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Transaction Index
|
||||
source <(/home/admin/config.scripts/network.txindex.sh status)
|
||||
if [ "${txindex}" == "1" ] && [ "${isIndexed}" != "1" ]; then
|
||||
|
@ -64,8 +64,8 @@ configFile="/mnt/hdd/raspiblitz.conf"
|
||||
infoFile="/home/admin/raspiblitz.info"
|
||||
|
||||
# check that user is pi
|
||||
if [ "$USER" != "pi" ]; then
|
||||
echo "plz run as user pi --> su pi"
|
||||
if [ "$USER" != "pi" ] && [ "$USER" != "root" ]; then
|
||||
echo "plz run as user pi or with sudo"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -86,7 +86,6 @@ while :
|
||||
|
||||
# get config info if already available (with state value)
|
||||
source ${infoFile}
|
||||
source <(/home/admin/_cache.sh get state message)
|
||||
|
||||
configExists=$(ls "${configFile}" 2>/dev/null | grep -c '.conf')
|
||||
if [ ${configExists} -eq 1 ]; then
|
||||
@ -94,9 +93,12 @@ while :
|
||||
source <(/home/admin/config.scripts/network.aliases.sh getvars)
|
||||
fi
|
||||
|
||||
if [ "${setupPhase}" != "done" ] || [ "${state}" == "reboot" ] || [ "${state}" == "shutdown" ] || [ "${state}" == "copytarget" ] || [ "${state}" == "copysource" ] || [ "${state}" == "copystation" ]; then
|
||||
if [ "${setupPhase}" != "done" ] || [ "${state}" == "reboot" ] || [ "${state}" == "shutdown" ] || [ "${state}" == "copytarget" ] || [ "${state}" == "copysource" ]; then
|
||||
|
||||
# show status info during boot & setup & repair on LCD
|
||||
if [ "${state}" == "" ]; then
|
||||
state="nostate"
|
||||
fi
|
||||
/home/admin/setup.scripts/eventInfoWait.sh "${state}" "${message}" lcd
|
||||
sleep 1
|
||||
continue
|
||||
|
@ -92,6 +92,9 @@ fi
|
||||
if [ "${ElectRS}" == "on" ]; then
|
||||
OPTIONS+=(ELECTRS "Electrum Rust Server")
|
||||
fi
|
||||
if [ "${fulcrum}" == "on" ]; then
|
||||
OPTIONS+=(FULCRUM "Fulcrum Electrum Server")
|
||||
fi
|
||||
if [ "${BTCRPCexplorer}" == "on" ]; then
|
||||
OPTIONS+=(EXPLORE "BTC RPC Explorer")
|
||||
fi
|
||||
@ -108,6 +111,9 @@ fi
|
||||
if [ "${loop}" == "on" ]; then
|
||||
OPTIONS+=(LOOP "Loop In/Out Service")
|
||||
fi
|
||||
if [ "${lndk}" == "on" ]; then
|
||||
OPTIONS+=(LNDK "LND BOLT 12 privacy")
|
||||
fi
|
||||
if [ "${mempoolExplorer}" == "on" ]; then
|
||||
OPTIONS+=(MEMPOOL "Mempool Space")
|
||||
fi
|
||||
@ -150,28 +156,21 @@ fi
|
||||
if [ "${chantools}" == "on" ]; then
|
||||
OPTIONS+=(CHANTOOLS "ChannelTools (Fund Rescue)")
|
||||
fi
|
||||
if [ "${homer}" == "on" ]; then
|
||||
OPTIONS+=(HOMER "Homer Dashboard")
|
||||
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
|
||||
fi
|
||||
if [ "${circuitbreaker}" == "on" ]; then
|
||||
OPTIONS+=(CIRCUITBREAKER "Circuitbreaker (LND firewall)")
|
||||
fi
|
||||
if [ "${tallycoinConnect}" == "on" ]; then
|
||||
OPTIONS+=(TALLY "Tallycoin Connect")
|
||||
fi
|
||||
if [ "${squeaknode}" == "on" ]; then
|
||||
OPTIONS+=(SQUEAKNODE "Squeaknode")
|
||||
fi
|
||||
if [ "${itchysats}" == "on" ]; then
|
||||
OPTIONS+=(ITCHYSATS "Show ItchySats details")
|
||||
fi
|
||||
if [ "${lightningtipbot}" == "on" ]; then
|
||||
OPTIONS+=(LIGHTNINGTIPBOT "Show LightningTipBot details")
|
||||
fi
|
||||
if [ "${fints}" == "on" ]; then
|
||||
OPTIONS+=(FINTS "Show FinTS/HBCI details")
|
||||
fi
|
||||
if [ "${labelbase}" == "on" ]; then
|
||||
OPTIONS+=(LABELBASE "Labelbase (UTXO labeling)")
|
||||
fi
|
||||
|
||||
# dont offer to switch to "testnet view for now" - so no wswitch back to mainnet needed
|
||||
#if [ ${chain} != "main" ]; then
|
||||
@ -266,6 +265,9 @@ case $CHOICE in
|
||||
ELECTRS)
|
||||
/home/admin/config.scripts/bonus.electrs.sh menu
|
||||
;;
|
||||
FULCRUM)
|
||||
/home/admin/config.scripts/bonus.fulcrum.sh menu
|
||||
;;
|
||||
LIT)
|
||||
/home/admin/config.scripts/bonus.lit.sh menu
|
||||
;;
|
||||
@ -278,6 +280,9 @@ case $CHOICE in
|
||||
LNDMANAGE)
|
||||
/home/admin/config.scripts/bonus.lndmanage.sh menu
|
||||
;;
|
||||
LNDK)
|
||||
/home/admin/config.scripts/bonus.lndk.sh menu
|
||||
;;
|
||||
LIGHTNINGTIPBOT)
|
||||
/home/admin/config.scripts/bonus.lightningtipbot.sh menu
|
||||
;;
|
||||
@ -305,9 +310,6 @@ case $CHOICE in
|
||||
THUB)
|
||||
sudo /home/admin/config.scripts/bonus.thunderhub.sh menu
|
||||
;;
|
||||
TALLY)
|
||||
sudo /home/admin/config.scripts/bonus.tallycoin-connect.sh menu
|
||||
;;
|
||||
ZEROTIER)
|
||||
sudo /home/admin/config.scripts/bonus.zerotier.sh menu
|
||||
;;
|
||||
@ -329,6 +331,9 @@ case $CHOICE in
|
||||
CIRCUITBREAKER)
|
||||
sudo /home/admin/config.scripts/bonus.circuitbreaker.sh menu
|
||||
;;
|
||||
LABELBASE)
|
||||
sudo /home/admin/config.scripts/bonus.labelbase.sh menu
|
||||
;;
|
||||
FINTS)
|
||||
sudo /home/admin/config.scripts/bonus.fints.sh menu
|
||||
;;
|
||||
@ -338,9 +343,6 @@ case $CHOICE in
|
||||
SUBSCRIBE)
|
||||
/home/admin/config.scripts/blitz.subscriptions.py
|
||||
;;
|
||||
HOMER)
|
||||
sudo /home/admin/config.scripts/bonus.homer.sh menu
|
||||
;;
|
||||
SERVICES)
|
||||
/home/admin/00settingsMenuServices.sh
|
||||
;;
|
||||
|
@ -13,7 +13,6 @@ source /mnt/hdd/raspiblitz.conf 2>/dev/null
|
||||
# INFOFILE - state data from bootstrap
|
||||
infoFile="/home/admin/raspiblitz.info"
|
||||
source ${infoFile}
|
||||
source <(/home/admin/_cache.sh get state message)
|
||||
|
||||
# check that basic system phase/state information is available
|
||||
if [ "${setupPhase}" == "" ] || [ "${state}" == "" ]; then
|
||||
@ -48,14 +47,6 @@ if [ "${copyInProgress}" = "1" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
# special state: copystation
|
||||
if [ "${state}" = "copystation" ]; then
|
||||
echo "Copy Station is Running ..."
|
||||
echo "reboot to return to normal"
|
||||
sudo /home/admin/XXcopyStation.sh
|
||||
exit
|
||||
fi
|
||||
|
||||
#####################################
|
||||
# SSH MENU LOOP
|
||||
# this loop runs until user exits or
|
||||
@ -99,8 +90,7 @@ do
|
||||
network \
|
||||
chain \
|
||||
lightning \
|
||||
internet_localip \
|
||||
system_vm_vagrant \
|
||||
internet_localip
|
||||
)
|
||||
|
||||
# background.scan is not ready yet
|
||||
@ -187,11 +177,17 @@ do
|
||||
sleep 3
|
||||
continue
|
||||
fi
|
||||
else
|
||||
elif [ "${lightning}" = "lnd" ]; then
|
||||
if [ "${btc_default_synced}" != "1" ] || [ "${ln_default_ready}" == "0" ] || [ "${ln_default_sync_chain}" == "0" ] || [ "${ln_default_sync_initial_done}" == "0" ]; then
|
||||
/home/admin/setup.scripts/eventBlockchainSync.sh ssh
|
||||
sleep 3
|
||||
continue
|
||||
fi
|
||||
else
|
||||
if [ "${btc_default_synced}" != "1" ]; then
|
||||
/home/admin/setup.scripts/eventBlockchainSync.sh ssh
|
||||
sleep 3
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@ -282,25 +278,6 @@ MAINMENU > REPAIR > REPAIR-LND > RETRYSCB
|
||||
|
||||
#echo "# DURING SETUP: Handle System State (${state})"
|
||||
|
||||
# when no HDD on Vagrant - just print info & exit (admin info & exit)
|
||||
if [ "${state}" == "noHDD" ] && [ ${system_vm_vagrant} != "0" ]; then
|
||||
echo "***********************************************************"
|
||||
echo "VAGRANT INFO"
|
||||
echo "***********************************************************"
|
||||
echo "To connect a HDD data disk to your VagrantVM:"
|
||||
echo "- shutdown VM with command: off"
|
||||
echo "- open your VirtualBox GUI and select RaspiBlitzVM"
|
||||
echo "- change the 'mass storage' settings"
|
||||
echo "- add a second 'Primary Slave' drive to the already existing controller"
|
||||
echo "- close VirtualBox GUI and run: vagrant up & vagrant ssh"
|
||||
echo "***********************************************************"
|
||||
echo "You can either create a new dynamic VDI with around 900GB or download"
|
||||
echo "a VDI with a presynced blockchain to speed up setup. If you dont have 900GB"
|
||||
echo "space on your laptop you can store the VDI file on an external drive."
|
||||
echo "***********************************************************"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# for all critical errors (admin info & exit)
|
||||
if [ "${state}" == "error" ] || [ "${state}" == "errorHDD" ]; then
|
||||
clear
|
||||
@ -324,6 +301,8 @@ MAINMENU > REPAIR > REPAIR-LND > RETRYSCB
|
||||
echo "https://github.com/rootzoll/raspiblitz#support"
|
||||
echo "command to shutdown --> off"
|
||||
exit 1
|
||||
elif [ "${state}" == "" ]; then
|
||||
echo "state(${state}) message(${message})"
|
||||
else
|
||||
# every other state just push as event to SSH frontend
|
||||
/home/admin/setup.scripts/eventInfoWait.sh "${state}" "${message}"
|
||||
|
@ -6,7 +6,6 @@ source /home/admin/raspiblitz.info
|
||||
source /mnt/hdd/raspiblitz.conf
|
||||
|
||||
echo "services default values"
|
||||
if [ ${#autoPilot} -eq 0 ]; then autoPilot="off"; fi
|
||||
if [ ${#autoUnlock} -eq 0 ]; then autoUnlock="off"; fi
|
||||
if [ ${#runBehindTor} -eq 0 ]; then runBehindTor="off"; fi
|
||||
if [ ${#networkUPnP} -eq 0 ]; then networkUPnP="off"; fi
|
||||
@ -70,14 +69,6 @@ if [ ${touchscreen} -gt 0 ]; then
|
||||
touchscreenMenu='on'
|
||||
fi
|
||||
|
||||
echo "# map autopilot to on/off"
|
||||
lndAutoPilotOn=$(sudo cat /mnt/hdd/lnd/lnd.conf 2>/dev/null | grep -c 'autopilot.active=1')
|
||||
if [ ${lndAutoPilotOn} -eq 1 ]; then
|
||||
autoPilot="on"
|
||||
else
|
||||
autoPilot="off"
|
||||
fi
|
||||
|
||||
echo "# map clboss to on/off"
|
||||
clbossMenu='off'
|
||||
if [ "${clboss}" == "on" ]; then
|
||||
@ -102,13 +93,6 @@ if [ "${clWatchtowerClient}" == "on" ]; then
|
||||
clWatchtowerClientMenu='on'
|
||||
fi
|
||||
|
||||
echo "# map keysend to on/off (may take time)"
|
||||
keysend="on"
|
||||
source <(sudo /home/admin/config.scripts/lnd.keysend.sh status)
|
||||
if [ ${keysendOn} -eq 0 ]; then
|
||||
keysend="off"
|
||||
fi
|
||||
|
||||
# show select dialog
|
||||
echo "run dialog ..."
|
||||
|
||||
@ -119,7 +103,7 @@ OPTIONS+=(A 'Blitz API + WebUI' ${blitzapi})
|
||||
|
||||
# LCD options (only when running with LCD screen)
|
||||
if [ "${displayClass}" == "lcd" ]; then
|
||||
OPTIONS+=(s 'Touchscreen (experimental)' ${touchscreenMenu})
|
||||
# OPTIONS+=(s 'Touchscreen (experimental)' ${touchscreenMenu})
|
||||
OPTIONS+=(r 'LCD Rotate' ${lcdrotateMenu})
|
||||
fi
|
||||
|
||||
@ -143,8 +127,6 @@ fi
|
||||
# LND & options (only when running LND)
|
||||
OPTIONS+=(m 'LND LIGHTNING LABS NODE' ${lndNode})
|
||||
if [ "${lndNode}" == "on" ]; then
|
||||
OPTIONS+=(a '-LND Channel Autopilot' ${autoPilot})
|
||||
OPTIONS+=(k '-LND Accept Keysend' ${keysend})
|
||||
OPTIONS+=(c '-LND Circuitbreaker (firewall)' ${circuitbreaker})
|
||||
OPTIONS+=(u '-LND Auto-Unlock' ${autoUnlock})
|
||||
fi
|
||||
@ -198,18 +180,6 @@ else
|
||||
echo "Blitz API + webUI Setting unchanged."
|
||||
fi
|
||||
|
||||
# LND AUTOPILOT process choice
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "a")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${autoPilot}" != "${choice}" ] && [ "${lndNode}" == "on" ]; then
|
||||
echo "Autopilot Setting changed .."
|
||||
anychange=1
|
||||
sudo /home/admin/config.scripts/lnd.autopilot.sh ${choice}
|
||||
needsReboot=1
|
||||
else
|
||||
echo "Autopilot Setting unchanged."
|
||||
fi
|
||||
|
||||
# Dynamic Domain
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "y")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
@ -355,20 +325,6 @@ else
|
||||
echo "BackupdDevice setting unchanged."
|
||||
fi
|
||||
|
||||
# LND Keysend process choice
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "k")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${keysend}" != "${choice}" ] && [ "${lndNode}" == "on" ]; then
|
||||
echo "keysend setting changed .."
|
||||
anychange=1
|
||||
sudo -u admin /home/admin/config.scripts/lnd.keysend.sh ${choice}
|
||||
sudo systemctl restart lnd
|
||||
dialog --msgbox "Accept Keysend on LND mainnet is now ${choice}.\n\nLND restarted - you might need to unlock wallet." 7 52
|
||||
sudo -u admin /home/admin/config.scripts/lnd.unlock.sh
|
||||
else
|
||||
echo "keysend setting unchanged."
|
||||
fi
|
||||
|
||||
# ZeroTier process choice
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "z")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
@ -376,16 +332,8 @@ if [ "${zerotierSwitch}" != "${choice}" ]; then
|
||||
echo "zerotier setting changed .."
|
||||
anychange=1
|
||||
error=""
|
||||
source <(sudo -u admin /home/admin/config.scripts/bonus.zerotier.sh ${choice})
|
||||
if [ "${choice}" == "on" ]; then
|
||||
if [ ${#error} -eq 0 ]; then
|
||||
dialog --msgbox "Your RaspiBlitz joined the ZeroTier network." 6 46
|
||||
else
|
||||
if [ "${error}" != "cancel" ]; then
|
||||
dialog --msgbox "ZeroTier Error:\n${error}" 8 46
|
||||
fi
|
||||
fi
|
||||
else
|
||||
sudo -u admin /home/admin/config.scripts/bonus.zerotier.sh ${choice}
|
||||
if [ "${choice}" != "on" ]; then
|
||||
dialog --msgbox "ZeroTier is now OFF." 5 46
|
||||
fi
|
||||
|
||||
@ -427,16 +375,18 @@ if [ "${clNode}" != "${choice}" ]; then
|
||||
echo "# Core Lightning NODE Setting changed .."
|
||||
if [ "${choice}" = "on" ]; then
|
||||
echo "# turning ON"
|
||||
|
||||
/home/admin/config.scripts/cl.install.sh on mainnet
|
||||
# generate wallet from seedwords or just display (write to dev/null to not write seed words to logs)
|
||||
/home/admin/config.scripts/cl.hsmtool.sh new mainnet 1>/dev/null
|
||||
echo "Generating CL wallet seedwords .."
|
||||
/home/admin/config.scripts/cl.hsmtool.sh new mainnet noninteractive
|
||||
if [ "${testnet}" == "on" ]; then
|
||||
# no seed for testnet
|
||||
echo "Turn on CL testnet .."
|
||||
/home/admin/config.scripts/cl.install.sh on testnet
|
||||
fi
|
||||
if [ "${signet}" == "on" ]; then
|
||||
# no seed for signet
|
||||
echo "Turn on CL signet .."
|
||||
/home/admin/config.scripts/cl.install.sh on signet
|
||||
fi
|
||||
|
||||
|
@ -19,7 +19,6 @@ if [ ${#jam} -eq 0 ]; then jam="off"; fi
|
||||
if [ ${#LNBits} -eq 0 ]; then LNBits="off"; fi
|
||||
if [ ${#mempoolExplorer} -eq 0 ]; then mempoolExplorer="off"; fi
|
||||
if [ ${#bos} -eq 0 ]; then bos="off"; fi
|
||||
if [ ${#lnproxy} -eq 0 ]; then lnproxy="off"; fi
|
||||
if [ ${#pyblock} -eq 0 ]; then pyblock="off"; fi
|
||||
if [ ${#thunderhub} -eq 0 ]; then thunderhub="off"; fi
|
||||
if [ ${#sphinxrelay} -eq 0 ]; then sphinxrelay="off"; fi
|
||||
@ -27,14 +26,11 @@ if [ ${#lit} -eq 0 ]; then lit="off"; fi
|
||||
if [ ${#lndg} -eq 0 ]; then lndg="off"; fi
|
||||
if [ ${#whitepaper} -eq 0 ]; then whitepaper="off"; fi
|
||||
if [ ${#chantools} -eq 0 ]; then chantools="off"; fi
|
||||
if [ ${#homer} -eq 0 ]; then homer="off"; fi
|
||||
if [ ${#tallycoinConnect} -eq 0 ]; then tallycoinConnect="off"; fi
|
||||
if [ ${#helipad} -eq 0 ]; then helipad="off"; fi
|
||||
if [ ${#bitcoinminds} -eq 0 ]; then bitcoinminds="off"; fi
|
||||
if [ ${#squeaknode} -eq 0 ]; then squeaknode="off"; fi
|
||||
if [ ${#itchysats} -eq 0 ]; then itchysats="off"; fi
|
||||
if [ ${#lightningtipbot} -eq 0 ]; then lightningtipbot="off"; fi
|
||||
if [ ${#fints} -eq 0 ]; then fints="off"; fi
|
||||
if [ ${#lndk} -eq 0 ]; then lndk="off"; fi
|
||||
if [ ${#labelbase} -eq 0 ]; then labelbase="off"; fi
|
||||
|
||||
# show select dialog
|
||||
echo "run dialog ..."
|
||||
@ -51,8 +47,7 @@ if [ "${network}" == "bitcoin" ]; then
|
||||
OPTIONS+=(ja 'BTC JoinMarket+JoininBox menu' ${joinmarket})
|
||||
OPTIONS+=(za 'BTC Jam (JoinMarket WebUI)' ${jam})
|
||||
OPTIONS+=(wa 'BTC Download Bitcoin Whitepaper' ${whitepaper})
|
||||
OPTIONS+=(va 'BTC Install BitcoinMinds.org' ${bitcoinminds})
|
||||
OPTIONS+=(ua 'BTC Install ItchySats' ${itchysats})
|
||||
OPTIONS+=(ls 'BTC Labelbase' ${labelbase})
|
||||
fi
|
||||
|
||||
# available for both LND & c-lightning
|
||||
@ -68,13 +63,10 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
|
||||
OPTIONS+=(la 'LND LIT (loop, pool, faraday)' ${lit})
|
||||
OPTIONS+=(gb 'LND LNDg (auto-rebalance, auto-fees)' ${lndg})
|
||||
OPTIONS+=(oa 'LND Balance of Satoshis' ${bos})
|
||||
#OPTIONS+=(lp 'LND lnproxy server' ${lnproxy})
|
||||
OPTIONS+=(ya 'LND PyBLOCK' ${pyblock})
|
||||
OPTIONS+=(ha 'LND ChannelTools (Fund Rescue)' ${chantools})
|
||||
OPTIONS+=(xa 'LND Sphinx-Relay' ${sphinxrelay})
|
||||
OPTIONS+=(fa 'LND Helipad Boostagram reader' ${helipad})
|
||||
OPTIONS+=(da 'LND Tallycoin Connect' ${tallycoinConnect})
|
||||
#OPTIONS+=(qa 'LND Squeaknode' ${squeaknode})
|
||||
OPTIONS+=(lb 'LND LNDK (experimental BOLT 12)' ${lndk})
|
||||
fi
|
||||
|
||||
# just available for CL
|
||||
@ -82,7 +74,6 @@ if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then
|
||||
OPTIONS+=(ca 'Core Lightning RTL Webinterface' ${crtlWebinterface})
|
||||
fi
|
||||
|
||||
OPTIONS+=(ma 'Homer Dashboard' ${homer})
|
||||
OPTIONS+=(fn 'FinTS/HBCI Interface (experimental)' ${fints})
|
||||
|
||||
CHOICES=$(dialog --title ' Additional Mainnet Services ' \
|
||||
@ -339,21 +330,6 @@ else
|
||||
echo "Balance of Satoshis setting unchanged."
|
||||
fi
|
||||
|
||||
# lnproxy process choice
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "lp")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${lnproxy}" != "${choice}" ]; then
|
||||
echo "lnproxy setting changed .."
|
||||
anychange=1
|
||||
sudo -u admin /home/admin/config.scripts/bonus.lnproxy.sh ${choice}
|
||||
source /mnt/hdd/raspiblitz.conf
|
||||
if [ "${lnproxy}" = "on" ]; then
|
||||
sudo -u admin /home/admin/config.scripts/bonus.lnproxy.sh menu
|
||||
fi
|
||||
else
|
||||
echo "lnproxy setting unchanged."
|
||||
fi
|
||||
|
||||
# PyBLOCK process choice
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "ya")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
@ -474,25 +450,6 @@ else
|
||||
echo "LNDg unchanged."
|
||||
fi
|
||||
|
||||
# Sphinx Relay
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "xa")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${sphinxrelay}" != "${choice}" ]; then
|
||||
echo "Sphinx-Relay Setting changed .."
|
||||
anychange=1
|
||||
sudo -u admin /home/admin/config.scripts/bonus.sphinxrelay.sh ${choice}
|
||||
if [ "${choice}" = "on" ]; then
|
||||
echo "Giving service 1 minute to start up ... (please wait) ..."
|
||||
sleep 60
|
||||
whiptail --title " Installed Sphinx Server" --msgbox "\
|
||||
Sphinx Server was installed.\n
|
||||
Use the new 'SPHINX' entry in Main Menu for more info.\n
|
||||
" 10 35
|
||||
fi
|
||||
else
|
||||
echo "Sphinx Relay unchanged."
|
||||
fi
|
||||
|
||||
# Helipad
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "fa")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
@ -508,21 +465,20 @@ else
|
||||
echo "Helipad setting unchanged."
|
||||
fi
|
||||
|
||||
# Tallycoin
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "da")
|
||||
# LNDK
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "lb")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${tallycoinConnect}" != "${choice}" ]; then
|
||||
echo "Tallycoin Setting changed .."
|
||||
if [ "${lndk}" != "${choice}" ]; then
|
||||
echo "LNDK Setting changed .."
|
||||
anychange=1
|
||||
sudo -u admin /home/admin/config.scripts/bonus.tallycoin-connect.sh ${choice}
|
||||
sudo -u admin /home/admin/config.scripts/bonus.lndk.sh ${choice}
|
||||
if [ "${choice}" = "on" ]; then
|
||||
whiptail --title " Installed Tallycoin-Connect" --msgbox "\
|
||||
Tallycoin-Connect was installed.\n
|
||||
Use the new 'TALLY' entry in Main Menu for more info.\n
|
||||
whiptail --title " Installed LNDK" --msgbox "\
|
||||
LNDK was installed.\n
|
||||
" 10 45
|
||||
fi
|
||||
else
|
||||
echo "Tallycoin Setting unchanged."
|
||||
echo "LNDK Setting unchanged."
|
||||
fi
|
||||
|
||||
# JoinMarket process choice
|
||||
@ -625,67 +581,19 @@ else
|
||||
echo "Whitepaper setting unchanged."
|
||||
fi
|
||||
|
||||
# Homer process choice
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "ma")
|
||||
# labelbase process choice
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "ls")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${homer}" != "${choice}" ]; then
|
||||
echo "Homer settings changed .."
|
||||
if [ "${labelbase}" != "${choice}" ]; then
|
||||
echo "Labelbase setting changed .."
|
||||
anychange=1
|
||||
/home/admin/config.scripts/bonus.homer.sh ${choice}
|
||||
errorOnInstall=$?
|
||||
if [ "${choice}" = "on" ]; then
|
||||
whiptail --title " Installed Homer" --msgbox "\
|
||||
Homer was installed.\n
|
||||
Use the new 'Homer' entry in Main Menu for more info.\n
|
||||
" 10 35
|
||||
fi
|
||||
else
|
||||
echo "Homer Setting unchanged."
|
||||
fi
|
||||
|
||||
# BitcoinMinds process choice
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "va")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${bitcoinminds}" != "${choice}" ]; then
|
||||
echo "BitcoinMinds setting changed."
|
||||
anychange=1
|
||||
sudo -u admin /home/admin/config.scripts/bonus.bitcoinminds.sh ${choice}
|
||||
sudo -u admin /home/admin/config.scripts/bonus.labelbase.sh ${choice}
|
||||
source /mnt/hdd/raspiblitz.conf
|
||||
if [ "${bitcoinminds}" = "on" ]; then
|
||||
sudo -u admin /home/admin/config.scripts/bonus.bitcoinminds.sh menu
|
||||
if [ "${labelbase}" = "on" ]; then
|
||||
sudo -u admin /home/admin/config.scripts/bonus.labelbase.sh menu
|
||||
fi
|
||||
else
|
||||
echo "BitcoinMinds setting unchanged."
|
||||
fi
|
||||
|
||||
# squeaknode process choice
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "qa")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${squeaknode}" != "${choice}" ]; then
|
||||
echo "squeaknode Setting changed .."
|
||||
anychange=1
|
||||
sudo -u admin /home/admin/config.scripts/bonus.squeaknode.sh ${choice}
|
||||
if [ "${choice}" = "on" ]; then
|
||||
sudo systemctl start squeaknode
|
||||
sudo -u admin /home/admin/config.scripts/bonus.squeaknode.sh menu
|
||||
fi
|
||||
else
|
||||
echo "squeaknode setting unchanged."
|
||||
fi
|
||||
|
||||
# ItchySats process choice
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "ua")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${itchysats}" != "${choice}" ]; then
|
||||
echo "ItchySats setting changed .."
|
||||
anychange=1
|
||||
sudo -u admin /home/admin/config.scripts/bonus.itchysats.sh ${choice} --download
|
||||
if [ "${choice}" = "on" ]; then
|
||||
sudo systemctl start itchysats
|
||||
sudo -u admin /home/admin/config.scripts/bonus.itchysats.sh menu
|
||||
fi
|
||||
else
|
||||
echo "ItchySats setting unchanged."
|
||||
echo "Labelbase setting unchanged."
|
||||
fi
|
||||
|
||||
# fints process choice
|
||||
|
@ -147,12 +147,12 @@ Or scan the qr code on the LCD with your mobile phone.
|
||||
SENDMANY_ANDROID)
|
||||
|
||||
# check if keysend is activated first
|
||||
source <(/home/admin/config.scripts/lnd.keysend.sh status)
|
||||
keysendOn=$(cat /mnt/hdd/lnd/lnd.conf | grep -c '^accept-keysend=1')
|
||||
if [ "${keysendOn}" == "0" ]; then
|
||||
whiptail --title " KEYSEND NEEDED " --msgbox "
|
||||
whiptail --title " LND KEYSEND NEEDED " --msgbox "
|
||||
To use the chat feature of the SendMany app, you need to activate the Keysend feature first.
|
||||
|
||||
Please go to MAINMENU > SERVICES and activate KEYSEND first.
|
||||
Please go to MAINMENU > SYSTEM > LNDCONF and set accept-keysend=1 first.
|
||||
" 12 65
|
||||
exit 0
|
||||
fi
|
||||
|
@ -66,7 +66,7 @@ RaspiBlitz image to your SD card.
|
||||
}
|
||||
|
||||
# get status of txindex
|
||||
source <(/home/admin/config.scripts/network.txindex.sh status)
|
||||
source <(sudo /home/admin/config.scripts/network.txindex.sh status)
|
||||
|
||||
OPTIONS=()
|
||||
#OPTIONS+=(HARDWARE "Run Hardwaretest")
|
||||
|
@ -56,7 +56,7 @@ CHOICE=$(dialog --clear \
|
||||
case $CHOICE in
|
||||
SUMMARY)
|
||||
clear
|
||||
/home/admin/config.scripts/cl-plugin.summary.sh $CHAIN
|
||||
/home/admin/config.scripts/cl-plugin.summars.sh $CHAIN
|
||||
echo "Press ENTER to return to main menu."
|
||||
read key
|
||||
;;
|
||||
|
@ -204,7 +204,7 @@ Save this password as it will be needed to restore the backup (same as the Passw
|
||||
source $_temp
|
||||
/home/admin/config.scripts/cl.hsmtool.sh seed-force "$CHAIN" "${seedWords}"
|
||||
sudo rm $_temp 2>/dev/null
|
||||
if ! sudo ls /home/bitcoin/.lightning/${CLNETWORK}/hsm_secret; then
|
||||
if ! sudo ls /home/bitcoin/.lightning/${CLNETWORK}/hsm_secret 2>/dev/null; then
|
||||
echo "# There was no hsm_secret created - exiting"
|
||||
exit 15
|
||||
fi
|
||||
|
@ -34,6 +34,9 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
|
||||
OPTIONS+=(RESET "Recreate LND Macaroons & tls.cert")
|
||||
OPTIONS+=(SYNC "Sync Macaroons & tls.cert with Apps/Users")
|
||||
fi
|
||||
if [ -f /mnt/hdd/app-data/selfsignedcert/selfsigned.cert ]; then
|
||||
OPTIONS+=(RESET-TLS "Reset the self-signed TLS certificate")
|
||||
fi
|
||||
|
||||
CHOICE_HEIGHT=$(("${#OPTIONS[@]}/2+1"))
|
||||
HEIGHT=$((CHOICE_HEIGHT+6))
|
||||
@ -75,7 +78,9 @@ case $CHOICE in
|
||||
EXPORT)
|
||||
sudo /home/admin/config.scripts/lnd.export.sh
|
||||
exit 0;;
|
||||
|
||||
RESET-TLS)
|
||||
sudo /home/admin/config.scripts/internetselfsignedcert.sh reset
|
||||
exit 0;;
|
||||
ALBY)
|
||||
/home/admin/config.scripts/bonus.alby.sh
|
||||
exit 0;
|
||||
|
@ -9,8 +9,6 @@ source <(/home/admin/config.scripts/network.aliases.sh getvars lnd $1)
|
||||
|
||||
sudo mkdir /var/cache/raspiblitz/temp 2>/dev/null
|
||||
|
||||
if ! pip list | grep grpc; then sudo -H python3 -m pip install grpcio==1.38.1; fi
|
||||
|
||||
askLNDbackupCopy()
|
||||
{
|
||||
whiptail --title "LND Data Backup" --yes-button "Backup" --no-button "Skip" --yesno "
|
||||
@ -348,7 +346,7 @@ case $CHOICE in
|
||||
echo
|
||||
echo "Press ENTER when your backup download is done to shutdown."
|
||||
read key
|
||||
/home/admin/config.scripts/blitz.shutdown.sh
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh
|
||||
;;
|
||||
RESET-LND)
|
||||
askLNDbackupCopy
|
||||
|
@ -15,6 +15,9 @@ TITLE=" ${CHAIN} System Options "
|
||||
MENU="" # adds lines to HEIGHT
|
||||
OPTIONS=() # adds lines to HEIGHt + CHOICE_HEIGHT
|
||||
|
||||
OPTIONS+=(BTOP "Monitor system resources with btop")
|
||||
OPTIONS+=(TIME "Set Timezone")
|
||||
|
||||
OPTIONS+=(${network}LOG "Monitor the debug.log for ${CHAIN}")
|
||||
OPTIONS+=(${network}CONF "Edit the bitcoin.conf")
|
||||
|
||||
@ -49,6 +52,16 @@ CHOICE=$(dialog --clear \
|
||||
2>&1 >/dev/tty)
|
||||
|
||||
case $CHOICE in
|
||||
BTOP)
|
||||
if ! btop -v; then
|
||||
sudo apt install -y btop
|
||||
fi
|
||||
# run as root to allow signal sending to any process
|
||||
sudo btop
|
||||
;;
|
||||
TIME)
|
||||
sudo /home/admin/config.scripts/blitz.time.sh choose-timezone
|
||||
;;
|
||||
${network}LOG)
|
||||
if [ ${CHAIN} = signet ]; then
|
||||
bitcoinlogpath="/mnt/hdd/bitcoin/signet/debug.log"
|
||||
|
@ -80,7 +80,7 @@ Once the LCD is white and no LEDs are blinking anymore:
|
||||
- Remove the Power from RaspiBlitz
|
||||
- Exchange the old with the new SD card
|
||||
- Connect Power back to the RaspiBlitz
|
||||
- Follow the instructions on the LCD
|
||||
- Login again per SSH or WebUI
|
||||
|
||||
Do you have the SD card with the new version image ready
|
||||
and do you WANT TO START UPDATE NOW?
|
||||
@ -160,7 +160,7 @@ patch()
|
||||
if [ $? -eq 0 ]; then
|
||||
clear
|
||||
echo "REBOOT .."
|
||||
/home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
sleep 8
|
||||
exit 1
|
||||
else
|
||||
@ -269,7 +269,28 @@ Do you really want to update LND now?
|
||||
if [ ${#error} -gt 0 ]; then
|
||||
whiptail --title "ERROR" --msgbox "${error}" 8 30
|
||||
else
|
||||
/home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
whiptail \
|
||||
--title " LND update " \
|
||||
--yes-button "Reboot" \
|
||||
--no-button "Skip Reboot" \
|
||||
--yesno \
|
||||
"OK LND update is done.
|
||||
|
||||
By default a reboot is advised to sync macaroons and the TLS certificate.
|
||||
Consider rebooting later manually if encountering any problems.
|
||||
" 12 50
|
||||
if [ $? -eq 0 ]; then
|
||||
clear
|
||||
echo "# REBOOT .."
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
sleep 8
|
||||
exit 1
|
||||
else
|
||||
echo "# SKIP REBOOT"
|
||||
echo "# starting the lnd.service .."
|
||||
sudo systemctl start lnd
|
||||
exit 0
|
||||
fi
|
||||
sleep 8
|
||||
fi
|
||||
;;
|
||||
@ -293,7 +314,28 @@ Do you really want to update LND now?
|
||||
if [ ${#error} -gt 0 ]; then
|
||||
whiptail --title "ERROR" --msgbox "${error}" 8 30
|
||||
else
|
||||
/home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
whiptail \
|
||||
--title " LND update " \
|
||||
--yes-button "Reboot" \
|
||||
--no-button "Skip Reboot" \
|
||||
--yesno \
|
||||
"OK LND update is done.
|
||||
|
||||
By default a reboot is advised to sync macaroons and the TLS certificate.
|
||||
Consider rebooting later manually if encountering any problems.
|
||||
" 12 50
|
||||
if [ $? -eq 0 ]; then
|
||||
clear
|
||||
echo "# REBOOT .."
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
sleep 8
|
||||
exit 1
|
||||
else
|
||||
echo "# SKIP REBOOT"
|
||||
echo "# starting the lnd.service .."
|
||||
sudo systemctl start lnd
|
||||
exit 0
|
||||
fi
|
||||
sleep 8
|
||||
fi
|
||||
;;
|
||||
@ -418,7 +460,28 @@ Do you really want to update Bitcoin Core now?
|
||||
error=""
|
||||
warn=""
|
||||
sudo -u admin /home/admin/config.scripts/bitcoin.update.sh tested
|
||||
/home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
whiptail \
|
||||
--title " Bitcoin Core update " \
|
||||
--yes-button "Reboot" \
|
||||
--no-button "Skip Reboot" \
|
||||
--yesno \
|
||||
"OK Bitcoin Core update is done.
|
||||
|
||||
By default a reboot is advised.
|
||||
" 9 40
|
||||
if [ $? -eq 0 ]; then
|
||||
clear
|
||||
echo "# REBOOT .."
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
sleep 8
|
||||
exit 1
|
||||
else
|
||||
echo "# SKIP REBOOT"
|
||||
echo "# starting the bitcoind.service .."
|
||||
sudo systemctl start bitcoind
|
||||
exit 0
|
||||
fi
|
||||
sleep 8
|
||||
;;
|
||||
RECKLESS)
|
||||
whiptail --title "UNTESTED Bitcoin Core update to ${bitcoinLatestVersion}" --yes-button "Cancel" \
|
||||
@ -439,11 +502,53 @@ Do you really want to update Bitcoin Core now?
|
||||
if [ ${#error} -gt 0 ]; then
|
||||
whiptail --title "ERROR" --msgbox "${error}" 8 30
|
||||
fi
|
||||
/home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
whiptail \
|
||||
--title " Bitcoin Core update " \
|
||||
--yes-button "Reboot" \
|
||||
--no-button "Skip Reboot" \
|
||||
--yesno \
|
||||
"OK Bitcoin Core update is done.
|
||||
|
||||
By default a reboot is advised.
|
||||
" 9 40
|
||||
if [ $? -eq 0 ]; then
|
||||
clear
|
||||
echo "REBOOT .."
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
sleep 8
|
||||
exit 1
|
||||
else
|
||||
echo "# SKIP REBOOT"
|
||||
echo "# starting the bitcoind.service .."
|
||||
sudo systemctl start bitcoind
|
||||
exit 0
|
||||
fi
|
||||
sleep 8
|
||||
;;
|
||||
CUSTOM)
|
||||
sudo -u admin /home/admin/config.scripts/bitcoin.update.sh custom
|
||||
/home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
whiptail \
|
||||
--title " Bitcoin Core update " \
|
||||
--yes-button "Reboot" \
|
||||
--no-button "Skip Reboot" \
|
||||
--yesno \
|
||||
"OK Bitcoin Core update is done.
|
||||
|
||||
By default a reboot is advised.
|
||||
" 9 40
|
||||
if [ $? -eq 0 ]; then
|
||||
clear
|
||||
echo "# REBOOT .."
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
sleep 8
|
||||
exit 1
|
||||
else
|
||||
echo "# SKIP REBOOT"
|
||||
echo "# starting the bitcoind.service .."
|
||||
sudo systemctl start bitcoind
|
||||
exit 0
|
||||
fi
|
||||
sleep 8
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@ -490,9 +595,9 @@ if [ "${lndg}" == "on" ]; then
|
||||
fi
|
||||
|
||||
## Disabled for now until the base image has Python 3.10
|
||||
#if [ "${specter}" == "on" ]; then
|
||||
# OPTIONS+=(SPECTER "Update Specter Desktop")
|
||||
#fi
|
||||
if [ "${specter}" == "on" ]; then
|
||||
OPTIONS+=(SPECTER "Update Specter Desktop")
|
||||
fi
|
||||
|
||||
if [ "${BTCPayServer}" == "on" ]; then
|
||||
OPTIONS+=(BTCPAY "Update BTCPayServer")
|
||||
@ -502,10 +607,6 @@ if [ "${sphinxrelay}" == "on" ]; then
|
||||
OPTIONS+=(SPHINX "Update Sphinx Server Relay")
|
||||
fi
|
||||
|
||||
if [ "${homer}" == "on" ]; then
|
||||
OPTIONS+=(HOMER "Update Homer")
|
||||
fi
|
||||
|
||||
if [ "${mempoolExplorer}" == "on" ]; then
|
||||
OPTIONS+=(MEMPOOL "Update Mempool Explorer")
|
||||
fi
|
||||
@ -518,10 +619,6 @@ if [ "${runBehindTor}" == "on" ]; then
|
||||
OPTIONS+=(TOR "Update Tor from the Torproject repo")
|
||||
fi
|
||||
|
||||
if [ "${itchysats}" == "on" ]; then
|
||||
OPTIONS+=(ITCHYSATS "Update ItchySats")
|
||||
fi
|
||||
|
||||
CHOICE_HEIGHT=$(("${#OPTIONS[@]}/2+1"))
|
||||
HEIGHT=$((CHOICE_HEIGHT+6))
|
||||
CHOICE=$(dialog --clear \
|
||||
@ -577,16 +674,10 @@ case $CHOICE in
|
||||
TOR)
|
||||
sudo /home/admin/config.scripts/tor.network.sh update
|
||||
;;
|
||||
HOMER)
|
||||
/home/admin/config.scripts/bonus.homer.sh update
|
||||
;;
|
||||
MEMPOOL)
|
||||
/home/admin/config.scripts/bonus.mempool.sh update
|
||||
;;
|
||||
JAM)
|
||||
/home/admin/config.scripts/bonus.jam.sh update
|
||||
;;
|
||||
ITCHYSATS)
|
||||
/home/admin/config.scripts/bonus.itchysats.sh update
|
||||
;;
|
||||
esac
|
||||
|
@ -682,7 +682,7 @@ adjectives = [
|
||||
"picky",
|
||||
"pied",
|
||||
"piggy",
|
||||
"pilar",
|
||||
"pillar",
|
||||
"pink",
|
||||
"plain",
|
||||
"plane",
|
||||
|
@ -648,7 +648,7 @@ piano
|
||||
picky
|
||||
pied
|
||||
piggy
|
||||
pilar
|
||||
pillar
|
||||
pink
|
||||
plain
|
||||
plane
|
||||
|
@ -1,296 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# command info
|
||||
if [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
echo "# Turns the RaspiBlitz into HDD CopyStation Mode"
|
||||
echo "# lightning is deactivated during CopyStationMode"
|
||||
echo "# reboot RaspiBlitz to set back to normal mode"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
####### CONFIG #############
|
||||
|
||||
# where to find the BITCOIN data directory (no trailing /)
|
||||
pathBitcoinBlockchain="/mnt/hdd/bitcoin"
|
||||
|
||||
# where to find the RaspiBlitz HDD template directory (no trailing /)
|
||||
pathTemplateHDD="/mnt/hdd/app-storage/templateHDD"
|
||||
|
||||
####### SCRIPT #############
|
||||
|
||||
# check sudo
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "Please run as root (with sudo)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# get HDD info
|
||||
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh status)
|
||||
|
||||
# check if HDD is mounted
|
||||
if [ ${isMounted} -eq 0 ]; then
|
||||
echo "error='HDD is not mounted'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check if HDD is big enough
|
||||
if [ ${hddGigaBytes} -lt 800 ]; then
|
||||
echo "# To run copy station (+/- 1TB needed)"
|
||||
echo "error='HDD is too small'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check that path information is valid
|
||||
if [ -d "$pathBitcoinBlockchain" ]; then
|
||||
echo "# OK found $pathBitcoinBlockchain"
|
||||
else
|
||||
echo "# FAIL path of 'pathBitcoinBlockchain' does not exists: ${pathBitcoinBlockchain}"
|
||||
echo "error='pathBitcoinBlockchain not found'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# make sure that its running in screen
|
||||
# call with '-foreground' to prevent running in screen
|
||||
if [ "$1" != "-foreground" ]; then
|
||||
screenPID=$(screen -ls | grep "copystation" | cut -d "." -f1 | xargs)
|
||||
if [ ${#screenPID} -eq 0 ]; then
|
||||
# start copystation in screen
|
||||
echo "# starting copystation screen session"
|
||||
screen -S copystation -dm /home/admin/XXcopyStation.sh -foreground
|
||||
screen -d -r
|
||||
exit 0
|
||||
else
|
||||
echo "# changing into running copystation screen session"
|
||||
screen -d -r
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
clear
|
||||
echo "# ******************************"
|
||||
echo "# RASPIBLITZ COPYSTATION SCRIPT"
|
||||
echo "# ******************************"
|
||||
echo
|
||||
echo "Make sure that no target HDD/SSDs are not connected yet .."
|
||||
echo
|
||||
sudo sed -i "s/^state=.*/state=copystation/g" /home/admin/raspiblitz.info 2>/dev/null
|
||||
sleep 10
|
||||
|
||||
echo "*** CHECKING CONFIG"
|
||||
|
||||
# check that path information is valid
|
||||
if [ -d "$pathTemplateHDD" ]; then
|
||||
echo "# OK found $pathTemplateHDD"
|
||||
else
|
||||
echo "# Creating: ${pathTemplateHDD}"
|
||||
mkdir ${pathTemplateHDD}
|
||||
chmod 777 ${pathTemplateHDD}
|
||||
fi
|
||||
|
||||
# make sure that lnd is stopped (if running)
|
||||
systemctl stop lnd 2>/dev/null
|
||||
systemctl stop background 2>/dev/null
|
||||
|
||||
# finding system drives (the drives that should not be synced to)
|
||||
echo "# OK - the following drives detected as the system drive: $datadisk"
|
||||
echo
|
||||
|
||||
# BASIC IDEA:
|
||||
# 1. get fresh data from bitcoind --> template data
|
||||
# 2. detect HDDs
|
||||
# 3. sync HDDs with template data
|
||||
# repeat
|
||||
|
||||
echo
|
||||
echo "*** RUNNING ***"
|
||||
lastBlockchainUpdateTimestamp=1
|
||||
firstLoop=1
|
||||
|
||||
while :
|
||||
do
|
||||
|
||||
# reset external data stores (needed because local vars dont work in deeper while loops)
|
||||
echo "" > /var/cache/raspiblitz/copystationHddsInfoString.tmp
|
||||
rm /var/cache/raspiblitz/copystationFoundTargets.flag
|
||||
|
||||
################################################
|
||||
# 1. get fresh data from bitcoind for template data (skip on first loop)
|
||||
|
||||
# only execute every 30min
|
||||
nowTimestamp=$(date +%s)
|
||||
secondsDiff=$(echo "${nowTimestamp}-${lastBlockchainUpdateTimestamp}" | bc)
|
||||
echo "# seconds since last update from bitcoind: ${secondsDiff}"
|
||||
echo
|
||||
|
||||
if [ ${secondsDiff} -gt 3000 ]; then
|
||||
|
||||
echo "******************************"
|
||||
echo "Bitcoin Blockchain Update"
|
||||
echo "******************************"
|
||||
|
||||
# stop blockchains
|
||||
echo "# Stopping Blockchain ..."
|
||||
systemctl stop bitcoind 2>/dev/null
|
||||
sleep 10
|
||||
|
||||
# sync bitcoin
|
||||
echo "# Syncing Bitcoin to template folder ..."
|
||||
/home/admin/_cache.sh set message "Updating Template: Bitcoin"
|
||||
|
||||
# make sure the bitcoin directory in template folder exists
|
||||
if [ ! -d "$pathTemplateHDD/bitcoin" ]; then
|
||||
echo "# creating the bitcoin subfolder in the template folder"
|
||||
mkdir ${pathTemplateHDD}/bitcoin
|
||||
chmod 777 ${pathTemplateHDD}/bitcoin
|
||||
fi
|
||||
|
||||
# do the sync to the template folder for BITCOIN
|
||||
rsync -a --info=progress2 --delete ${pathBitcoinBlockchain}/chainstate ${pathBitcoinBlockchain}/blocks ${pathTemplateHDD}/bitcoin
|
||||
|
||||
# restart bitcoind (to let further setup while syncing HDDs)
|
||||
echo "# Restarting Blockchain ..."
|
||||
systemctl start bitcoind 2>/dev/null
|
||||
|
||||
# update timer
|
||||
lastBlockchainUpdateTimestamp=$(date +%s)
|
||||
fi
|
||||
|
||||
################################################
|
||||
# 2. detect connected HDDs and loop thru them
|
||||
|
||||
echo
|
||||
echo "**************************************"
|
||||
echo "SYNCING TEMPLATE -> CONNECTED HDD/SSDs"
|
||||
echo "**************************************"
|
||||
sleep 2
|
||||
lsblk -o NAME | grep "^[s|v]d" | while read -r detectedDrive ; do
|
||||
isSystemDrive=$(echo "${datadisk}" | grep -c "${detectedDrive}")
|
||||
if [ ${isSystemDrive} -eq 0 ]; then
|
||||
|
||||
# remember that disks were found
|
||||
touch /var/cache/raspiblitz/copystationFoundTargets.flag
|
||||
|
||||
# check if drives 1st partition is named BLOCKCHAIN & in EXT4 format
|
||||
isNamedBlockchain=$(lsblk -o NAME,FSTYPE,LABEL | grep "${detectedDrive}" | grep -c "BLOCKCHAIN")
|
||||
isFormatExt4=$(lsblk -o NAME,FSTYPE,LABEL | grep "${detectedDrive}" | grep -c "ext4")
|
||||
|
||||
# init a fresh device
|
||||
if [ ${isNamedBlockchain} -eq 0 ] || [ ${isFormatExt4} -eq 0 ]; then
|
||||
|
||||
echo
|
||||
echo "**************************************************************"
|
||||
echo "*** NEW EMPTY HDD FOUND ---> ${detectedDrive}"
|
||||
echo "isNamedBlockchain: ${isNamedBlockchain}"
|
||||
echo "isFormatExt4:" ${isFormatExt4}
|
||||
|
||||
# check if size is OK
|
||||
size=$(lsblk -o NAME,SIZE -b | grep "^${detectedDrive}" | awk '$1=$1' | cut -d " " -f 2)
|
||||
echo "size: ${size}"
|
||||
if [ ${size} -lt 900000000000 ]; then
|
||||
echo "# THE HDD/SSD IS TOO SMALL <900GB - use at least 1TB"
|
||||
/home/admin/_cache.sh set message "HDD smaller than 1TB: ${detectedDrive}"
|
||||
echo
|
||||
sleep 10
|
||||
else
|
||||
|
||||
choice=0
|
||||
/home/admin/_cache.sh set message "Formatting new HDD: ${detectedDrive}"
|
||||
|
||||
# format the HDD
|
||||
echo "Starting Formatting of device ${detectedDrive} ..."
|
||||
/home/admin/config.scripts/blitz.datadrive.sh format ext4 ${detectedDrive}
|
||||
sleep 4
|
||||
|
||||
fi
|
||||
|
||||
else
|
||||
echo
|
||||
echo "*** ALREADY ACTIVE HDD FOUND ---> ${detectedDrive}"
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
################################################
|
||||
# 3. sync HDD with template data (skip on first loop)
|
||||
|
||||
partition=$(lsblk -o NAME,FSTYPE,LABEL | grep "${detectedDrive}" | grep "BLOCKCHAIN" | cut -d ' ' -f 1 | tr -cd "[:alnum:]")
|
||||
if [ "${firstLoop}" != "1" ] && [ ${#partition} -gt 0 ]; then
|
||||
|
||||
# temp mount device
|
||||
echo "mounting: ${partition}"
|
||||
mkdir /mnt/hdd2 2>/dev/null
|
||||
mount -t ext4 /dev/${partition} /mnt/hdd2
|
||||
|
||||
# rsync device
|
||||
mountOK=$(lsblk -o NAME,MOUNTPOINT | grep "${detectedDrive}" | grep -c "/mnt/hdd2")
|
||||
if [ ${mountOK} -eq 1 ]; then
|
||||
hddsInfoString=$(cat /var/cache/raspiblitz/copystationHddsInfoString.tmp | tr '\n' ' ')
|
||||
/home/admin/_cache.sh set message "${hddsInfoString} ${partition}>SYNC"
|
||||
rsync -a --info=progress2 --delete ${pathTemplateHDD}/* /mnt/hdd2
|
||||
chmod -R 777 /mnt/hdd2
|
||||
rm -r /mnt/hdd2/lost+found 2>/dev/null
|
||||
echo "${partition}>OK" >> /var/cache/raspiblitz/copystationHddsInfoString.tmp
|
||||
else
|
||||
echo "# FAIL: was not able to mount --> ${partition}"
|
||||
fi
|
||||
|
||||
# unmount device
|
||||
umount -l /mnt/hdd2
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
done
|
||||
|
||||
# check for flag
|
||||
foundTargets=$(ls /var/cache/raspiblitz/copystationFoundTargets.flag 2>/dev/null | grep -c "copystationFoundTargets.flag")
|
||||
hddsInfoString=$(cat /var/cache/raspiblitz/copystationHddsInfoString.tmp | tr '\n' ' ')
|
||||
|
||||
clear
|
||||
if [ "${foundTargets}" == "1" ] && [ "${firstLoop}" == "1" ]; then
|
||||
|
||||
# after script found discs and did formatting ... go into full loop
|
||||
echo "OK first loop done ..."
|
||||
firstLoop=0
|
||||
sleep 1
|
||||
|
||||
elif [ "${foundTargets}" == "0" ]; then
|
||||
|
||||
echo "**** NO TARGET HDD/SSDs CONNECTED ****"
|
||||
echo
|
||||
echo "Best way to start a new batch:"
|
||||
echo "- Disconnect powered USB-Hub (best unplug USB cable at USB-Hub)"
|
||||
echo "- Connect all HDD/SSDs to the disconnected USB-Hub"
|
||||
echo "- Connect powered USB-Hub to Blitz (plug USB cable in)"
|
||||
echo "- During formatting remember names of physical HDD/SSDs"
|
||||
echo "- As soon as you see an OK for that HDD/SSD name you can remove it"
|
||||
echo
|
||||
echo "Next round starts in 30 seconds ..."
|
||||
echo "To stop copystation script: CTRL+c and then 'restart'"
|
||||
echo "You can close SSH terminal and script will run in background can can be re-entered."
|
||||
|
||||
/home/admin/_cache.sh set message "No target HDDs connected - connect USB Hub"
|
||||
firstLoop=1
|
||||
sleep 30
|
||||
|
||||
else
|
||||
|
||||
echo "**** SYNC LOOP DONE ****"
|
||||
echo "HDDs ready synced:"
|
||||
cat /var/cache/raspiblitz/copystationHddsInfoString.tmp
|
||||
echo
|
||||
echo "*************************"
|
||||
echo
|
||||
echo "Next round starts in 25 seconds ..."
|
||||
echo "To stop copystation script: CTRL+c and then 'restart'"
|
||||
echo "You can close SSH terminal and script will run in background can can be re-entered."
|
||||
|
||||
/home/admin/_cache.sh set message "Ready HDDs: ${hddsInfoString}"
|
||||
sleep 25
|
||||
|
||||
fi
|
||||
|
||||
clear
|
||||
echo "starting new sync loop"
|
||||
sleep 5
|
||||
|
||||
done
|
@ -105,29 +105,18 @@ fi
|
||||
echo "importing: _version.info"
|
||||
/home/admin/_cache.sh import /home/admin/_version.info
|
||||
|
||||
# basic hardware info (will not change)
|
||||
source <(/home/admin/_cache.sh valid \
|
||||
system_board \
|
||||
system_ram_mb \
|
||||
system_ram_gb \
|
||||
)
|
||||
if [ "${stillvalid}" == "0" ]; then
|
||||
source <(/home/admin/config.scripts/blitz.hardware.sh status)
|
||||
/home/admin/_cache.sh set system_board "${board}"
|
||||
/home/admin/_cache.sh set system_ram_mb "${ramMB}"
|
||||
/home/admin/_cache.sh set system_ram_gb "${ramGB}"
|
||||
fi
|
||||
|
||||
# VM detect vagrant
|
||||
source <(/home/admin/_cache.sh valid system_vm_vagrant)
|
||||
if [ "${stillvalid}" == "0" ]; then
|
||||
vagrant=$(df | grep -c "/vagrant")
|
||||
/home/admin/_cache.sh set system_vm_vagrant "${vagrant}"
|
||||
fi
|
||||
# get hardware info
|
||||
source <(/home/admin/config.scripts/blitz.hardware.sh status)
|
||||
/home/admin/_cache.sh set system_board "${board}"
|
||||
/home/admin/_cache.sh set system_ram_mb "${ramMB}"
|
||||
/home/admin/_cache.sh set system_ram_gb "${ramGB}"
|
||||
|
||||
# flag that init was done (will be checked on each loop)
|
||||
/home/admin/_cache.sh set system_init_time "$(date +%s)"
|
||||
|
||||
# add info about start to raspiblitz.log
|
||||
echo "INFO: _bootstrap.scan.sh loop started > sudo journalctl -f -u background.scan" >> /home/admin/raspiblitz.log
|
||||
|
||||
while [ 1 ]
|
||||
do
|
||||
|
||||
@ -140,6 +129,7 @@ do
|
||||
source <(/home/admin/_cache.sh get system_init_time)
|
||||
if [ "${system_init_time}" == "" ]; then
|
||||
echo "FAIL: CACHE IS MISSING INIT DATA ... exiting to let systemd restart"
|
||||
echo "INFO: _bootstrap.scan.sh -> cache not running - exiting" >> /home/admin/raspiblitz.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -151,7 +141,9 @@ do
|
||||
|
||||
# uptime just do on every run
|
||||
system_up=$(cat /proc/uptime | grep -o '^[0-9]\+')
|
||||
system_up_text=$(uptime -p | cut -d ' ' -f 2- | cut -d ',' -f 1 | awk '{print $1 substr($2, 1, 1)}')
|
||||
/home/admin/_cache.sh set system_up "${system_up}"
|
||||
/home/admin/_cache.sh set system_up_text "${system_up_text}"
|
||||
|
||||
# cpu load
|
||||
cpu_load=$(w | head -n 1 | cut -d 'v' -f2 | cut -d ':' -f2)
|
||||
@ -167,9 +159,7 @@ do
|
||||
fi
|
||||
|
||||
# ram
|
||||
ram=$(free -m | grep Mem | awk '{ print $2 }')
|
||||
ram_avail=$(free -m | grep Mem | awk '{ print $7 }')
|
||||
/home/admin/_cache.sh set system_ram_mb "${ram}"
|
||||
ram_avail=$(free -m | grep -E 'Mem|Speicher' | awk '{ print $7 }')
|
||||
/home/admin/_cache.sh set system_ram_available_mb "${ram_avail}"
|
||||
|
||||
# undervoltage
|
||||
@ -268,6 +258,29 @@ do
|
||||
/home/admin/_cache.sh set internet_online "${online}"
|
||||
fi
|
||||
|
||||
###################
|
||||
# HARDDRIVE
|
||||
|
||||
# info on storage medium
|
||||
source <(/home/admin/_cache.sh valid hdd_mounted)
|
||||
if [ "${stillvalid}" == "0" ] || [ ${age} -gt ${MINUTE2} ]; then
|
||||
echo "updating: /home/admin/config.scripts/blitz.datadrive.sh status"
|
||||
source <(/home/admin/config.scripts/blitz.datadrive.sh status)
|
||||
/home/admin/_cache.sh set hdd_mounted "${isMounted}"
|
||||
/home/admin/_cache.sh set hdd_ssd "${isSSD}"
|
||||
/home/admin/_cache.sh set hdd_btrfs "${isBTRFS}"
|
||||
/home/admin/_cache.sh set hdd_raid "${isRaid}"
|
||||
/home/admin/_cache.sh set hdd_uasp "${hddAdapterUSAP}"
|
||||
/home/admin/_cache.sh set hdd_capacity_bytes "${hddBytes}"
|
||||
/home/admin/_cache.sh set hdd_capacity_gb "${hddGigaBytes}"
|
||||
/home/admin/_cache.sh set hdd_free_bytes "${hddDataFreeBytes}"
|
||||
/home/admin/_cache.sh set hdd_free_gb "${hddDataFreeGB}"
|
||||
/home/admin/_cache.sh set hdd_used_info "${hddUsedInfo}"
|
||||
/home/admin/_cache.sh set hddTemperature "${hddTemperature}"
|
||||
/home/admin/_cache.sh set hddTBSize "${hddTBSize}"
|
||||
|
||||
fi
|
||||
|
||||
# exit if still setup or higher system stopped
|
||||
source <(/home/admin/_cache.sh get setupPhase state)
|
||||
if [ "${setupPhase}" != "done" ] ||
|
||||
@ -296,25 +309,6 @@ do
|
||||
# read/update config values
|
||||
source /mnt/hdd/raspiblitz.conf
|
||||
|
||||
###################
|
||||
# HARDDRIVE
|
||||
|
||||
if [ "${stillvalid}" == "0" ] || [ ${age} -gt ${MINUTE2} ]; then
|
||||
echo "updating: /home/admin/config.scripts/blitz.datadrive.sh status"
|
||||
source <(/home/admin/config.scripts/blitz.datadrive.sh status)
|
||||
/home/admin/_cache.sh set hdd_mounted "${isMounted}"
|
||||
/home/admin/_cache.sh set hdd_ssd "${isSSD}"
|
||||
/home/admin/_cache.sh set hdd_btrfs "${isBTRFS}"
|
||||
/home/admin/_cache.sh set hdd_raid "${isRaid}"
|
||||
/home/admin/_cache.sh set hdd_uasp "${hddAdapterUSAP}"
|
||||
/home/admin/_cache.sh set hdd_capacity_bytes "${hddBytes}"
|
||||
/home/admin/_cache.sh set hdd_capacity_gb "${hddGigaBytes}"
|
||||
/home/admin/_cache.sh set hdd_free_bytes "${hddDataFreeBytes}"
|
||||
/home/admin/_cache.sh set hdd_free_gb "${hddDataFreeGB}"
|
||||
/home/admin/_cache.sh set hdd_used_info "${hddUsedInfo}"
|
||||
/home/admin/_cache.sh set hdd_blockchain_data "${hddBlocksBitcoin}"
|
||||
fi
|
||||
|
||||
###################
|
||||
# BITCOIN
|
||||
|
||||
|
@ -13,11 +13,21 @@ configFile="/mnt/hdd/raspiblitz.conf"
|
||||
# LOGS see: sudo journalctl -f -u background
|
||||
|
||||
echo "_background.sh STARTED"
|
||||
echo "INFO: _background.sh loop started - sudo journalctl -f -u background" >> /home/admin/raspiblitz.log
|
||||
|
||||
# global vars
|
||||
blitzTUIHeartBeatLine=""
|
||||
/home/admin/_cache.sh set blitzTUIRestarts "0"
|
||||
|
||||
# determine correct raspberrypi boot drive path (that easy to access when sd card is insert into laptop)
|
||||
raspi_bootdir=""
|
||||
if [ -d /boot/firmware ]; then
|
||||
raspi_bootdir="/boot/firmware"
|
||||
elif [ -d /boot ]; then
|
||||
raspi_bootdir="/boot"
|
||||
fi
|
||||
echo "# raspi_bootdir(${raspi_bootdir})"
|
||||
|
||||
counter=0
|
||||
while [ 1 ]
|
||||
do
|
||||
@ -42,7 +52,6 @@ do
|
||||
# source info & config file fresh on every loop
|
||||
source ${infoFile} 2>/dev/null
|
||||
source ${configFile} 2>/dev/null
|
||||
source <(/home/admin/_cache.sh get state setupPhase)
|
||||
|
||||
####################################################
|
||||
# SKIP BACKGROUND TASK LOOP ON CERTAIN SYSTEM STATES
|
||||
@ -104,8 +113,7 @@ do
|
||||
|
||||
# detect a missing DHCP config
|
||||
if [ "${localip:0:4}" = "169." ]; then
|
||||
echo "Missing DHCP detected ... trying emergency reboot"
|
||||
/home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
echo "Missing DHCP detected ..."
|
||||
else
|
||||
echo "DHCP OK"
|
||||
fi
|
||||
@ -265,6 +273,8 @@ do
|
||||
debuginfo=$(ls -la /var/log/ 2>/dev/null)
|
||||
# dont delete directories - can make services crash
|
||||
sudo rm /var/log/*
|
||||
sudo touch /var/log/auth.log
|
||||
sudo chown root:adm /var/log/auth.log
|
||||
sudo service rsyslog restart
|
||||
/home/admin/config.scripts/blitz.error.sh _background.sh "log-delete" "REPAIR: /var/log/ >5GB" "Logs in /var/log in were bigger then 5GB and got emergency delete to prevent fillup." "${debuginfo}"
|
||||
sleep 10
|
||||
@ -480,11 +490,35 @@ do
|
||||
echo "--> Channel Backup File changed"
|
||||
|
||||
# make copy to sd card (as local basic backup)
|
||||
mkdir -p /home/admin/backups/scb/ 2>/dev/null
|
||||
mkdir -p ${localBackupDir} 2>/dev/null
|
||||
cp $scbPath $localBackupPath
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "OK channel.backup copied to '${localBackupPath}'"
|
||||
else
|
||||
logger -p daemon.err "_background.sh FAIL channel.backup copy to '${localBackupPath}'"
|
||||
echo "FAIL channel.backup copy to '${localBackupPath}'"
|
||||
fi
|
||||
|
||||
cp $scbPath $localTimestampedPath
|
||||
cp $scbPath /boot/channel.backup
|
||||
echo "OK channel.backup copied to '${localBackupPath}' and '${localTimestampedPath}' and '/boot/channel.backup'"
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "OK channel.backup copied to '${localTimestampedPath}'"
|
||||
else
|
||||
logger -p daemon.err "_background.sh FAIL channel.backup copy to '${localTimestampedPath}'"
|
||||
echo "FAIL channel.backup copy to '${localTimestampedPath}'"
|
||||
fi
|
||||
|
||||
# copy to boot drive (for easy recovery)
|
||||
if [ "${raspi_bootdir}" != "" ]; then
|
||||
cp $scbPath ${raspi_bootdir}/channel.backup
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "OK channel.backup copied to '${raspi_bootdir}/channel.backup'"
|
||||
else
|
||||
logger -p daemon.err "_background.sh FAIL channel.backup copy to '${raspi_bootdir}/channel.backup'"
|
||||
echo "FAIL channel.backup copy to '${raspi_bootdir}/channel.backup'"
|
||||
fi
|
||||
else
|
||||
echo "No boot drive found - skip copy to boot"
|
||||
fi
|
||||
|
||||
# check if a additional local backup target is set
|
||||
# see ./config.scripts/blitz.backupdevice.sh
|
||||
@ -511,27 +545,27 @@ do
|
||||
fi
|
||||
fi
|
||||
|
||||
# check if a SFTP backup target is set
|
||||
# check if a SCP backup target is set
|
||||
# parameter in raspiblitz.conf:
|
||||
# sftpBackupTarget='[USER]@[SERVER]:[DIRPATH-WITHOUT-ENDING-/]'
|
||||
# optionally a custom option string for the sftp command can be set with
|
||||
# sftpBackupOptions='[YOUR-CUSTOM-OPTIONS]'
|
||||
# scpBackupTarget='[USER]@[SERVER]:[DIRPATH-WITHOUT-ENDING-/]'
|
||||
# optionally a custom option string for the scp command can be set with
|
||||
# scpBackupOptions='[YOUR-CUSTOM-OPTIONS]'
|
||||
# On target server add the public key of your RaspiBlitz to the authorized_keys for the user
|
||||
# https://www.linode.com/docs/security/authentication/use-public-key-authentication-with-ssh/
|
||||
if [ ${#sftpBackupTarget} -gt 0 ]; then
|
||||
if [ ${#scpBackupTarget} -gt 0 ]; then
|
||||
echo "--> Offsite-Backup SFTP Server"
|
||||
if [ "${sftpBackupOptions}" == "" ]; then
|
||||
sftpBackupOptions="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
|
||||
if [ "${scpBackupOptions}" == "" ]; then
|
||||
scpBackupOptions="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
|
||||
fi
|
||||
# its ok to ignore known host, because data is encrypted (worst case of MiM would be: no offsite channel backup)
|
||||
# but its more likely that without ignoring known host, script might not run thru and that way: no offsite channel backup
|
||||
sftp ${sftpBackupOptions} ${localBackupPath} ${sftpBackupTarget}/
|
||||
sftp ${sftpBackupOptions} ${localTimestampedPath} ${sftpBackupTarget}/
|
||||
scp ${scpBackupOptions} ${localBackupPath} ${scpBackupTarget}/
|
||||
scp ${scpBackupOptions} ${localTimestampedPath} ${scpBackupTarget}/
|
||||
result=$?
|
||||
if [ ${result} -eq 0 ]; then
|
||||
echo "OK - SFTP Backup exited with 0"
|
||||
echo "OK - SCP Backup exited with 0"
|
||||
else
|
||||
echo "FAIL - SFTP Backup exited with ${result}"
|
||||
echo "FAIL - SCP Backup exited with ${result}"
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -589,8 +623,8 @@ do
|
||||
mkdir -p /home/admin/backups/er/ 2>/dev/null
|
||||
cp $erPath $localBackupPath
|
||||
cp $erPath $localTimestampedPath
|
||||
cp $erPath /boot/${netprefix}emergency.recover
|
||||
echo "OK emergency.recover copied to '${localBackupPath}' and '${localTimestampedPath}' and '/boot/${netprefix}emergency.recover'"
|
||||
cp $erPath ${raspi_bootdir}/${netprefix}emergency.recover
|
||||
echo "OK emergency.recover copied to '${localBackupPath}' and '${localTimestampedPath}' and '${raspi_bootdir}/${netprefix}emergency.recover'"
|
||||
|
||||
# check if a additional local backup target is set
|
||||
# see ./config.scripts/blitz.backupdevice.sh
|
||||
@ -617,27 +651,27 @@ do
|
||||
fi
|
||||
fi
|
||||
|
||||
# check if a SFTP backup target is set
|
||||
# check if a SCP backup target is set
|
||||
# parameter in raspiblitz.conf:
|
||||
# sftpBackupTarget='[USER]@[SERVER]:[DIRPATH-WITHOUT-ENDING-/]'
|
||||
# optionally a custom option string for the sftp command can be set with
|
||||
# sftpBackupOptions='[YOUR-CUSTOM-OPTIONS]'
|
||||
# scpBackupTarget='[USER]@[SERVER]:[DIRPATH-WITHOUT-ENDING-/]'
|
||||
# optionally a custom option string for the scp command can be set with
|
||||
# scpBackupOptions='[YOUR-CUSTOM-OPTIONS]'
|
||||
# On target server add the public key of your RaspiBlitz to the authorized_keys for the user
|
||||
# https://www.linode.com/docs/security/authentication/use-public-key-authentication-with-ssh/
|
||||
if [ ${#sftpBackupTarget} -gt 0 ]; then
|
||||
if [ ${#scpBackupTarget} -gt 0 ]; then
|
||||
echo "--> Offsite-Backup SFTP Server"
|
||||
if [ "${sftpBackupOptions}" == "" ]; then
|
||||
sftpBackupOptions="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
|
||||
if [ "${scpBackupOptions}" == "" ]; then
|
||||
scpBackupOptions="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
|
||||
fi
|
||||
# its ok to ignore known host, because data is encrypted (worst case of MiM would be: no offsite channel backup)
|
||||
# but its more likely that without ignoring known host, script might not run thru and that way: no offsite channel backup
|
||||
sftp ${sftpBackupOptions} ${localBackupPath} ${sftpBackupTarget}/
|
||||
sftp ${sftpBackupOptions} ${localTimestampedPath} ${sftpBackupTarget}/
|
||||
scp ${scpBackupOptions} ${localBackupPath} ${scpBackupTarget}/
|
||||
scp ${scpBackupOptions} ${localTimestampedPath} ${scpBackupTarget}/
|
||||
result=$?
|
||||
if [ ${result} -eq 0 ]; then
|
||||
echo "OK - SFTP Backup exited with 0"
|
||||
echo "OK - SCP Backup exited with 0"
|
||||
else
|
||||
echo "FAIL - SFTP Backup exited with ${result}"
|
||||
echo "FAIL - SCP Backup exited with ${result}"
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -683,6 +717,7 @@ do
|
||||
if [ ${recheckRAID} -eq 1 ]; then
|
||||
|
||||
# check if BTRTFS raid is active & scrub
|
||||
logger -p info "background.sh - RAID data check"
|
||||
source <(/home/admin/config.scripts/blitz.datadrive.sh status)
|
||||
if [ "${isBTRFS}" == "1" ] && [ "${isRaid}" == "1" ]; then
|
||||
echo "STARTING BTRFS RAID DATA CHECK ..."
|
||||
|
@ -3,6 +3,8 @@
|
||||
# This script runs on every start called by boostrap.service
|
||||
# see logs with --> tail -n 100 /home/admin/raspiblitz.log
|
||||
|
||||
# NOTE: this boostrap script runs as root user (bootstrap.service) - so no sudo needed
|
||||
|
||||
################################
|
||||
# BASIC SETTINGS
|
||||
################################
|
||||
@ -27,22 +29,36 @@ infoFile="/home/admin/raspiblitz.info"
|
||||
# this key/value file contains the state during the setup process
|
||||
setupFile="/var/cache/raspiblitz/temp/raspiblitz.setup"
|
||||
|
||||
# Backup last log file if available
|
||||
cp ${logFile} /home/admin/raspiblitz.last.log 2>/dev/null
|
||||
|
||||
# Init boostrap log file
|
||||
echo "Writing logs to: ${logFile}"
|
||||
echo "" > $logFile
|
||||
sudo chmod 640 ${logFile}
|
||||
sudo chown root:sudo ${logFile}
|
||||
chmod 640 ${logFile}
|
||||
chown root:sudo ${logFile}
|
||||
echo "***********************************************" >> $logFile
|
||||
echo "Running RaspiBlitz Bootstrap ${codeVersion}" >> $logFile
|
||||
date >> $logFile
|
||||
echo "***********************************************" >> $logFile
|
||||
|
||||
# make sure SSH server is configured & running
|
||||
sudo /home/admin/config.scripts/blitz.ssh.sh checkrepair >> ${logFile}
|
||||
# list all running systemd services for future debug
|
||||
systemctl list-units --type=service --state=running >> $logFile
|
||||
|
||||
# check if the file /etc/ssh/sshd_init_keys exists --> initial boot of fresh sd card image
|
||||
if [ -f "/etc/ssh/sshd_init_keys" ]; then
|
||||
echo "# init SSH KEYS fresh for new user" >> $logFile
|
||||
/home/admin/config.scripts/blitz.ssh.sh init >> $logFile
|
||||
else
|
||||
echo "# make sure SSH server is configured & running" >> $logFile
|
||||
/home/admin/config.scripts/blitz.ssh.sh checkrepair >> $logFile
|
||||
fi
|
||||
|
||||
echo "## prepare raspiblitz temp" >> $logFile
|
||||
|
||||
# make sure /var/cache/raspiblitz/temp exists
|
||||
sudo mkdir -p /var/cache/raspiblitz/temp
|
||||
sudo chmod 777 /var/cache/raspiblitz/temp
|
||||
mkdir -p /var/cache/raspiblitz/temp
|
||||
chmod 777 /var/cache/raspiblitz/temp
|
||||
|
||||
################################
|
||||
# INIT raspiblitz.info
|
||||
@ -74,15 +90,16 @@ ln_cl_signet_sync_initial_done=0
|
||||
source ${infoFile} 2>/dev/null
|
||||
|
||||
# write fresh raspiblitz.info file
|
||||
echo "baseimage=${baseimage}" > $infoFile
|
||||
echo "state=starting" > $infoFile
|
||||
echo "message=starting" >> $infoFile
|
||||
echo "setupPhase=${setupPhase}" >> $infoFile
|
||||
echo "setupStep=${setupStep}" >> $infoFile
|
||||
echo "baseimage=${baseimage}" >> $infoFile
|
||||
echo "cpu=${cpu}" >> $infoFile
|
||||
echo "blitzapi=${blitzapi}" >> $infoFile
|
||||
echo "displayClass=${displayClass}" >> $infoFile
|
||||
echo "displayType=${displayType}" >> $infoFile
|
||||
echo "setupPhase=${setupPhase}" >> $infoFile
|
||||
echo "setupStep=${setupStep}" >> $infoFile
|
||||
echo "fsexpanded=${fsexpanded}" >> $infoFile
|
||||
echo "state=starting" >> $infoFile
|
||||
echo "btc_mainnet_sync_initial_done=${btc_mainnet_sync_initial_done}" >> $infoFile
|
||||
echo "btc_testnet_sync_initial_done=${btc_testnet_sync_initial_done}" >> $infoFile
|
||||
echo "btc_signet_sync_initial_done=${btc_signet_sync_initial_done}" >> $infoFile
|
||||
@ -93,15 +110,52 @@ echo "ln_cl_mainnet_sync_initial_done=${ln_cl_mainnet_sync_initial_done}" >> $in
|
||||
echo "ln_cl_testnet_sync_initial_done=${ln_cl_testnet_sync_initial_done}" >> $infoFile
|
||||
echo "ln_cl_signet_sync_initial_done=${ln_cl_signet_sync_initial_done}" >> $infoFile
|
||||
|
||||
sudo chmod 664 ${infoFile}
|
||||
chmod 664 ${infoFile}
|
||||
|
||||
# write content of raspiblitz.info to logs
|
||||
cat $infoFile >> $logFile
|
||||
|
||||
# determine correct raspberrypi boot drive path (that easy to access when sd card is insert into laptop)
|
||||
raspi_bootdir=""
|
||||
if [ -d /boot/firmware ]; then
|
||||
raspi_bootdir="/boot/firmware"
|
||||
elif [ -d /boot ]; then
|
||||
raspi_bootdir="/boot"
|
||||
fi
|
||||
echo "# raspi_bootdir(${raspi_bootdir})" >> $logFile
|
||||
|
||||
######################################
|
||||
# STOP file flag - for manual provision
|
||||
|
||||
# when a file 'stop' is on the sd card bootfs partition root - stop for manual provision
|
||||
flagExists=$(ls ${raspi_bootdir}/stop 2>/dev/null | grep -c 'stop')
|
||||
if [ "${flagExists}" == "1" ]; then
|
||||
# set state info
|
||||
/home/admin/_cache.sh set state "stop"
|
||||
/home/admin/_cache.sh set message "stopped for manual provision"
|
||||
systemctl stop background.service
|
||||
systemctl stop background.scan.service
|
||||
# log info
|
||||
echo "INFO: 'bootstrap stopped - run command release after manual provison to remove stop flag" >> ${logFile}
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#########################
|
||||
# INIT RaspiBlitz Cache
|
||||
#########################
|
||||
|
||||
# make sure that redis service is enabled (disabled on fresh sd card image)
|
||||
redisEnabled=$(systemctl is-enabled redis-server | grep -c "enabled")
|
||||
echo "## redisEnabled(${redisEnabled})" >> $logFile
|
||||
if [ ${redisEnabled} -eq 0 ]; then
|
||||
echo "# make sure redis is running" >> $logFile
|
||||
sleep 6
|
||||
systemctl status redis-server >> $logFile
|
||||
systemctl enable redis-server >> $logFile
|
||||
systemctl start redis-server >> $logFile
|
||||
systemctl status redis-server >> $logFile
|
||||
fi
|
||||
|
||||
echo "## INIT RaspiBlitz Cache ... wait background.scan.service to finish first scan loop" >> $logFile
|
||||
systemscan_runtime=""
|
||||
while [ "${systemscan_runtime}" == "" ]
|
||||
@ -127,23 +181,59 @@ source ${configFile} 2>/dev/null
|
||||
######################################
|
||||
# CHECK SD CARD STATE
|
||||
|
||||
# when a file 'stop' is on the sd card boot partition - stop for manual provision
|
||||
flagExists=$(sudo ls /boot/stop | grep -c 'stop')
|
||||
if [ "${flagExists}" == "1" ]; then
|
||||
# remove flag
|
||||
sudo rm /boot/stop
|
||||
# set state info
|
||||
/home/admin/_cache.sh set state "stop"
|
||||
/home/admin/_cache.sh set message "stopped for manual provision"
|
||||
# log info
|
||||
echo "INFO: 'bootstrap stopped - run release after manual provison'" >> ${logFile}
|
||||
exit 0
|
||||
# wifi config by file on sd card
|
||||
wifiFileExists=$(ls ${raspi_bootdir}/wifi 2>/dev/null | grep -c 'wifi')
|
||||
wpaFileExists=$(ls ${raspi_bootdir}/wpa_supplicant.conf 2>/dev/null | grep -c 'wpa_supplicant.conf')
|
||||
if [ "${wifiFileExists}" == "1" ] || [ "${wpaFileExists}" == "1" ]; then
|
||||
|
||||
# set info
|
||||
echo "Setting Wifi by file on sd card ..." >> ${logFile}
|
||||
/home/admin/_cache.sh set message "setting wifi"
|
||||
|
||||
# File: wifi
|
||||
# get first line as string from wifi file (NAME OF WIFI)
|
||||
# get second line as string from wifi file (PASSWORD OF WIFI)
|
||||
if [ "${wifiFileExists}" == "1" ]; then
|
||||
echo "Getting data from file: ${raspi_bootdir}/wifi" >> ${logFile}
|
||||
ssid=$(sed -n '1p' ${raspi_bootdir}/wifi | tr -d '[:space:]')
|
||||
password=$(sed -n '2p' ${raspi_bootdir}/wifi | tr -d '[:space:]')
|
||||
fi
|
||||
|
||||
# File: wpa_supplicant.conf (legacy way to set wifi)
|
||||
# see: https://github.com/raspibolt/raspibolt/blob/a21788c0518618d17093e3f447f68a53e4efa6e7/raspibolt/raspibolt_20_pi.md#prepare-wifi
|
||||
if [ "${wpaFileExists}" == "1" ]; then
|
||||
echo "Getting data from file: ${raspi_bootdir}/wpa_supplicant.conf" >> ${logFile}
|
||||
ssid=$(grep ssid "${raspi_bootdir}/wpa_supplicant.conf" | awk -F'=' '{print $2}' | tr -d '"')
|
||||
password=$(grep psk "${raspi_bootdir}/wpa_supplicant.conf" | awk -F'=' '{print $2}' | tr -d '"')
|
||||
fi
|
||||
|
||||
# set wifi
|
||||
err=""
|
||||
echo "Setting Wifi SSID(${ssid}) Password(${password})" >> ${logFile}
|
||||
source <(/home/admin/config.scripts/internet.wifi.sh on ${ssid} ${password})
|
||||
if [ "${err}" != "" ]; then
|
||||
echo "Setting Wifi failed - edit or remove file ${raspi_bootdir}/wifi" >> ${logFile}
|
||||
echo "error(${err})" >> ${logFile}
|
||||
echo "Will shutdown in 1min ..." >> ${logFile}
|
||||
/home/admin/_cache.sh set state "errorWIFI"
|
||||
/home/admin/_cache.sh set message "${err}"
|
||||
sleep 60
|
||||
shutdown now
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# remove file
|
||||
echo "Setting Wifi worked - removing file" >> ${logFile}
|
||||
rm ${raspi_bootdir}/wifi 2>/dev/null
|
||||
rm ${raspi_bootdir}/wpa_supplicant.conf 2>/dev/null
|
||||
else
|
||||
echo "No Wifi config by file on sd card." >> ${logFile}
|
||||
fi
|
||||
|
||||
# when the provision did not ran thru without error (ask user for fresh sd card)
|
||||
provisionFlagExists=$(sudo ls /home/admin/provision.flag | grep -c 'provision.flag')
|
||||
provisionFlagExists=$(ls /home/admin/provision.flag | grep -c 'provision.flag')
|
||||
if [ "${provisionFlagExists}" == "1" ]; then
|
||||
sudo systemctl stop ${network}d 2>/dev/null
|
||||
systemctl stop ${network}d 2>/dev/null
|
||||
/home/admin/_cache.sh set state "inconsistentsystem"
|
||||
/home/admin/_cache.sh set message "provision did not ran thru"
|
||||
echo "FAIL: 'provision did not ran thru' - need fresh sd card!" >> ${logFile}
|
||||
@ -170,15 +260,15 @@ sleep 5
|
||||
# Emergency cleaning logs when over 1GB (to prevent SD card filling up)
|
||||
# see https://github.com/rootzoll/raspiblitz/issues/418#issuecomment-472180944
|
||||
echo "*** Checking Log Size ***"
|
||||
logsMegaByte=$(sudo du -c -m /var/log | grep "total" | awk '{print $1;}')
|
||||
logsMegaByte=$(du -c -m /var/log | grep "total" | awk '{print $1;}')
|
||||
if [ ${logsMegaByte} -gt 1000 ]; then
|
||||
echo "WARN # Logs /var/log in are bigger then 1GB" >> $logFile
|
||||
# dont delete directories - can make services crash
|
||||
sudo rm /var/log/*
|
||||
sudo service rsyslog restart
|
||||
rm /var/log/*
|
||||
service rsyslog restart
|
||||
/home/admin/_cache.sh set message "WARNING: /var/log/ >1GB"
|
||||
echo "WARN # Logs in /var/log in were bigger then 1GB and got emergency delete to prevent fillup." >> $logFile
|
||||
sudo ls -la /var/log >> $logFile
|
||||
ls -la /var/log >> $logFile
|
||||
echo "If you see this in the logs please report to the GitHub issues, so LOG config needs to be optimized." >> $logFile
|
||||
sleep 10
|
||||
else
|
||||
@ -187,19 +277,19 @@ fi
|
||||
echo ""
|
||||
|
||||
# get the state of data drive
|
||||
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh status)
|
||||
source <(/home/admin/config.scripts/blitz.datadrive.sh status)
|
||||
|
||||
################################
|
||||
# WAIT LOOP: HDD CONNECTED
|
||||
################################
|
||||
|
||||
echo "Waiting for HDD/SSD ..." >> $logFile
|
||||
sudo ls -la /etc/ssh >> $logFile
|
||||
ls -la /etc/ssh >> $logFile
|
||||
until [ ${isMounted} -eq 1 ] || [ ${#hddCandidate} -gt 0 ]
|
||||
do
|
||||
|
||||
# recheck HDD/SSD
|
||||
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh status)
|
||||
source <(/home/admin/config.scripts/blitz.datadrive.sh status)
|
||||
echo "isMounted: $isMounted" >> $logFile
|
||||
echo "hddCandidate: $hddCandidate" >> $logFile
|
||||
|
||||
@ -230,33 +320,61 @@ systemInitReboot=0
|
||||
################################
|
||||
# FORCED SWITCH TO HDMI
|
||||
# if a file called 'hdmi' gets
|
||||
# placed onto the boot part of
|
||||
# placed onto the bootfs part of
|
||||
# the sd card - switch to hdmi
|
||||
################################
|
||||
|
||||
forceHDMIoutput=$(sudo ls /boot/hdmi* 2>/dev/null | grep -c hdmi)
|
||||
forceHDMIoutput=$(ls ${raspi_bootdir}/hdmi* 2>/dev/null | grep -c hdmi)
|
||||
if [ ${forceHDMIoutput} -eq 1 ]; then
|
||||
# delete that file (to prevent loop)
|
||||
sudo rm /boot/hdmi*
|
||||
rm ${raspi_bootdir}/hdmi*
|
||||
# switch to HDMI what will trigger reboot
|
||||
echo "HDMI switch found ... activating HDMI display output & reboot" >> $logFile
|
||||
sudo /home/admin/config.scripts/blitz.display.sh set-display hdmi >> $logFile
|
||||
/home/admin/config.scripts/blitz.display.sh set-display hdmi >> $logFile
|
||||
systemInitReboot=1
|
||||
/home/admin/_cache.sh set message "HDMI"
|
||||
else
|
||||
echo "No HDMI switch found. " >> $logFile
|
||||
fi
|
||||
|
||||
################################
|
||||
# GPT integrity check
|
||||
################################
|
||||
|
||||
check_and_fix_gpt() {
|
||||
local device=$1
|
||||
output=$(sudo gdisk -l $device 2>&1)
|
||||
if echo "$output" | grep -q "PMBR size mismatch"; then
|
||||
echo "GPT PMBR size mismatch detected on $device. Fixing..." >> $logFile
|
||||
sgdisk -e $device
|
||||
echo "Fixed GPT PMBR size mismatch on $device." >> $logFile
|
||||
elif echo "$output" | grep -q "The backup GPT table is not on the end of the device"; then
|
||||
echo "Backup GPT table is not at the end of $device. Fixing..." >> $logFile
|
||||
sgdisk -e $device
|
||||
echo "Fixed backup GPT table location on $device." >> $logFile
|
||||
else
|
||||
echo "No GPT issues detected on $device." >> $logFile
|
||||
fi
|
||||
}
|
||||
|
||||
# List all block devices
|
||||
devices=$(lsblk -dno NAME | grep -E '^sd|^nvme|^vd|^mmcblk')
|
||||
|
||||
# Check and fix each device
|
||||
for dev in $devices; do
|
||||
check_and_fix_gpt /dev/$dev
|
||||
done
|
||||
|
||||
################################
|
||||
# FS EXPAND
|
||||
# extend sd card to maximum capacity
|
||||
################################
|
||||
|
||||
source <(sudo /home/admin/config.scripts/blitz.bootdrive.sh status)
|
||||
source <(/home/admin/config.scripts/blitz.bootdrive.sh status)
|
||||
if [ "${needsExpansion}" == "1" ] && [ "${fsexpanded}" == "0" ]; then
|
||||
echo "FSEXPAND needed ... starting process" >> $logFile
|
||||
sudo /home/admin/config.scripts/blitz.bootdrive.sh status >> $logFile
|
||||
sudo /home/admin/config.scripts/blitz.bootdrive.sh fsexpand >> $logFile
|
||||
/home/admin/config.scripts/blitz.bootdrive.sh status >> $logFile
|
||||
/home/admin/config.scripts/blitz.bootdrive.sh fsexpand >> $logFile
|
||||
systemInitReboot=1
|
||||
/home/admin/_cache.sh set message "FSEXPAND"
|
||||
elif [ "${tooSmall}" == "1" ]; then
|
||||
@ -266,7 +384,7 @@ elif [ "${tooSmall}" == "1" ]; then
|
||||
/home/admin/_cache.sh set state "sdtoosmall"
|
||||
echo "System stopped. Please cut power." >> $logFile
|
||||
sleep 6000
|
||||
sudo shutdown -r now
|
||||
shutdown -r now
|
||||
slepp 100
|
||||
exit 1
|
||||
else
|
||||
@ -283,7 +401,7 @@ fi
|
||||
####################################
|
||||
|
||||
# check if there is a WIFI configuration to backup or restore
|
||||
if [ -f "/var/cache/raspiblitz/hdd-inspect/wpa_supplicant.conf" ]; then
|
||||
if [ -d "/var/cache/raspiblitz/hdd-inspect/wifi" ]; then
|
||||
echo "WIFI RESTORE from /var/cache/raspiblitz/hdd-inspect/wpa_supplicant.conf" >> $logFile
|
||||
/home/admin/config.scripts/internet.wifi.sh backup-restore >> $logFile
|
||||
else
|
||||
@ -310,10 +428,10 @@ fi
|
||||
# the sd card - delete old ssh data
|
||||
################################
|
||||
|
||||
sshReset=$(sudo ls /boot/ssh.reset* 2>/dev/null | grep -c reset)
|
||||
sshReset=$(ls ${raspi_bootdir}/ssh.reset* 2>/dev/null | grep -c reset)
|
||||
if [ ${sshReset} -eq 1 ]; then
|
||||
# delete that file (to prevent loop)
|
||||
rm /boot/ssh.reset* >> $logFile
|
||||
rm ${raspi_bootdir}/ssh.reset* >> $logFile
|
||||
# delete ssh certs
|
||||
echo "SSHRESET switch found ... stopping SSH and deleting old certs" >> $logFile
|
||||
/home/admin/config.scripts/blitz.ssh.sh renew >> $logFile
|
||||
@ -358,7 +476,7 @@ fi
|
||||
# UASP FIX
|
||||
################################
|
||||
/home/admin/_cache.sh set message "checking HDD"
|
||||
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh uasp-fix)
|
||||
source <(/home/admin/config.scripts/blitz.datadrive.sh uasp-fix)
|
||||
if [ "${neededReboot}" == "1" ]; then
|
||||
echo "UASP FIX applied ... reboot needed." >> $logFile
|
||||
systemInitReboot=1
|
||||
@ -371,10 +489,11 @@ fi
|
||||
# from actions above
|
||||
|
||||
if [ "${systemInitReboot}" == "1" ]; then
|
||||
sudo cp ${logFile} /home/admin/raspiblitz.systeminit.log
|
||||
echo "Reboot" >> $logFile
|
||||
cp ${logFile} /home/admin/raspiblitz.systeminit.log
|
||||
/home/admin/_cache.sh set state "reboot"
|
||||
sleep 8
|
||||
sudo shutdown -r now
|
||||
shutdown -r now
|
||||
sleep 100
|
||||
exit 0
|
||||
fi
|
||||
@ -387,6 +506,8 @@ gotLocalIP=0
|
||||
until [ ${gotLocalIP} -eq 1 ]
|
||||
do
|
||||
|
||||
echo "gotLocalIP(${gotLocalIP})" >> $logFile
|
||||
|
||||
# get latest network info directly
|
||||
source <(/home/admin/config.scripts/internet.sh status online)
|
||||
|
||||
@ -415,12 +536,41 @@ do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
################################
|
||||
# RaspberryPi 5 - Firmware Update (needs internet)
|
||||
# https://github.com/raspiblitz/raspiblitz/issues/4359
|
||||
################################
|
||||
|
||||
echo "checking Firmware" >> $logFile
|
||||
/home/admin/_cache.sh set message "checking Firmware"
|
||||
if [ "${baseimage}" == "raspios_arm64" ]; then
|
||||
echo "getting data" >> $logFile
|
||||
isRaspberryPi5=$(cat /proc/device-tree/model 2>/dev/null | grep -c "Raspberry Pi 5")
|
||||
firmwareBuildNumber=$(rpi-eeprom-update | grep "CURRENT" | cut -d "(" -f2 | sed 's/[^0-9]*//g')
|
||||
echo "checking Firmware: isRaspberryPi5(${isRaspberryPi5}) firmwareBuildNumber(${firmwareBuildNumber})" >> $logFile
|
||||
if [ ${isRaspberryPi5} -gt 0 ] && [ ${firmwareBuildNumber} -lt 1708097321 ]; then # Fri 16 Feb 15:28:41 UTC 2024 (1708097321)
|
||||
echo "updating Firmware" >> $logFile
|
||||
echo "RaspberryPi 5 detected with old firmware (${firmwareBuildNumber}) ... do update." >> $logFile
|
||||
apt-get update -y
|
||||
apt-get upgrade -y
|
||||
apt-get install -y rpi-eeprom
|
||||
rpi-eeprom-update -a
|
||||
echo "Restarting ..." >> $logFile
|
||||
sleep 3
|
||||
reboot
|
||||
else
|
||||
echo "RaspberryPi Firmware not in th need of update." >> $logFile
|
||||
fi
|
||||
else
|
||||
echo "Not a RaspberryPi .. no firmware update needed." >> $logFile
|
||||
fi
|
||||
|
||||
# write info for LCD
|
||||
/home/admin/_cache.sh set state "inspect-hdd"
|
||||
/home/admin/_cache.sh set message "please wait"
|
||||
|
||||
# get fresh info about data drive to continue
|
||||
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh status)
|
||||
source <(/home/admin/config.scripts/blitz.datadrive.sh status)
|
||||
|
||||
echo "isMounted: $isMounted" >> $logFile
|
||||
|
||||
@ -506,11 +656,11 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
do
|
||||
|
||||
# get fresh info about data drive (in case the hdd gets disconnected)
|
||||
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh status)
|
||||
source <(/home/admin/config.scripts/blitz.datadrive.sh status)
|
||||
if [ "${hddCandidate}" == "" ]; then
|
||||
/home/admin/config.scripts/blitz.error.sh _bootstrap.sh "lost-hdd" "Lost HDD connection .. triggering reboot." "happened during WAIT LOOP: USER SETUP/UPDATE/MIGRATION" ${logFile}
|
||||
sleep 8
|
||||
sudo shutdown -r now
|
||||
shutdown -r now
|
||||
sleep 100
|
||||
exit 0
|
||||
fi
|
||||
@ -521,7 +671,7 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
if [ "${localip}" == "" ]; then
|
||||
sed -i "s/^state=.*/state=errorNetwork/g" ${infoFile}
|
||||
sleep 8
|
||||
sudo shutdown now
|
||||
shutdown now
|
||||
sleep 100
|
||||
exit 0
|
||||
fi
|
||||
@ -546,7 +696,7 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
echo "the provision process was started but did not finish yet" > /home/admin/provision.flag
|
||||
|
||||
# get fresh data from setup file & data drive
|
||||
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh status)
|
||||
source <(/home/admin/config.scripts/blitz.datadrive.sh status)
|
||||
source ${setupFile}
|
||||
|
||||
# special setup tasks (triggered by api/webui thru setupfile)
|
||||
@ -557,7 +707,7 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
|
||||
# check if there is a flag set on sd card boot section to format as btrfs (experimental)
|
||||
filesystem="ext4"
|
||||
flagBTRFS=$(sudo ls /boot/btrfs* 2>/dev/null | grep -c btrfs)
|
||||
flagBTRFS=$(ls ${raspi_bootdir}/btrfs* 2>/dev/null | grep -c btrfs)
|
||||
if [ "${flagBTRFS}" != "0" ]; then
|
||||
echo "Found BTRFS flag ---> formatting with experimental BTRFS filesystem" >> ${logFile}
|
||||
filesystem="btrfs"
|
||||
@ -566,8 +716,8 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
# run formatting
|
||||
error=""
|
||||
/home/admin/_cache.sh set state "formathdd"
|
||||
echo "Running Format: (${filesystem}) (${hddCandidate})" >> ${logFile}
|
||||
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh format ${filesystem} ${hddCandidate})
|
||||
echo "Running Format: filesystem(${filesystem}) hddCandidate(${hddCandidate})" >> ${logFile}
|
||||
source <(/home/admin/config.scripts/blitz.datadrive.sh format ${filesystem} ${hddCandidate})
|
||||
if [ "${error}" != "" ]; then
|
||||
echo "FAIL ON FORMATTING THE DRIVE:" >> ${logFile}
|
||||
echo "${error}" >> ${logFile}
|
||||
@ -587,7 +737,7 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
if [ "${hddGotMigrationData}" != "" ]; then
|
||||
clear
|
||||
echo "Migrating Blockchain of ${hddGotMigrationData}'" >> ${logFile}
|
||||
source <(sudo /home/admin/config.scripts/blitz.migration.sh migration-${hddGotMigrationData})
|
||||
source <(/home/admin/config.scripts/blitz.migration.sh migration-${hddGotMigrationData})
|
||||
if [ "${error}" != "0" ]; then
|
||||
echo "MIGRATION OF BLOCKHAIN FAILED: ${err}" >> ${logFile}
|
||||
echo "Format data disk on laptop & recover funds with fresh sd card using seed words + static channel backup." >> ${logFile}
|
||||
@ -599,8 +749,8 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
|
||||
# delete everything but blockchain
|
||||
echo "Deleting everything on HDD/SSD while keeping blockchain ..." >> ${logFile}
|
||||
sudo /home/admin/config.scripts/blitz.datadrive.sh tempmount 1>/dev/null 2>/dev/null
|
||||
sudo /home/admin/config.scripts/blitz.datadrive.sh clean all -keepblockchain >> ${logFile}
|
||||
/home/admin/config.scripts/blitz.datadrive.sh tempmount 1>/dev/null 2>/dev/null
|
||||
/home/admin/config.scripts/blitz.datadrive.sh clean all -keepblockchain >> ${logFile}
|
||||
if [ "${error}" != "" ]; then
|
||||
echo "CLEANING HDD FAILED:" >> ${logFile}
|
||||
echo "${error}" >> ${logFile}
|
||||
@ -609,7 +759,7 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
/home/admin/_cache.sh set message "Fail Cleaning HDD"
|
||||
exit 1
|
||||
fi
|
||||
sudo /home/admin/config.scripts/blitz.datadrive.sh unmount >> ${logFile}
|
||||
/home/admin/config.scripts/blitz.datadrive.sh unmount >> ${logFile}
|
||||
/home/admin/_cache.sh set setupPhase "setup"
|
||||
|
||||
sleep 2
|
||||
@ -634,10 +784,10 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
# will first be created and in cache drive
|
||||
# and some lines below copied to hdd when mounted
|
||||
TEMPCONFIGFILE="/var/cache/raspiblitz/temp/raspiblitz.conf"
|
||||
sudo rm $TEMPCONFIGFILE 2>/dev/null
|
||||
sudo touch $TEMPCONFIGFILE
|
||||
sudo chown admin:admin $TEMPCONFIGFILE
|
||||
sudo chmod 777 $TEMPCONFIGFILE
|
||||
rm $TEMPCONFIGFILE 2>/dev/null
|
||||
touch $TEMPCONFIGFILE
|
||||
chown admin:admin $TEMPCONFIGFILE
|
||||
chmod 777 $TEMPCONFIGFILE
|
||||
echo "# RASPIBLITZ CONFIG FILE" > $TEMPCONFIGFILE
|
||||
echo "raspiBlitzVersion='${codeVersion}'" >> $TEMPCONFIGFILE
|
||||
echo "lcdrotate='1'" >> $TEMPCONFIGFILE
|
||||
@ -651,7 +801,7 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
# make sure HDD is mounted (could be freshly formatted by user on last loop)
|
||||
source <(/home/admin/config.scripts/blitz.datadrive.sh status)
|
||||
echo "Temp mounting (2) data drive (hddFormat='${hddFormat}')" >> ${logFile}
|
||||
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh tempmount)
|
||||
source <(/home/admin/config.scripts/blitz.datadrive.sh tempmount)
|
||||
echo "Temp mounting (2) result: ${isMounted}" >> ${logFile}
|
||||
|
||||
# check that HDD was temp mounted
|
||||
@ -663,16 +813,16 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
|
||||
# make sure all links between directories/drives are correct
|
||||
echo "Refreshing links between directories/drives .." >> ${logFile}
|
||||
sudo /home/admin/config.scripts/blitz.datadrive.sh link
|
||||
/home/admin/config.scripts/blitz.datadrive.sh link
|
||||
|
||||
# copy over the raspiblitz.conf created from setup to HDD
|
||||
configExists=$(ls /mnt/hdd/raspiblitz.conf 2>/dev/null | grep -c "raspiblitz.conf")
|
||||
if [ "${configExists}" != "1" ]; then
|
||||
sudo cp /var/cache/raspiblitz/temp/raspiblitz.conf ${configFile}
|
||||
cp /var/cache/raspiblitz/temp/raspiblitz.conf ${configFile}
|
||||
fi
|
||||
|
||||
# enable tor service
|
||||
sudo /home/admin/config.scripts/tor.install.sh enable >> ${logFile}
|
||||
/home/admin/config.scripts/tor.install.sh enable >> ${logFile}
|
||||
|
||||
# kick-off provision process
|
||||
/home/admin/_cache.sh set state "provision"
|
||||
@ -740,7 +890,7 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
fi
|
||||
|
||||
echo "# setting PASSWORD A" >> ${logFile}
|
||||
sudo /home/admin/config.scripts/blitz.passwords.sh set a "${passwordA}" >> ${logFile}
|
||||
/home/admin/config.scripts/blitz.passwords.sh set a "${passwordA}" >> ${logFile}
|
||||
|
||||
# Bitcoin Mainnet
|
||||
if [ "${mainnet}" == "on" ] || [ "${chain}" == "main" ]; then
|
||||
@ -773,7 +923,7 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
/home/admin/_cache.sh set message "Provision Setup"
|
||||
/home/admin/_provision.setup.sh
|
||||
errorState=$?
|
||||
sudo cat /home/admin/raspiblitz.provision-setup.log
|
||||
cat /home/admin/raspiblitz.provision-setup.log
|
||||
if [ "$errorState" != "0" ]; then
|
||||
# only trigger an error message if the script hasnt itself triggered an error message already
|
||||
source <(/home/admin/_cache.sh get state)
|
||||
@ -897,8 +1047,10 @@ else
|
||||
################################
|
||||
# LND and Blockchain Errors will be still in systemd journals
|
||||
|
||||
# /mnt/hdd/bitcoin/debug.log
|
||||
rm /mnt/hdd/${network}/debug.log 2>/dev/null
|
||||
# limit debug.log to 10MB on start - see #3872
|
||||
if [ $(grep -c "shrinkdebugfile=" < /mnt/hdd/bitcoin/bitcoin.conf) -eq 0 ];then
|
||||
echo "shrinkdebugfile=1" | tee -a /mnt/hdd/bitcoin/bitcoin.conf
|
||||
fi
|
||||
# /mnt/hdd/lnd/logs/bitcoin/mainnet/lnd.log
|
||||
rm /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log 2>/dev/null
|
||||
# https://github.com/rootzoll/raspiblitz/issues/1700
|
||||
@ -962,7 +1114,7 @@ fi
|
||||
# CLEAN HDD TEMP
|
||||
#####################################
|
||||
echo "CLEANING TEMP DRIVE/FOLDER" >> $logFile
|
||||
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh clean temp)
|
||||
source <(/home/admin/config.scripts/blitz.datadrive.sh clean temp)
|
||||
if [ ${#error} -gt 0 ]; then
|
||||
echo "FAIL: ${error}" >> $logFile
|
||||
else
|
||||
@ -985,8 +1137,9 @@ fi
|
||||
# FORCE UASP FLAG
|
||||
####################
|
||||
# if uasp.force flag was set on sd card - now move into raspiblitz.conf
|
||||
if [ -f "/boot/uasp.force" ]; then
|
||||
if [ -f "${raspi_bootdir}/uasp.force" ]; then
|
||||
/home/admin/config.scripts/blitz.conf.sh set forceUasp "on"
|
||||
rm ${raspi_bootdir}/uasp.force* >> $logFile
|
||||
echo "DONE forceUasp=on recorded in raspiblitz.conf" >> $logFile
|
||||
fi
|
||||
|
||||
@ -996,7 +1149,7 @@ fi
|
||||
|
||||
if [ -d "/mnt/hdd/app-data/subscriptions" ]; then
|
||||
echo "OK: subscription data directory exists"
|
||||
sudo chown admin:admin /mnt/hdd/app-data/subscriptions
|
||||
chown admin:admin /mnt/hdd/app-data/subscriptions
|
||||
else
|
||||
echo "CREATE: subscription data directory"
|
||||
mkdir /mnt/hdd/app-data/subscriptions
|
||||
@ -1004,7 +1157,7 @@ else
|
||||
fi
|
||||
|
||||
# make sure that bitcoin service is active
|
||||
sudo systemctl enable ${network}d
|
||||
systemctl enable ${network}d
|
||||
|
||||
# make sure setup/provision is marked as done
|
||||
/home/admin/_cache.sh set setupPhase "done"
|
||||
@ -1021,6 +1174,9 @@ if [ "${btc_default_sync_initialblockdownload}" == "1" ]; then
|
||||
/home/admin/_cache.sh focus btc_default_sync_progress 0
|
||||
fi
|
||||
|
||||
# backup wifi settings
|
||||
/home/admin/config.scripts/internet.wifi.sh backup-restore
|
||||
|
||||
# notify about (re)start if activated
|
||||
source <(/home/admin/_cache.sh get hostname)
|
||||
/home/admin/config.scripts/blitz.notify.sh send "RaspiBlitz '${hostname}' (re)started" >> $logFile
|
||||
|
@ -111,15 +111,16 @@ elif [ "$1" = "keyvalue" ] && [ "$2" = "on" ]; then
|
||||
sudo apt install -y redis-server
|
||||
|
||||
# edit config: dont save to disk
|
||||
sudo sed -i "/^save .*/d" /etc/redis/redis.conf
|
||||
# echo "# edit config"
|
||||
sudo cp /etc/redis/redis.conf /etc/redis/redis.conf.backup
|
||||
sudo sed -i "s/^# save \"\"/save \"\"/g" /etc/redis/redis.conf
|
||||
sudo sed -i "s/^appendonly yes/appendonly no/g" /etc/redis/redis.conf
|
||||
sudo sed -i "s/^stop-writes-on-bgsave-error yes/stop-writes-on-bgsave-error no/g" /etc/redis/redis.conf
|
||||
|
||||
echo "# restart and remove db dump file"
|
||||
# restart with new config
|
||||
if ! ischroot; then sudo systemctl restart redis-server; fi
|
||||
|
||||
# clean old databases if exist
|
||||
sudo rm /var/lib/redis/dump.rdb 2>/dev/null
|
||||
|
||||
# restart again this time there is no old data dump to load
|
||||
if ! ischroot; then sudo systemctl restart redis-server; fi
|
||||
|
||||
# uninstall
|
||||
@ -147,6 +148,23 @@ elif [ "$1" = "set" ] || [ "$1" = "init" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# update certain values also in raspiblitz.info
|
||||
if [ "${keystr}" = "state" ]; then
|
||||
# change value in raspiblitz.info
|
||||
sudo sed -i "s/^state=.*/state='${valuestr}'/g" ${infoFile}
|
||||
fi
|
||||
if [ "${keystr}" = "message" ]; then
|
||||
# change value in raspiblitz.info
|
||||
sudo sed -i "s/^message=.*/message='${valuestr}'/g" ${infoFile}
|
||||
fi
|
||||
if [ "${keystr}" = "setupPhase" ]; then
|
||||
# change value in raspiblitz.info
|
||||
sudo sed -i "s/^setupPhase=.*/setupPhase='${valuestr}'/g" ${infoFile}
|
||||
fi
|
||||
if [ "${keystr}" = "setupStep" ]; then
|
||||
# change value in raspiblitz.info
|
||||
sudo sed -i "s/^setupStep=.*/setupStep='${valuestr}'/g" ${infoFile}
|
||||
fi
|
||||
|
||||
NX=""
|
||||
if [ "$1" = "init" ]; then
|
||||
|
@ -55,6 +55,11 @@ function blitzhelp() {
|
||||
echo " cache check on chache system state"
|
||||
echo " github jumping directly into the options to change branch/repo/pr"
|
||||
echo
|
||||
echo "Development with VM:"
|
||||
echo " sync sync all repos from shared folder"
|
||||
echo " sync code sync only main raspiblitz repo from shared folder"
|
||||
echo " sync api sync only blitz api repo from shared folder"
|
||||
echo
|
||||
echo "Power:"
|
||||
echo " restart restart the node"
|
||||
echo " off shutdown the node"
|
||||
@ -81,7 +86,7 @@ function blitzhelp() {
|
||||
echo " whitepaper download the whitepaper from the blockchain to /home/admin/bitcoin.pdf"
|
||||
echo " notifyme wrapper for blitz.notify.sh that will send a notification using the configured method and settings"
|
||||
echo " suez visualize channels (for the default ln implementation and chain when installed)"
|
||||
exho " lnproxy wrap invoices with lnproxy"
|
||||
echo " lnproxy wrap invoices with lnproxy"
|
||||
echo
|
||||
echo "LND:"
|
||||
echo " lncli LND commandline interface (when installed)"
|
||||
@ -120,7 +125,7 @@ function restart() {
|
||||
echo "Command to restart your RaspiBlitz"
|
||||
confirmMsg restart
|
||||
if [ $confirm -eq 1 ]; then
|
||||
/home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
|
||||
fi
|
||||
}
|
||||
|
||||
@ -172,7 +177,7 @@ function debug() {
|
||||
if [ "$1" = "-l" ]||[ "$1" = "--link" ]; then
|
||||
proxy="-X 5 -x localhost:9050"
|
||||
if [ "$2" = "-n" ]||[ "$2" = "--no-tor" ]; then proxy=""; fi
|
||||
cat /var/cache/raspiblitz/debug.log | nc ${proxy} termbin.com 9999 | sed "s/termbin.com/l.termbin.com/"
|
||||
cat /var/cache/raspiblitz/debug.log | nc ${proxy} termbin.com 9999
|
||||
else
|
||||
cat /var/cache/raspiblitz/debug.log
|
||||
fi
|
||||
@ -215,12 +220,19 @@ function patch() {
|
||||
echo
|
||||
}
|
||||
|
||||
# command: sync
|
||||
# sync VM with shared folder
|
||||
function sync() {
|
||||
sudo /home/admin/config.scripts/blitz.vm.sh sync ${1}
|
||||
echo
|
||||
}
|
||||
|
||||
# command: off
|
||||
function off() {
|
||||
echo "Command to power off your RaspiBlitz"
|
||||
confirmMsg off
|
||||
if [ $confirm -eq 1 ]; then
|
||||
/home/admin/config.scripts/blitz.shutdown.sh
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh
|
||||
fi
|
||||
}
|
||||
|
||||
@ -345,8 +357,8 @@ function bos() {
|
||||
# switch to the pyblock user for PyBLOCK
|
||||
function pyblock() {
|
||||
if [ $(grep -c "pyblock=on" < /mnt/hdd/raspiblitz.conf) -eq 1 ]; then
|
||||
cd /home/pyblock
|
||||
sudo -u pyblock /home/pyblock/.local/bin/pyblock
|
||||
cd /home/pyblock/pyblock
|
||||
sudo -u pyblock poetry run python -m pybitblock.console
|
||||
else
|
||||
echo "PyBlock is not installed - to install run:"
|
||||
echo "/home/admin/config.scripts/bonus.pyblock.sh on"
|
||||
|
@ -267,7 +267,6 @@ if [ "${lightning}" == "lnd" ]; then
|
||||
|
||||
echo "WALLET --> SEED" >> ${logFile}
|
||||
/home/admin/_cache.sh set message "LND Wallet (SEED)"
|
||||
if ! pip list | grep grpc; then sudo -H python3 -m pip install grpcio==1.38.1; fi
|
||||
source <(/home/admin/config.scripts/lnd.initwallet.py seed mainnet "${passwordC}" "${seedWords}" "${seedPassword}")
|
||||
if [ "${err}" != "" ]; then
|
||||
/home/admin/config.scripts/blitz.error.sh _provision.setup.sh "lnd-wallet-seed" "lnd.initwallet.py seed returned error" "/home/admin/config.scripts/lnd.initwallet.py seed mainnet ... --> ${err} + ${errMore}" ${logFile}
|
||||
@ -284,7 +283,6 @@ if [ "${lightning}" == "lnd" ]; then
|
||||
|
||||
echo "# WALLET --> NEW" >> ${logFile}
|
||||
/home/admin/_cache.sh set message "LND Wallet (NEW)"
|
||||
if ! pip list | grep grpc; then sudo -H python3 -m pip install grpcio==1.38.1; fi
|
||||
source <(/home/admin/config.scripts/lnd.initwallet.py new mainnet "${passwordC}")
|
||||
if [ "${err}" != "" ]; then
|
||||
/home/admin/config.scripts/blitz.error.sh _provision.setup.sh "lnd-wallet-new" "lnd.initwallet.py new returned error" "/home/admin/config.scripts/lnd.initwallet.py new mainnet ... --> ${err} + ${errMore}" ${logFile}
|
||||
|
@ -46,7 +46,13 @@ fi
|
||||
# load old or init raspiblitz config
|
||||
source ${configFile}
|
||||
|
||||
# check if config files contains basic: hostname
|
||||
# if hostname missing - set default
|
||||
if [ ${#hostname} -eq 0 ]; then
|
||||
/home/admin/config.scripts/blitz.conf.sh set hostname "raspiblitz"
|
||||
source ${configFile}
|
||||
fi
|
||||
|
||||
# re-check if config files contains hostname value
|
||||
if [ ${#hostname} -eq 0 ]; then
|
||||
/home/admin/config.scripts/blitz.error.sh _provision.update.sh "missing-hostname" "${setupFile} or ${configFile} contains no hostname" "" ${logFile}
|
||||
exit 1
|
||||
@ -177,13 +183,6 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
|
||||
# prepare lnd service
|
||||
cp /home/admin/assets/lnd.service /etc/systemd/system/lnd.service >> ${logFile} 2>&1
|
||||
|
||||
# convert old keysend by lndExtraParameter to raspiblitz.conf setting (will be enforced by lnd.check.sh prestart) since 1.7.1
|
||||
if [ "${lndExtraParameter}" == "--accept-keysend" ]; then
|
||||
echo "# MIGRATION KEYSEND from lndExtraParameter --> raspiblitz.conf" >> ${logFile}
|
||||
/home/admin/config.scripts/blitz.conf.sh set lndKeysend "on"
|
||||
/home/admin/config.scripts/blitz.conf.sh delete lndExtraParameter
|
||||
fi
|
||||
|
||||
# if old lnd.conf exists ...
|
||||
configExists=$(sudo ls /mnt/hdd/lnd/lnd.conf | grep -c '.conf')
|
||||
if [ ${configExists} -eq 1 ]; then
|
||||
|
@ -35,6 +35,6 @@ sudo rm /var/cache/raspiblitz/temp/raspiblitz.setup
|
||||
sudo cp /home/admin/raspiblitz.log /home/admin/raspiblitz.setup.log
|
||||
sudo chmod 640 /home/admin/raspiblitz.setup.log
|
||||
sudo chown root:sudo /home/admin/raspiblitz.setup.log
|
||||
timeout 120 /home/admin/config.scripts/blitz.shutdown.sh reboot finalsetup
|
||||
timeout 120 sudo /home/admin/config.scripts/blitz.shutdown.sh reboot finalsetup
|
||||
# if system has not rebooted yet - force reboot directly
|
||||
sudo shutdown -r now
|
||||
sudo shutdown -r now
|
||||
|
@ -61,6 +61,9 @@ echo "deprecatedrpc=addresses" >> /mnt/hdd/bitcoin/bitcoin.conf 2>/dev/null
|
||||
# backup SSH PubKeys
|
||||
/home/admin/config.scripts/blitz.ssh.sh backup
|
||||
|
||||
# set timezone
|
||||
/home/admin/config.scripts/blitz.time.sh set-by-config >> ${logFile}
|
||||
|
||||
# optimize mempool if RAM >1GB
|
||||
kbSizeRAM=$(cat /proc/meminfo | grep "MemTotal" | sed 's/[^0-9]*//g')
|
||||
if [ ${kbSizeRAM} -gt 1500000 ]; then
|
||||
@ -77,12 +80,12 @@ fi
|
||||
|
||||
# link and copy HDD content into new OS on sd card
|
||||
echo "Copy HDD content for user admin" >> ${logFile}
|
||||
mkdir /home/admin/.${network} >> ${logFile} 2>&1
|
||||
mkdir /home/admin/.${network} >> ${logFile}
|
||||
cp /mnt/hdd/${network}/${network}.conf /home/admin/.${network}/${network}.conf >> ${logFile} 2>&1
|
||||
mkdir /home/admin/.lnd >> ${logFile} 2>&1
|
||||
cp /mnt/hdd/lnd/lnd.conf /home/admin/.lnd/lnd.conf >> ${logFile} 2>&1
|
||||
cp /mnt/hdd/lnd/tls.cert /home/admin/.lnd/tls.cert >> ${logFile} 2>&1
|
||||
mkdir /home/admin/.lnd/data >> ${logFile} 2>&1
|
||||
mkdir /home/admin/.lnd >> ${logFile}
|
||||
cp /mnt/hdd/lnd/lnd.conf /home/admin/.lnd/lnd.conf >> ${logFile}
|
||||
cp /mnt/hdd/lnd/tls.cert /home/admin/.lnd/tls.cert >> ${logFile}
|
||||
mkdir /home/admin/.lnd/data >> ${logFile}
|
||||
cp -r /mnt/hdd/lnd/data/chain /home/admin/.lnd/data/chain >> ${logFile} 2>&1
|
||||
chown -R admin:admin /home/admin/.${network} >> ${logFile} 2>&1
|
||||
chown -R admin:admin /home/admin/.lnd >> ${logFile} 2>&1
|
||||
@ -90,7 +93,6 @@ cp /home/admin/assets/tmux.conf.local /mnt/hdd/.tmux.conf.local >> ${logFile} 2>
|
||||
chown admin:admin /mnt/hdd/.tmux.conf.local >> ${logFile} 2>&1
|
||||
ln -s -f /mnt/hdd/.tmux.conf.local /home/admin/.tmux.conf.local >> ${logFile} 2>&1
|
||||
|
||||
|
||||
# PREPARE LND (if activated)
|
||||
if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
|
||||
# backup LND TLS certs
|
||||
@ -184,17 +186,43 @@ sed -i "s/^setupStep=.*/setupStep=100/g" /home/admin/raspiblitz.info
|
||||
##########################
|
||||
# PROVISIONING SERVICES
|
||||
##########################
|
||||
/home/admin/_cache.sh set message "Installing Services"
|
||||
|
||||
echo "### CHECKING BLITZ-API/FRONT STATUS ###" >> ${logFile}
|
||||
blitzApiInstalled=$(systemctl status blitzapi | grep -c "loaded")
|
||||
echo "# blitzapi(${blitzapi}) blitzApiInstalled(${blitzApiInstalled})"
|
||||
if [ "${blitzapi}" != "on" ] && [ ${blitzApiInstalled} -gt 0 ]; then
|
||||
/home/admin/_cache.sh set message "Deactivated API/WebUI (as in your config) - please use SSH for further setup"
|
||||
sleep 10
|
||||
else
|
||||
/home/admin/_cache.sh set message "Installing Services"
|
||||
fi
|
||||
|
||||
# BLITZ WEB SERVICE
|
||||
echo "Provisioning BLITZ WEB SERVICE - run config script" >> ${logFile}
|
||||
/home/admin/config.scripts/blitz.web.sh https-on >> ${logFile} 2>&1
|
||||
|
||||
# deinstall when not explizit 'on' when blitzapi is installed by fatpack
|
||||
# https://github.com/raspiblitz/raspiblitz/issues/4171#issuecomment-1728302628
|
||||
if [ "${blitzapi}" != "on" ] && [ ${blitzApiInstalled} -gt 0 ]; then
|
||||
echo "blitz_api directory exists & blitzapi is not 'on' - deactivating blitz-api" >> ${logFile}
|
||||
/home/admin/config.scripts/blitz.web.api.sh off >> ${logFile} 2>&1
|
||||
/home/admin/config.scripts/blitz.web.ui.sh off >> ${logFile} 2>&1
|
||||
fi
|
||||
# WebAPI & UI (in case image was not fatpack - but webapi was switchen on)
|
||||
if [ "${blitzapi}" == "on" ] && [ $blitzApiInstalled -eq 0 ]; then
|
||||
echo "Provisioning BlitzAPI - run config script" >> ${logFile}
|
||||
/home/admin/_cache.sh set message "Setup BlitzAPI (takes time)"
|
||||
/home/admin/config.scripts/blitz.web.api.sh on DEFAULT >> ${logFile} 2>&1
|
||||
/home/admin/config.scripts/blitz.web.ui.sh on DEFAULT >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Provisioning BlitzAPI - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
echo "### RUNNING PROVISIONING SERVICES ###" >> ${logFile}
|
||||
|
||||
# BITCOIN INTERIMS UPDATE
|
||||
if [ ${#bitcoinInterimsUpdate} -gt 0 ]; then
|
||||
/home/admin/_cache.sh set message "Provisioning Bitcoin Core update"
|
||||
/home/admin/_cache.sh set message "Bitcoin Core update"
|
||||
if [ "${bitcoinInterimsUpdate}" == "reckless" ]; then
|
||||
# recklessly update Bitcoin Core to latest release on GitHub
|
||||
echo "Provisioning Bitcoin Core reckless interims update" >> ${logFile}
|
||||
@ -210,11 +238,6 @@ else
|
||||
echo "Provisioning Bitcoin Core interims update - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# I2P
|
||||
echo "Start i2pd" >> ${logFile}
|
||||
/home/admin/_cache.sh set message "i2pd setup"
|
||||
/home/admin/config.scripts/blitz.i2pd.sh on >> ${logFile}
|
||||
|
||||
# LND INTERIMS UPDATE
|
||||
if [ ${#lndInterimsUpdate} -gt 0 ]; then
|
||||
/home/admin/_cache.sh set message "Provisioning LND update"
|
||||
@ -343,26 +366,6 @@ else
|
||||
echo "Provisioning Tor - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# WebAPI & UI (in case image was not fatpack - but webapi was switchen on)
|
||||
blitzApiInstalled=$(systemctl status blitzapi | grep -c "loaded")
|
||||
if [ "${blitzapi}" == "on" ] && [ $blitzApiInstalled -eq 0 ]; then
|
||||
echo "Provisioning BlitzAPI - run config script" >> ${logFile}
|
||||
/home/admin/_cache.sh set message "Setup BlitzAPI (takes time)"
|
||||
/home/admin/config.scripts/blitz.web.api.sh on DEFAULT >> ${logFile} 2>&1
|
||||
/home/admin/config.scripts/blitz.web.ui.sh on DEFAULT >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Provisioning BlitzAPI - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# AUTO PILOT
|
||||
if [ "${autoPilot}" = "on" ]; then
|
||||
echo "Provisioning AUTO PILOT - run config script" >> ${logFile}
|
||||
/home/admin/_cache.sh set message "Setup AutoPilot"
|
||||
/home/admin/config.scripts/lnd.autopilot.sh on >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Provisioning AUTO PILOT - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# NETWORK UPNP
|
||||
if [ "${networkUPnP}" = "on" ]; then
|
||||
echo "Provisioning NETWORK UPnP - run config script" >> ${logFile}
|
||||
@ -444,6 +447,15 @@ else
|
||||
echo "Provisioning ElectRS - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
#FULCRUM
|
||||
if [ "${fulcrum}" = "on" ]; then
|
||||
echo "Provisioning Fulcrum - run config script" >> ${logFile}
|
||||
/home/admin/_cache.sh set message "Setup Fulcrum"
|
||||
sudo -u admin /home/admin/config.scripts/bonus.fulcrum.sh on >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Provisioning Fulcrum - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# BTCPAYSERVER
|
||||
if [ "${BTCPayServer}" = "on" ]; then
|
||||
|
||||
@ -455,16 +467,6 @@ else
|
||||
echo "Provisioning BTCPayServer - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# deprecated - see: #2031
|
||||
# LNDMANAGE
|
||||
#if [ "${lndmanage}" = "on" ]; then
|
||||
# echo "Provisioning lndmanage - run config script" >> ${logFile}
|
||||
# /home/admin/_cache.sh set message "Setup lndmanage"
|
||||
# sudo -u admin /home/admin/config.scripts/bonus.lndmanage.sh on >> ${logFile} 2>&1
|
||||
#else
|
||||
# echo "Provisioning lndmanage - not active" >> ${logFile}
|
||||
#fi
|
||||
|
||||
# CUSTOM PORT
|
||||
echo "Provisioning LND Port" >> ${logFile}
|
||||
if [ ${#lndPort} -eq 0 ]; then
|
||||
@ -529,14 +531,14 @@ else
|
||||
echo "Provisioning LCD rotate - not needed, keep default rotate on" >> ${logFile}
|
||||
fi
|
||||
|
||||
# TOUCHSCREEN
|
||||
if [ "${#touchscreen}" -gt 0 ]; then
|
||||
echo "Provisioning Touchscreen - run config script" >> ${logFile}
|
||||
/home/admin/_cache.sh set message "Setup Touchscreen"
|
||||
/home/admin/config.scripts/blitz.touchscreen.sh ${touchscreen} >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Provisioning Touchscreen - not active" >> ${logFile}
|
||||
fi
|
||||
# TOUCHSCREEN - deactivated see https://github.com/raspiblitz/raspiblitz/pull/4609#issuecomment-2144406124
|
||||
# if [ "${#touchscreen}" -gt 0 ]; then
|
||||
# echo "Provisioning Touchscreen - run config script" >> ${logFile}
|
||||
# /home/admin/_cache.sh set message "Setup Touchscreen"
|
||||
# /home/admin/config.scripts/blitz.touchscreen.sh ${touchscreen} >> ${logFile} 2>&1
|
||||
# else
|
||||
# echo "Provisioning Touchscreen - not active" >> ${logFile}
|
||||
# fi
|
||||
|
||||
# UPS
|
||||
if [ "${#ups}" -gt 0 ]; then
|
||||
@ -595,15 +597,6 @@ else
|
||||
echo "Provisioning Balance of Satoshis - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
## LNPROXY
|
||||
#if [ "${lnproxy}" = "on" ]; then
|
||||
# echo "Provisioning lnproxy - run config script" >> ${logFile}
|
||||
# /home/admin/_cache.sh set message "Setup lnproxy"
|
||||
# sudo -u admin /home/admin/config.scripts/bonus.lnproxy.sh on >> ${logFile} 2>&1
|
||||
#else
|
||||
# echo "Provisioning lnproxy - keep default" >> ${logFile}
|
||||
#fi
|
||||
|
||||
# thunderhub
|
||||
if [ "${thunderhub}" = "on" ]; then
|
||||
echo "Provisioning ThunderHub - run config script" >> ${logFile}
|
||||
@ -667,6 +660,15 @@ else
|
||||
echo "Provisioning LIT - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# labelbase
|
||||
if [ "${labelbase}" = "on" ]; then
|
||||
echo "Provisioning Labelbase - run config script" >> ${logFile}
|
||||
/home/admin/_cache.sh set message "Setup Labelbase"
|
||||
sudo -u admin /home/admin/config.scripts/bonus.labelbase.sh on >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Provisioning Labelbase - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# lndg
|
||||
if [ "${lndg}" = "on" ]; then
|
||||
echo "Provisioning LNDg - run config script" >> ${logFile}
|
||||
@ -676,15 +678,6 @@ else
|
||||
echo "Provisioning LNDg - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# sphinxrelay
|
||||
if [ "${sphinxrelay}" = "on" ]; then
|
||||
echo "Sphinx-Relay - run config script" >> ${logFile}
|
||||
/home/admin/_cache.sh set message "Setup Sphinx-Relay"
|
||||
sudo -u admin /home/admin/config.scripts/bonus.sphinxrelay.sh on >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Sphinx-Relay - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# helipad
|
||||
if [ "${helipad}" = "on" ]; then
|
||||
echo "Helipad - run config script" >> ${logFile}
|
||||
@ -703,33 +696,6 @@ else
|
||||
echo "Provisioning CircuitBreaker - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# homer
|
||||
if [ "${homer}" = "on" ]; then
|
||||
echo "Provisioning Homer - run config script" >> ${logFile}
|
||||
/home/admin/_cache.sh set message "Setup Homer"
|
||||
sudo -u admin /home/admin/config.scripts/bonus.homer.sh on >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Provisioning Homer - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# tallycoin_connect
|
||||
if [ "${tallycoinConnect}" = "on" ]; then
|
||||
echo "Provisioning Tallycoin Connect - run config script" >> ${logFile}
|
||||
/home/admin/_cache.sh set message "Setup Tallycoin Connect"
|
||||
sudo -u admin /home/admin/config.scripts/bonus.tallycoin-connect.sh on >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Provisioning Tallycoin Connect - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# bitcoinminds.org
|
||||
if [ "${bitcoinminds}" = "on" ]; then
|
||||
echo "Provisioning bitcoinminds.org - run config script" >> ${logFile}
|
||||
/home/admin/_cache.sh set message "Setup Bitcoinminds.org"
|
||||
sudo -u admin /home/admin/config.scripts/bonus.bitcoinminds.sh on >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Provisioning bitcoinminds.org - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# squeaknode
|
||||
if [ "${squeaknode}" = "on" ]; then
|
||||
echo "Provisioning Squeaknode - run config script" >> ${logFile}
|
||||
@ -739,15 +705,6 @@ else
|
||||
echo "Provisioning Squeaknode - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# itchysats
|
||||
if [ "${itchysats}" = "on" ]; then
|
||||
echo "Provisioning ItchySats - run config script" >> ${logFile}
|
||||
/home/admin/_cache.sh set message "Setup ItchySats"
|
||||
sudo -u admin /home/admin/config.scripts/bonus.itchysats.sh on --download >> ${logFile} 2>&1
|
||||
else
|
||||
echo "ItchySats - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# LightningTipBot
|
||||
if [ "${lightningtipbot}" = "on" ]; then
|
||||
echo "Provisioning LightningTipBot - run config script" >> ${logFile}
|
||||
@ -811,6 +768,15 @@ if [ ${confExists} -eq 0 ]; then
|
||||
chown bitcoin:bitcoin /mnt/hdd/bitcoin/bitcoin.conf
|
||||
fi
|
||||
|
||||
# I2P
|
||||
echo "Start i2pd" >> ${logFile}
|
||||
/home/admin/_cache.sh set message "i2pd setup"
|
||||
/home/admin/config.scripts/blitz.i2pd.sh on >> ${logFile}
|
||||
|
||||
# clean up raspiblitz config from old settings
|
||||
sed -i '/^autoPilot=/d' /mnt/hdd/raspiblitz.conf
|
||||
sed -i '/^lndKeysend=/d' /mnt/hdd/raspiblitz.conf
|
||||
|
||||
# signal setup done
|
||||
/home/admin/_cache.sh set message "Setup Done"
|
||||
|
||||
@ -864,7 +830,6 @@ if [ "${lightning}" == "lnd" ];then
|
||||
if [ "${passwordFlagExists}" == "1" ]; then
|
||||
echo "Found /mnt/hdd/passwordc.flag .. changing password" >> ${logFile}
|
||||
oldPasswordC=$(cat /mnt/hdd/passwordc.flag)
|
||||
if ! pip list | grep grpc; then sudo -H python3 -m pip install grpcio==1.38.1; fi
|
||||
/home/admin/config.scripts/lnd.initwallet.py change-password mainnet "${oldPasswordC}" "${passwordC}" >> ${logFile}
|
||||
shred -u /mnt/hdd/passwordc.flag
|
||||
else
|
||||
|
@ -1,3 +1,3 @@
|
||||
# RaspiBlitz Version - always [major].[main].[sub] (sub can be a string like '2rc1')
|
||||
codeVersion="1.10.0"
|
||||
# keep last line with comment
|
||||
codeVersion="1.11.1"
|
||||
# keep last line with comment ---> IF YOU HAVE A NEW VERSION BRANCH > EDIT ALSO build_sdcard.sh
|
@ -1,4 +1,4 @@
|
||||
# Boostrap the RaspiBlitz
|
||||
# Bootstrap the RaspiBlitz
|
||||
# /etc/systemd/system/bootstrap.service
|
||||
|
||||
[Unit]
|
||||
|
@ -1,7 +1,7 @@
|
||||
# lnd configuration - some values might be overruled directly systemd-service exec call parameters
|
||||
|
||||
[Application Options]
|
||||
debuglevel=debug
|
||||
debuglevel=info
|
||||
maxpendingchannels=5
|
||||
alias=raspiblitz
|
||||
color=#68F442
|
||||
|
@ -11,7 +11,7 @@ server {
|
||||
error_log /var/log/nginx/error_helipad.log;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:3010;
|
||||
proxy_pass http://127.0.0.1:2112;
|
||||
|
||||
include /etc/nginx/snippets/ssl-proxy-params.conf;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
server {
|
||||
listen 7502;
|
||||
listen [::1]:7502;
|
||||
listen [::]:7502;
|
||||
server_name _;
|
||||
|
||||
access_log /var/log/nginx/access_jam.log;
|
||||
@ -12,7 +12,6 @@ server {
|
||||
gzip_vary on;
|
||||
gzip_proxied any;
|
||||
gzip_types *;
|
||||
gzip_types application/javascript application/json text/css image/svg+xml;
|
||||
|
||||
root /home/jam/webui/build;
|
||||
index index.html;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
server {
|
||||
listen 7503 ssl http2;
|
||||
listen [::1]:7503 ssl http2;
|
||||
listen [::]:7503 ssl http2;
|
||||
server_name _;
|
||||
|
||||
include /etc/nginx/snippets/ssl-params.conf;
|
||||
@ -15,7 +15,6 @@ server {
|
||||
gzip_vary on;
|
||||
gzip_proxied any;
|
||||
gzip_types *;
|
||||
gzip_types application/javascript application/json text/css image/svg+xml;
|
||||
|
||||
root /home/jam/webui/build;
|
||||
index index.html;
|
||||
|
@ -19,6 +19,11 @@ server {
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:5000;
|
||||
|
||||
# needed for websocket connections
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
include /etc/nginx/snippets/ssl-proxy-params.conf;
|
||||
}
|
||||
|
@ -19,6 +19,11 @@ server {
|
||||
location / {
|
||||
proxy_pass https://127.0.0.1:5001;
|
||||
|
||||
# needed for websocket connections
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
include /etc/nginx/snippets/ssl-proxy-params.conf;
|
||||
}
|
||||
|
||||
|
@ -1,21 +0,0 @@
|
||||
## tallycoin_connect_ssl.conf
|
||||
|
||||
server {
|
||||
listen 8124 ssl http2;
|
||||
listen [::]:8124 ssl http2;
|
||||
server_name _;
|
||||
|
||||
include /etc/nginx/snippets/ssl-params.conf;
|
||||
include /etc/nginx/snippets/ssl-certificate-app-data.conf;
|
||||
|
||||
include /etc/nginx/snippets/gzip-params.conf;
|
||||
|
||||
access_log /var/log/nginx/access_tallycoin_connect.log;
|
||||
error_log /var/log/nginx/error_tallycoin_connect.log;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8123;
|
||||
|
||||
include /etc/nginx/snippets/ssl-proxy-params.conf;
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
## tallycoin_connect_tor.conf
|
||||
|
||||
server {
|
||||
listen 8125;
|
||||
listen [::]:8125;
|
||||
server_name _;
|
||||
|
||||
include /etc/nginx/snippets/gzip-params.conf;
|
||||
|
||||
access_log /var/log/nginx/access_tallycoin_connect.log;
|
||||
error_log /var/log/nginx/error_tallycoin_connect.log;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8123;
|
||||
|
||||
include /etc/nginx/snippets/ssl-proxy-params.conf;
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
## tallycoin_connect_tor_ssl.conf
|
||||
|
||||
server {
|
||||
listen 8126 ssl http2;
|
||||
listen [::]:8126 ssl http2;
|
||||
server_name _;
|
||||
|
||||
include /etc/nginx/snippets/ssl-params.conf;
|
||||
include /etc/nginx/snippets/ssl-certificate-app-data-tor.conf;
|
||||
|
||||
include /etc/nginx/snippets/gzip-params.conf;
|
||||
|
||||
access_log /var/log/nginx/access_tallycoin_connect.log;
|
||||
error_log /var/log/nginx/error_tallycoin_connect.log;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8123;
|
||||
|
||||
include /etc/nginx/snippets/ssl-proxy-params.conf;
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -63,7 +63,7 @@
|
||||
#### basic information about the blockchain
|
||||
#### --> https://developer.bitcoin.org/reference/rpc/getblockchaininfo.html
|
||||
##
|
||||
## Most usefull fields...
|
||||
## Most useful fields...
|
||||
## * blocks
|
||||
## * headers
|
||||
## * verificationprogress
|
||||
@ -79,7 +79,7 @@
|
||||
#### basic information about the mempool
|
||||
#### --> https://developer.bitcoin.org/reference/rpc/getmempoolinfo.html
|
||||
##
|
||||
## Most usefull fields...
|
||||
## Most useful fields...
|
||||
## * loaded (boolean) True if the mempool is fully loaded
|
||||
## * size (numeric) Current tx count
|
||||
## * usage (numeric) Total memory usage for the mempool
|
||||
@ -95,7 +95,7 @@
|
||||
#### information about network traffic, including bytes in, bytes out, and current time window
|
||||
#### --> https://developer.bitcoin.org/reference/rpc/getnettotals.html
|
||||
##
|
||||
## Most usefull fields...
|
||||
## Most useful fields...
|
||||
## * totalbytesrecv
|
||||
## * totalbytessent
|
||||
##
|
||||
@ -136,7 +136,7 @@
|
||||
#### basic information about the LN node
|
||||
#### --> https://api.lightning.community/#getinfo
|
||||
##
|
||||
## Most usefull fields...
|
||||
## Most useful fields...
|
||||
## * block_height
|
||||
## * num_peers
|
||||
## * num_active_channels
|
||||
@ -160,7 +160,7 @@
|
||||
##
|
||||
## * publicIP from /mnt/hdd/raspiblitz.conf
|
||||
## * bitcoind node ip address via: bitcoin-cli getnetworkinfo => "localaddresses"
|
||||
## * lnd ip addess via: lncli getinfo => "uris"
|
||||
## * lnd ip address via: lncli getinfo => "uris"
|
||||
## * IPv6 global from eth0/wlan0
|
||||
## * IPv4 local network address from eth0/wlan0
|
||||
##
|
||||
|
@ -67,6 +67,12 @@ if [ "$1" == "prestart" ]; then
|
||||
echo "# make sure entry(${bitcoinlog_entry}) has the correct value(${bitcoinlog_path})"
|
||||
sed -i "s|^${bitcoinlog_entry}=.*|${bitcoinlog_entry}=${bitcoinlog_path}|g" /mnt/hdd/bitcoin/bitcoin.conf
|
||||
|
||||
# make sure bitcoin debug file exists
|
||||
echo "# make sure bitcoin debug file exists"
|
||||
touch ${bitcoinlog_path}
|
||||
chown bitcoin:bitcoin ${bitcoinlog_path}
|
||||
chmod 600 ${bitcoinlog_path}
|
||||
|
||||
##### STATISTICS #####
|
||||
|
||||
# count startings
|
||||
|
@ -1,58 +1,101 @@
|
||||
#!/bin/bash
|
||||
|
||||
# set version (change if update is available)
|
||||
# https://bitcoincore.org/en/download/
|
||||
bitcoinVersion="26.0"
|
||||
|
||||
|
||||
# command info
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
echo
|
||||
echo "bitcoin.install.sh install - called by build.sdcard.sh"
|
||||
echo "Install or remove parallel chains for Bitcoin Core:"
|
||||
echo "bitcoin.install.sh [install|on|off] [signet|testnet|mainnet]"
|
||||
echo "bitcoin.install.sh install"
|
||||
echo "bitcoin.install.sh [on|off] [signet|testnet|mainnet]"
|
||||
echo "Installs Bitcoin Core $bitcoinVersion by default"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "# Running: bitcoin.install.sh $*"
|
||||
|
||||
# mainnet | testnet | signet
|
||||
CHAIN=${2:-mainnet}
|
||||
if [ "${CHAIN}" != signet ] && [ "${CHAIN}" != testnet ] && [ "${CHAIN}" != mainnet ]; then
|
||||
echo "# ${CHAIN} is not supported"
|
||||
exit 1
|
||||
fi
|
||||
# prefixes for parallel services
|
||||
if [ "${CHAIN}" = testnet ]; then
|
||||
prefix="t"
|
||||
bitcoinprefix="test"
|
||||
zmqprefix=21 # zmqpubrawblock=21332 zmqpubrawtx=21333 zmqpubhashblock=21334
|
||||
rpcprefix=1 # rpcport=18332
|
||||
elif [ ${CHAIN} = signet ]; then
|
||||
prefix="s"
|
||||
bitcoinprefix="signet"
|
||||
zmqprefix=23
|
||||
rpcprefix=3
|
||||
elif [ ${CHAIN} = mainnet ]; then
|
||||
prefix=""
|
||||
bitcoinprefix="main"
|
||||
zmqprefix=28
|
||||
rpcprefix=""
|
||||
fi
|
||||
# bitcoinlogpath
|
||||
if [ ${CHAIN} = signet ]; then
|
||||
bitcoinlogpath="/mnt/hdd/bitcoin/signet/debug.log"
|
||||
elif [ ${CHAIN} = testnet ]; then
|
||||
bitcoinlogpath="/mnt/hdd/bitcoin/testnet3/debug.log"
|
||||
elif [ ${CHAIN} = mainnet ]; then
|
||||
bitcoinlogpath="/mnt/hdd/bitcoin/debug.log"
|
||||
fi
|
||||
|
||||
function addBitcoinAliases {
|
||||
echo "# Add aliases ${prefix}bitcoin-cli, ${prefix}bitcoinlog"
|
||||
sudo -u admin touch /home/admin/_aliases
|
||||
if ! grep "alias ${prefix}bitcoin-cli" /home/admin/_aliases; then
|
||||
echo "alias ${prefix}bitcoin-cli=\"sudo -u bitcoin /usr/local/bin/bitcoin-cli -rpcport=${rpcprefix}8332\"" |
|
||||
sudo tee -a /home/admin/_aliases
|
||||
fi
|
||||
if ! grep "alias ${prefix}bitcoinlog" /home/admin/_aliases; then
|
||||
echo "alias ${prefix}bitcoinlog=\"sudo -u bitcoin tail -n 30 -f ${bitcoinlogpath}\"" |
|
||||
sudo tee -a /home/admin/_aliases
|
||||
fi
|
||||
if ! grep "alias bitcoinconf" /home/admin/_aliases; then
|
||||
echo "alias bitcoinconf=\"sudo nano /mnt/hdd/bitcoin/bitcoin.conf\"" |
|
||||
sudo tee -a /home/admin/_aliases
|
||||
fi
|
||||
sudo chown admin:admin /home/admin/_aliases
|
||||
}
|
||||
|
||||
if [ "$1" = "install" ]; then
|
||||
echo "*** PREPARING BITCOIN ***"
|
||||
|
||||
# set version (change if update is available)
|
||||
# https://bitcoincore.org/en/download/
|
||||
bitcoinVersion="25.0"
|
||||
|
||||
# needed to check code signing
|
||||
# https://github.com/laanwj
|
||||
laanwjPGP="71A3 B167 3540 5025 D447 E8F2 7481 0B01 2346 C9A6"
|
||||
|
||||
# prepare directories
|
||||
sudo rm -rf /home/admin/download
|
||||
sudo -u admin mkdir /home/admin/download
|
||||
cd /home/admin/download || exit 1
|
||||
|
||||
# receive signer key
|
||||
if ! gpg --keyserver hkps://keys.openpgp.org --recv-key "71A3 B167 3540 5025 D447 E8F2 7481 0B01 2346 C9A6"
|
||||
then
|
||||
echo "# FAIL # Couldn't download Wladimir J. van der Laan's PGP pubkey"
|
||||
exit 1
|
||||
fi
|
||||
echo "# Receive signer keys"
|
||||
curl -s "https://api.github.com/repos/bitcoin-core/guix.sigs/contents/builder-keys" |
|
||||
jq -r '.[].download_url' | while read url; do curl -s "$url" | gpg --import; done
|
||||
|
||||
# download signed binary sha256 hash sum file
|
||||
sudo -u admin wget https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS
|
||||
sudo -u admin wget --prefer-family=ipv4 --progress=bar:force -O SHA256SUMS https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS
|
||||
# download the signed binary sha256 hash sum file and check
|
||||
sudo -u admin wget --prefer-family=ipv4 --progress=bar:force -O SHA256SUMS.asc https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS.asc
|
||||
|
||||
# download signed binary sha256 hash sum file and check
|
||||
sudo -u admin wget https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS.asc
|
||||
verifyResult=$(LANG=en_US.utf8; gpg --verify SHA256SUMS.asc 2>&1)
|
||||
goodSignature=$(echo ${verifyResult} | grep 'Good signature' -c)
|
||||
echo "goodSignature(${goodSignature})"
|
||||
correctKey=$(echo ${verifyResult} | grep "${laanwjPGP}" -c)
|
||||
echo "correctKey(${correctKey})"
|
||||
if [ ${correctKey} -lt 1 ] || [ ${goodSignature} -lt 1 ]; then
|
||||
echo
|
||||
echo "# BUILD FAILED --> PGP Verify not OK / signature(${goodSignature}) verify(${correctKey})"
|
||||
exit 1
|
||||
else
|
||||
if gpg --verify SHA256SUMS.asc; then
|
||||
echo
|
||||
echo "****************************************"
|
||||
echo "OK --> BITCOIN MANIFEST IS CORRECT"
|
||||
echo "****************************************"
|
||||
echo
|
||||
else
|
||||
echo
|
||||
echo "# BUILD FAILED --> the PGP verification failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# bitcoinOSversion
|
||||
@ -70,11 +113,12 @@ if [ "$1" = "install" ]; then
|
||||
# download resources
|
||||
binaryName="bitcoin-${bitcoinVersion}-${bitcoinOSversion}.tar.gz"
|
||||
if [ ! -f "./${binaryName}" ]; then
|
||||
sudo -u admin wget https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/${binaryName}
|
||||
echo "# Downloading https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/${binaryName} ..."
|
||||
sudo -u admin wget --quiet https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/${binaryName}
|
||||
fi
|
||||
if [ ! -f "./${binaryName}" ]; then
|
||||
echo "# FAIL # Could not download the BITCOIN BINARY"
|
||||
exit 1
|
||||
echo "# FAIL # Could not download the BITCOIN BINARY"
|
||||
exit 1
|
||||
else
|
||||
|
||||
# check binary checksum test
|
||||
@ -103,58 +147,21 @@ if [ "$1" = "install" ]; then
|
||||
sudo -u admin tar -xvf ${binaryName}
|
||||
sudo install -m 0755 -o root -g root -t /usr/local/bin/ bitcoin-${bitcoinVersion}/bin/*
|
||||
sleep 3
|
||||
installed=$(sudo -u admin bitcoind --version | grep "${bitcoinVersion}" -c)
|
||||
if [ ${installed} -lt 1 ]; then
|
||||
if ! sudo /usr/local/bin/bitcoind --version | grep "${bitcoinVersion}"; then
|
||||
echo
|
||||
echo "# BUILD FAILED --> Was not able to install bitcoind version(${bitcoinVersion})"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$(alias | grep -c "alias bitcoinlog")" -eq 0 ];then
|
||||
echo "alias bitcoinlog=\"sudo tail -n 30 -f /mnt/hdd/bitcoin/debug.log\"" | sudo tee -a /home/admin/_aliases
|
||||
fi
|
||||
sudo chown admin:admin /home/admin/_aliases
|
||||
|
||||
addBitcoinAliases
|
||||
|
||||
echo "- Bitcoin install OK"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
# CHAIN is mainnet | testnet | signet
|
||||
CHAIN=$2
|
||||
if [ "${CHAIN}" != signet ]&&[ "${CHAIN}" != testnet ]&&[ "${CHAIN}" != mainnet ];then
|
||||
echo "# ${CHAIN} is not supported"
|
||||
exit 1
|
||||
fi
|
||||
# prefixes for parallel services
|
||||
if [ "${CHAIN}" = testnet ];then
|
||||
prefix="t"
|
||||
bitcoinprefix="test"
|
||||
zmqprefix=21 # zmqpubrawblock=21332 zmqpubrawtx=21333 zmqpubhashblock=21334
|
||||
rpcprefix=1 # rpcport=18332
|
||||
elif [ ${CHAIN} = signet ];then
|
||||
prefix="s"
|
||||
bitcoinprefix="signet"
|
||||
zmqprefix=23
|
||||
rpcprefix=3
|
||||
elif [ ${CHAIN} = mainnet ];then
|
||||
prefix=""
|
||||
bitcoinprefix="main"
|
||||
zmqprefix=28
|
||||
rpcprefix=""
|
||||
fi
|
||||
# bitcoinlogpath
|
||||
if [ ${CHAIN} = signet ]; then
|
||||
bitcoinlogpath="/mnt/hdd/bitcoin/signet/debug.log"
|
||||
elif [ ${CHAIN} = testnet ]; then
|
||||
bitcoinlogpath="/mnt/hdd/bitcoin/testnet3/debug.log"
|
||||
elif [ ${CHAIN} = mainnet ]; then
|
||||
bitcoinlogpath="/mnt/hdd/bitcoin/debug.log"
|
||||
fi
|
||||
|
||||
|
||||
function removeParallelService() {
|
||||
if [ -f "/etc/systemd/system/${prefix}bitcoind.service" ];then
|
||||
if [ ${CHAIN} != mainnet ];then
|
||||
if [ -f "/etc/systemd/system/${prefix}bitcoind.service" ]; then
|
||||
if [ ${CHAIN} != mainnet ]; then
|
||||
/usr/local/bin/bitcoin-cli -${CHAIN} stop
|
||||
else
|
||||
/usr/local/bin/bitcoin-cli stop
|
||||
@ -162,9 +169,9 @@ function removeParallelService() {
|
||||
sudo systemctl stop ${prefix}bitcoind
|
||||
sudo systemctl disable ${prefix}bitcoind
|
||||
sudo rm /etc/systemd/system/${prefix}bitcoind.service 2>/dev/null
|
||||
if [ ${bitcoinprefix} = signet ];then
|
||||
if [ ${bitcoinprefix} = signet ]; then
|
||||
# check for signet service set up by joininbox
|
||||
if [ -f "/etc/systemd/system/signetd.service" ];then
|
||||
if [ -f "/etc/systemd/system/signetd.service" ]; then
|
||||
sudo systemctl stop signetd
|
||||
sudo systemctl disable signetd
|
||||
echo "# The signetd.service is stopped and disabled"
|
||||
@ -177,9 +184,9 @@ function removeParallelService() {
|
||||
function installParallelService() {
|
||||
echo "# Installing Bitcoin Core instance on ${CHAIN}"
|
||||
# bitcoin.conf
|
||||
if [ ! -f /home/bitcoin/.bitcoin/bitcoin.conf ];then
|
||||
if [ ! -f /home/bitcoin/.bitcoin/bitcoin.conf ]; then
|
||||
# add minimal config
|
||||
randomRPCpass=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c8)
|
||||
randomRPCpass=$(tr </dev/urandom -dc _A-Z-a-z-0-9 | head -c8)
|
||||
echo "
|
||||
# bitcoind configuration for ${CHAIN}
|
||||
|
||||
@ -201,41 +208,39 @@ datadir=/mnt/hdd/bitcoin
|
||||
|
||||
# make sure rpcbind is correctly configured
|
||||
sudo sed -i s/^rpcbind=/main.rpcbind=/g /mnt/hdd/bitcoin/bitcoin.conf
|
||||
if [ $(grep -c "rpcallowip" < /mnt/hdd/bitcoin/bitcoin.conf) -gt 0 ];then
|
||||
if [ $(grep -c "${bitcoinprefix}.rpcbind=" < /mnt/hdd/bitcoin/bitcoin.conf) -eq 0 ];then
|
||||
echo "\
|
||||
${bitcoinprefix}.rpcbind=127.0.0.1"|\
|
||||
sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
|
||||
if grep "rpcallowip" /mnt/hdd/bitcoin/bitcoin.conf; then
|
||||
if ! grep "${bitcoinprefix}.rpcbind=" /mnt/hdd/bitcoin/bitcoin.conf; then
|
||||
echo "${bitcoinprefix}.rpcbind=127.0.0.1" |
|
||||
sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
# correct rpcport entry
|
||||
sudo sed -i s/^rpcport=/main.rpcport=/g /mnt/hdd/bitcoin/bitcoin.conf
|
||||
if [ $(grep -c "${bitcoinprefix}.rpcport" < /mnt/hdd/bitcoin/bitcoin.conf) -eq 0 ];then
|
||||
echo "\
|
||||
${bitcoinprefix}.rpcport=${rpcprefix}8332"|\
|
||||
sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
|
||||
if ! grep "${bitcoinprefix}.rpcport" /mnt/hdd/bitcoin/bitcoin.conf; then
|
||||
echo "${bitcoinprefix}.rpcport=${rpcprefix}8332" |
|
||||
sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
|
||||
fi
|
||||
|
||||
# correct zmq entry
|
||||
sudo sed -i s/^zmqpubraw/main.zmqpubraw/g /mnt/hdd/bitcoin/bitcoin.conf
|
||||
if [ $(grep -c "${bitcoinprefix}.zmqpubrawblock" < /mnt/hdd/bitcoin/bitcoin.conf) -eq 0 ];then
|
||||
if ! grep "${bitcoinprefix}.zmqpubrawblock" /mnt/hdd/bitcoin/bitcoin.conf; then
|
||||
echo "\
|
||||
${bitcoinprefix}.zmqpubrawblock=tcp://127.0.0.1:${zmqprefix}332
|
||||
${bitcoinprefix}.zmqpubrawtx=tcp://127.0.0.1:${zmqprefix}333"|\
|
||||
sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
|
||||
${bitcoinprefix}.zmqpubrawtx=tcp://127.0.0.1:${zmqprefix}333" |
|
||||
sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
|
||||
fi
|
||||
|
||||
# addnode
|
||||
if [ ${bitcoinprefix} = signet ];then
|
||||
if [ $(grep -c "${bitcoinprefix}.addnode" < /mnt/hdd/bitcoin/bitcoin.conf) -eq 0 ];then
|
||||
if [ ${bitcoinprefix} = signet ]; then
|
||||
if [ $(grep -c "${bitcoinprefix}.addnode" </mnt/hdd/bitcoin/bitcoin.conf) -eq 0 ]; then
|
||||
echo "\
|
||||
signet.addnode=s7fcvn5rblem7tiquhhr7acjdhu7wsawcph7ck44uxyd6sismumemcyd.onion:38333
|
||||
signet.addnode=6megrst422lxzsqvshkqkg6z2zhunywhyrhy3ltezaeyfspfyjdzr3qd.onion:38333
|
||||
signet.addnode=jahtu4veqnvjldtbyxjiibdrltqiiighauai7hmvknwxhptsb4xat4qd.onion:38333
|
||||
signet.addnode=f4kwoin7kk5a5kqpni7yqe25z66ckqu6bv37sqeluon24yne5rodzkqd.onion:38333
|
||||
signet.addnode=nsgyo7begau4yecc46ljfecaykyzszcseapxmtu6adrfagfrrzrlngyd.onion:38333"|\
|
||||
sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
|
||||
signet.addnode=nsgyo7begau4yecc46ljfecaykyzszcseapxmtu6adrfagfrrzrlngyd.onion:38333" |
|
||||
sudo tee -a /mnt/hdd/bitcoin/bitcoin.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -303,21 +308,7 @@ WantedBy=multi-user.target
|
||||
sudo systemctl enable ${prefix}bitcoind
|
||||
echo "# OK - the bitcoin daemon on ${CHAIN} service is now enabled"
|
||||
|
||||
echo "# Add aliases ${prefix}bitcoin-cli, ${prefix}bitcoind, ${prefix}bitcoinlog"
|
||||
sudo -u admin touch /home/admin/_aliases
|
||||
if [ "$(alias | grep -c "alias ${prefix}bitcoin-cli")" -eq 0 ];then
|
||||
echo "\
|
||||
alias ${prefix}bitcoin-cli=\"sudo -u bitcoin /usr/local/bin/bitcoin-cli\
|
||||
-rpcport=${rpcprefix}8332\"
|
||||
alias ${prefix}bitcoind=\"sudo -u bitcoin /usr/local/bin/bitcoind -${CHAIN}\"\
|
||||
" | sudo tee -a /home/admin/_aliases
|
||||
fi
|
||||
if [ "$(alias | grep -c "alias ${prefix}bitcoinlog")" -eq 0 ];then
|
||||
echo "\
|
||||
alias ${prefix}bitcoinlog=\"sudo -u bitcoin tail -n 30 -f ${bitcoinlogpath}\"\
|
||||
" | sudo tee -a /home/admin/_aliases
|
||||
fi
|
||||
sudo chown admin:admin /home/admin/_aliases
|
||||
addBitcoinAliases
|
||||
|
||||
source <(/home/admin/_cache.sh get state)
|
||||
|
||||
@ -331,7 +322,7 @@ alias ${prefix}bitcoinlog=\"sudo -u bitcoin tail -n 30 -f ${bitcoinlogpath}\"\
|
||||
|
||||
isInstalled=$(systemctl status ${prefix}bitcoind | grep -c active)
|
||||
if [ $isInstalled -gt 0 ]; then
|
||||
echo "# Installed $(bitcoind --version | grep version)"
|
||||
echo "# Installed $(sudo -u bitcoin bitcoind --version | grep version)"
|
||||
echo
|
||||
echo "# Monitor the ${prefix}bitcoind with:"
|
||||
echo "# sudo tail -f /mnt/hdd/bitcoin/${prefix}debug.log"
|
||||
|
@ -148,7 +148,11 @@ if [ "$2" = "info" ]; then
|
||||
if [ "$1" == "signet" ]; then
|
||||
subfolder="signet/"
|
||||
fi
|
||||
btc_blocks_data_kb=$(sudo du -s /mnt/hdd/bitcoin/${subfolder}blocks | cut -f1)
|
||||
|
||||
btc_blocks_data_kb=$(du -s /mnt/hdd/bitcoin/${subfolder}blocks | cut -f1)
|
||||
if [ "${btc_blocks_data_kb}" == "" ]; then
|
||||
btc_blocks_data_kb="0"
|
||||
fi
|
||||
|
||||
# parse data
|
||||
btc_blocks_headers=$(echo "${blockchaininfo}" | jq -r '.headers')
|
||||
@ -156,9 +160,14 @@ if [ "$2" = "info" ]; then
|
||||
btc_blocks_behind=$((${btc_blocks_headers} - ${btc_blocks_verified}))
|
||||
btc_sync_initialblockdownload=$(echo "${blockchaininfo}" | jq -r '.initialblockdownload' | grep -c 'true')
|
||||
btc_sync_progress=$(echo "${blockchaininfo}" | jq -r '.verificationprogress')
|
||||
if (( $(awk 'BEGIN { print( '${btc_sync_progress}'<0.99995 ) }') )); then
|
||||
if [[ "${btc_sync_progress}" == *"e-"* ]]; then
|
||||
# is still very small - round up to 0.01%
|
||||
btc_sync_percentage="0.01"
|
||||
elif (( $(awk 'BEGIN { print( '${btc_sync_progress}'<0.99995 ) }') )); then
|
||||
# #3620 prevent displaying 100.00%, although incorrect because of rounding
|
||||
btc_sync_percentage=$(awk 'BEGIN { printf( "%.2f%%", 100 * '${btc_sync_progress}') }')
|
||||
btc_sync_percentage="${btc_sync_progress:2:2}.${btc_sync_progress:4:2}"
|
||||
# remove trailing zero if present (just first one)
|
||||
btc_sync_percentage="${btc_sync_percentage#0}"
|
||||
elif [ "${btc_blocks_headers}" != "" ] && [ "${btc_blocks_headers}" == "${btc_blocks_verified}" ]; then
|
||||
btc_sync_percentage="100.00"
|
||||
else
|
||||
@ -247,7 +256,7 @@ if [ "$2" = "peer-kickstart" ]; then
|
||||
if [ "$(cat /mnt/hdd/raspiblitz.conf | grep -c "^runBehindTor=on")" != "0" ]; then
|
||||
addressFormat="tor"
|
||||
else
|
||||
source <(sudo /home/admin/config.scripts/internet.sh status global)
|
||||
source <(/home/admin/config.scripts/internet.sh status global)
|
||||
if [ "${ipv6}" == "off" ]; then
|
||||
addressFormat="ipv4"
|
||||
else
|
||||
|
80
home.admin/config.scripts/bitcoin.testnet.sh
Executable file
80
home.admin/config.scripts/bitcoin.testnet.sh
Executable file
@ -0,0 +1,80 @@
|
||||
#!/bin/bash
|
||||
|
||||
# command info
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
echo "# Switches on bitcoind mainnet behind the scenes to testnet."
|
||||
echo "# !!! JUST USE FOR DEVELOPEMNT - NOT FOR PRODUCTION !!!"
|
||||
echo "# "
|
||||
echo "# bitcoin.testnet.sh [activate|revert]"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# make sure user is root
|
||||
if [ $UID -ne 0 ]; then
|
||||
echo "error='run this script with sudo'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "# Running: bitcoin.testnet.sh $*"
|
||||
|
||||
if [ "$1" == "activate" ]; then
|
||||
|
||||
# check if bitcoin testnet is already activated
|
||||
testnetSet=$(cat /mnt/hdd/bitcoin/bitcoin.conf | grep -c "^testnet=1")
|
||||
if [ $testnetSet -gt 0 ]; then
|
||||
echo "error='testnet is already activated'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "# SWITCHING TO TESTNET .."
|
||||
|
||||
# make changes to bitcoin.conf
|
||||
sed -i 's|^testnet=0|testnet=1|' /mnt/hdd/bitcoin/bitcoin.conf
|
||||
sed -i 's/^\(main.debuglogfile=.*\)/#\1/' /mnt/hdd/bitcoin/bitcoin.conf
|
||||
sed -i 's|^test.debuglogfile=/mnt/hdd/bitcoin/testnet3/debug.log|test.debuglogfile=/mnt/hdd/bitcoin/debug.log|' /mnt/hdd/bitcoin/bitcoin.conf
|
||||
sed -i 's/^\(main.rpcbind=.*\)/#\1/' /mnt/hdd/bitcoin/bitcoin.conf
|
||||
sed -i 's|^test.rpcbind=127.0.0.1:18332|test.rpcbind=127.0.0.1:8332|' /mnt/hdd/bitcoin/bitcoin.conf
|
||||
|
||||
# restart bitcoind service
|
||||
systemctl restart bitcoind.service
|
||||
|
||||
echo "# OK bitcoind should now run testnet on mainnet ports"
|
||||
echo "# If you want to save space you can delete old mainnet blockchain with:"
|
||||
echo "# rm -rf /mnt/hdd/bitcoin/blocks"
|
||||
echo "# rm -rf /mnt/hdd/bitcoin/chainstate"
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" == "revert" ]; then
|
||||
|
||||
# check if bitcoin testnet is already activated
|
||||
testnetSet=$(cat /mnt/hdd/bitcoin/bitcoin.conf | grep -c "^testnet=1")
|
||||
if [ $testnetSet -eq 0 ]; then
|
||||
echo "error='testnet is not activated'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "# SWITCHING BACK TO MAINNET .."
|
||||
|
||||
# make changes to bitcoin.conf
|
||||
sed -i 's|^testnet=1|testnet=0|' /mnt/hdd/bitcoin/bitcoin.conf
|
||||
sed -i 's|^#main.debuglogfile=.*|main.debuglogfile=/mnt/hdd/bitcoin/debug.log|' /mnt/hdd/bitcoin/bitcoin.conf
|
||||
sed -i 's|^test.debuglogfile=/mnt/hdd/bitcoin/debug.log|test.debuglogfile=/mnt/hdd/bitcoin/testnet3/debug.log|' /mnt/hdd/bitcoin/bitcoin.conf
|
||||
sed -i 's|^#main.rpcbind=.*|main.rpcbind=127.0.0.1:8332|' /mnt/hdd/bitcoin/bitcoin.conf
|
||||
sed -i 's|^test.rpcbind=127.0.0.1:8332|test.rpcbind=127.0.0.1:18332|' /mnt/hdd/bitcoin/bitcoin.conf
|
||||
|
||||
# restart bitcoind service
|
||||
systemctl restart bitcoind.service
|
||||
|
||||
echo "# OK bitcoind should now run normal mainnet again"
|
||||
echo "# If you want to save space you can delete old testnet blockchain with:"
|
||||
echo "# rm -rf /mnt/hdd/bitcoin/testnet3/blocks"
|
||||
echo "# rm -rf /mnt/hdd/bitcoin/testnet3/chainstate"
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "error='unkown parameter'"
|
||||
exit 1
|
@ -7,35 +7,31 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
echo "info -> get actual state and possible actions"
|
||||
echo "tested -> only do a tested update by the RaspiBlitz team"
|
||||
echo "reckless -> the update was not tested by the RaspiBlitz team"
|
||||
echo "custom -> update to a chosen version"
|
||||
echo " the binary will be checked by signature and checksum in all cases"
|
||||
echo "custom <version> <skipverify> -> update to a chosen version"
|
||||
echo " the binary checksum and signatures will be checked in all cases"
|
||||
echo " except when 'skipverify' is used"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "# Running: bitcoin.update.sh $*"
|
||||
|
||||
# 1. parameter [info|tested|reckless]
|
||||
mode="$1"
|
||||
|
||||
# RECOMMENDED UPDATE BY RASPIBLITZ TEAM (just possible once per sd card update)
|
||||
# comment will be shown as "BEWARE Info" when option is choosen (can be multiple lines)
|
||||
bitcoinVersion="" # example: 22.0 .. keep empty if no newer version as sd card build is available
|
||||
|
||||
# needed to check code signing
|
||||
# https://github.com/emzy.gpg
|
||||
fallbackSigner=Emzy
|
||||
# RECOMMENDED UPDATE BY RASPIBLITZ TEAM (latest tested version available)
|
||||
bitcoinVersion="27.1" # example: 22.0 .. keep empty if no newer version as sd card build is available
|
||||
|
||||
# GATHER DATA
|
||||
# setting download directory to the current user
|
||||
downloadDir="/home/$(whoami)/download/bitcoin.update"
|
||||
|
||||
# detect CPU architecture & fitting download link
|
||||
if [ $(uname -m | grep -c 'arm') -eq 1 ]; then
|
||||
# bitcoinOSversion
|
||||
if [ "$(uname -m | grep -c 'arm')" -gt 0 ]; then
|
||||
bitcoinOSversion="arm-linux-gnueabihf"
|
||||
fi
|
||||
if [ $(uname -m | grep -c 'aarch64') -eq 1 ]; then
|
||||
elif [ "$(uname -m | grep -c 'aarch64')" -gt 0 ]; then
|
||||
bitcoinOSversion="aarch64-linux-gnu"
|
||||
fi
|
||||
if [ $(uname -m | grep -c 'x86_64') -eq 1 ]; then
|
||||
elif [ "$(uname -m | grep -c 'x86_64')" -gt 0 ]; then
|
||||
bitcoinOSversion="x86_64-linux-gnu"
|
||||
fi
|
||||
|
||||
@ -62,6 +58,39 @@ function displayInfo() {
|
||||
echo "bitcoinLatestVersion='${bitcoinLatestVersion}'"
|
||||
}
|
||||
|
||||
# COMAPRE TWO VERSION STRINGS
|
||||
# 0 = first version string is equal
|
||||
# 1 = first version string is older
|
||||
# 2 = first version string is newer
|
||||
function version_compare() {
|
||||
if [[ $1 == $2 ]]
|
||||
then
|
||||
echo "equal"
|
||||
return 0
|
||||
fi
|
||||
IFS='.' read -r -a ver1 <<< "$1"
|
||||
IFS='.' read -r -a ver2 <<< "$2"
|
||||
len1=${#ver1[@]}
|
||||
len2=${#ver2[@]}
|
||||
max_len=$((len1>len2?len1:len2))
|
||||
for ((i=0; i<max_len; i++))
|
||||
do
|
||||
part1=${ver1[i]:-0}
|
||||
part2=${ver2[i]:-0}
|
||||
if ((part1 < part2))
|
||||
then
|
||||
# older
|
||||
return 1
|
||||
elif ((part1 > part2))
|
||||
then
|
||||
# newer
|
||||
return 2
|
||||
fi
|
||||
done
|
||||
# equal
|
||||
return 0
|
||||
}
|
||||
|
||||
if [ "${mode}" = "info" ]; then
|
||||
displayInfo
|
||||
exit 1
|
||||
@ -72,20 +101,43 @@ if [ "${mode}" = "tested" ]; then
|
||||
|
||||
echo "# bitcoin.update.sh tested"
|
||||
|
||||
# check if a tested update is available
|
||||
if [ ${#bitcoinVersion} -eq 0 ]; then
|
||||
echo "# warn='no tested update available'"
|
||||
echo "# thats OK on update from older versions"
|
||||
/home/admin/config.scripts/blitz.conf.sh delete bitcoinInterimsUpdate 2>/dev/null
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check for optional second parameter: forced update version
|
||||
# --> only does the tested update if its the given version
|
||||
# this is needed for recovery/update.
|
||||
fixedBitcoinVersion="$2"
|
||||
if [ ${#fixedBitcoinVersion} -gt 0 ]; then
|
||||
echo "# checking for fixed version update: askedFor(${bitcoinVersion}) available(${bitcoinVersion})"
|
||||
if [ "${fixedBitcoinVersion}" != "${bitcoinVersion}" ]; then
|
||||
echo "# warn='required update version does not match'"
|
||||
echo "# this is normal when the recovery script of a new RaspiBlitz version checks for an old update - just ignore"
|
||||
echo "# checking for fixed version update: installed(${installedVersion}) requested(${fixedBitcoinVersion}) available(${bitcoinVersion})"
|
||||
version_compare "${fixedBitcoinVersion}" "${bitcoinVersion}"
|
||||
result=$?
|
||||
if [ "${result}" -eq 2 ]; then
|
||||
echo "# WARNING: requested version is newer then available tested --> ABORT (already up2date)"
|
||||
exit 1
|
||||
else
|
||||
echo "# OK - update version is matching"
|
||||
echo "# requested version is older or equal --> OK install available tested version"
|
||||
fi
|
||||
fi
|
||||
|
||||
# check against installed version
|
||||
version_compare "${installedVersion}" "${bitcoinVersion}"
|
||||
result=$?
|
||||
if [ "${result}" -eq 2 ]; then
|
||||
# this can happen if bitcoin install script already has a higher version then the tested version set by this script (see above)
|
||||
echo "# installed version is newer then to be updated version --> ABORT"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
if [ "${result}" -eq 0 ]; then
|
||||
echo "# version is already installed --> ABORT"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pathVersion=${bitcoinVersion}
|
||||
|
||||
elif [ "${mode}" = "reckless" ]; then
|
||||
@ -98,16 +150,21 @@ elif [ "${mode}" = "reckless" ]; then
|
||||
pathVersion=${bitcoinVersion}
|
||||
|
||||
elif [ "${mode}" = "custom" ]; then
|
||||
clear
|
||||
echo
|
||||
echo "# Update Bitcoin Core to a chosen version."
|
||||
echo
|
||||
echo "# Input the version you would like to install and press ENTER."
|
||||
echo "# Examples (versions below 22 are not supported):"
|
||||
echo "22.0rc3"
|
||||
echo "24.0.1"
|
||||
echo
|
||||
read bitcoinVersion
|
||||
if [ $# -gt 1 ]; then
|
||||
bitcoinVersion="$2"
|
||||
else
|
||||
clear
|
||||
echo
|
||||
echo "# Update Bitcoin Core to a chosen version."
|
||||
echo
|
||||
echo "# Input the version you would like to install and press ENTER."
|
||||
echo "# Examples (versions below 22.1 are not supported):"
|
||||
echo "24.0.1"
|
||||
echo "26.0"
|
||||
echo
|
||||
read bitcoinVersion
|
||||
fi
|
||||
|
||||
if [ $(echo ${bitcoinVersion} | grep -c "rc") -gt 0 ]; then
|
||||
cutVersion=$(echo ${bitcoinVersion} | awk -F"r" '{print $1}')
|
||||
rcVersion=$(echo ${bitcoinVersion} | awk -F"r" '{print $2}')
|
||||
@ -120,6 +177,9 @@ elif [ "${mode}" = "custom" ]; then
|
||||
if curl --output /dev/null --silent --head --fail \
|
||||
https://bitcoincore.org/bin/bitcoin-core-${pathVersion}/SHA256SUMS.asc; then
|
||||
echo "# OK version exists at https://bitcoincore.org/bin/bitcoin-core-${pathVersion}"
|
||||
if [ "${mode}" = "custom" ] && [ "$3" = "skipverify" ]; then
|
||||
echo "# skipping signature verification"
|
||||
fi
|
||||
echo "# Press ENTER to proceed to install Bitcoin Core $bitcoinVersion or CTRL+C to abort."
|
||||
read key
|
||||
else
|
||||
@ -148,48 +208,34 @@ if [ "${mode}" = "tested" ] || [ "${mode}" = "reckless" ] || [ "${mode}" = "cust
|
||||
mkdir -p "${downloadDir}"
|
||||
cd "${downloadDir}" || exit 1
|
||||
|
||||
# NOTE: this script is run by provision and cannot have user input at this point or it will lock up the provision process
|
||||
# echo "# Enter the github username of a signer. Find the list of signers at: "
|
||||
# echo "https://github.com/bitcoin-core/guix.sigs/tree/main/${pathVersion}"
|
||||
# echo "# Example for Peter Wuille (https://github.com/sipa):"
|
||||
# echo "sipa"
|
||||
# echo "# example for Emzy (https://github.com/Emzy):"
|
||||
# echo "Emzy"
|
||||
# read customSigner
|
||||
# if [ ${#customSigner} -eq 0 ]; then
|
||||
# customSigner=$fallbackSigner
|
||||
# fi
|
||||
customSigner=$fallbackSigner
|
||||
echo "# Receive signer keys"
|
||||
curl -s "https://api.github.com/repos/bitcoin-core/guix.sigs/contents/builder-keys" |
|
||||
jq -r '.[].download_url' | while read url; do curl -s "$url" | gpg --import; done
|
||||
|
||||
echo "# Download the binary sha256 hash sum file"
|
||||
wget -O all.SHA256SUMS https://raw.githubusercontent.com/bitcoin-core/guix.sigs/main/${pathVersion}/${customSigner}/all.SHA256SUMS
|
||||
echo "# Download signature of the binary sha256 hash sum file"
|
||||
wget -O all.SHA256SUMS.asc https://raw.githubusercontent.com/bitcoin-core/guix.sigs/main/${pathVersion}/${customSigner}/all.SHA256SUMS.asc
|
||||
# download signed binary sha256 hash sum file
|
||||
wget --prefer-family=ipv4 --progress=bar:force -O SHA256SUMS https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS
|
||||
# download the signed binary sha256 hash sum file and check
|
||||
wget --prefer-family=ipv4 --progress=bar:force -O SHA256SUMS.asc https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS.asc
|
||||
|
||||
echo "# Download PGP pubkey of ${customSigner}"
|
||||
if ! wget -O pubkey.asc https://github.com/${customSigner}.gpg; then
|
||||
echo "# FAIL # Could not down
|
||||
load the PGP pubkey of ${customSigner}"
|
||||
rm pubkey.asc
|
||||
exit 1
|
||||
fi
|
||||
echo "# Import PGP pubkey of ${customSigner}"
|
||||
if ! gpg --import pubkey.asc; then
|
||||
echo "# FAIL # Couldn't import the PGP pubkey of ${customSigner}"
|
||||
rm pubkey.asc
|
||||
exit 1
|
||||
fi
|
||||
rm pubkey.asc
|
||||
|
||||
echo "# Checking PGP signature of the binary sha256 hash sum file"
|
||||
if ! gpg --verify all.SHA256SUMS.asc; then
|
||||
echo
|
||||
echo "# BUILD FAILED --> the signature does not match"
|
||||
exit 1
|
||||
if [ "${mode}" = "custom" ] && [ "$3" = "skipverify" ]; then
|
||||
echo "# skipping signature verification"
|
||||
echo "# display the output of 'gpg --verify SHA256SUMS.asc'"
|
||||
gpg --verify SHA256SUMS.asc
|
||||
else
|
||||
echo
|
||||
echo "# OK --> BITCOIN MANIFEST IS CORRECT"
|
||||
echo
|
||||
if gpg --verify SHA256SUMS.asc; then
|
||||
echo
|
||||
echo "****************************************"
|
||||
echo "OK --> BITCOIN MANIFEST IS CORRECT"
|
||||
echo "****************************************"
|
||||
echo
|
||||
else
|
||||
echo
|
||||
echo "# BUILD FAILED --> the PGP verification failed"
|
||||
echo "# try again or with a different version"
|
||||
echo "# if you want to skip verifying all signatures (and just show them) use the command:"
|
||||
echo "# /home/admin/config.scripts/bonus.bitcoin.sh custom ${bitcoinVersion:-<version>} skipverify"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "# Downloading Bitcoin Core v${bitcoinVersion} for ${bitcoinOSversion} ..."
|
||||
@ -201,9 +247,9 @@ if [ "${mode}" = "tested" ] || [ "${mode}" = "reckless" ] || [ "${mode}" = "cust
|
||||
fi
|
||||
|
||||
echo "# Checking the binary checksum ..."
|
||||
if ! sha256sum -c --ignore-missing all.SHA256SUMS; then
|
||||
if ! sha256sum -c --ignore-missing SHA256SUMS; then
|
||||
# get the sha256 value for the corresponding platform from signed hash sum file
|
||||
bitcoinSHA256=$(grep -i "${binaryName}}" all.SHA256SUMS | cut -d " " -f1)
|
||||
bitcoinSHA256=$(grep -i "${binaryName}}" SHA256SUMS | cut -d " " -f1)
|
||||
echo "# FAIL # Downloaded BITCOIN BINARY CHECKSUM:"
|
||||
echo "$(sha256sum ${binaryName})"
|
||||
echo "NOT matching SHA256 checksum:"
|
||||
@ -235,7 +281,7 @@ if [ "${mode}" = "tested" ] || [ "${mode}" = "reckless" ] || [ "${mode}" = "cust
|
||||
tar -xvf ${binaryName}
|
||||
sudo install -m 0755 -o root -g root -t /usr/local/bin/ bitcoin-${bitcoinVersion}/bin/*
|
||||
sleep 3
|
||||
if ! bitcoind --version | grep "${bitcoinVersion}"; then
|
||||
if ! sudo /usr/local/bin/bitcoind --version | grep "${bitcoinVersion}"; then
|
||||
echo
|
||||
echo "# BUILD FAILED --> Was not able to install bitcoind version(${bitcoinVersion})"
|
||||
exit 1
|
||||
|
@ -27,10 +27,11 @@ action=$1
|
||||
#########################
|
||||
# STATUS
|
||||
|
||||
# gather data on sd card
|
||||
# gather data on SDcard / OS drive
|
||||
minimumSizeByte=16384000000
|
||||
rootPartition=$(sudo mount | grep " / " | cut -d " " -f 1 | cut -d "/" -f 3)
|
||||
rootPartitionBytes=$(lsblk -b -o NAME,SIZE | grep "${rootPartition}" | tr -s ' ' | cut -d " " -f 2)
|
||||
rootPartitionLine=$(sudo mount | grep " / " | cut -d " " -f 1)
|
||||
rootPartition=$(basename ${rootPartitionLine})
|
||||
rootPartitionBytes=$(lsblk -b -o NAME,SIZE | grep "${rootPartition}" | awk '{print $2}')
|
||||
|
||||
# make conclusions
|
||||
needsExpansion=0
|
||||
|
@ -40,7 +40,6 @@ if [ "$1" = "set" ]; then
|
||||
raspiblitzConfExists=$(ls ${configFile} 2>/dev/null | grep -c "${configFile}")
|
||||
if [ ${raspiblitzConfExists} -eq 0 ]; then
|
||||
echo "# blitz.conf.sh $@"
|
||||
echo "# FAIL: missing config file: ${configFile}"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
|
@ -26,6 +26,15 @@ if [ "$EUID" -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# determine correct raspberrypi boot drive path (that easy to access when sd card is insert into laptop)
|
||||
raspi_bootdir=""
|
||||
if [ -d /boot/firmware ]; then
|
||||
raspi_bootdir="/boot/firmware"
|
||||
elif [ -d /boot ]; then
|
||||
raspi_bootdir="/boot"
|
||||
fi
|
||||
echo "# raspi_bootdir(${raspi_bootdir})"
|
||||
|
||||
# install BTRFS if needed
|
||||
btrfsInstalled=$(btrfs --version 2>/dev/null | grep -c "btrfs-progs")
|
||||
if [ ${btrfsInstalled} -eq 0 ]; then
|
||||
@ -109,10 +118,10 @@ if [ "$1" = "status" ]; then
|
||||
testname=$(echo $line | cut -d " " -f 1 | sed 's/[^a-z0-9]*//g')
|
||||
if [ $(echo $line | grep -c "nvme") = 0 ]; then
|
||||
testdevice=$(echo $testname | sed 's/[^a-z]*//g')
|
||||
testpartition=$(echo $testname | grep -P '[a-z]{3,5}[0-9]{1}')
|
||||
testpartition=$(echo $testname | grep -P '[a-z]{3,5}[0-9]{1}')
|
||||
else
|
||||
testdevice=$(echo $testname | sed 's/\([^p]*\).*/\1/')
|
||||
testpartition=$(echo $testname | grep -P '[p]{1}')
|
||||
testdevice=$(echo $testname | sed 's/\([^p]*\).*/\1/')
|
||||
testpartition=$(echo $testname | grep -P '[p]{1}')
|
||||
fi
|
||||
|
||||
if [ ${#testpartition} -gt 0 ]; then
|
||||
@ -121,8 +130,8 @@ if [ "$1" = "status" ]; then
|
||||
testsize=0
|
||||
fi
|
||||
|
||||
#echo "# line($line)"
|
||||
#echo "# testname(${testname}) testdevice(${testdevice}) testpartition(${testpartition}) testsize(${testsize})"
|
||||
# echo "# line($line)"
|
||||
# echo "# testname(${testname}) testdevice(${testdevice}) testpartition(${testpartition}) testsize(${testsize})"
|
||||
|
||||
# count partitions
|
||||
testpartitioncount=0
|
||||
@ -132,36 +141,37 @@ if [ "$1" = "status" ]; then
|
||||
testpartitioncount=$((testpartitioncount-1))
|
||||
fi
|
||||
|
||||
#echo "# testpartitioncount($testpartitioncount)"
|
||||
#echo "# testpartitioncount(${testpartitioncount})"
|
||||
#echo "# OSPartition(${OSPartition})"
|
||||
#echo "# bootPartition(${bootPartition})"
|
||||
#echo "# hdd(${hdd})"
|
||||
|
||||
if [ "$(uname -m)" = "x86_64" ]; then
|
||||
if [ $(echo "$testpartition" | grep -c "nvme") = 0 ]; then
|
||||
|
||||
# For PC systems
|
||||
|
||||
if [ $(echo "$testpartition" | grep -c "nvme") = 0 ]; then
|
||||
testParentDisk=$(echo "$testpartition" | sed 's/[^a-z]*//g')
|
||||
else
|
||||
else
|
||||
testParentDisk=$(echo "$testpartition" | sed 's/\([^p]*\).*/\1/')
|
||||
fi
|
||||
if [ $(echo "$OSPartition" | grep -c "nvme") = 0 ]; then
|
||||
fi
|
||||
|
||||
if [ $(echo "$OSPartition" | grep -c "nvme") = 0 ]; then
|
||||
OSParentDisk=$(echo "$OSPartition" | sed 's/[^a-z]*//g')
|
||||
else
|
||||
else
|
||||
OSParentDisk=$(echo "$OSPartition" | sed 's/\([^p]*\).*/\1/')
|
||||
fi
|
||||
|
||||
if [ $(echo "$bootPartition" | grep -c "nvme") = 0 ]; then
|
||||
bootParentDisk=$(echo "$bootPartition" | sed 's/[^a-z]*//g')
|
||||
else
|
||||
bootParentDisk=$(echo "$bootPartition" | sed 's/\([^p]*\).*/\1/')
|
||||
fi
|
||||
else
|
||||
bootParentDisk=$(echo "$bootPartition" | sed 's/\([^p]*\).*/\1/')
|
||||
fi
|
||||
|
||||
if [ "$testdevice" != "$OSParentDisk" ] && [ "$testdevice" != "$bootParentDisk" ];then
|
||||
sizeDataPartition=${testsize}
|
||||
hddDataPartition="${testpartition}"
|
||||
hdd="${testdevice}"
|
||||
fi
|
||||
|
||||
elif [ $testpartitioncount -gt 0 ]; then
|
||||
# if a partition was found - make sure to skip the OS and boot partitions
|
||||
# echo "# testpartitioncount > 0"
|
||||
if [ "${testpartition}" != "${OSPartition}" ] && [ "${testpartition}" != "${bootPartition}" ]; then
|
||||
# make sure to use the biggest
|
||||
if [ ${testsize} -gt ${sizeDataPartition} ]; then
|
||||
@ -170,19 +180,34 @@ if [ "$1" = "status" ]; then
|
||||
hdd="${testdevice}"
|
||||
fi
|
||||
fi
|
||||
|
||||
else
|
||||
# default hdd set, when there is no OSpartition and there might be no partitions at all
|
||||
if [ "${OSPartition}" = "root" ] && [ "${hdd}" = "" ] && [ "${testdevice}" != "" ]; then
|
||||
# echo "# else"
|
||||
# echo "# testsize(${testsize})"
|
||||
# echo "# sizeDataPartition(${sizeDataPartition})"
|
||||
|
||||
if [ "${OSPartition}" = "mmcblk0p2" ] && [ "${hdd}" = "" ] && [ "${testdevice}" != "" ]; then
|
||||
# echo "# OSPartition = mmcblk0p2"
|
||||
hdd="${testdevice}"
|
||||
fi
|
||||
# make sure to use the biggest
|
||||
|
||||
# make sure to use the biggest
|
||||
if [ ${testsize} -gt ${sizeDataPartition} ]; then
|
||||
# Partition to be created is smaller than disk so this is not correct (but close)
|
||||
# Partition to be created is smaller than disk so this is not correct (but close)
|
||||
# echo "# testsize > sizeDataPartition"
|
||||
sizeDataPartition=$(fdisk -l /dev/$testdevice | grep GiB | cut -d " " -f 5)
|
||||
hddDataPartition="${testdevice}1"
|
||||
hdd="${testdevice}"
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# echo "# testpartitioncount($testpartitioncount)"
|
||||
# echo "# OSPartition(${OSPartition})"
|
||||
# echo "# bootPartition(${bootPartition})"
|
||||
# echo "# hdd(${hdd})"
|
||||
|
||||
done < .lsblk.tmp
|
||||
rm -f .lsblk.tmp 1>/dev/null 2>/dev/null
|
||||
|
||||
@ -193,16 +218,17 @@ if [ "$1" = "status" ]; then
|
||||
fi
|
||||
|
||||
# try to detect if its an SSD
|
||||
isSMART=$(sudo smartctl -a /dev/${hdd} | grep -c "Rotation Rate:")
|
||||
isSMART=$(smartctl -a /dev/${hdd} | grep -c "Serial Number:")
|
||||
echo "isSMART=${isSMART}"
|
||||
if [ ${isSMART} -gt 0 ]; then
|
||||
#detect using smartmontools (preferred)
|
||||
isSSD=$(sudo smartctl -a /dev/${hdd} | grep 'Rotation Rate:' | grep -c "Solid State")
|
||||
else
|
||||
#detect using using fall back method
|
||||
isSSD=$(cat /sys/block/${hdd}/queue/rotational 2>/dev/null | grep -c 0)
|
||||
fi
|
||||
isSSD=1
|
||||
isRotational=$(echo "${smartCtlA}" | grep -c "Rotation Rate:")
|
||||
if [ ${isRotational} -gt 0 ]; then
|
||||
isSSD=$(echo "${smartCtlA}" | grep "Rotation Rate:" | grep -c "Solid State Device")
|
||||
fi
|
||||
echo "isSSD=${isSSD}"
|
||||
hddTemp=""
|
||||
echo "hddTemperature="
|
||||
echo "hddTemperatureStr='?°C'"
|
||||
|
||||
# display results from hdd & partition detection
|
||||
echo "hddCandidate='${hdd}'"
|
||||
@ -277,7 +303,7 @@ if [ "$1" = "status" ]; then
|
||||
cp -a /mnt/hdd${subVolumeDir}/raspiblitz.conf /var/cache/raspiblitz/hdd-inspect/raspiblitz.conf
|
||||
|
||||
# make copy of WIFI config to RAMDISK (if available)
|
||||
cp -a /mnt/hdd${subVolumeDir}/app-data/wpa_supplicant.conf /var/cache/raspiblitz/hdd-inspect/wpa_supplicant.conf 2>/dev/null
|
||||
cp -a /mnt/hdd${subVolumeDir}/app-data/wifi /var/cache/raspiblitz/hdd-inspect/ 2>/dev/null
|
||||
|
||||
# Convert old ssh backup data structure (if needed)
|
||||
oldDataExists=$(sudo ls /mnt/hdd${subVolumeDir}/ssh/ssh_host_rsa_key 2>/dev/null | grep -c "ssh_host_rsa_key")
|
||||
@ -432,15 +458,16 @@ if [ "$1" = "status" ]; then
|
||||
fi
|
||||
echo "hddRaspiVersion='${hddRaspiVersion}'"
|
||||
|
||||
smartCtlA=$(smartctl -a /dev/${hdd} | tr -d '"')
|
||||
|
||||
# try to detect if its an SSD
|
||||
isSMART=$(sudo smartctl -a /dev/${hdd} | grep -c "Rotation Rate:")
|
||||
isSMART=$(echo "${smartCtlA}" | grep -c "Serial Number:")
|
||||
echo "isSMART=${isSMART}"
|
||||
if [ ${isSMART} -gt 0 ]; then
|
||||
#detect using smartmontools (preferred)
|
||||
isSSD=$(sudo smartctl -a /dev/${hdd} | grep 'Rotation Rate:' | grep -c "Solid State")
|
||||
else
|
||||
#detect using using fall back method
|
||||
isSSD=$(cat /sys/block/${hdd}/queue/rotational 2>/dev/null | grep -c 0)
|
||||
|
||||
isSSD=1
|
||||
isRotational=$(echo "${smartCtlA}" | grep -c "Rotation Rate:")
|
||||
if [ ${isRotational} -gt 0 ]; then
|
||||
isSSD=$(echo "${smartCtlA}" | grep "Rotation Rate:" | grep -c "Solid State Device")
|
||||
fi
|
||||
echo "isSSD=${isSSD}"
|
||||
|
||||
@ -449,6 +476,13 @@ if [ "$1" = "status" ]; then
|
||||
echo "hddCandidate='${hdd}'"
|
||||
echo "hddPartitionCandidate='${hddDataPartition}'"
|
||||
|
||||
# check temp if possible
|
||||
hddTemp=$(echo "${smartCtlA}" | grep "^Temperature" | head -n 1 | grep -o '[0-9]\+')
|
||||
if [ hddTemp = "" ]; then
|
||||
hddTemp=$(echo "${smartCtlA}" | grep "^194" | tr -s ' ' | cut -d" " -f 10 | grep -o '[0-9]\+')
|
||||
fi
|
||||
echo "hddTemperature=${hddTemp}"
|
||||
|
||||
# check if blockchain data is available
|
||||
hddBlocksBitcoin=$(ls /mnt/hdd/bitcoin/blocks/blk00000.dat 2>/dev/null | grep -c '.dat')
|
||||
echo "hddBlocksBitcoin=${hddBlocksBitcoin}"
|
||||
@ -466,6 +500,7 @@ if [ "$1" = "status" ]; then
|
||||
sizeDataPartition=$(lsblk -o NAME,SIZE -b | grep "${hddDataPartition}" | awk '$1=$1' | cut -d " " -f 2)
|
||||
hddGigaBytes=$(echo "scale=0; ${sizeDataPartition}/1024/1024/1024" | bc -l)
|
||||
fi
|
||||
hddBytes=${sizeDataPartition}
|
||||
echo "hddBytes=${sizeDataPartition}"
|
||||
echo "hddGigaBytes=${hddGigaBytes}"
|
||||
|
||||
@ -482,21 +517,36 @@ if [ "$1" = "status" ]; then
|
||||
datadrive=$(df -h | grep "/dev/${hdd}${nvp}1" | sed -e's/ */ /g' | cut -d" " -f 5)
|
||||
storageDrive=$(df -h | grep "/dev/${hdd}${nvp}2" | sed -e's/ */ /g' | cut -d" " -f 5)
|
||||
hdd_data_free1Kblocks=$(df -h -k /dev/${hdd}${nvp}1 | grep "/dev/${hdd}${nvp}1" | sed -e's/ */ /g' | cut -d" " -f 4 | tr -dc '0-9')
|
||||
hddUsedInfo="${datadrive} & ${storageDrive}"
|
||||
hddUsedInfo="${datadrive} ${storageDrive}"
|
||||
elif [ "${isZFS}" -gt 0 ]; then
|
||||
# ZFS calculations
|
||||
hdd_used_space=$(($(zpool list -pH | awk '{print $3}')/1024/1024/1024))
|
||||
hdd_used_ratio=$((100 * hdd_used_space / hddGigaBytes))
|
||||
hdd_data_free1Kblocks=$(($(zpool list -pH | awk '{print $4}') / 1024))
|
||||
hddUsedInfo="${hdd_used_space} (${hdd_used_ratio}%)"
|
||||
hddUsedInfo="${hdd_used_ratio}%"
|
||||
else
|
||||
# EXT4 calculations
|
||||
hdd_used_space=$(df -h | grep "/dev/${hddDataPartitionExt4}" | sed -e's/ */ /g' | cut -d" " -f 3 2>/dev/null)
|
||||
hdd_used_ratio=$(df -h | grep "/dev/${hddDataPartitionExt4}" | sed -e's/ */ /g' | cut -d" " -f 5 | tr -dc '0-9' 2>/dev/null)
|
||||
hdd_data_free1Kblocks=$(df -h -k /dev/${hddDataPartitionExt4} | grep "/dev/${hddDataPartitionExt4}" | sed -e's/ */ /g' | cut -d" " -f 4 | tr -dc '0-9')
|
||||
hddUsedInfo="${hdd_used_space} (${hdd_used_ratio}%)"
|
||||
hddUsedInfo="${hdd_used_ratio}%"
|
||||
fi
|
||||
echo "hddUsedInfo='${hddUsedInfo}'"
|
||||
|
||||
hddTBSize="<1TB"
|
||||
if [ ${hddBytes} -gt 800000000000 ]; then
|
||||
hddTBSize="1TB"
|
||||
fi
|
||||
if [ ${hddBytes} -gt 1800000000000 ]; then
|
||||
hddTBSize="2TB"
|
||||
fi
|
||||
if [ ${hddBytes} -gt 2300000000000 ]; then
|
||||
hddTBSize=">2TB"
|
||||
fi
|
||||
if [ "${hddTemp}" != "" ]; then
|
||||
hddUsedInfo="${hdd_used_ratio}% ${hddTemp}°C"
|
||||
fi
|
||||
echo "hddTBSize='${hddTBSize}'"
|
||||
echo "hddUsedInfo='${hddTBSize} ${hddUsedInfo}'"
|
||||
hddDataFreeBytes=$((${hdd_data_free1Kblocks} * 1024))
|
||||
hddDataFreeGB=$((${hdd_data_free1Kblocks} / (1024 * 1024)))
|
||||
echo "hddDataFreeBytes=${hddDataFreeBytes}"
|
||||
@ -520,7 +570,7 @@ if [ "$1" = "status" ]; then
|
||||
hddAdapterUSAP=0
|
||||
|
||||
# check if force UASP flag is set on sd card
|
||||
if [ -f "/boot/uasp.force" ]; then
|
||||
if [ -f "${raspi_bootdir}/uasp.force" ]; then
|
||||
hddAdapterUSAP=1
|
||||
fi
|
||||
# or UASP is set by config file
|
||||
@ -695,10 +745,13 @@ if [ "$1" = "format" ]; then
|
||||
if [ $wipePartitions -eq 1 ]; then
|
||||
# wipe all partitions and write fresh GPT
|
||||
>&2 echo "# Wiping all partitions (sfdisk/wipefs)"
|
||||
>&2 echo "# sfdisk"
|
||||
sfdisk --delete /dev/${hdd}
|
||||
sleep 4
|
||||
>&2 echo "# wipefs"
|
||||
wipefs -a /dev/${hdd}
|
||||
sleep 4
|
||||
>&2 echo "# lsblk"
|
||||
partitions=$(lsblk | grep -c "─${hdd}")
|
||||
if [ ${partitions} -gt 0 ]; then
|
||||
>&2 echo "# WARNING: partitions are still not clean - try Quick & Dirty"
|
||||
@ -710,6 +763,7 @@ if [ "$1" = "format" ]; then
|
||||
echo "error='partition cleaning failed'"
|
||||
exit 1
|
||||
fi
|
||||
>&2 echo "# parted"
|
||||
parted -s /dev/${hdd} mklabel gpt 1>/dev/null 1>&2
|
||||
sleep 2
|
||||
sync
|
||||
@ -726,9 +780,10 @@ if [ "$1" = "format" ]; then
|
||||
mkdir -p /tmp/ext4 1>/dev/null
|
||||
if [ $ext4IsPartition -eq 0 ]; then
|
||||
# write new EXT4 partition
|
||||
>&2 echo "# Creating the one big partition"
|
||||
parted -s /dev/${hdd} mkpart primary ext4 1024KiB 100% 1>&2
|
||||
>&2 echo "# Creating the one big partition - hdd(${hdd})"
|
||||
parted -s /dev/${hdd} mkpart primary ext4 0% 100% 1>&2
|
||||
sleep 6
|
||||
>&2 echo "# sync"
|
||||
sync
|
||||
# loop until the partition gets available
|
||||
loopdone=0
|
||||
@ -1835,18 +1890,18 @@ if [ "$1" = "uasp-fix" ]; then
|
||||
|
||||
# check if UASP is already deactivated (on RaspiOS)
|
||||
# https://www.pragmaticlinux.com/2021/03/fix-for-getting-your-ssd-working-via-usb-3-on-your-raspberry-pi/
|
||||
cmdlineExists=$(ls /boot/cmdline.txt 2>/dev/null | grep -c "cmdline.txt")
|
||||
cmdlineExists=$(ls ${raspi_bootdir}/cmdline.txt 2>/dev/null | grep -c "cmdline.txt")
|
||||
if [ ${cmdlineExists} -eq 1 ] && [ ${#hddAdapterUSB} -gt 0 ] && [ ${hddAdapterUSAP} -eq 0 ]; then
|
||||
echo "# Checking for UASP deactivation ..."
|
||||
usbQuirkActive=$(cat /boot/cmdline.txt | grep -c "usb-storage.quirks=")
|
||||
usbQuirkDone=$(cat /boot/cmdline.txt | grep -c "usb-storage.quirks=${hddAdapterUSB}:u")
|
||||
usbQuirkActive=$(cat ${raspi_bootdir}/cmdline.txt | grep -c "usb-storage.quirks=")
|
||||
usbQuirkDone=$(cat ${raspi_bootdir}/cmdline.txt | grep -c "usb-storage.quirks=${hddAdapterUSB}:u")
|
||||
if [ ${usbQuirkActive} -gt 0 ] && [ ${usbQuirkDone} -eq 0 ]; then
|
||||
# remove old usb-storage.quirks
|
||||
sed -i "s/usb-storage.quirks=[^ ]* //g" /boot/cmdline.txt
|
||||
sed -i "s/usb-storage.quirks=[^ ]* //g" ${raspi_bootdir}/cmdline.txt
|
||||
fi
|
||||
if [ ${usbQuirkDone} -eq 0 ]; then
|
||||
# add new usb-storage.quirks
|
||||
sed -i "s/^/usb-storage.quirks=${hddAdapterUSB}:u /" /boot/cmdline.txt
|
||||
sed -i "s/^/usb-storage.quirks=${hddAdapterUSB}:u /" ${raspi_bootdir}/cmdline.txt
|
||||
# go into reboot to activate new setting
|
||||
echo "# DONE deactivating UASP for ${hddAdapterUSB} ... reboot needed"
|
||||
echo "neededReboot=1"
|
||||
|
@ -48,6 +48,9 @@ if [ "$1" == "redact" ]; then
|
||||
sed -i 's/usr=[a-zA-Z0-9]\+/usr=***/' ${redactFile}
|
||||
sed -i 's/user [a-zA-Z0-9]\+/user ***/' ${redactFile}
|
||||
|
||||
# redact i2p #4507
|
||||
sed -i 's/[[:alnum:]]*.b32.i2p/***.b32.i2p/' ${redactFile}
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@ -308,6 +311,8 @@ if [ "${ElectRS}" == "on" ]; then
|
||||
echo
|
||||
echo "*** ElectRS Status ***"
|
||||
sudo /home/admin/config.scripts/bonus.electrs.sh status
|
||||
echo "*** ElectRS Status-Sync ***"
|
||||
sudo /home/admin/config.scripts/bonus.electrs.sh status-sync
|
||||
echo
|
||||
else
|
||||
echo "- Electrum Rust Server is OFF by config"
|
||||
@ -444,7 +449,9 @@ sudo du -sh /var/log
|
||||
|
||||
echo
|
||||
echo "*** DATADRIVE ***"
|
||||
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh status)
|
||||
sudo /home/admin/config.scripts/blitz.datadrive.sh status
|
||||
sudo smartctl -a /dev/${datadisk}
|
||||
echo
|
||||
|
||||
echo "*** NETWORK ***"
|
||||
@ -457,6 +464,7 @@ sudo /home/admin/config.scripts/blitz.zram.sh status
|
||||
echo
|
||||
|
||||
echo "*** HARDWARE TEST RESULTS ***"
|
||||
sudo vcgencmd get_throttled 2>/dev/null
|
||||
source <(/home/admin/_cache.sh get system_count_undervoltage)
|
||||
showImproveInfo=0
|
||||
if [ ${#system_count_undervoltage} -gt 0 ]; then
|
||||
|
@ -19,6 +19,7 @@ fi
|
||||
|
||||
# 1. Parameter: lcd command
|
||||
command=$1
|
||||
echo "### blitz.display.sh $command"
|
||||
|
||||
# its OK if its not exist yet
|
||||
source /home/admin/raspiblitz.info
|
||||
@ -29,6 +30,16 @@ source /mnt/hdd/raspiblitz.conf 2>/dev/null
|
||||
# but basically this just says if the driver for GPIO LCD is installed - not if connected
|
||||
fb1Exists=$(ls /dev/fb1 2>/dev/null | grep -c "/dev/fb1")
|
||||
|
||||
# determine correct raspberrypi config files
|
||||
raspi_configfile="/boot/config.txt"
|
||||
raspi_commandfile="/boot/cmdline.txt"
|
||||
if [ -d /boot/firmware ];then
|
||||
raspi_configfile="/boot/firmware/config.txt"
|
||||
raspi_commandfile="/boot/firmware/cmdline.txt"
|
||||
fi
|
||||
echo "# raspi_configfile(${raspi_configfile})"
|
||||
echo "# raspi_commandfile(${raspi_commandfile})"
|
||||
|
||||
###################
|
||||
# QR CODE KONSOLE
|
||||
# fallback if no LCD is available
|
||||
@ -137,7 +148,7 @@ if [ "${command}" == "rotate" ]; then
|
||||
|
||||
# change rotation config
|
||||
echo "# Turn ON: LCD ROTATE"
|
||||
sed -i "s/^dtoverlay=.*/dtoverlay=waveshare35a:rotate=90/g" /boot/config.txt
|
||||
sed -i "s/^dtoverlay=.*/dtoverlay=waveshare35a:rotate=90/g" ${raspi_configfile}
|
||||
rm /etc/X11/xorg.conf.d/40-libinput.conf 2>/dev/null
|
||||
|
||||
/home/admin/config.scripts/blitz.conf.sh set lcdrotate 1 1>/dev/null 2>/dev/null
|
||||
@ -148,7 +159,7 @@ if [ "${command}" == "rotate" ]; then
|
||||
|
||||
# change rotation config
|
||||
echo "#Turn OFF: LCD ROTATE"
|
||||
sed -i "s/^dtoverlay=.*/dtoverlay=waveshare35a:rotate=270/g" /boot/config.txt
|
||||
sed -i "s/^dtoverlay=.*/dtoverlay=waveshare35a:rotate=270/g" ${raspi_configfile}
|
||||
|
||||
# if touchscreen is on
|
||||
if [ "${touchscreen}" = "1" ]; then
|
||||
@ -219,14 +230,14 @@ function prepareinstall() {
|
||||
|
||||
function install_hdmi() {
|
||||
echo "# hdmi install ... set framebuffer width/height"
|
||||
#sed -i "s/^#framebuffer_width=.*/framebuffer_width=480/g" /boot/config.txt
|
||||
#sed -i "s/^#framebuffer_height=.*/framebuffer_height=320/g" /boot/config.txt
|
||||
#sed -i "s/^#framebuffer_width=.*/framebuffer_width=480/g" ${raspi_configfile}
|
||||
#sed -i "s/^#framebuffer_height=.*/framebuffer_height=320/g" ${raspi_configfile}
|
||||
}
|
||||
|
||||
function uninstall_hdmi() {
|
||||
echo "# hdmi uninstall ... reset framebuffer width/height"
|
||||
#sed -i "s/^framebuffer_width=.*/#framebuffer_width=480/g" /boot/config.txt
|
||||
#sed -i "s/^framebuffer_height=.*/#framebuffer_height=320/g" /boot/config.txt
|
||||
#sed -i "s/^framebuffer_width=.*/#framebuffer_width=480/g" ${raspi_configfile}
|
||||
#sed -i "s/^framebuffer_height=.*/#framebuffer_height=320/g" ${raspi_configfile}
|
||||
}
|
||||
|
||||
function install_lcd() {
|
||||
@ -249,48 +260,47 @@ function install_lcd() {
|
||||
cd /home/admin/wavesharelcd-64bit-rpi
|
||||
sudo -u admin git checkout master
|
||||
sudo -u admin git reset --hard 5a206a7 || exit 1
|
||||
sudo -u admin /home/admin/config.scripts/blitz.git-verify.sh \
|
||||
'GitHub' 'https://github.com/web-flow.gpg' '4AEE18F83AFDEB23' || exit 1
|
||||
|
||||
sudo -u admin /home/admin/config.scripts/blitz.git-verify.sh 'GitHub' 'https://github.com/web-flow.gpg' '(4AEE18F83AFDEB23|B5690EEEBB952194)' || exit 1
|
||||
|
||||
# customized from https://github.com/tux1c/wavesharelcd-64bit-rpi/blob/master/install.sh
|
||||
# prepare X11
|
||||
rm -rf /etc/X11/xorg.conf.d/40-libinput.conf
|
||||
mkdir -p /etc/X11/xorg.conf.d
|
||||
mv /etc/X11/xorg.conf.d/40-libinput.conf /home/admin/wavesharelcd-64bit-rpi/40-libinput.conf 2>/dev/null
|
||||
cp -rf ./99-calibration.conf /etc/X11/xorg.conf.d/99-calibration.conf
|
||||
# sudo cp -rf ./99-fbturbo.conf /etc/X11/xorg.conf.d/99-fbturbo.conf # there is no such file
|
||||
cp -rf ./99-calibration.conf /etc/X11/xorg.conf.d/99-calibration.conf
|
||||
cp -rf ./99-fbturbo.conf /etc/X11/xorg.conf.d/99-fbturbo.conf
|
||||
|
||||
# add waveshare mod
|
||||
cp ./waveshare35a.dtbo /boot/overlays/
|
||||
|
||||
# modify /boot/config.txt
|
||||
sed -i "s/^hdmi_force_hotplug=.*//g" /boot/config.txt
|
||||
sed -i '/^hdmi_group=/d' /boot/config.txt 2>/dev/null
|
||||
sed -i "/^hdmi_mode=/d" /boot/config.txt 2>/dev/null
|
||||
# modify config file
|
||||
sed -i "s/^hdmi_force_hotplug=.*//g" ${raspi_configfile}
|
||||
sed -i '/^hdmi_group=/d' ${raspi_configfile} 2>/dev/null
|
||||
sed -i "/^hdmi_mode=/d" ${raspi_configfile} 2>/dev/null
|
||||
|
||||
#sed -i "s/^#framebuffer_width=.*/framebuffer_width=480/g" /boot/config.txt
|
||||
#sed -i "s/^#framebuffer_height=.*/framebuffer_height=320/g" /boot/config.txt
|
||||
#echo "hdmi_force_hotplug=1" >> /boot/config.txt
|
||||
sed -i "s/^dtparam=i2c_arm=.*//g" /boot/config.txt
|
||||
# echo "dtparam=i2c_arm=on" >> /boot/config.txt --> this is to be called I2C errors - see: https://github.com/rootzoll/raspiblitz/issues/1058#issuecomment-739517713
|
||||
#sed -i "s/^#framebuffer_width=.*/framebuffer_width=480/g" ${raspi_configfile}
|
||||
#sed -i "s/^#framebuffer_height=.*/framebuffer_height=320/g" ${raspi_configfile}
|
||||
#echo "hdmi_force_hotplug=1" >> ${raspi_configfile}
|
||||
sed -i "s/^dtparam=i2c_arm=.*//g" ${raspi_configfile}
|
||||
# echo "dtparam=i2c_arm=on" >> ${raspi_configfile} --> this is to be called I2C errors - see: https://github.com/rootzoll/raspiblitz/issues/1058#issuecomment-739517713
|
||||
# don't enable SPI and UART ports by default
|
||||
# echo "dtparam=spi=on" >> /boot/config.txt
|
||||
# echo "enable_uart=1" >> /boot/config.txt
|
||||
sed -i "s/^dtoverlay=.*//g" /boot/config.txt
|
||||
echo "dtoverlay=waveshare35a:rotate=90" >> /boot/config.txt
|
||||
# echo "dtparam=spi=on" >> ${raspi_configfile}
|
||||
# echo "enable_uart=1" >> ${raspi_configfile}
|
||||
sed -i "s/^dtoverlay=.*//g" ${raspi_configfile}
|
||||
echo "dtoverlay=waveshare35a:rotate=90" >> ${raspi_configfile}
|
||||
|
||||
# modify cmdline.txt
|
||||
modification="dwc_otg.lpm_enable=0 quiet fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo"
|
||||
containsModification=$(grep -c "${modification}" /boot/cmdline.txt)
|
||||
containsModification=$(grep -c "${modification}" ${raspi_commandfile})
|
||||
if [ ${containsModification} -eq 0 ]; then
|
||||
echo "# adding modification to /boot/cmdline.txt"
|
||||
cmdlineContent=$(cat /boot/cmdline.txt)
|
||||
echo "${cmdlineContent} ${modification}" > /boot/cmdline.txt
|
||||
echo "# adding modification to ${raspi_commandfile}"
|
||||
cmdlineContent=$(cat ${raspi_commandfile})
|
||||
echo "${cmdlineContent} ${modification}" > ${raspi_commandfile}
|
||||
else
|
||||
echo "# /boot/cmdline.txt already contains modification"
|
||||
echo "# ${raspi_commandfile} already contains modification"
|
||||
fi
|
||||
containsModification=$(grep -c "${modification}" /boot/cmdline.txt)
|
||||
containsModification=$(grep -c "${modification}" ${raspi_commandfile})
|
||||
if [ ${containsModification} -eq 0 ]; then
|
||||
echo "# FAIL: was not able to modify /boot/cmdline.txt"
|
||||
echo "# FAIL: was not able to modify ${raspi_commandfile}"
|
||||
echo "err='ended unclear state'"
|
||||
exit 1
|
||||
fi
|
||||
@ -328,19 +338,19 @@ function uninstall_lcd() {
|
||||
apt-get install -y xinput-calibrator
|
||||
|
||||
# remove modifications of config.txt
|
||||
sed -i '/^hdmi_force_hotplug=/d' /boot/config.txt 2>/dev/null
|
||||
sed -i '/^hdmi_group=/d' /boot/config.txt 2>/dev/null
|
||||
sed -i "/^hdmi_mode=/d" /boot/config.txt 2>/dev/null
|
||||
sed -i "s/^dtoverlay=.*//g" /boot/config.txt 2>/dev/null
|
||||
#sed -i "s/^framebuffer_width=.*/#framebuffer_width=480/g" /boot/config.txt
|
||||
#sed -i "s/^framebuffer_height=.*/#framebuffer_height=320/g" /boot/config.txt
|
||||
echo "hdmi_group=1" >> /boot/config.txt
|
||||
echo "hdmi_mode=3" >> /boot/config.txt
|
||||
echo "dtoverlay=pi3-disable-bt" >> /boot/config.txt
|
||||
echo "dtoverlay=disable-bt" >> /boot/config.txt
|
||||
sed -i '/^hdmi_force_hotplug=/d' ${raspi_configfile} 2>/dev/null
|
||||
sed -i '/^hdmi_group=/d' ${raspi_configfile} 2>/dev/null
|
||||
sed -i "/^hdmi_mode=/d" ${raspi_configfile} 2>/dev/null
|
||||
sed -i "s/^dtoverlay=.*//g" ${raspi_configfile} 2>/dev/null
|
||||
#sed -i "s/^framebuffer_width=.*/#framebuffer_width=480/g" ${raspi_configfile}
|
||||
#sed -i "s/^framebuffer_height=.*/#framebuffer_height=320/g" ${raspi_configfile}
|
||||
echo "hdmi_group=1" >> ${raspi_configfile}
|
||||
echo "hdmi_mode=3" >> ${raspi_configfile}
|
||||
echo "dtoverlay=pi3-disable-bt" >> ${raspi_configfile}
|
||||
echo "dtoverlay=disable-bt" >> ${raspi_configfile}
|
||||
|
||||
# remove modification of cmdline.txt
|
||||
sed -i "s/ dwc_otg.lpm_enable=0 quiet fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo//g" /boot/cmdline.txt
|
||||
sed -i "s/ dwc_otg.lpm_enable=0 quiet fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo//g" ${raspi_commandfile}
|
||||
|
||||
# un-prepare X11
|
||||
mv /home/admin/wavesharelcd-64bit-rpi/40-libinput.conf /etc/X11/xorg.conf.d/40-libinput.conf 2>/dev/null
|
||||
|
@ -1,152 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# NOTE: Like the nodeJS frame work docker can be used to run additional apps
|
||||
# the goal is that you can run a basic RaspiBlitz install without Docker
|
||||
# but if you want to run certain special apps they can switch Docker on
|
||||
|
||||
# command info
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
echo "config script to install Docker"
|
||||
echo "blitz.docker.sh [on|off]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source /mnt/hdd/raspiblitz.conf
|
||||
|
||||
# switch on
|
||||
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||
|
||||
echo
|
||||
echo "### 1) INSTALL Docker ###"
|
||||
|
||||
# check if Docker is installed
|
||||
if docker -v 2>/dev/null ; then
|
||||
echo "# Docker is already installed"
|
||||
docker -v
|
||||
docker compose version
|
||||
exit 0
|
||||
fi
|
||||
|
||||
## run easy install script provided by Docker
|
||||
## its a copy from https://get.docker.com
|
||||
#sudo chmod +x /home/admin/assets/get-docker.sh
|
||||
#sudo /home/admin/assets/get-docker.sh
|
||||
|
||||
# https://github.com/rootzoll/raspiblitz/issues/2074#issuecomment-819435910
|
||||
# dependencies
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg \
|
||||
lsb-release
|
||||
|
||||
# add the docker repo
|
||||
if ! gpg /usr/share/keyrings/docker-archive-keyring.gpg 2>/dev/null; then
|
||||
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
fi
|
||||
echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
|
||||
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
|
||||
sudo apt-get update
|
||||
|
||||
# install docker
|
||||
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
|
||||
|
||||
# add the default user to the docker group
|
||||
# https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user
|
||||
sudo usermod -aG docker admin
|
||||
|
||||
echo
|
||||
echo "### 2) INSTALL docker compose ###"
|
||||
|
||||
# add docker compose
|
||||
# sudo pip3 install docker-compose
|
||||
# add bash completion https://docs.docker.com/compose/completion/
|
||||
# sudo curl \
|
||||
# -L https://raw.githubusercontent.com/docker/compose/1.29.0/contrib/completion/bash/docker-compose \
|
||||
# -o /etc/bash_completion.d/docker-compose
|
||||
|
||||
# https://docs.docker.com/compose/cli-command/#install-on-linux
|
||||
DockerComposeVersion=2.14.2
|
||||
# DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
|
||||
# mkdir -p $DOCKER_CONFIG/cli-plugins
|
||||
sudo mkdir -p /usr/local/lib/docker/cli-plugins
|
||||
sudo curl -SL "https://github.com/docker/compose/releases/download/v${DockerComposeVersion}/docker-compose-linux-$(uname -m)" \
|
||||
-o /usr/local/lib/docker/cli-plugins/docker-compose
|
||||
sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
|
||||
|
||||
# switch docker-compose to docker compose
|
||||
# curl -fL https://raw.githubusercontent.com/docker/compose-switch/master/install_on_linux.sh | sudo sh
|
||||
COMPOSE_SWITCH_VERSION="v1.0.5"
|
||||
COMPOSE_SWITCH_URL="https://github.com/docker/compose-switch/releases/download/${COMPOSE_SWITCH_VERSION}/docker-compose-linux-$(dpkg --print-architecture)"
|
||||
if ! docker compose version 2>&1 >/dev/null; then
|
||||
echo "Docker Compose V2 is not installed"
|
||||
exit 1
|
||||
fi
|
||||
sudo curl -fL $COMPOSE_SWITCH_URL -o /usr/local/bin/compose-switch
|
||||
sudo chmod +x /usr/local/bin/compose-switch
|
||||
COMPOSE=$(command -v docker-compose)
|
||||
if [ "$COMPOSE" = /usr/local/bin/docker-compose ]; then
|
||||
# This is a manual installation of docker-compose
|
||||
# so, safe for us to rename binary
|
||||
sudo mv /usr/local/bin/docker-compose /usr/local/bin/docker-compose-v1
|
||||
COMPOSE=/usr/local/bin/docker-compose-v1
|
||||
fi
|
||||
ALTERNATIVES="update-alternatives"
|
||||
if ! command -v $ALTERNATIVES; then
|
||||
ALTERNATIVES=alternatives
|
||||
fi
|
||||
echo "Configuring docker-compose alternatives"
|
||||
if [ -n "$COMPOSE" ]; then
|
||||
sudo $ALTERNATIVES --install /usr/local/bin/docker-compose docker-compose $COMPOSE 1
|
||||
fi
|
||||
sudo $ALTERNATIVES --install /usr/local/bin/docker-compose docker-compose /usr/local/bin/compose-switch 99
|
||||
echo "'docker-compose' is now set to run Compose V2"
|
||||
echo "use '$ALTERNATIVES --config docker-compose' if you want to switch back to Compose V1"
|
||||
|
||||
echo
|
||||
echo "### 3) Symlink the working directory to the SSD"
|
||||
sudo systemctl stop docker
|
||||
sudo systemctl stop docker.socket
|
||||
|
||||
# keep the docker dir on the OS drive if the disk is ZFS - needs special config
|
||||
isZFS=$(zfs list 2>/dev/null | grep -c "/mnt/hdd")
|
||||
if [ "${isZFS}" -eq 0 ]; then
|
||||
sudo mv -f /var/lib/docker /mnt/hdd/
|
||||
sudo ln -s /mnt/hdd/docker /var/lib/docker
|
||||
# move to a different partition or configure docker with ZFS
|
||||
# https://docs.docker.com/storage/storagedriver/zfs-driver/#configure-docker-with-the-zfs-storage-driver
|
||||
#else
|
||||
# sudo mv -f /var/lib/docker /home/admin/
|
||||
# sudo ln -s /home/admin/docker /var/lib/docker
|
||||
fi
|
||||
sudo systemctl start docker
|
||||
sudo systemctl start docker.socket
|
||||
|
||||
# setting value in raspi blitz config
|
||||
/home/admin/config.scripts/blitz.conf.sh set docker "on"
|
||||
echo "# Docker install done"
|
||||
docker -v
|
||||
docker compose version
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# switch off
|
||||
if [ "$1" = "0" ] || [ "$1" = "off" ]; then
|
||||
# setting value in raspiblitz config
|
||||
/home/admin/config.scripts/blitz.conf.sh set docker "off"
|
||||
echo "*** REMOVING Docker & docker-compose ***"
|
||||
sudo pip3 uninstall -y docker-compose
|
||||
sudo rm /usr/local/lib/docker/cli-plugins/docker-compose
|
||||
sudo rm /usr/local/bin/docker-compose-v1
|
||||
sudo rm /usr/local/bin/compose-switch
|
||||
sudo apt-get purge -y docker-ce docker-ce-cli containerd.io
|
||||
echo "# Docker remove done"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "error='wrong parameter'"
|
||||
exit 1
|
@ -60,6 +60,10 @@ if [ "${logfile}" != "" ]; then
|
||||
echo "##################" >> ${logFile}
|
||||
echo "${errorReport}" >> ${logFile}
|
||||
echo "##################" >> ${logFile}
|
||||
else
|
||||
# if no logfile given - write to default log
|
||||
echo "##################" >> /home/admin/raspiblitz.log
|
||||
echo "${errorReport}" >> /home/admin/raspiblitz.log
|
||||
fi
|
||||
|
||||
# on serial calls make sure that at least a second is between error reports
|
||||
|
@ -9,6 +9,23 @@ if [ "$EUID" -ne 0 ]
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# determine correct raspberrypi boot drive path (that easy to access when sd card is insert into laptop)
|
||||
raspi_bootdir=""
|
||||
if [ -d /boot/firmware ]; then
|
||||
raspi_bootdir="/boot/firmware"
|
||||
elif [ -d /boot ]; then
|
||||
raspi_bootdir="/boot"
|
||||
fi
|
||||
echo "# raspi_bootdir(${raspi_bootdir})"
|
||||
|
||||
# determine if this is a release candidate (use file not cache)
|
||||
codeVersion=$(cat /home/admin/_version.info | grep 'codeVersion="' | cut -d'"' -f2)
|
||||
isReleaseCandidate=0
|
||||
if [[ "$codeVersion" == *"rc"* ]]; then
|
||||
isReleaseCandidate=1
|
||||
fi
|
||||
echo "# isReleaseCandidate(${isReleaseCandidate})"
|
||||
|
||||
# make sure LCD is on (default for fatpack)
|
||||
/home/admin/config.scripts/blitz.display.sh set-display lcd
|
||||
|
||||
@ -24,7 +41,7 @@ if [ "${needsExpansion}" == "1" ]; then
|
||||
|
||||
# write a stop file to prevent full bootstrap
|
||||
# after fsexpand reboot
|
||||
touch /boot/stop
|
||||
touch ${raspi_bootdir}/stop
|
||||
|
||||
# trigger fsexpand
|
||||
/home/admin/config.scripts/blitz.bootdrive.sh fsexpand
|
||||
@ -44,7 +61,7 @@ if [ "${needsExpansion}" == "1" ]; then
|
||||
fi
|
||||
|
||||
apt_install() {
|
||||
apt install -y ${@}
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt install -y ${@}
|
||||
if [ $? -eq 100 ]; then
|
||||
echo "FAIL! apt failed to install needed packages!"
|
||||
echo ${@}
|
||||
@ -62,12 +79,13 @@ echo "# defaultAPIuser(${defaultAPIuser})"
|
||||
echo "# defaultAPIrepo(${defaultAPIrepo})"
|
||||
echo "# defaultWEBUIuser(${defaultWEBUIuser})"
|
||||
echo "# defaultWEBUIrepo(${defaultWEBUIrepo})"
|
||||
sleep 3
|
||||
|
||||
echo "* Adding nodeJS Framework ..."
|
||||
/home/admin/config.scripts/bonus.nodejs.sh on || exit 1
|
||||
|
||||
echo "* Optional Packages (may be needed for extended features)"
|
||||
apt_install qrencode secure-delete fbi msmtp unclutter xterm python3-pyqt5 xfonts-terminus apache2-utils nginx python3-jinja2 socat libatlas-base-dev hexyl autossh
|
||||
apt_install qrencode secure-delete fbi msmtp unclutter xterm python3-pyqt5 xfonts-terminus python3-jinja2 socat libatlas-base-dev hexyl
|
||||
|
||||
echo "* Adding LND ..."
|
||||
/home/admin/config.scripts/lnd.install.sh install || exit 1
|
||||
@ -82,10 +100,19 @@ sudo -u admin curl -H "Accept: application/json; indent=4" https://bitnodes.io/a
|
||||
# Fallback Nodes List from Bitcoin Core
|
||||
sudo -u admin curl https://raw.githubusercontent.com/bitcoin/bitcoin/master/contrib/seeds/nodes_main.txt -o /home/admin/fallback.bitcoin.nodes
|
||||
|
||||
echo "* Adding Raspiblitz API ..."
|
||||
sudo /home/admin/config.scripts/blitz.web.api.sh on "${defaultAPIuser}" "${defaultAPIrepo}" "blitz-${branch}" || exit 1
|
||||
echo "* Adding Raspiblitz WebUI ..."
|
||||
sudo /home/admin/config.scripts/blitz.web.ui.sh on "${defaultWEBUIuser}" "${defaultWEBUIrepo}" "release/${branch}" || exit 1
|
||||
# use dev branch when its an Release Candidate
|
||||
if [ "${isReleaseCandidate}" == "1" ]; then
|
||||
echo "# RELEASE CANDIDATE: using development branches for WebUI & API"
|
||||
echo "* Adding Raspiblitz API ..."
|
||||
sudo /home/admin/config.scripts/blitz.web.api.sh on "${defaultAPIuser}" "${defaultAPIrepo}" "dev" || exit 1
|
||||
echo "* Adding Raspiblitz WebUI ..."
|
||||
sudo /home/admin/config.scripts/blitz.web.ui.sh on "${defaultWEBUIuser}" "${defaultWEBUIrepo}" "master" || exit 1
|
||||
else
|
||||
echo "* Adding Raspiblitz API ..."
|
||||
sudo /home/admin/config.scripts/blitz.web.api.sh on "${defaultAPIuser}" "${defaultAPIrepo}" "blitz-${branch}" || exit 1
|
||||
echo "* Adding Raspiblitz WebUI ..."
|
||||
sudo /home/admin/config.scripts/blitz.web.ui.sh on "${defaultWEBUIuser}" "${defaultWEBUIrepo}" "release/${branch}" || exit 1
|
||||
fi
|
||||
|
||||
# set build code as new www default
|
||||
sudo rm -r /home/admin/assets/nginx/www_public
|
||||
@ -108,6 +135,8 @@ echo "* Adding Code&Compile for WEBUI-APP: BTC RPC EXPLORER"
|
||||
/home/admin/config.scripts/bonus.btc-rpc-explorer.sh install || exit 1
|
||||
echo "* Adding Code&Compile for WEBUI-APP: MEMPOOL"
|
||||
/home/admin/config.scripts/bonus.mempool.sh install || exit 1
|
||||
echo "* Adding Code&Compile for WEBUI-APP: ELECTRS"
|
||||
/home/admin/config.scripts/bonus.electrs.sh install || exit 1
|
||||
|
||||
# set default display to LCD
|
||||
sudo /home/admin/config.scripts/blitz.display.sh set-display lcd
|
||||
|
@ -15,7 +15,7 @@ fi
|
||||
# Example for commits created on GitHub:
|
||||
# PGPsigner="web-flow"
|
||||
# PGPpubkeyLink="https://github.com/${PGPsigner}.gpg"
|
||||
# PGPpubkeyFingerprint="4AEE18F83AFDEB23"
|
||||
# PGPpubkeyFingerprint="(4AEE18F83AFDEB23|B5690EEEBB952194)"
|
||||
|
||||
# Example for commits signed with a personal PGP key:
|
||||
# PGPsigner="janoside"
|
||||
@ -30,6 +30,10 @@ PGPsigner="$1"
|
||||
PGPpubkeyLink="$2"
|
||||
PGPpubkeyFingerprint="$3"
|
||||
|
||||
# force outputs to English
|
||||
export LANG=en_US.UTF-8
|
||||
export LC_ALL=en_US.UTF-8
|
||||
|
||||
wget -O /var/cache/raspiblitz/pgp_keys_${PGPsigner}.asc "${PGPpubkeyLink}"
|
||||
|
||||
# in the case the wget above fails, try to use curl instead
|
||||
@ -45,7 +49,7 @@ fi
|
||||
|
||||
echo "# importing key of ${PGPsigner}"
|
||||
gpg --import --import-options show-only /var/cache/raspiblitz/pgp_keys_${PGPsigner}.asc
|
||||
fingerprint=$(gpg --show-keys --keyid-format LONG /var/cache/raspiblitz/pgp_keys_${PGPsigner}.asc 2>/dev/null | grep "${PGPpubkeyFingerprint}" -c)
|
||||
fingerprint=$(gpg --show-keys --keyid-format LONG /var/cache/raspiblitz/pgp_keys_${PGPsigner}.asc 2>/dev/null | grep -Ec "${PGPpubkeyFingerprint}")
|
||||
if [ "${fingerprint}" -lt 1 ]; then
|
||||
echo
|
||||
echo "# WARNING --> the PGP fingerprint is not as expected for ${PGPsigner}" >&2
|
||||
@ -68,16 +72,14 @@ elif [ $# -eq 4 ]; then
|
||||
commitOrTag="$4 tag"
|
||||
fi
|
||||
echo "# running: ${gitCommand}"
|
||||
if ${gitCommand} 2>&1 >&"$_temp"; then
|
||||
goodSignature=1
|
||||
else
|
||||
goodSignature=0
|
||||
fi
|
||||
${gitCommand} 2>&1 >&"$_temp"
|
||||
echo
|
||||
cat "$_temp"
|
||||
echo "# goodSignature(${goodSignature})"
|
||||
echo
|
||||
|
||||
correctKey=$(tr -d " \t\n\r" <"$_temp" | grep "${PGPpubkeyFingerprint}" -c)
|
||||
goodSignature=$(grep "Good signature from" -c <"$_temp")
|
||||
echo "# goodSignature(${goodSignature})"
|
||||
correctKey=$(tr -d " \t\n\r" <"$_temp" | grep -Ec "${PGPpubkeyFingerprint}")
|
||||
echo "# correctKey(${correctKey})"
|
||||
|
||||
if [ "${correctKey}" -lt 1 ] || [ "${goodSignature}" -lt 1 ]; then
|
||||
|
@ -174,7 +174,7 @@ echo "# checkSumBlitzPyAfter = ${checkSumBlitzPyAfter}"
|
||||
if [ "${checkSumBlitzPyBefore}" = "${checkSumBlitzPyAfter}" ] && [ ${install} -eq 0 ]; then
|
||||
echo "# BlitzPy did not changed."
|
||||
else
|
||||
blitzpy_wheel=$(ls -trR /home/admin/raspiblitz/home.admin/BlitzPy/dist | grep -E "*any.whl" | tail -n 1)
|
||||
blitzpy_wheel=$(ls -trR /home/admin/raspiblitz/home.admin/BlitzPy/dist | grep -E ".*any.whl" | tail -n 1)
|
||||
blitzpy_version=$(echo ${blitzpy_wheel} | grep -oE "([0-9]\.[0-9]\.[0-9])")
|
||||
echo "# BlitzPy changed --> UPDATING to Version ${blitzpy_version}"
|
||||
sudo -H /usr/bin/python -m pip install "/home/admin/raspiblitz/home.admin/BlitzPy/dist/${blitzpy_wheel}" >/dev/null 2>&1
|
||||
|
@ -13,11 +13,31 @@ fi
|
||||
|
||||
# detect known SBCs
|
||||
board=""
|
||||
isRaspberryPi4=$(cat /proc/device-tree/model | grep -c "Raspberry Pi 4")
|
||||
|
||||
# detect RaspberryPi 3
|
||||
isRaspberryPi3=$(cat /proc/device-tree/model 2>/dev/null | grep -c "Raspberry Pi 3")
|
||||
if [ "${isRaspberryPi3}" == "1" ]; then
|
||||
board="rp3"
|
||||
fi
|
||||
|
||||
# detect RaspberryPi 4
|
||||
isRaspberryPi4=$(cat /proc/device-tree/model 2>/dev/null | grep -c "Raspberry Pi 4")
|
||||
if [ "${isRaspberryPi4}" == "1" ]; then
|
||||
board="rp4"
|
||||
fi
|
||||
|
||||
# detect RaspberryPi 5
|
||||
isRaspberryPi5=$(cat /proc/device-tree/model 2>/dev/null | grep -c "Raspberry Pi 5")
|
||||
if [ "${isRaspberryPi5}" == "1" ]; then
|
||||
board="rp5"
|
||||
fi
|
||||
|
||||
# detect VM
|
||||
isVM=$(grep -c 'hypervisor' /proc/cpuinfo)
|
||||
if [ ${isVM} -gt 0 ]; then
|
||||
board="vm"
|
||||
fi
|
||||
|
||||
# get how many RAM (in MB)
|
||||
ramMB=$(awk '/MemTotal/ {printf( "%d\n", $2 / 1024 )}' /proc/meminfo)
|
||||
|
||||
|
@ -9,7 +9,7 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
echo "blitz.i2pd.sh install -> Install i2pd"
|
||||
echo "blitz.i2pd.sh on -> Switch on i2pd"
|
||||
echo "blitz.i2pd.sh off -> Uninstall i2pd"
|
||||
echo "blitz.i2pd.sh addseednodes -> Add all I2P seed nodes from: https://github.com/bitcoin/bitcoin/blob/master/contrib/seeds/nodes_main.txt"
|
||||
echo "blitz.i2pd.sh addseednodes -> Add 21 randonly selected I2P seed nodes from: https://github.com/bitcoin/bitcoin/blob/master/contrib/seeds/nodes_main.txt"
|
||||
echo "blitz.i2pd.sh status -> I2P related logs from bitcoind, bitcoin-cli -netinfo 4 and webconsole access"
|
||||
exit 1
|
||||
fi
|
||||
@ -38,44 +38,44 @@ function add_repo {
|
||||
source /etc/os-release
|
||||
DIST=$ID
|
||||
case $ID in
|
||||
debian|ubuntu|raspbian)
|
||||
if [[ -n $DEBIAN_CODENAME ]]; then
|
||||
VERSION_CODENAME=$DEBIAN_CODENAME
|
||||
fi
|
||||
if [[ -n $UBUNTU_CODENAME ]]; then
|
||||
VERSION_CODENAME=$UBUNTU_CODENAME
|
||||
fi
|
||||
if [[ -z $VERSION_CODENAME ]]; then
|
||||
echo "Couldn't find VERSION_CODENAME in your /etc/os-release file. Did your system supported? Please report issue to me by writing to email: 'r4sas <at> i2pd.xyz'"
|
||||
exit 1
|
||||
fi
|
||||
RELEASE=$VERSION_CODENAME
|
||||
debian | ubuntu | raspbian)
|
||||
if [[ -n $DEBIAN_CODENAME ]]; then
|
||||
VERSION_CODENAME=$DEBIAN_CODENAME
|
||||
fi
|
||||
if [[ -n $UBUNTU_CODENAME ]]; then
|
||||
VERSION_CODENAME=$UBUNTU_CODENAME
|
||||
fi
|
||||
if [[ -z $VERSION_CODENAME ]]; then
|
||||
echo "Couldn't find VERSION_CODENAME in your /etc/os-release file. Did your system supported? Please report issue to me by writing to email: 'r4sas <at> i2pd.xyz'"
|
||||
exit 1
|
||||
fi
|
||||
RELEASE=$VERSION_CODENAME
|
||||
;;
|
||||
*)
|
||||
if [[ -z $ID_LIKE || "$ID_LIKE" != "debian" && "$ID_LIKE" != "ubuntu" ]]; then
|
||||
echo "Your system is not supported by this script. Currently it supports debian-like and ubuntu-like systems."
|
||||
exit 1
|
||||
else
|
||||
DIST=$ID_LIKE
|
||||
case $ID_LIKE in
|
||||
debian)
|
||||
if [[ "$ID" == "kali" ]]; then
|
||||
if [[ "$VERSION" == "2019"* || "$VERSION" == "2020"* ]]; then
|
||||
RELEASE="buster"
|
||||
elif [[ "$VERSION" == "2021"* || "$VERSION" == "2022"* ]]; then
|
||||
RELEASE="bullseye"
|
||||
fi
|
||||
else
|
||||
RELEASE=$DEBIAN_CODENAME
|
||||
fi
|
||||
;;
|
||||
ubuntu)
|
||||
RELEASE=$UBUNTU_CODENAME
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
*)
|
||||
if [[ -z $ID_LIKE || "$ID_LIKE" != "debian" && "$ID_LIKE" != "ubuntu" ]]; then
|
||||
echo "Your system is not supported by this script. Currently it supports debian-like and ubuntu-like systems."
|
||||
exit 1
|
||||
else
|
||||
DIST=$ID_LIKE
|
||||
case $ID_LIKE in
|
||||
debian)
|
||||
if [[ "$ID" == "kali" ]]; then
|
||||
if [[ "$VERSION" == "2019"* || "$VERSION" == "2020"* ]]; then
|
||||
RELEASE="buster"
|
||||
elif [[ "$VERSION" == "2021"* || "$VERSION" == "2022"* ]]; then
|
||||
RELEASE="bullseye"
|
||||
fi
|
||||
else
|
||||
RELEASE=$DEBIAN_CODENAME
|
||||
fi
|
||||
;;
|
||||
ubuntu)
|
||||
RELEASE=$UBUNTU_CODENAME
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if [[ -z $RELEASE ]]; then
|
||||
echo "Couldn't detect your system release. Please report issue to me by writing to email: 'r4sas <at> i2pd.xyz'"
|
||||
exit 1
|
||||
@ -92,7 +92,7 @@ function bitcoinI2Pstatus {
|
||||
echo "# Follow live with the command:"
|
||||
echo "sudo tail -n 1000 -f /mnt/hdd/bitcoin/debug.log | grep i2p"
|
||||
echo
|
||||
sudo cat /mnt/hdd/bitcoin/debug.log | grep i2p
|
||||
sudo cat /mnt/hdd/bitcoin/debug.log | grep i2p
|
||||
echo
|
||||
echo "# Running the command:"
|
||||
echo "bitcoin-cli -netinfo 4"
|
||||
@ -107,12 +107,11 @@ function bitcoinI2Pstatus {
|
||||
echo
|
||||
}
|
||||
|
||||
|
||||
echo "# Running: 'blitz.i2pd.sh $*'"
|
||||
source /mnt/hdd/raspiblitz.conf
|
||||
|
||||
# make sure to be present in PATH
|
||||
if ! echo "$PATH" | grep "/usr/sbin"; then
|
||||
if ! echo "$PATH" | grep "/usr/sbin" >/dev/null; then
|
||||
export PATH=$PATH:/usr/sbin
|
||||
echo "PATH=\$PATH:/usr/sbin" | sudo tee -a /etc/profile
|
||||
fi
|
||||
@ -145,21 +144,20 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||
|
||||
if systemctl is-active --quiet i2pd.service; then
|
||||
echo "# i2pd.service is already active."
|
||||
exit 0
|
||||
else
|
||||
echo "# sudo systemctl enable i2pd"
|
||||
sudo systemctl enable i2pd
|
||||
fi
|
||||
|
||||
echo "# sudo systemctl enable i2pd"
|
||||
sudo systemctl enable i2pd
|
||||
|
||||
echo "# i2pd config"
|
||||
/home/admin/config.scripts/blitz.conf.sh set debug tor /mnt/hdd/bitcoin/bitcoin.conf noquotes
|
||||
confAdd debug i2p /mnt/hdd/bitcoin/bitcoin.conf
|
||||
/home/admin/config.scripts/blitz.conf.sh set i2psam 127.0.0.1:7656 /mnt/hdd/bitcoin/bitcoin.conf noquotes
|
||||
/home/admin/config.scripts/blitz.conf.sh set i2pacceptincoming 1 /mnt/hdd/bitcoin/bitcoin.conf noquotes
|
||||
/home/admin/config.scripts/blitz.conf.sh set onlynet tor /mnt/hdd/bitcoin/bitcoin.conf noquotes
|
||||
/home/admin/config.scripts/blitz.conf.sh set onlynet onion /mnt/hdd/bitcoin/bitcoin.conf noquotes
|
||||
confAdd onlynet i2p /mnt/hdd/bitcoin/bitcoin.conf
|
||||
PASSWORD_B=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcpassword | cut -c 13-)
|
||||
cat << EOF | sudo tee /etc/i2pd/i2pd.conf
|
||||
cat <<EOF | sudo tee /etc/i2pd/i2pd.conf
|
||||
# i2pd settings for the RaspiBlitz
|
||||
# for the defaults see:
|
||||
# https://github.com/PurpleI2P/i2pd/blob/openssl/contrib/i2pd.conf
|
||||
@ -212,6 +210,7 @@ EOF
|
||||
# setting value in raspiblitz.conf
|
||||
/home/admin/config.scripts/blitz.conf.sh set i2pd "on"
|
||||
|
||||
localip=$(hostname -I | awk '{print $1}')
|
||||
echo "# Config: /etc/i2pd/i2pd.conf"
|
||||
echo "# i2pd web console: ${localip}:7070"
|
||||
echo "# Monitor i2p in bitcoind:"
|
||||
@ -223,20 +222,30 @@ fi
|
||||
|
||||
if [ "$1" = "addseednodes" ]; then
|
||||
|
||||
/home/admin/config.scripts/blitz.i2pd.sh on
|
||||
if ! sudo -u bitcoin bitcoin-cli -netinfo 4 | grep i2p; then
|
||||
/home/admin/config.scripts/blitz.i2pd.sh on
|
||||
fi
|
||||
echo "Add 21 randomly selected I2P seed nodes from: https://github.com/bitcoin/bitcoin/blob/master/contrib/seeds/nodes_main.txt"
|
||||
echo "Monitor in a new terminal with:"
|
||||
echo "watch sudo -u bitcoin bitcoin-cli -netinfo 4"
|
||||
echo "This will take some time ..."
|
||||
|
||||
echo "Add all I2P seed nodes from: https://github.com/bitcoin/bitcoin/blob/master/contrib/seeds/nodes_main.txt"
|
||||
# Fetch and filter the list of seed nodes
|
||||
i2pSeedNodeList=$(curl -sS https://raw.githubusercontent.com/bitcoin/bitcoin/master/contrib/seeds/nodes_main.txt | grep .b32.i2p:0)
|
||||
for i2pSeedNode in ${i2pSeedNodeList}; do
|
||||
bitcoin-cli addnode "$i2pSeedNode" "onetry"
|
||||
done
|
||||
|
||||
echo
|
||||
echo "# Display sudo tail -n 100 /mnt/hdd/bitcoin/debug.log | grep i2p"
|
||||
sudo tail -n 100 /mnt/hdd/bitcoin/debug.log | grep i2p
|
||||
# Shuffle the list and pick the first 21 nodes
|
||||
selectedNodes=$(echo "$i2pSeedNodeList" | shuf | head -n 21)
|
||||
|
||||
# Add each selected node
|
||||
for i2pSeedNode in ${selectedNodes}; do
|
||||
echo "# Add i2p seed node: ${i2pSeedNode} by running:"
|
||||
echo "bitcoin-cli addnode $i2pSeedNode onetry"
|
||||
sudo -u bitcoin bitcoin-cli addnode "$i2pSeedNode" "onetry"
|
||||
done
|
||||
|
||||
echo
|
||||
echo "# Display bitcoin-cli -netinfo 4"
|
||||
bitcoin-cli -netinfo 4
|
||||
sudo -u bitcoin bitcoin-cli -netinfo 4
|
||||
|
||||
exit 0
|
||||
fi
|
||||
@ -257,7 +266,7 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
|
||||
/home/admin/config.scripts/blitz.conf.sh delete i2psam /mnt/hdd/bitcoin/bitcoin.conf noquotes
|
||||
/home/admin/config.scripts/blitz.conf.sh delete i2pacceptincoming /mnt/hdd/bitcoin/bitcoin.conf noquotes
|
||||
/home/admin/config.scripts/blitz.conf.sh delete onlynet /mnt/hdd/bitcoin/bitcoin.conf noquotes
|
||||
/home/admin/config.scripts/blitz.conf.sh set onlynet tor /mnt/hdd/bitcoin/bitcoin.conf noquotes
|
||||
/home/admin/config.scripts/blitz.conf.sh set onlynet onion /mnt/hdd/bitcoin/bitcoin.conf noquotes
|
||||
|
||||
sudo rm /etc/systemd/system/i2pd.service
|
||||
|
||||
|
@ -510,7 +510,7 @@ if [ "$1" = "export-gui" ]; then
|
||||
read key
|
||||
echo "Shutting down ...."
|
||||
sleep 4
|
||||
/home/admin/config.scripts/blitz.shutdown.sh
|
||||
sudo /home/admin/config.scripts/blitz.shutdown.sh
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
@ -338,27 +338,31 @@ elif [ "${abcd}" = "b" ]; then
|
||||
sed -i "s/^rpcpassword=.*/rpcpassword=${newPassword}/g" /mnt/hdd/${network}/${network}.conf 2>/dev/null
|
||||
sed -i "s/^rpcpassword=.*/rpcpassword=${newPassword}/g" /home/admin/.${network}/${network}.conf 2>/dev/null
|
||||
|
||||
# NOTE: now other bonus apps configs that need passwordB need to be adapted manually
|
||||
# bonus apps that use a "prestart" will adapt themselves on service restart after reboot
|
||||
# dont reboot - starting either services manually below or they get restarted thru
|
||||
# systemd dependencies like on bitcoind (Partof=...) after all configs changed
|
||||
reboot=0;
|
||||
|
||||
# blitzweb
|
||||
if ! [ -f /etc/nginx/.htpasswd ]; then
|
||||
echo "${newPassword}" | sudo htpasswd -ci /etc/nginx/.htpasswd admin
|
||||
else
|
||||
echo "${newPassword}" | sudo htpasswd -i /etc/nginx/.htpasswd admin
|
||||
fi
|
||||
echo "# restart bitcoind"
|
||||
sudo systemctl restart ${network}d
|
||||
|
||||
# NOTE: now other bonus apps configs that need passwordB need to be adapted manually
|
||||
# bonus apps that use a "prestart" will adapt themselves on service
|
||||
|
||||
# electrs
|
||||
if [ "${ElectRS}" == "on" ]; then
|
||||
echo "# changing the RPC password for ELECTRS"
|
||||
RPC_USER=$(cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcuser | cut -c 9-)
|
||||
sudo sed -i "s/^auth = \"$RPC_USER.*\"/auth = \"$RPC_USER:${newPassword}\"/g" /home/electrs/.electrs/config.toml
|
||||
echo "# restarting electrs"
|
||||
sudo systemctl restart electrs.service
|
||||
fi
|
||||
|
||||
# BTCPayServer
|
||||
if [ "${BTCPayServer}" == "on" ]; then
|
||||
echo "# changing the RPC password for BTCPAYSERVER"
|
||||
sudo sed -i "s/^btc.rpc.password=.*/btc.rpc.password=${newPassword}/g" /home/btcpay/.nbxplorer/Main/settings.config
|
||||
echo "# restarting btcpay server"
|
||||
sudo systemctl restart btcpayserver.service
|
||||
fi
|
||||
|
||||
# JoinMarket
|
||||
@ -367,12 +371,16 @@ elif [ "${abcd}" = "b" ]; then
|
||||
sudo sed -i "s/^rpc_password =.*/rpc_password = ${newPassword}/g" /home/joinmarket/.joinmarket/joinmarket.cfg
|
||||
echo "# changing the password for the 'joinmarket' user"
|
||||
echo "joinmarket:${newPassword}" | sudo chpasswd
|
||||
echo "# restarting jopinmarket API"
|
||||
sudo systemctl restart joinmarket-api.service
|
||||
fi
|
||||
|
||||
# ThunderHub
|
||||
if [ "${thunderhub}" == "on" ]; then
|
||||
echo "# changing the password for ThunderHub"
|
||||
sudo sed -i "s/^masterPassword:.*/masterPassword: '${newPassword}'/g" /mnt/hdd/app-data/thunderhub/thubConfig.yaml
|
||||
echo "# restarting thunderhub.service"
|
||||
sudo systemctl restart thunderhub.service
|
||||
fi
|
||||
|
||||
# LIT
|
||||
@ -380,18 +388,26 @@ elif [ "${abcd}" = "b" ]; then
|
||||
echo "# changing the password for LIT"
|
||||
sudo sed -i "s/^uipassword=.*/uipassword=${newPassword}/g" /mnt/hdd/app-data/.lit/lit.conf
|
||||
sudo sed -i "s/^faraday.bitcoin.password=.*/faraday.bitcoin.password=${newPassword}/g" /mnt/hdd/app-data/.lit/lit.conf
|
||||
echo "# restarting litd.service"
|
||||
sudo systemctl restart litd.service
|
||||
fi
|
||||
|
||||
# i2pd
|
||||
if [ "${i2pd}" == "on" ]; then
|
||||
echo "# changing the password for i2pd"
|
||||
sudo sed -i "s/^pass = .*/pass = ${newPassword}/g" /etc/i2pd/i2pd.conf
|
||||
echo "# restarting i2pd.service"
|
||||
sudo systemctl restart i2pd.service
|
||||
fi
|
||||
|
||||
# LNDg
|
||||
if [ "${lndg}" == "on" ]; then
|
||||
echo "# changing the password for lndg"
|
||||
sudo -u lndg /home/lndg/lndg/.venv/bin/python /home/lndg/lndg/initialize.py -pw ${newPassword}
|
||||
/home/admin/config.scripts/bonus.lndg.sh set-password "${newPassword}"
|
||||
echo "# restarting lndg services"
|
||||
sudo systemctl restart jobs-lndg.service
|
||||
sudo systemctl restart rebalancer-lndg.service
|
||||
sudo systemctl restart htlc-stream-lndg.service
|
||||
fi
|
||||
|
||||
# mempool Explorer
|
||||
@ -400,11 +416,20 @@ elif [ "${abcd}" = "b" ]; then
|
||||
sudo jq ".CORE_RPC.PASSWORD=\"${newPassword}\"" /home/mempool/mempool/backend/mempool-config.json > /var/cache/raspiblitz/mempool-config.json
|
||||
sudo mv /var/cache/raspiblitz/mempool-config.json /home/mempool/mempool/backend/mempool-config.json
|
||||
sudo chown mempool:mempool /home/mempool/mempool/backend/mempool-config.json
|
||||
echo "# restarting mempool.service"
|
||||
sudo systemctl restart mempool.service
|
||||
fi
|
||||
|
||||
# elements
|
||||
if [ "${elements}" == "on" ]; then
|
||||
echo "# changing the password for elements"
|
||||
sudo sed -i "s/^rpcpassword=.*/rpcpassword=${newPassword}/g" /home/elements/.elements/elements.conf
|
||||
sudo sed -i "s/^mainchainrpcpassword=.*/mainchainrpcpassword=${newPassword}/g" /home/elements/.elements/elements.conf
|
||||
echo "# restarting elementsd.service"
|
||||
sudo systemctl restart elementsd.service
|
||||
fi
|
||||
|
||||
echo "# OK -> RPC Password B changed"
|
||||
echo "# Reboot is needed (will be triggered if interactive menu was called)"
|
||||
echo "error=''"
|
||||
sleep 3
|
||||
|
||||
############################
|
||||
@ -489,10 +514,6 @@ elif [ "${abcd}" = "c" ]; then
|
||||
sleep 2
|
||||
|
||||
err=""
|
||||
if ! pip list | grep grpc; then
|
||||
echo "# pip install grpc"
|
||||
sudo -H python3 -m pip install grpcio==1.38.1 1>/dev/null 2>/dev/null
|
||||
fi
|
||||
source <(sudo /home/admin/config.scripts/lnd.initwallet.py change-password mainnet $oldPassword $newPassword)
|
||||
if [ "${err}" != "" ]; then
|
||||
echo "error='Was not able to change password'"
|
||||
|
@ -3,13 +3,31 @@
|
||||
# Just run this script once after a fresh sd card build
|
||||
# to prepare the image for release as a downloadable sd card image
|
||||
|
||||
# determine correct raspberrypi boot drive path (that easy to access when sd card is insert into laptop)
|
||||
raspi_bootdir=""
|
||||
if [ -d /boot/firmware ]; then
|
||||
raspi_bootdir="/boot/firmware"
|
||||
elif [ -d /boot ]; then
|
||||
raspi_bootdir="/boot"
|
||||
fi
|
||||
echo "# raspi_bootdir(${raspi_bootdir})"
|
||||
|
||||
# stop background services
|
||||
sudo systemctl stop background.service
|
||||
sudo systemctl stop background.scan.service
|
||||
|
||||
# remove stop flag (if exists)
|
||||
echo "deleting stop flag .."
|
||||
sudo rm ${raspi_bootdir}/stop 2>/dev/null
|
||||
|
||||
# cleaning logs
|
||||
echo "deleting raspiblitz & system logs .."
|
||||
sudo rm /var/log/* 2>/dev/null
|
||||
sudo rm -rf /var/log/journal/* 2>/dev/null
|
||||
sudo rm /var/log/redis/* 2>/dev/null
|
||||
sudo rm /var/log/private/* 2>/dev/null
|
||||
sudo rm /var/log/nginx/* 2>/dev/null
|
||||
sudo rm /home/admin/*.log 2>/dev/null
|
||||
logger -p info "****** RASPIBLITZ RELEASE ******"
|
||||
echo "OK"
|
||||
|
||||
# clean raspiblitz.info toward the values set by sd card build script
|
||||
@ -20,33 +38,49 @@ echo "cpu=${cpu}" >> /home/admin/raspiblitz.info
|
||||
echo "blitzapi=${blitzapi}" >> /home/admin/raspiblitz.info
|
||||
echo "displayClass=${displayClass}" >> /home/admin/raspiblitz.info
|
||||
|
||||
# SSH Pubkeys (make unique for every sd card image install)
|
||||
# https://github.com/rootzoll/raspiblitz/issues/1371
|
||||
echo
|
||||
echo "deleting SSH Pub keys ..."
|
||||
echo "they will get recreated on fresh bootup, by _bootstrap.sh service"
|
||||
sudo rm /etc/ssh/ssh_host_*
|
||||
echo "deactivate local WIFI ..."
|
||||
sudo nmcli radio wifi off
|
||||
echo "OK"
|
||||
|
||||
# make sure that every install runs API with own secret
|
||||
# https://github.com/raspiblitz/raspiblitz/issues/4469
|
||||
echo
|
||||
echo "deleting old API conf ..."
|
||||
sudo rm /home/blitzapi/blitz_api/.env 2>/dev/null
|
||||
REDIS_ENABLED=$(sudo systemctl is-enabled redis 2>/dev/null | grep -c enabled)
|
||||
if [ ${REDIS_ENABLED} -gt 0 ]; then
|
||||
echo "disable redis for initial start ..."
|
||||
sudo systemctl stop redis 2>/dev/null
|
||||
sudo systemctl disable redis 2>/dev/null
|
||||
fi
|
||||
echo "deleting redis data (if still there) ..."
|
||||
sudo rm /var/lib/redis/dump.rdb 2>/dev/null
|
||||
echo "OK"
|
||||
|
||||
# https://github.com/rootzoll/raspiblitz/issues/1068#issuecomment-599267503
|
||||
echo
|
||||
echo "deleting local DNS confs ..."
|
||||
sudo rm /etc/resolv.conf
|
||||
echo "reset DNS confs ..."
|
||||
echo -e "nameserver 1.1.1.1\nnameserver 84.200.69.80" | sudo tee /etc/resolv.conf > /dev/null
|
||||
echo "OK"
|
||||
|
||||
# make sure that every install runs API with own secret=
|
||||
# update system (only security updates with minimal risk of breaking changes)
|
||||
echo
|
||||
echo "deleting old API conf ..."
|
||||
sudo rm /home/blitzapi/blitz_api/.env 2>/dev/null
|
||||
echo "OK"
|
||||
echo "update OS ..."
|
||||
sudo apt-get update -y
|
||||
sudo apt-get upgrade -o Dir::Etc::SourceList=/etc/apt/sources.list.d/security.list -y
|
||||
sudo apt-get upgrade openssh-server -y
|
||||
sudo dpkg --configure -a
|
||||
|
||||
# https://github.com/rootzoll/raspiblitz/issues/1371
|
||||
# SSH Pubkeys (make unique for every sd card image install)
|
||||
echo
|
||||
echo "deleting local WIFI conf ..."
|
||||
sudo rm /boot/wpa_supplicant.conf 2>/dev/null
|
||||
# reset entries
|
||||
echo "ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
|
||||
update_config=1
|
||||
country=US" | sudo tee /etc/wpa_supplicant/wpa_supplicant.conf 2>/dev/null
|
||||
echo "deleting SSH Pub keys ..."
|
||||
echo "keys will get recreated and sshd reactivated on fresh bootup, by _bootstrap.sh service"
|
||||
sudo systemctl stop sshd
|
||||
sudo systemctl disable sshd
|
||||
sudo rm /etc/ssh/ssh_host_*
|
||||
sudo touch ${raspi_bootdir}/ssh
|
||||
echo "OK"
|
||||
|
||||
echo
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user