README.md 4.96 KB
Newer Older
HgO's avatar
HgO committed
1
# Neutrinet Cube install
Ilja's avatar
Ilja committed
2

ilja's avatar
ilja committed
3 4 5 6 7 8
A script to easily install Neutrinet internetcubes

- [Neutrinet association](https://neutrinet.be)
- [La Brique Internet/Internet Cube project](https://labriqueinter.net/)
- [Yunohost project](https://yunohost.org)

HgO's avatar
HgO committed
9 10
# Requirements

Ilja's avatar
Ilja committed
11 12 13 14 15
You will need the packages `git`, `curl`, `jq`, `unzip`, `gpg` installed on your system.  
In addition, some parts of this script require sudo access to be executed.

On Debian based distributions you can run
```shell
16
sudo apt install git curl jq unzip gpg
HgO's avatar
HgO committed
17 18
```

Ilja's avatar
Ilja committed
19 20
# How to use this script
## What the script does
ilja's avatar
ilja committed
21

Ilja's avatar
Ilja committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
The script will ask several questions needed to set up the Neutrinet cube, including usernames and passwords.  
A file called `install.hypercube` will be created containing this information.  
If an `install.hypercube` is already found, you'll be asked if you want to reuse these answers first.  
If you choose to reuse the answers, the script won't ask the questions again.

Questions that will be asked and stored in the `install.hypercube` file are:
* What domain to use. If you do not have your own domain, you can get a free subdomain under `.nohost.me`, `.noho.st` or `.ynh.fr`.
* A username for the first user on the cube
* Your firstname and lastname. These are the firstname and lastname that will be configured on the cube. You can give any names you want, but it can't be blank.
* A password for this user 
* A password for the admin interface
* Your Neutrinet VPN credentials
* A name and password for the wifi hotspot

The script will then download several resources in order to set up the image to install and configure the cube.  
These files will be kept in a folder called `cube_resources`.  
If you run the script with this folder already present, it will try to find the files there instead of downloading everything again.

Once everything is set up, the script will ask you to insert your micro-SD card and flash the image on it.

Once this is done, you can assemble your cube and let the script look for your cube on the network.  
You can follow the progress of the configuration via `http://<cube-ip>:2468/install.html`. Make sure you have Javascript enabled for this.

When the script has either finished or has failed, it will ask you if you want to remove the `cube_resources` folder and `install.hypercube` file.  
A good reason to keep the `cube_resources` folder is if you want to do multiple installation.  
A good reason to keep the `install.hypercube` file is if the script failed for some reason and you want to rerun it.  
Note that the `install.hypercube` file has your passwords, so you shouldn't keep it longer than needed!

It can take about two hours from downloading and running the script until the Neutrinet cube is fully installed and configured.

## Downloading the script

54 55 56 57 58 59 60
There are several ways to get the script:

- Download the [standalone script](https://gitlab.domainepublic.net/Neutrinet/neutrinet_cube_install/blob/stable/neutrinet_cube_install.sh) (English only):
```shell
curl https://git.domainepublic.net/Neutrinet/neutrinet_cube_install/raw/stable/neutrinet_cube_install.sh -o neutrinet_cube_install.sh
```
- Clone the whole project and navigate to it:
Ilja's avatar
Ilja committed
61
```shell
62
git clone https://gitlab.domainepublic.net/Neutrinet/neutrinet_cube_install.git
Ilja's avatar
Ilja committed
63
cd neutrinet_cube_install
ilja's avatar
ilja committed
64
```
65 66 67 68 69 70
- Download a zip file with the button on the [project page](https://git.domainepublic.net/Neutrinet/neutrinet_cube_install) (below the clone button), or run:
```shell
curl https://git.domainepublic.net/Neutrinet/neutrinet_cube_install/-/archive/stable/neutrinet_cube_install-stable.zip -o neutrinet_cube_install.zip
unzip neutrinet_cube_install.zip
cd neutrinet_cube_install-stable
```
71

Ilja's avatar
Ilja committed
72 73 74 75 76 77 78 79
## Running the script

After you cloned the package, you can run the script and follow the instructions
```shell
bash neutrinet_cube_install.sh
```
If you are planning on installing multiple cubes at a later time, you may consider dedicating a folder on your PC/laptop for this and run
```shell
ilja's avatar
ilja committed
80 81
bash neutrinet_cube_install.sh -p
```
Ilja's avatar
Ilja committed
82
This will create a `cube_resources` folder and already download and prepare as much as possible.
ilja's avatar
ilja committed
83

84
For more information you can use the -h option:
Ilja's avatar
Ilja committed
85
```shell
ilja's avatar
ilja committed
86 87
bash neutrinet_cube_install.sh -h
```
Ilja's avatar
Ilja committed
88

Ilja's avatar
Ilja committed
89
## Running the script using translations
HgO's avatar
HgO committed
90

Ilja's avatar
Ilja committed
91
You can change the language of this script with the `LANGUAGE` environment variable. For French you can do
HgO's avatar
HgO committed
92 93 94 95
```shell
LANGUAGE=fr bash neutrinet_cube_install.sh
```

Ilja's avatar
Ilja committed
96 97 98 99 100 101
# Contributing

## Adding translations

You can start a translation by using the template translation file `locale/neutrinet.pot`.  
You can open it with [poedit](https://poedit.net/) to start a translation.
HgO's avatar
HgO committed
102 103 104 105 106 107

This template file can be generated with:
```shell
bash --dump-po-strings neutrinet_cube_install.sh | msguniq -o locale/neutrinet.pot
```

Ilja's avatar
Ilja committed
108
## Bugs, features and issues
Ilja's avatar
Ilja committed
109
* Bugs, feature requests and other issues can be logged on the issue tracker at https://git.domainepublic.net/Neutrinet/neutrinet_cube_install/issues
Ilja's avatar
Ilja committed
110
* Merge requests should be submitted to the `unstable` branch https://git.domainepublic.net/Neutrinet/neutrinet_cube_install/