Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Commit

Permalink
refactor: moved all linux relatex resources
Browse files Browse the repository at this point in the history
  • Loading branch information
carlocorradini committed Nov 30, 2022
1 parent 539f06a commit d3afdb0
Show file tree
Hide file tree
Showing 38 changed files with 373 additions and 193 deletions.
35 changes: 21 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,33 @@

reCluster is an architecture for a data center that actively reduces its impact and minimizes its resource utilization.

## Members
## :busts_in_silhouette: Members

| Name | Surname | Username | MAT |
| :---: | :-------: | :--------------: | :--------: |
| Carlo | Corradini | `carlocorradini` | **223811** |

## :books: Documentation

See [docs](./docs/) directory for more information.

## :file_folder: Directories

> **Note**: Refer to the `README.md` of each directory for more information
| **Name** | **Description** |
| ----------------------- | ----------------------------------------------------------------- |
| [`.github`](./.github/) | [GitHub](https://github.com) configuration |
| [`.husky`](./.husky/) | [husky](https://typicode.github.io/husky) configuration |
| [`.vscode`](./.vscode/) | [Visual Studio Code](https://code.visualstudio.com) configuration |
| [`linux`](./linux/) | `Linux`-related resources |
| [`scripts`](./scripts/) | `Shell` scripts |
| [`server`](./server/) | `reCluster` server |
| **Name** | **Description** |
| ----------------------------------- | ----------------------------------------------------------------- |
| [`.github`](./.github/) | [GitHub](https://github.com) configuration |
| [`.husky`](./.husky/) | [husky](https://typicode.github.io/husky) configuration |
| [`.vscode`](./.vscode/) | [Visual Studio Code](https://code.visualstudio.com) configuration |
| [`configs`](./configs/) | Configuration files |
| [`dependencies`](./dependencies/) | Dependencies |
| [`distributions`](./distributions/) | Distributions |
| [`docs`](./docs/) | Documentation |
| [`scripts`](./scripts/) | `Shell` scripts |
| [`server`](./server/) | `reCluster` server |

## Development
## :computer: Development

### Requirements

Expand Down Expand Up @@ -64,10 +71,10 @@ reCluster is an architecture for a data center that actively reduces its impact

> **Note**: Execute with `npm run <NAME>`

| **Name** | **Description** |
| -------- | ----------------- |
| `check` | Check for errors. |
| `fix` | Fix errors. |
| **Name** | **Description** |
| -------- | ---------------- |
| `check` | Check for errors |
| `fix` | Fix errors |

## License

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion linux/configs/config.yml → configs/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ kind: controller
# kind: server

recluster:
server: http://192.168.0.25:8080
server: http://192.168.0.10:8080

ssh_authorized_keys:
- ssh-ed25519 ... # TODO Change with SSH public key !
File renamed without changes.
2 changes: 1 addition & 1 deletion linux/configs/k3s.worker.yml → configs/k3s.worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
# SOFTWARE.

token: 4646f99bc4cbae3d5eceed856b337c9d3284be0d4056a3909f780c0c385fbf93
server: https://192.168.0.25:6443
server: https://192.168.0.10:6443
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions linux/configs/ssh_config → configs/ssh_config
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/*
MIT License

Copyright (c) 2022-2022 Carlo Corradini

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/


# This is the ssh client system-wide configuration file. See
# ssh_config(5) for more information. This file provides defaults for
Expand Down
24 changes: 24 additions & 0 deletions linux/configs/sshd_config → configs/sshd_config
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/*
MIT License

Copyright (c) 2022-2022 Carlo Corradini

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/


# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
Expand Down
17 changes: 9 additions & 8 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
"**/node_modules/",
"./license.json",
"./server/prisma/migrations/",
"./linux/configs/ssh_config",
"./linux/configs/sshd_config",
"./linux/distributions/alpine/Dockerfile",
"./linux/distributions/alpine/mkimg.recluster.sh",
"./linux/distributions/alpine/genapkovl-recluster.sh",
"./linux/distributions/arch/Dockerfile",
"./linux/distributions/arch/packages.x86_64",
"./linux/distributions/arch/profiledef.sh"
"./configs/ssh_config",
"./configs/sshd_config",
"./distributions/alpine/Dockerfile",
"./distributions/alpine/mkimg.recluster.sh",
"./distributions/alpine/genapkovl-recluster.sh",
"./distributions/arch/Dockerfile",
"./distributions/arch/packages.x86_64",
"./distributions/arch/profiledef.sh"
],
"words": [
"aarch",
Expand Down Expand Up @@ -150,6 +150,7 @@
"uncompiled",
"upsert",
"workdir",
"xvzf",
"zoneinfo"
]
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@
DIRNAME=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)

# Load commons
# shellcheck source=../../scripts/__commons.sh
. "$DIRNAME/../../scripts/__commons.sh"
# shellcheck source=../scripts/__commons.sh
. "$DIRNAME/../scripts/__commons.sh"

# ================
# CONFIGURATION
# ================
# Configuration file
CONFIG_FILE="dependencies.config.yml"
# Root directory
ROOT_DIR="$(readlink -f "$DIRNAME/../..")"
ROOT_DIR="$(readlink -f "$DIRNAME/..")"
# Synchronize flag
SYNC=false
# Synchronize force flag
Expand Down
11 changes: 11 additions & 0 deletions distributions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# reCluster distributions

reCluster distributions.

## [Alpine Linux](./alpine/)

Alpine Linux distribution.

## [Arch Linux](./arch/) distribution

Arch Linux.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
DIRNAME=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)

# Load commons
# shellcheck source=../../../scripts/__commons.sh
. "$DIRNAME/../../../scripts/__commons.sh"
# shellcheck source=../../scripts/__commons.sh
. "$DIRNAME/../../scripts/__commons.sh"

# ================
# CONFIGURATION
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
DIRNAME=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)

# Load commons
# shellcheck source=../../../scripts/__commons.sh
. "$DIRNAME/../../../scripts/__commons.sh"
# shellcheck source=../../scripts/__commons.sh
. "$DIRNAME/../../scripts/__commons.sh"

# ================
# CONFIGURATION
Expand Down
File renamed without changes
62 changes: 62 additions & 0 deletions distributions/arch/packages.x86_64
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
MIT License

Copyright (c) 2022-2022 Carlo Corradini

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

# ================
# Base
# ================
base
cloud-init
hyperv
linux
mkinitcpio
mkinitcpio-archiso
open-vm-tools
openssh
pv
qemu-guest-agent
syslinux
virtualbox-guest-utils-nox
# ================
# Installation
# ================
archinstall
parted
# ================
# reCluster
# ================
coreutils
ethtool
inotify-tools
iproute2
jq
ncurses
nodejs
npm
openssh
procps
sudo
sysbench
tzdata
util-linux
yq
File renamed without changes.
7 changes: 7 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# reCluster documentation

reCluster documentation.

- [Installation](./installation.md)
- [Requirements](./installation_requirements.md)
- [Script](./installation_script.md)
69 changes: 69 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Installation

reCluster installation.

## Requirements

See [Installation requirements](./installation_requirements.md) for more information.

## Steps

1. Download the most recent `recluster.tar.gz` from [GitHub release](https://github.com/carlocorradini/reCluster/releases/latest)

```sh
wget https://github.com/carlocorradini/reCluster/releases/latest/download/recluster.tar.gz
```

1. Unzip `recluster.tar.gz`

```sh
tar -xvzf recluster.tar.gz
```

1. Generate certificates

> **Warning**: Change `_ssh_passphrase` and `_token_passphrase` passphrase

> **Info**: See [certs](../scripts/README.md#📑-certssh) for more information

```sh
_ssh_passphrase="password"
_token_passphrase="password"
_out_dir="configs/certs"
mkdir "$_out_dir" # Create certs directory
./scripts/certs.sh \ # Generate certificates
--ssh-passphrase "$_ssh_passphrase" \
--token-passphrase "$_token_passphrase" \
--out-dir "$_out_dir"
```

1. Start a PostgreSQL database instance

> **Note**: Visit <https://www.postgresql.org> for more information

1. Edit [configuration files](../configs/) to match your environment

> **Note**: Remember to change `DATABASE_URL` in [`server.env`](../configs/server.env)

1. Copy the text from `configs/certs/ssh.pub` and put it in the `ssh_authorized_keys` property of [`configs/config.yml`](../configs/config.yml) (`ssh-ed25519 ...`).

> **Warning**: All files from `configs/certs` should be copied and saved in a well known and secure place

1. Place all files and directories on a flash drive

> **Note**: See <https://askubuntu.com/a/802675/1149269> for more information

1. Pick a Linux distribution from [`distributions`](../distributions/) and install it

> **Note**: For further information on how to install a distribution, see its accompanying `README.md` file

> **Note**: Remember to connect the Power Consumption device

1. Mount the flash drive on the node

1. Launch `install.sh` installation script

> See [Installation script](./installation_script.md) for more information

1. Congratulations! You have successfully installed reCluster
Loading

0 comments on commit d3afdb0

Please sign in to comment.