├── config ├── .network ├── README.md ├── lnd.conf └── bitcoin.conf ├── .gitignore ├── bin └── electrs ├── scripts ├── grafana.db ├── raspibolt-autoinit.sh └── prometheus-bitcoind.py ├── docs ├── README.md ├── _config.yml ├── hardware-02.md ├── hardware-01.md ├── hardware.md ├── index.md └── armbian-build.md ├── fs ├── README.md └── etc │ ├── systemd │ └── system │ │ ├── eps.service │ │ ├── lnd.service │ │ └── bitcoind.service │ └── update-motd.d │ └── 20-raspibolt-welcome ├── docker └── bitcoin │ ├── docker-entrypoint.sh │ ├── LICENSE │ └── Dockerfile ├── LICENSE ├── README.md └── dietpi.txt /config/.network: -------------------------------------------------------------------------------- 1 | bitcoin 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | README.md 2 | dietpi.txt 3 | -------------------------------------------------------------------------------- /bin/electrs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stadicus/raspibolt-setup/HEAD/bin/electrs -------------------------------------------------------------------------------- /scripts/grafana.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stadicus/raspibolt-setup/HEAD/scripts/grafana.db -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | ### Documentation 2 | 3 | This is the source of the documentation that is available at 4 | https://stadicus.github.io/raspibolt-setup. -------------------------------------------------------------------------------- /config/README.md: -------------------------------------------------------------------------------- 1 | ### /config 2 | Files in the **config** folder represent the initial / blank configuration and will be altered by the user. 3 | They must not be overwritten during an upgrade. 4 | -------------------------------------------------------------------------------- /fs/README.md: -------------------------------------------------------------------------------- 1 | ### /fs 2 | Files in the **fs** folder are core components and are copied directly to the file system. 3 | They must not be edited by the user and are overwritten during an upgrade. 4 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | remote_theme: pmarsceill/just-the-docs 2 | search_enabled: true 3 | aux_links: 4 | "Issues / Knowledge Base": 5 | - "https://github.com/digitalbitbox/bitbox-base/issues" 6 | "Contribute! Source on GitHub": 7 | - "https://github.com/digitalbitbox/bitbox-base" 8 | 9 | -------------------------------------------------------------------------------- /docs/hardware-02.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Hardware 02 4 | parent: Hardware 5 | nav_order: 20 6 | has_toc: false 7 | --- 8 | # Hardware 02 9 | Eget consectetur sed, iaculis lacinia dui. Curabitur quis augue mauris. Phasellus semper interdum rutrum. Nullam ultrices ligula est, eu feugiat dolor lacinia non. Ut magna quam, lacinia in tristique et, elementum volutpat elit. Etiam eu ullamcorper massa. Cras orci sem, commodo 10 | -------------------------------------------------------------------------------- /docs/hardware-01.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Hardware 01 4 | parent: Hardware 5 | nav_order: 10 6 | has_toc: false 7 | --- 8 | # Hardware 01 9 | Cras quam urna, pulvinar eget consectetur sed, iaculis lacinia dui. Curabitur quis augue mauris. Phasellus semper interdum rutrum. Nullam ultrices ligula est, eu feugiat dolor lacinia non. Ut magna quam, lacinia in tristique et, elementum volutpat elit. Etiam eu ullamcorper massa. Cras orci sem, commodo 10 | -------------------------------------------------------------------------------- /config/lnd.conf: -------------------------------------------------------------------------------- 1 | # RaspiBolt LND Mainnet: lnd configuration 2 | # /home/bitcoin/.lnd/lnd.conf 3 | 4 | [Application Options] 5 | debuglevel=info 6 | maxpendingchannels=5 7 | alias=YOUR_NAME [LND] 8 | color=#68F442 9 | 10 | [Bitcoin] 11 | bitcoin.active=1 12 | 13 | # enable either testnet or mainnet 14 | bitcoin.testnet=1 15 | #bitcoin.mainnet=1 16 | 17 | bitcoin.node=bitcoind 18 | 19 | [autopilot] 20 | autopilot.active=1 21 | autopilot.maxchannels=5 22 | autopilot.allocation=0.6 23 | -------------------------------------------------------------------------------- /fs/etc/systemd/system/eps.service: -------------------------------------------------------------------------------- 1 | # RaspiBolt: systemd unit for Electrum Personal Server 2 | # /etc/systemd/system/eps.service 3 | 4 | [Unit] 5 | Description=Electrum Personal Server 6 | After=bitcoind.service 7 | 8 | [Service] 9 | ExecStart=/usr/bin/python3 /home/bitcoin/electrum-personal-server/eps/server.py /home/bitcoin/electrum-personal-server/eps 10 | User=bitcoin 11 | Group=bitcoin 12 | Type=simple 13 | KillMode=process 14 | TimeoutSec=60 15 | Restart=always 16 | RestartSec=60 17 | 18 | [Install] 19 | WantedBy=multi-user.target 20 | -------------------------------------------------------------------------------- /fs/etc/systemd/system/lnd.service: -------------------------------------------------------------------------------- 1 | # RaspiBolt LND Mainnet: systemd unit for lnd 2 | # /etc/systemd/system/lnd.service 3 | 4 | [Unit] 5 | Description=LND Lightning Daemon 6 | Wants=bitcoind.service 7 | After=bitcoind.service 8 | 9 | [Service] 10 | ExecStart=/usr/local/bin/lnd 11 | #unlock script 12 | PIDFile=/home/bitcoin/.lnd/lnd.pid 13 | User=bitcoin 14 | Group=bitcoin 15 | LimitNOFILE=256000 16 | Type=simple 17 | KillMode=process 18 | TimeoutSec=180 19 | Restart=always 20 | RestartSec=60 21 | 22 | [Install] 23 | WantedBy=multi-user.target 24 | -------------------------------------------------------------------------------- /config/bitcoin.conf: -------------------------------------------------------------------------------- 1 | # RaspiBolt LND Mainnet: bitcoind configuration 2 | # /home/bitcoin/.bitcoin/bitcoin.conf 3 | 4 | # remove the following line to enable Bitcoin mainnet 5 | testnet=1 6 | 7 | # Bitcoind options 8 | server=1 9 | daemon=1 10 | txindex=1 11 | disablewallet=1 12 | 13 | # Connection settings 14 | rpcuser=raspibolt 15 | rpcpassword=PASSWORD_[B] 16 | rpcport=8332 17 | onlynet=ipv4 18 | zmqpubrawblock=tcp://127.0.0.1:29000 19 | zmqpubrawtx=tcp://127.0.0.1:29000 20 | 21 | # Raspberry Pi optimizations 22 | dbcache=100 23 | maxorphantx=10 24 | maxmempool=50 25 | maxconnections=40 26 | maxuploadtarget=5000 27 | -------------------------------------------------------------------------------- /fs/etc/systemd/system/bitcoind.service: -------------------------------------------------------------------------------- 1 | # RaspiBolt LND Mainnet: systemd unit for bitcoind 2 | # /etc/systemd/system/bitcoind.service 3 | 4 | [Unit] 5 | Description=Bitcoin daemon 6 | After=network.target 7 | 8 | [Service] 9 | ExecStartPre=/bin/sh -c 'sleep 30' 10 | ExecStart=/usr/local/bin/bitcoind -daemon -conf=/home/bitcoin/.bitcoin/bitcoin.conf -pid=/home/bitcoin/.bitcoin/bitcoind.pid 11 | PIDFile=/home/bitcoin/.bitcoin/bitcoind.pid 12 | User=bitcoin 13 | Group=bitcoin 14 | Type=forking 15 | KillMode=process 16 | Restart=always 17 | TimeoutSec=120 18 | RestartSec=30 19 | 20 | [Install] 21 | WantedBy=multi-user.target 22 | -------------------------------------------------------------------------------- /docker/bitcoin/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | if [ $(echo "$1" | cut -c1) = "-" ]; then 5 | echo "$0: assuming arguments for bitcoind" 6 | 7 | set -- bitcoind "$@" 8 | fi 9 | 10 | if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then 11 | mkdir -p "$BITCOIN_DATA" 12 | chmod 700 "$BITCOIN_DATA" 13 | chown -R bitcoin "$BITCOIN_DATA" 14 | 15 | echo "$0: setting data directory to $BITCOIN_DATA" 16 | 17 | set -- "$@" -datadir="$BITCOIN_DATA" 18 | fi 19 | 20 | if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then 21 | echo 22 | exec gosu bitcoin "$@" 23 | fi 24 | 25 | echo 26 | exec "$@" 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docker/bitcoin/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Rui Marinho 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/hardware.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Hardware 4 | nav_order: 200 5 | has_children: true 6 | has_toc: false 7 | --- 8 | # Hardware 9 | Nunc pharetra, velit non venenatis viverra, nunc orci mollis ante, condimentum ullamcorper massa orci ac eros. Etiam ut risus id dolor elementum laoreet. Cras quam urna, pulvinar eget consectetur sed, iaculis lacinia dui. Curabitur quis augue mauris. Phasellus semper interdum rutrum. Nullam ultrices ligula est, eu feugiat dolor lacinia non. Ut magna quam, lacinia in tristique et, elementum volutpat elit. Etiam eu ullamcorper massa. Cras orci sem, commodo sed mi vitae, mollis convallis felis. Fusce iaculis tellus a euismod faucibus. 10 | 11 | ## Pellentesque 12 | Viverra est non pellentesque consequat. Vivamus sodales erat eget aliquet mattis. Nunc interdum egestas lectus. 13 | 14 | ## Fringilla 15 | Sodales mauris consequat quis. Sed non nunc vulputate, tincidunt ipsum non, lobortis neque. Morbi eu nisl eget nisl ornare convallis. Praesent in dictum ex, sit amet tristique ante. Vivamus at nisl facilisis ante tempus tempor. Integer sit amet nulla neque. Duis sit amet hendrerit ante. Etiam non odio aliquam libero vestibulum viverra. Donec ullamcorper enim nec tortor pharetra ullamcorper. Nam sodales in nisi vitae malesuada. 16 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: RaspiBolt Setup 4 | nav_order: 100 5 | --- 6 | # Test TOC for documentation 7 | 8 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elementum non leo at porttitor. Praesent faucibus imperdiet malesuada. Quisque blandit justo sit amet neque viverra rhoncus. Morbi lobortis sem non quam ultrices malesuada. Fusce tempor pharetra elit vitae finibus. Praesent nec fermentum odio. Cras commodo, purus at efficitur mattis, erat tortor semper metus, a consectetur felis arcu ut ante. Nam varius, odio eu tincidunt pulvinar, massa purus luctus dolor, sit amet auctor justo turpis non nibh. 9 | 10 | ## Curabitur convallis venenatis risus 11 | Eget tempor ex volutpat vitae. Curabitur fermentum, augue ac euismod placerat, quam neque dignissim leo, ut aliquam mi libero nec lorem. Morbi vitae nulla rhoncus, sodales justo sit amet, accumsan ipsum. Ut sit amet consectetur ligula, at elementum massa. Cras tincidunt lorem quis lorem rutrum, a convallis ligula imperdiet. Etiam imperdiet arcu urna, non tristique neque fermentum in. Aenean pulvinar tortor sit amet ipsum dictum, vitae lacinia mi ullamcorper. Praesent ultricies ante a lectus viverra, non suscipit nisi efficitur. In massa risus, finibus et hendrerit ut, rutrum pulvinar urna. Quisque magna magna, sodales id justo in, iaculis cursus lectus. Donec pretium maximus sollicitudin. Donec tincidunt, risus non laoreet auctor, nisi eros convallis neque, a eleifend urna nulla vehicula urna. Cras accumsan consequat dolor ac elementum. Sed ac arcu laoreet, congue urna sed, rutrum ex. 12 | 13 | ## Aenean finibus 14 | Aliquam nulla, porttitor ultricies leo imperdiet sit amet. Morbi ultrices cursus porttitor. Morbi at vehicula urna. Curabitur lobortis massa non erat aliquam, ac ullamcorper felis porta. Pellentesque eget quam non enim ultrices fringilla. Donec tristique imperdiet metus nec mollis. Donec et semper diam. Vestibulum aliquam erat et efficitur egestas. 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # raspibolt-setup 2 | Automated installation for RaspiBolt 3 | 4 | The goal of this project is to enable you to get your own Bitcoin & Lightning full node up and running as quickly as possible. Key is a completely automated setup, ideally without touching the Linux command line at all. There are different key areas to achieve that. 5 | 6 | ### Linux distribution that allows for automation 7 | The setup process needs to be as trustless as possible. It is therefore helpful to start with a well-known Linux distribution and automate the setup process using public scripts that are pulled from a easily verifiable source. 8 | 9 | This solution is based on DietPi ([Website](https://dietpi.com/), [Github](https://github.com/Fourdee/DietPi)), which is completely open-source and available for wide range of single-board computers. It's very lightweight, features a heavily customizable automated setup and allows to execute a custom scripts after setup. 10 | 11 | **This is very much work in progress and does not work yet!** 12 | 13 | To try it out, follow these steps: 14 | 15 | 1. Get the DietPi image for your hardware, eg. a Raspberry Pi 3 16 | https://dietpi.com/#download 17 | 18 | 1. Burn the image to a sdcard (16 GB is recommended) 19 | https://dietpi.com/phpbb/viewtopic.php?f=8&t=9#p9 20 | 21 | 1. Download the file /dietpi.txt from this repo and copy it to the "boot" partition of your sdcard 22 | https://github.com/Stadicus/raspibolt-setup/blob/master/dietpi.txt 23 | 24 | 1. Connect your Pi to the internet using a network cable, a monitor (to watch the setup beauty), insert the sdcard and power your Pi up 25 | 26 | Setup can take up to 10 minutes. At the moment, this is just a proof-of-concept, but we're getting there. 27 | 28 | ### Other areas for an easy setup 29 | After the base system is set up, the node needs to be configured. This is another area to work on. 30 | 31 | * Customization scripts on operating system-level 32 | * Usage of a PiScreen to convey the current status & install / setup progress 33 | * Web interface for setup and continuous management of hardware / Bitcoin / Lightning components 34 | * Connectivity / TLS certificates for backend usage 35 | * and more... 36 | 37 | If you'd like to help, feel free to send me a DM on Twitter [@Stadicus3000](https://twitter.com/Stadicus3000). 38 | -------------------------------------------------------------------------------- /scripts/raspibolt-autoinit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # RaspiBolt: init script for DietPi automation 3 | 4 | baseDir="/opt/trueno" 5 | logDir="$baseDir/log" 6 | logFile="$logDir/init.log" 7 | stateFile="$baseDir/init.state" 8 | 9 | # How far in the init process? --> get init state 10 | if [ -f "$stateFile" ]; then 11 | state=$( cat $stateFile ) 12 | else 13 | state=10 14 | fi 15 | echo "" > $logFile 16 | mkdir -p $logDir 17 | { 18 | echo "*** $(date +'%Y-%m/%d %H:%M:%S') - INIT - state: $state" 19 | 20 | ### 10: Get source files 21 | if [ $state = 10 ]; then 22 | rm -rf $baseDir/src 23 | git clone https://github.com/Stadicus/raspibolt-setup $baseDir/src 24 | chmod +x $baseDir/src/scripts/* 25 | cp $baseDir/src/scripts/* /usr/local/bin 26 | 27 | # do not overwrite existing config 28 | if [ ! -d "$baseDir/config" ]; then 29 | cp -R $baseDir/src/config $baseDir 30 | fi 31 | 32 | # start autoinit on root login (prevent double entries) 33 | (grep -vE "(raspibolt-autoinit)" /root/.bashrc; echo "/usr/local/bin/raspibolt-autoinit.sh") >> /root/.bashrc_tmp 34 | mv /root/.bashrc_tmp /root/.bashrc 35 | dietpi-autostart 7 36 | 37 | adduser admin --gecos "" --disabled-password 38 | adduser admin sudo 39 | adduser bitcoin --gecos "" --disabled-password 40 | adduser display --gecos "" --disabled-password 41 | adduser web --gecos "" --disabled-password 42 | 43 | state=20 44 | echo "$state" > $stateFile 45 | fi 46 | 47 | ### 20: Prepare Linux 48 | if [ $state = 20 ]; then 49 | echo "*** $(date +'%Y-%m/%d %H:%M:%S') - INIT - state: $state" 50 | apt-get install -y usbmount jq dphys-swapfile python python3 python-pip xxd ufw 51 | pip install docker-compose 52 | 53 | # Copy all system files to the base filesystem 54 | cp -R $baseDir/src/fs/* / 55 | 56 | # Set Uncomplicated Firewall (UFW) 57 | ufw default deny incoming 58 | ufw default allow outgoing 59 | ufw allow 22 comment 'allow SSH' 60 | ufw allow 8333 comment 'allow Bitcoin mainnet' 61 | ufw allow 18333 comment 'allow Bitcoin testnet' 62 | ufw allow 9735 comment 'allow Lightning' 63 | ufw allow 50002 comment 'allow Electrum' 64 | echo "y" | ufw enable 65 | systemctl enable ufw 66 | fi 67 | 68 | ### 30: Build docker 69 | if [ $state = 30 ]; then 70 | echo "*** $(date +'%Y-%m/%d %H:%M:%S') - INIT - state: $state" 71 | echo "Build Docker!" 72 | 73 | fi 74 | } 2>&1 | tee $logFile 75 | -------------------------------------------------------------------------------- /docs/armbian-build.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Armbian 4 | nav_order: 300 5 | --- 6 | # Armbian build 7 | Integer mollis porta efficitur. Cras ex orci, cursus mollis facilisis ornare, bibendum a eros. Phasellus mi massa, tempor sit amet aliquet gravida, ornare vel neque. Donec finibus imperdiet viverra. Cras vulputate condimentum magna, ut consequat tortor varius in. Integer sed nulla sagittis, volutpat mi et, pretium ligula. Ut eget tortor pretium, pretium dui ut, tempus justo. Etiam bibendum eros a felis accumsan, non ullamcorper turpis gravida. Nam elementum ligula ante, et dapibus felis hendrerit tempor. Morbi egestas, risus ac vehicula facilisis, tellus odio pellentesque est, et sollicitudin libero arcu vitae ante. Nunc id mattis lacus, sit amet auctor nulla. Fusce hendrerit sagittis ipsum. 8 | 9 | ## Integer fermentum 10 | Tempus orci. Morbi sed lacinia ligula, vitae fringilla erat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent in dignissim ligula, sit amet feugiat tellus. Donec tincidunt viverra elit elementum vulputate. Donec efficitur tincidunt pretium. Pellentesque turpis enim, malesuada sed orci sit amet, faucibus maximus ligula. Phasellus quis efficitur lorem. Etiam eu eros ex. Duis dictum nulla vel enim maximus dignissim. Suspendisse aliquet lacinia lorem mattis vulputate. Vestibulum libero sapien, faucibus convallis ante vel, interdum pretium ex. Vivamus consectetur metus at lectus elementum dapibus. 11 | 12 | ## In condimentum 13 | Rutrum metus, ut convallis augue dictum non. Vestibulum efficitur facilisis magna, eu mattis lorem luctus vel. Aenean ut tristique sapien. Phasellus lobortis urna vitae tellus laoreet posuere. Mauris pellentesque nec nibh a aliquam. Quisque in lacus nulla. Sed blandit enim nisi, at euismod elit rutrum sit amet. Etiam dui magna, ornare eu tristique euismod, commodo non lectus. Duis lorem dolor, iaculis ac tristique et, ultrices nec turpis. Vestibulum facilisis sagittis lorem, nec hendrerit lorem pulvinar in. Aenean sed rhoncus dui, nec sollicitudin ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas fermentum massa nibh, molestie blandit magna lacinia in. Nulla sed dapibus nulla. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras in massa erat. 14 | 15 | ## Integer tincidunt 16 | Eros ac scelerisque pulvinar, eros lorem commodo odio, ac vehicula diam ante eu elit. Quisque ac orci mattis, pharetra sapien ut, pellentesque velit. Morbi risus mi, eleifend a ullamcorper in, suscipit a turpis. In faucibus posuere ex, in sodales purus feugiat id. Aliquam sed elementum mauris. Etiam laoreet eget nibh et laoreet. Sed sit amet tellus egestas, aliquet leo quis, dapibus enim. 17 | -------------------------------------------------------------------------------- /docker/bitcoin/Dockerfile: -------------------------------------------------------------------------------- 1 | # Trueno Full Node: Bitcoin Core 2 | # ------------------------------ 3 | # based on https://github.com/ruimarinho/docker-bitcoin-core 4 | # Copyright (c) 2015 Rui Marinho 5 | # 6 | # Example run: 7 | # docker run -d --rm \ 8 | # --name bitcoin-server \ 9 | # --volume /mnt/hdd/bitcoin:/home/bitcoin/.bitcoin 10 | # --volume /opt/trueno/config/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf 11 | # -p 18333:18333 \ 12 | # -p 18332:18332 \ 13 | # -p 29000:29000 14 | # truenolightning/bitcoin-core-armv71 \ 15 | # -testnet=1 16 | # 17 | # mandatory volumes: 18 | # /home/bitcoin/.bitcoin data directory (blockchain 200GB+) 19 | # /home/bitcoin/.bitcoin/bitcoin.conf 20 | # configuration file, can be mounted seperately 21 | # 22 | # TCP ports (mainnet / testnet) 23 | # 8332 / 18332 JSON RPC port (only for local machine) 24 | # 8333 / 18333 Peer-to-peer communication port 25 | # 29000 ZeroMQ interface 26 | 27 | FROM debian:stable-slim 28 | 29 | RUN useradd -r bitcoin \ 30 | && apt-get update -y \ 31 | && apt-get install -y curl gnupg \ 32 | && apt-get clean \ 33 | && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ 34 | && set -ex \ 35 | && for key in \ 36 | B42F6819007F00F88E364FD4036A9C25BF357DD4 \ 37 | ; do \ 38 | gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ 39 | gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \ 40 | gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \ 41 | gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \ 42 | done 43 | 44 | ENV GOSU_VERSION=1.10 45 | 46 | RUN curl -o /usr/local/bin/gosu -fSL https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture) \ 47 | && curl -o /usr/local/bin/gosu.asc -fSL https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture).asc \ 48 | && gpg --verify /usr/local/bin/gosu.asc \ 49 | && rm /usr/local/bin/gosu.asc \ 50 | && chmod +x /usr/local/bin/gosu 51 | 52 | ENV BITCOIN_VERSION=0.16.2 53 | ENV BITCOIN_DATA=/home/bitcoin/.bitcoin 54 | ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH 55 | 56 | RUN curl -SL https://bitcoin.org/laanwj-releases.asc | gpg --import \ 57 | && curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc \ 58 | && curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz \ 59 | && gpg --verify SHA256SUMS.asc \ 60 | && grep " bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz\$" SHA256SUMS.asc | sha256sum -c - \ 61 | && tar -xzf *.tar.gz -C /opt \ 62 | && rm *.tar.gz *.asc 63 | 64 | COPY docker-entrypoint.sh /entrypoint.sh 65 | 66 | VOLUME ["/home/bitcoin/.bitcoin"] 67 | 68 | EXPOSE 8332 8333 18332 18333 18443 18444 29000 69 | 70 | ENTRYPOINT ["/entrypoint.sh"] 71 | 72 | CMD ["bitcoind"] 73 | -------------------------------------------------------------------------------- /scripts/prometheus-bitcoind.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | import json 5 | import time 6 | import subprocess 7 | import sys 8 | from prometheus_client import start_http_server, Gauge, Counter 9 | 10 | # CONFIG 11 | # counting transaction inputs and outputs requires that bitcoind is configured with txindex=1, which may also necessitate reindex=1 in bitcoin.conf 12 | # set True or False, according to your bicoind configuration 13 | txindex_enabled = False 14 | 15 | # when using a non-standard path for bitcoin.conf, set it here as cli argument (e.g. "-conf=/btc/bitcoin.conf") or leave empty 16 | bitcoind_conf = "-conf=/etc/bitcoin/bitcoin.conf" 17 | 18 | 19 | # Create Prometheus metrics to track bitcoind stats. 20 | BITCOIN_BLOCKS = Gauge('bitcoin_blocks', 'Block height') 21 | BITCOIN_DIFFICULTY = Gauge('bitcoin_difficulty', 'Difficulty') 22 | BITCOIN_PEERS = Gauge('bitcoin_peers', 'Number of peers') 23 | BITCOIN_HASHPS = Gauge('bitcoin_hashps', 'Estimated network hash rate per second') 24 | BITCOIN_VERIFICATION_PROGRESS = Gauge('bitcoin_verification_progress', 'Blockchain verification progress') 25 | BITCOIN_IBD = Gauge('bitcoin_ibd', 'Initial block download (true/false)') 26 | BITCOIN_SIZE_ON_DISK = Gauge('bitcoin_size_on_disk', 'size on disk in bytes') 27 | 28 | BITCOIN_WARNINGS = Counter('bitcoin_warnings', 'Number of warnings detected') 29 | BITCOIN_UPTIME = Gauge('bitcoin_uptime', 'Number of seconds the Bitcoin daemon has been running') 30 | 31 | BITCOIN_MEMPOOL_BYTES = Gauge('bitcoin_mempool_bytes', 'Size of mempool in bytes') 32 | BITCOIN_MEMPOOL_SIZE = Gauge('bitcoin_mempool_size', 'Number of unconfirmed transactions in mempool') 33 | 34 | BITCOIN_LATEST_BLOCK_SIZE = Gauge('bitcoin_latest_block_size', 'Size of latest block in bytes') 35 | BITCOIN_LATEST_BLOCK_TXS = Gauge('bitcoin_latest_block_txs', 'Number of transactions in latest block') 36 | 37 | BITCOIN_NUM_CHAINTIPS = Gauge('bitcoin_num_chaintips', 'Number of known blockchain branches') 38 | 39 | BITCOIN_TOTAL_BYTES_RECV = Gauge('bitcoin_total_bytes_recv', 'Total bytes received') 40 | BITCOIN_TOTAL_BYTES_SENT = Gauge('bitcoin_total_bytes_sent', 'Total bytes sent') 41 | 42 | BITCOIN_LATEST_BLOCK_INPUTS = Gauge('bitcoin_latest_block_inputs', 'Number of inputs in transactions of latest block') 43 | BITCOIN_LATEST_BLOCK_OUTPUTS = Gauge('bitcoin_latest_block_outputs', 'Number of outputs in transactions of latest block') 44 | 45 | def find_bitcoin_cli(): 46 | if sys.version_info[0] < 3: 47 | from whichcraft import which 48 | if sys.version_info[0] >= 3: 49 | from shutil import which 50 | return which('bitcoin-cli') 51 | 52 | BITCOIN_CLI_PATH = str(find_bitcoin_cli()) 53 | 54 | def bitcoin(cmd): 55 | args = [cmd] 56 | if len(bitcoind_conf) > 0: 57 | args = [bitcoind_conf] + args 58 | bitcoin = subprocess.Popen([BITCOIN_CLI_PATH] + args, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) 59 | output = bitcoin.communicate()[0] 60 | return json.loads(output.decode('utf-8')) 61 | 62 | 63 | def bitcoincli(cmd): 64 | args = [cmd] 65 | if len(bitcoind_conf) > 0: 66 | args = [bitcoind_conf] + args 67 | bitcoin = subprocess.Popen([BITCOIN_CLI_PATH] + args, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) 68 | output = bitcoin.communicate()[0] 69 | return output.decode('utf-8') 70 | 71 | 72 | def get_block(block_height): 73 | args = ["getblock", block_height] 74 | if len(bitcoind_conf) > 0: 75 | args = [bitcoind_conf] + args 76 | 77 | try: 78 | block = subprocess.check_output([BITCOIN_CLI_PATH] + args) 79 | except Exception as e: 80 | print(e) 81 | print('Error: Can\'t retrieve block number ' + block_height + ' from bitcoind.') 82 | return None 83 | return json.loads(block.decode('utf-8')) 84 | 85 | 86 | def get_raw_tx(txid): 87 | args = ["getrawtransaction", txid, '1'] 88 | if len(bitcoind_conf) > 0: 89 | args = [bitcoind_conf] + args 90 | 91 | try: 92 | rawtx = subprocess.check_output([BITCOIN_CLI_PATH]) 93 | except Exception as e: 94 | print(e) 95 | print('Error: Can\'t retrieve raw transaction ' + txid + ' from bitcoind.') 96 | return None 97 | return json.loads(rawtx.decode('utf-8')) 98 | 99 | 100 | def main(): 101 | # Start up the server to expose the metrics. 102 | start_http_server(8334) 103 | while True: 104 | blockchaininfo = bitcoin('getblockchaininfo') 105 | networkinfo = bitcoin('getnetworkinfo') 106 | chaintips = len(bitcoin('getchaintips')) 107 | mempool = bitcoin('getmempoolinfo') 108 | nettotals = bitcoin('getnettotals') 109 | latest_block = get_block(str(blockchaininfo['bestblockhash'])) 110 | hashps = float(bitcoincli('getnetworkhashps')) 111 | 112 | BITCOIN_BLOCKS.set(blockchaininfo['blocks']) 113 | BITCOIN_PEERS.set(networkinfo['connections']) 114 | BITCOIN_DIFFICULTY.set(blockchaininfo['difficulty']) 115 | BITCOIN_HASHPS.set(hashps) 116 | BITCOIN_VERIFICATION_PROGRESS.set(blockchaininfo['verificationprogress']) 117 | BITCOIN_IBD.set(blockchaininfo['initialblockdownload']) 118 | BITCOIN_SIZE_ON_DISK.set(blockchaininfo['size_on_disk']) 119 | 120 | if networkinfo['warnings']: 121 | BITCOIN_WARNINGS.inc() 122 | 123 | BITCOIN_NUM_CHAINTIPS.set(chaintips) 124 | 125 | BITCOIN_MEMPOOL_BYTES.set(mempool['bytes']) 126 | BITCOIN_MEMPOOL_SIZE.set(mempool['size']) 127 | 128 | BITCOIN_TOTAL_BYTES_RECV.set(nettotals['totalbytesrecv']) 129 | BITCOIN_TOTAL_BYTES_SENT.set(nettotals['totalbytessent']) 130 | 131 | if latest_block is not None: 132 | BITCOIN_LATEST_BLOCK_SIZE.set(latest_block['size']) 133 | BITCOIN_LATEST_BLOCK_TXS.set(len(latest_block['tx'])) 134 | inputs, outputs = 0, 0 135 | 136 | if txindex_enabled: 137 | for tx in latest_block['tx']: 138 | 139 | if get_raw_tx(tx) is not None: 140 | rawtx = get_raw_tx(tx) 141 | i = len(rawtx['vin']) 142 | inputs += i 143 | o = len(rawtx['vout']) 144 | outputs += o 145 | 146 | BITCOIN_LATEST_BLOCK_INPUTS.set(inputs) 147 | BITCOIN_LATEST_BLOCK_OUTPUTS.set(outputs) 148 | 149 | time.sleep(300) 150 | 151 | if __name__ == '__main__': 152 | main() 153 | -------------------------------------------------------------------------------- /fs/etc/update-motd.d/20-raspibolt-welcome: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # RaspiBolt LND Mainnet: systemd unit for getpublicip.sh script 3 | # /etc/systemd/system/20-raspibolt-welcome.sh 4 | 5 | # make executable and copy script to /etc/update-motd.d/ 6 | # root must be able to execute bitcoin-cli and lncli 7 | 8 | # set colors 9 | color_red='\033[0;31m' 10 | color_green='\033[0;32m' 11 | color_yellow='\033[0;33m' 12 | color_gray='\033[0;37m' 13 | 14 | # set datadir 15 | bitcoin_dir="/home/bitcoin/.bitcoin" 16 | lnd_dir="/home/bitcoin/.lnd" 17 | 18 | # get uptime & load 19 | load=$(w | grep "load average:" | cut -c11-) 20 | 21 | # get CPU temp 22 | cpu=$(cat /sys/class/thermal/thermal_zone0/temp) 23 | temp=$((cpu/1000)) 24 | 25 | # get memory 26 | ram_avail=$(free -m | grep Mem | awk '{ print $7 }') 27 | ram=$(printf "%sM / %sM" "${ram_avail}" "$(free -m | grep Mem | awk '{ print $2 }')") 28 | 29 | if [ ${ram_avail} -lt 100 ]; then 30 | color_ram="${color_red}\e[7m" 31 | else 32 | color_ram=${color_green} 33 | fi 34 | 35 | # get storage 36 | sd_free_ratio=$(printf "%d" "$(df -h | grep "/$" | awk '{ print $4/$2*100 }')") 2>/dev/null 37 | sd=$(printf "%s (%s%%)" "$(df -h | grep '/$' | awk '{ print $4 }')" "${sd_free_ratio}") 38 | if [ ${sd_free_ratio} -lt 10 ]; then 39 | color_sd="${color_red}" 40 | else 41 | color_sd=${color_green} 42 | fi 43 | 44 | hdd_free_ratio=$(printf "%d" "$(df -h | grep '/mnt/hdd$' | awk '{ print $4/$2*100 }')") 2>/dev/null 45 | hdd=$(printf "%s (%s%%)" "$(df -h | grep '/mnt/hdd$' | awk '{ print $4 }')" "${hdd_free_ratio}") 46 | 47 | if [ ${hdd_free_ratio} -lt 10 ]; then 48 | color_hdd="${color_red}\e[7m" 49 | else 50 | color_hdd=${color_green} 51 | fi 52 | 53 | # get network traffic 54 | network_rx=$(ifconfig eth0 | grep 'RX packets' | awk '{ print $6$7 }' | sed 's/[()]//g') 55 | network_tx=$(ifconfig eth0 | grep 'TX packets' | awk '{ print $6$7 }' | sed 's/[()]//g') 56 | 57 | # Bitcoin blockchain 58 | btc_path=$(command -v bitcoin-cli) 59 | if [ -n ${btc_path} ]; then 60 | btc_title="฿itcoin" 61 | chain="$(bitcoin-cli -datadir=${bitcoin_dir} getblockchaininfo | jq -r '.chain')" 62 | if [ -n $chain ]; then 63 | btc_title="${btc_title} (${chain}net)" 64 | 65 | # get sync status 66 | block_chain="$(bitcoin-cli -datadir=${bitcoin_dir} getblockchaininfo | jq -r '.headers')" 67 | block_verified="$(bitcoin-cli -datadir=${bitcoin_dir} getblockchaininfo | jq -r '.blocks')" 68 | block_diff=$(expr ${block_chain} - ${block_verified}) 69 | 70 | progress="$(bitcoin-cli -datadir=${bitcoin_dir} getblockchaininfo | jq -r '.verificationprogress')" 71 | sync_percentage=$(printf "%.2f%%" "$(echo $progress | awk '{print 100 * $1}')") 72 | 73 | if [ ${block_diff} -eq 0 ]; then # fully synced 74 | sync="OK" 75 | sync_color="${color_green}" 76 | sync_behind=" " 77 | elif [ ${block_diff} -eq 1 ]; then # fully synced 78 | sync="OK" 79 | sync_color="${color_green}" 80 | sync_behind="-1 block" 81 | elif [ ${block_diff} -le 10 ]; then # <= 2 blocks behind 82 | sync="Catching up" 83 | sync_color="${color_red}" 84 | sync_behind="-${block_diff} blocks" 85 | else 86 | sync="In progress" 87 | sync_color="${color_red}" 88 | sync_behind="${sync_percentage}" 89 | fi 90 | 91 | # get last known block 92 | last_block="$(bitcoin-cli -datadir=${bitcoin_dir} getblockcount)" 93 | if [ ! -z "${last_block}" ]; then 94 | btc_line2="${btc_line2} ${color_gray}(block ${last_block})" 95 | fi 96 | 97 | # get mem pool transactions 98 | mempool="$(bitcoin-cli -datadir=${bitcoin_dir} getmempoolinfo | jq -r '.size')" 99 | 100 | else 101 | btc_line2="${color_red}NOT RUNNING\t\t" 102 | fi 103 | fi 104 | 105 | # get public IP address & port 106 | public_ip=$(curl -s ipinfo.io/ip) 107 | public_port=$(cat ${bitcoin_dir}/bitcoin.conf 2>/dev/null | grep port= | awk -F"=" '{print $2}') 108 | if [ "${public_port}" = "" ]; then 109 | if [ $chain = "test" ]; then 110 | public_port=18333 111 | else 112 | public_port=8333 113 | fi 114 | fi 115 | 116 | public_check=$(timeout 2s nc -z ${public_ip} ${public_port}; echo $?) 117 | if [ $public_check = "0" ]; then 118 | public="Yes" 119 | public_color="${color_green}" 120 | else 121 | public="Not reachable" 122 | public_color="${color_red}" 123 | fi 124 | public_addr="${public_ip}:${public_port}" 125 | 126 | # get LND info 127 | /usr/local/bin/lncli --macaroonpath=${lnd_dir}/readonly.macaroon --tlscertpath=${lnd_dir}/tls.cert getinfo 2>&1 | grep "Please unlock" >/dev/null 128 | wallet_unlocked=$? 129 | if [ "$wallet_unlocked" -eq 0 ] ; then 130 | alias_color="${color_red}" 131 | ln_alias="Wallet Locked" 132 | else 133 | alias_color="${color_grey}" 134 | ln_alias="$(/usr/local/bin/lncli --macaroonpath=${lnd_dir}/readonly.macaroon --tlscertpath=${lnd_dir}/tls.cert getinfo | jq -r '.alias')" 2>/dev/null 135 | ln_walletbalance="$(/usr/local/bin/lncli --macaroonpath=${lnd_dir}/readonly.macaroon --tlscertpath=${lnd_dir}/tls.cert walletbalance | jq -r '.confirmed_balance')" 2>/dev/null 136 | ln_channelbalance="$(/usr/local/bin/lncli --macaroonpath=${lnd_dir}/readonly.macaroon --tlscertpath=${lnd_dir}/tls.cert channelbalance | jq -r '.balance')" 2>/dev/null 137 | 138 | fi 139 | ln_channels_online="$(/usr/local/bin/lncli --macaroonpath=${lnd_dir}/readonly.macaroon --tlscertpath=${lnd_dir}/tls.cert getinfo | jq -r '.num_active_channels')" 2>/dev/null 140 | ln_channels_total="$(/usr/local/bin/lncli --macaroonpath=${lnd_dir}/readonly.macaroon --tlscertpath=${lnd_dir}/tls.cert listchannels | jq '.[] | length')" 2>/dev/null 141 | ln_external="$(/usr/local/bin/lncli --macaroonpath=${lnd_dir}/readonly.macaroon --tlscertpath=${lnd_dir}/tls.cert getinfo | jq -r '.uris[0]' | tr "@" " " | awk '{ print $2 }')" 2>/dev/null 142 | ln_external_ip="$(echo $ln_external | tr ":" " " | awk '{ print $1 }' )" 2>/dev/null 143 | if [ "$ln_external_ip" = "$public_ip" ]; then 144 | external_color="${color_grey}" 145 | else 146 | external_color="${color_red}" 147 | fi 148 | 149 | 150 | printf " 151 | ${color_green} .~~. .~~. ${color_yellow}%s: ${color_gray}Bitcoin Core & LND 152 | ${color_green} '. \ ' ' / .' ${color_yellow}%s 153 | ${color_red} .~ .~~~..~. ${color_gray}%s, CPU Temp %s°C 154 | ${color_red} : .~.'~'.~. : 155 | ${color_red} ~ ( ) ( ) ~ ${color_yellow}%-24s %-24s %-20s 156 | ${color_red} ( : '~'.~.'~' : ) ${color_gray}Memory ${color_ram}%-16s${color_gray}Sync ${sync_color}%-14s${color_gray} ${alias_color}%s 157 | ${color_red} ~ .~ ( ) ~. ~ ${color_gray}SSD ${color_sd}%-16s${color_gray} %-14s ${external_color}%s 158 | ${color_red} ( : '~' : ) ${color_gray}HDD ${color_hdd}%-16s${color_gray}Public ${public_color}%-14s ${color_gray}%s/%s Channels 159 | ${color_red} '~ .~~~. ~' ${color_gray}Traffic ▲ %-12s %-20s ฿ %12s sat 160 | ${color_red} '~' ${color_gray} ▼ %-12s Mempool %-14s 🗲 %12s sat 161 | ${color_red} ${color_yellow}%s 162 | %s %s 163 | " \ 164 | "RaspiBolt" \ 165 | "-------------------------------------------------------------------" \ 166 | "${load}" "${temp}" \ 167 | "Resources free" "${btc_title}" "Lightning (LND)" \ 168 | "${ram}" "${sync}" "${ln_alias}" \ 169 | "${sd}" "${sync_behind}" "${ln_external}" \ 170 | "${hdd}" "${public}" "${ln_channels_online}" "${ln_channels_total}" \ 171 | "${network_tx}" "${public_addr}" "${ln_walletbalance}" \ 172 | "${network_rx}" "${mempool} tx" "${ln_channelbalance}" \ 173 | "" 174 | 175 | echo "$(tput -T xterm sgr0)" 176 | -------------------------------------------------------------------------------- /dietpi.txt: -------------------------------------------------------------------------------- 1 | #Modifications to /boot/* files, will not be saved when powered on. 2 | #Please ensure you edit from the DietPi-RamDisk location /DietPi/* 3 | 4 | #NB: This is intended for advanced users, unless you know what you are doing, do not edit this file. Please use the DietPi programs instead. 5 | #NB: Do not remove uncommented lines, as the items are scraped by DietPi programs, on demand. 6 | 7 | #------------------------------------------------------------------------------------------------------ 8 | # DietPi-Automation 9 | # All settings below will be applied on the 1st boot of DietPi, ONCE. 10 | #------------------------------------------------------------------------------------------------------ 11 | 12 | ##### Networking Options ##### 13 | 14 | # If both Ethernet and Wifi are enabled, Wifi will take priority and Ethernet will be disabled. 15 | # 1=enabled 16 | AUTO_SETUP_NET_ETHERNET_ENABLED=1 17 | AUTO_SETUP_NET_WIFI_ENABLED=0 18 | 19 | # Enter your Wifi details below, if applicable (Case Sensitive). 20 | AUTO_SETUP_NET_WIFI_SSID=MySuperDooperWiFi 21 | AUTO_SETUP_NET_WIFI_KEY=0123456789 22 | # available | WPA-PSK / WPA-EAP / NONE | WEP=No longer supported 23 | AUTO_SETUP_NET_WIFI_KEYMGR=WPA-PSK 24 | 25 | # For WPA2 Enterprise uncomment the following entries and set accordingly 26 | #AUTO_SETUP_NET_WIFI_PROTO=RSN 27 | #AUTO_SETUP_NET_WIFI_PAIRWISE=CCMP 28 | #AUTO_SETUP_NET_WIFI_AUTH_ALG=OPEN 29 | #AUTO_SETUP_NET_WIFI_EAP=PEAP 30 | #AUTO_SETUP_NET_WIFI_IDENTITY= 31 | #AUTO_SETUP_NET_WIFI_PASSWORD= 32 | # 33 | # If your WPA2 Enterprise requries a certificate copy the cert to this /boot directory and enter the name on the following line 34 | #AUTO_SETUP_NET_WIFI_CERT=wpa2ent_cert.cer 35 | # Uncomment either or both lines below and set accordingly for your WPA2 Enterprise needs. 36 | #AUTO_SETUP_NET_WIFI_PHASE1= 37 | #AUTO_SETUP_NET_WIFI_PHASE2=auth=MSCHAPV2 38 | 39 | # Enter your Static Network details below, if applicable. 40 | AUTO_SETUP_NET_USESTATIC=0 41 | AUTO_SETUP_NET_STATIC_IP=192.168.0.100 42 | AUTO_SETUP_NET_STATIC_MASK=255.255.255.0 43 | AUTO_SETUP_NET_STATIC_GATEWAY=192.168.0.1 44 | AUTO_SETUP_NET_STATIC_DNS=8.8.8.8 45 | 46 | # Hostname 47 | AUTO_SETUP_NET_HOSTNAME=DietPi 48 | 49 | # Force ethernet speeds 50 | # NB: This is mainly aimed towards Pine A64's which may have a HW issue that causes unstable 1Gbit link. 51 | # 0=automatic speed | 10 = 10mbit, 100 = 100mbit etc 52 | AUTO_SETUP_NET_ETH_FORCE_SPEED=0 53 | 54 | ##### Misc Options ##### 55 | 56 | # Size of swapfile to generate (MB) 57 | # 0=Disabled | 1=auto (2GB-RAM = size) | 2+=manual 58 | AUTO_SETUP_SWAPFILE_SIZE=0 59 | # Optional swapfile location 60 | AUTO_SETUP_SWAPFILE_LOCATION=/var/swap 61 | 62 | ##### Software Automation Options ##### 63 | 64 | # Fully automate installation 65 | # 1=Automated installation with no user inputs. 66 | # It is HIGHLY recommended to also set CONFIG_BOOT_WAIT_FOR_NETWORK=2, to force infinite wait for network connection during boot, preventing no connection errors due to timeout. 67 | AUTO_SETUP_AUTOMATED=1 68 | 69 | # Global Password to be applied for the system 70 | # Affects user "root" and "dietpi" login passwords, and, all software installed by dietpi-software, that requires a password 71 | # eg: MySQL, Transmission, Deluge etc. 72 | # WARN: Passwords with the any of the following characters are not supported: \"$ 73 | # WARN: Do NOT change this entry after 1st run setup of DietPi has been completed. It is always scraped by dietpi-software. 74 | AUTO_SETUP_GLOBAL_PASSWORD=dietpi 75 | 76 | # DietPi-Software to automatically install. | requires AUTO_SETUP_AUTOMATED=1 77 | # For a list of software index's (ID's), run '/DietPi/dietpi/dietpi-software list' 78 | # No limit on number entries, add as many as you need and uncomment the line. 79 | # DietPi will automatically install all pre-reqs (eg: ALSA/XSERVER for desktops etc) 80 | 81 | #AUTO_SETUP_INSTALL_SOFTWARE_ID=6 #Xserver 82 | 83 | AUTO_SETUP_INSTALL_SOFTWARE_ID=16 #Build essentials 84 | AUTO_SETUP_INSTALL_SOFTWARE_ID=17 #Git 85 | AUTO_SETUP_INSTALL_SOFTWARE_ID=73 #Fail2Ban 86 | AUTO_SETUP_INSTALL_SOFTWARE_ID=94 #ProFTP 87 | AUTO_SETUP_INSTALL_SOFTWARE_ID=130 #Python Pip 88 | AUTO_SETUP_INSTALL_SOFTWARE_ID=162 #Docker 89 | 90 | # DietPi-Software Choice System 91 | # SSH Server Selection: 92 | # 0=none 93 | # -1=dropbear 94 | # -2=opensshserver 95 | AUTO_SETUP_SSH_SERVER_INDEX=-2 96 | 97 | # File Server Selection: 98 | # 0=none/manual 99 | # -1=proftp 100 | # -2=samba 101 | AUTO_SETUP_FILE_SERVER_INDEX=-1 102 | 103 | # Logging Mode Selection: 104 | # 0=none/manual 105 | # -1=ramlog 1h clear 106 | # -2=ramlog 1h save clear 107 | # -3=logrotate + rsyslog 108 | AUTO_SETUP_LOGGING_INDEX=-1 109 | # RAMlog max tmpfs size (MB). 20MB should be fine for single use. 200MB+ for heavy webserver and access log use etc. 110 | AUTO_SETUP_RAMLOG_MAXSIZE=50 111 | 112 | # Webserver Preference Selection: 113 | # NB: This will get ignored, if you have manually selected any WEBSERVER_Stack. 114 | # 0=Apache2 115 | # -1=Nginx 116 | # -2=Lighttpd 117 | AUTO_SETUP_WEB_SERVER_INDEX=-1 118 | 119 | # DietPi-Autostart | Requires AUTO_SETUP_AUTOMATED=1 120 | # After installation is completed, which program should the system boot to? 121 | # 0=Console 7=Console+auto root login | 1=Kodi 2=Desktops (LXDE/MATE etc) 5=DietPi-Cloudshell 6=Uae4ARM (Fastboot) 8=Uae4ARM (standard boot) 9=dxx-rebirth 122 | AUTO_SETUP_AUTOSTART_TARGET_INDEX=0 123 | 124 | # Language/Regional settings | Requires AUTO_SETUP_AUTOMATED=1 125 | # Timezone eg: Europe/London America/New_York | Full list (TZ*): https://en.wikipedia.org/wiki/List_of_tz_database_time_zones 126 | AUTO_SETUP_TIMEZONE=Europe/London 127 | # Locale eg: en_GB.UTF-8 / en_US.UTF-8 etc. One entry ONLY. 128 | AUTO_SETUP_LOCALE=en_GB.UTF-8 129 | # Keyboard Layout eg: gb us de fr 130 | AUTO_SETUP_KEYBOARD_LAYOUT=gb 131 | 132 | # Custom Script | Requires AUTO_SETUP_AUTOMATED=1 133 | # Allows you to automatically execute a custom script at the end of DietPi installation. 134 | # Option 1 = Copy your script to /boot/Automation_Custom_Script.sh and it will be executed automatically. 135 | # Option 2 = Host your script online, then use AUTO_SETUP_CUSTOM_SCRIPT_EXEC=http://myweb.com/myscript.sh , it will be downloaded and executed automatically. | 0=disabled 136 | # NB: Executed script log /var/tmp/dietpi/logs/dietpi-automation_custom_script.log 137 | AUTO_SETUP_CUSTOM_SCRIPT_EXEC=https://raw.githubusercontent.com/Stadicus/raspibolt-setup/master/scripts/raspibolt-autoinit.sh 138 | 139 | #------------------------------------------------------------------------------------------------------ 140 | # D I E T - P I 141 | # DietPi-Config settings. 142 | #------------------------------------------------------------------------------------------------------ 143 | #RPi Hdmi output (if 0, sets tvservice -o and framebuffer 16x 16y 8z on boot, headless) 144 | CONFIG_HDMI_OUTPUT=1 145 | 146 | #Cpu Governor | ondemand | powersave | performance | conservative 147 | CONFIG_CPU_GOVERNOR=ondemand 148 | CONFIG_CPU_USAGE_THROTTLE_UP=50 149 | 150 | #Limit the max cpu frequency (Mhz) for all cores. | Disabled=disabled | Useful for lowering temp/power usage on your device. 151 | CONFIG_CPU_MAX_FREQ=Disabled 152 | 153 | #Limit the min cpu frequency (Mhz) for all cores. | Disabled=disabled | Useful for 1-wire correct support (eg. 480Mhz). 154 | CONFIG_CPU_MIN_FREQ=Disabled 155 | 156 | #Min value 10000 microseconds (10ms) 157 | CONFIG_CPU_ONDEMAND_SAMPLE_RATE=25000 158 | 159 | #sampling rate * down factor / 1000 = Milliseconds (40 = 1000ms when sampling rate is 25000) 160 | CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=80 161 | 162 | #Samba Client Details (Used by DietPi-Config | Networking NAS | Samba Client) 163 | # NB: Do not modify, you must use dietpi-config to configure/set options 164 | CONFIG_SMBCLIENT_COMPUTERNAME=computername 165 | CONFIG_SMBCLIENT_SHARENAME=sharename 166 | CONFIG_SMBCLIENT_USERNAME=username 167 | CONFIG_SMBCLIENT_PASSWORD=password 168 | 169 | #FTP Client Filesystem Mount (CurlFtpFs) (Used by DietPi-Config | Networking NAS | FTP Client) 170 | # NB: Do not modify, you must use dietpi-config to configure/set options 171 | CONFIG_CURLFTPFS_ADDRESS=192.168.0.100 172 | CONFIG_CURLFTPFS_USERNAME=username 173 | CONFIG_CURLFTPFS_PASSWORD=password 174 | 175 | #NFS Client Filesystem Mount (Used by DietPi-Config | Networking NAS | NFS Client) 176 | # NB: Do not modify, you must use dietpi-config to configure/set options 177 | CONFIG_NFSCLIENT_ADDRESS= 178 | 179 | #Proxy settings | System-wide proxy settings. Use dietpi-config > networking options to apply. 180 | # NB: Do not modify, you must use dietpi-config to configure/set options 181 | CONFIG_PROXY_ENABLED=0 182 | CONFIG_PROXY_ADDRESS=MyProxyServer.com 183 | CONFIG_PROXY_PORT=8080 184 | CONFIG_PROXY_USERNAME= 185 | CONFIG_PROXY_PASSWORD= 186 | 187 | #Delay boot until network is established: 0=disabled | 1=10 second wait max (default) | 2=infinite wait 188 | CONFIG_BOOT_WAIT_FOR_NETWORK=1 189 | 190 | #DietPi check for updates (allows dietpi to check for updates on a daily basis and boot using a <1kb file download.) 191 | CONFIG_CHECK_DIETPI_UPDATES=1 192 | 193 | #NTPD Update Mode: 0=disabled | 1=boot only | 2=boot + daily | 3=boot + hourly | 4=Daemon + Drift 194 | CONFIG_NTP_MODE=2 195 | 196 | #WiFi country code. 2 character value (eg GB US DE JP): https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 197 | CONFIG_WIFI_COUNTRY_CODE=GB 198 | 199 | #Serial Console: Set to 1 if you require a serial console. 200 | # NB: Serial console is always enabled by default for 1st run setup, then disabled afterwards, unless set below. 201 | CONFIG_SERIAL_CONSOLE_ENABLE=0 202 | 203 | #Soundcard 204 | CONFIG_SOUNDCARD=none 205 | 206 | #LCD Panel addon 207 | # NB: Do not modify, you must use dietpi-config to configure/set options 208 | CONFIG_LCDPANEL=none 209 | 210 | #Prefer IPversion (for: APT, wget) | auto (let system decide) / ipv4 (force) / ipv6 (prefer) | eg: force IPv4 with CONFIG_PREFER_IPVERSION=ipv4 211 | CONFIG_PREFER_IPVERSION=ipv4 212 | 213 | #Apt mirrors which are applied to /etc/apt/sources.list | Values here will also be applied during 1st run setup 214 | # Raspbian = https://www.raspbian.org/RaspbianMirrors 215 | # Debian = https://www.debian.org/mirror/official#list 216 | CONFIG_APT_RASPBIAN_MIRROR=http://raspbian.raspberrypi.org/raspbian 217 | CONFIG_APT_DEBIAN_MIRROR=https://deb.debian.org/debian/ 218 | 219 | #NTPD mirror, applied to /etc/ntp.conf 220 | # For a full list, please see http://www.pool.ntp.org 221 | # Please remove the initial interger and full stop from the value (removing 0.). eg: debian.pool.ntp.org 222 | CONFIG_NTP_MIRROR=debian.pool.ntp.org 223 | 224 | #------------------------------------------------------------------------------------------------------ 225 | # D I E T - P I 226 | # DietPi-Software settings. 227 | #------------------------------------------------------------------------------------------------------ 228 | #Enter your EmonCMS.org write API key here. It will be applied automatically during EmonPi/Hub installation. 229 | # eg: SOFTWARE_EMONHUB_APIKEY=b4dfmk2o203mmxx93a 230 | SOFTWARE_EMONHUB_APIKEY= 231 | 232 | #VNC Server Options 233 | SOFTWARE_VNCSERVER_WIDTH=1280 234 | SOFTWARE_VNCSERVER_HEIGHT=720 235 | SOFTWARE_VNCSERVER_DEPTH=16 236 | SOFTWARE_VNCSERVER_DISPLAY_INDEX=1 237 | SOFTWARE_VNCSERVER_SHARE_DESKTOP=0 238 | 239 | #Optional username for ownCloud/Nextcloud admin account, default is 'admin'. Applied during installation. 240 | SOFTWARE_OWNCLOUD_NEXTCLOUD_USERNAME=admin 241 | 242 | #Optional data directory for ownCloud, default is '/mnt/dietpi_userdata/owncloud_data'. Applied during installation. 243 | # This option is for advanced users. For full compatibility, please keep this options defaults, and, use dietpi-drive_manager to move the DietPi user data location. 244 | SOFTWARE_OWNCLOUD_DATADIR=/mnt/dietpi_userdata/owncloud_data 245 | 246 | #Optional data directory for Nextcloud, default is '/mnt/dietpi_userdata/nextcloud_data'. Applied during installation. 247 | # This option is for advanced users. For full compatibility, please keep this options defaults, and, use dietpi-drive_manager to move the DietPi user data location. 248 | SOFTWARE_NEXTCLOUD_DATADIR=/mnt/dietpi_userdata/nextcloud_data 249 | 250 | #Wifi Hotspot 251 | SOFTWARE_WIFI_HOTSPOT_SSID=DietPi-HotSpot 252 | # minimum of 8 characters 253 | SOFTWARE_WIFI_HOTSPOT_KEY=dietpihotspot 254 | SOFTWARE_WIFI_HOTSPOT_CHANNEL=3 255 | 256 | #------------------------------------------------------------------------------------------------------ 257 | # D I E T - P I 258 | # Dev settings 259 | #------------------------------------------------------------------------------------------------------ 260 | DEV_GITBRANCH=master 261 | DEV_GITOWNER=Fourdee 262 | --------------------------------------------------------------------------------