-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: better handle ports on Pi and allow albyhub to run on port 80 #584
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1a66046
chore: better handle ports on Pi and allow albyhub to run on port 80
bumi e995d03
chore: install script: create data dir before running docker compose
bumi 96956c6
chore: install script for pi-aarch64
bumi ba39cd1
chore: pi-zero move lib folder on update
bumi 0cc152d
chore: replace (not append) files in install scripts
bumi f0c87f5
chore: install text
bumi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
### Installation on a Raspberry Pi 4/5 (aarch64) | ||
|
||
This install scripts will help you installing Alby Hub on a Raspberry Pi with Raspberry Pi OS (previously called Raspbian). | ||
You should have some basic Linux understanding to install and operate it. | ||
|
||
Have a look at our [installation guide](https://guides.getalby.com/user-guide/v/alby-account-and-browser-extension/alby-hub/alby-hub-flavors/raspberry-pi-zero) for more details and inspiration. | ||
|
||
SSH into your Pi and run: | ||
```shell | ||
/bin/bash -c "$(curl -fsSL https://getalby.com/install/hub/pi-aarch64-install.sh)" | ||
``` | ||
|
||
### Updating a running instance | ||
|
||
SSH into your Pi and run: | ||
```shell | ||
/bin/bash -c "$(curl -fsSL https://getalby.com/install/hub/pi-aarch64-update.sh)" | ||
``` | ||
|
||
And see install.sh and update.sh for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
echo "" | ||
echo "" | ||
echo "⚡️ Welcome to Alby Hub" | ||
echo "-----------------------------------------" | ||
echo "Installing..." | ||
|
||
|
||
sudo mkdir -p /opt/albyhub | ||
sudo chown -R $USER:$USER /opt/albyhub | ||
cd /opt/albyhub | ||
wget https://getalby.com/install/hub/server-linux-aarch64.tar.bz2 | ||
|
||
# Extract archives | ||
tar -xvf server-linux-aarch64.tar.bz2 | ||
if [[ $? -ne 0 ]]; then | ||
echo "Failed to unpack Alby Hub. Potentially bzip2 is missing" | ||
echo "Install it with sudo apt-get install bzip2" | ||
fi | ||
|
||
# Cleanup | ||
rm server-linux-aarch64.tar.bz2 | ||
|
||
# allow albyhub to bind on port 80 | ||
sudo setcap CAP_NET_BIND_SERVICE=+eip /opt/albyhub/bin/albyhub | ||
|
||
# Use port 80 if available otherwise 8029 | ||
if sudo lsof -Pi :80 -sTCP:LISTEN -t >/dev/null ; then | ||
PORT=8029 | ||
URL="http://$HOSTNAME.local:8029" | ||
else | ||
PORT=80 | ||
URL="http://$HOSTNAME.local" | ||
fi | ||
|
||
### Create systemd service | ||
sudo tee -a /etc/systemd/system/albyhub.service > /dev/null << EOF | ||
[Unit] | ||
Description=Alby Hub | ||
After=network-online.target | ||
Wants=network-online.target | ||
|
||
[Service] | ||
Type=simple | ||
Restart=always | ||
RestartSec=1 | ||
User=$USER | ||
ExecStart=/opt/albyhub/bin/albyhub | ||
# Hack to ensure Alby Hub never uses more than 90% CPU | ||
CPUQuota=90% | ||
|
||
Environment="PORT=$PORT" | ||
Environment="WORK_DIR=/opt/albyhub/data" | ||
Environment="LDK_ESPLORA_SERVER=https://electrs.getalbypro.com" | ||
Environment="LOG_EVENTS=true" | ||
Environment="LDK_GOSSIP_SOURCE=" | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
EOF | ||
|
||
sudo systemctl enable albyhub | ||
sudo systemctl start albyhub | ||
|
||
echo "" | ||
echo "" | ||
echo "✅ Installation finished! Please visit $URL to configure your new Alby Hub." | ||
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
echo "🔃 Updating Alby Hub..." | ||
sudo systemctl stop albyhub | ||
|
||
# Download new artifacts | ||
cd /opt/albyhub | ||
rm -rf albyhub-backup | ||
mkdir albyhub-backup | ||
mv bin albyhub-backup | ||
mv lib albyhub-backup | ||
cp -r data albyhub-backup | ||
|
||
wget https://getalby.com/install/hub/server-linux-aarch64.tar.bz2 | ||
|
||
# Extract archives | ||
tar -xvf server-linux-aarch64.tar.bz2 | ||
|
||
# Cleanup | ||
rm server-linux-aarch64.tar.bz2 | ||
|
||
sudo systemctl start albyhub | ||
|
||
echo "✅ Update finished! Please login again to start your wallet." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,18 @@ | ||
### Installation on a Raspberry Pi Zero | ||
### Installation on a Raspberry Pi Zero (arm) | ||
|
||
Have a look at our [installation guide](https://guides.getalby.com/user-guide/v/alby-account-and-browser-extension/alby-hub/alby-hub-flavors/raspberry-pi-zero) for more details. | ||
This install scripts will help you installing Alby Hub on a Raspberry Pi with Raspberry Pi OS (previously called Raspbian). | ||
You should have some basic Linux understanding to install and operate it. | ||
|
||
```shell | ||
$ ssh [email protected] '/bin/bash -c "$(curl -fsSL https://getalby.com/install/hub/pi-zero-install.sh)"' | ||
``` | ||
Have a look at our [installation guide](https://guides.getalby.com/user-guide/v/alby-account-and-browser-extension/alby-hub/alby-hub-flavors/raspberry-pi-zero) for more details and inspiration. | ||
|
||
or on the Pi directly: | ||
SSH into your Pi and run: | ||
```shell | ||
/bin/bash -c "$(curl -fsSL https://getalby.com/install/hub/pi-zero-install.sh)" | ||
``` | ||
|
||
### Updating a running instance | ||
|
||
```shell | ||
$ ssh [email protected] '/bin/bash -c "$(curl -fsSL https://getalby.com/install/hub/pi-zero-install.sh)"' | ||
``` | ||
|
||
or on the Pi directly: | ||
SSH into your Pi and run: | ||
```shell | ||
/bin/bash -c "$(curl -fsSL https://getalby.com/install/hub/pi-zero-update.sh)" | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be optional? like how we ask to setup a service?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any option makes it more complicated and more fragile. Those install scripts suck anyway because everybody wants it to be a bit different and systems are often different.
People also need to know a little bit of what they do.
IF we don't run as root then as far as I understand we need this. otherwise we need to run as root or on a different port.