Skip to content
Snippets Groups Projects

selfdata

This documentation covers the technical aspects of projects developed by the Grandlyon in cooperation with Cozy Cloud.

Installing prerequisites

In order to work with a self-data environment, there are a couple of prerequisites. Don't forget to take a look at our general development guidelines wiki first.

Name Required Details
Node Yes Node 16 must be installed as it is the version that runs on the official cozystack.
Yarn Yes Yarn is our projects package manager.
Docker Yes See cozystack for more informations.
Docker-compose Yes
WSL No Required for windows users.

Usage

Node NVM

You might need to manage several NodeJS versions on the same computer when working on different projects. To manage it properly, you can use the nvm package on windows or n package on linux.

$ yarn global add nvm

=== "Install a version" console $ nvm install X.X.X

=== "See installed node versions" console $ nvm list

=== "Switch to a specific version" console $ nvm use X.X.X

=== "Check your current version" console $ node -v

WSL

First open Powershell as administrator and launch the following command:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

This command will install WSL on your computer. After this, you'll need to ==reboot==.

Upgrade to WSL 2

If you're on WSL 1 and want to upgrade to WSL 2, here is the process:

  1. Open an elevated powershell and paste the following command:

    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  2. Then, enable the Virtual Machine Platform optional feature.

    dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
  3. Now restart your computer to apply these features. Once it's done, open an elevated powershell again and set the default wsl version to 2

    $ wsl --set-default-version 2

!!! warning "You might see this message after running the command above" WSL 2 requires an update to its kernel component. For information please visit wsl2kernel.

If you install the MSI from wsl2kernel. Once you have the kernel installed, please run wsl --set-default-version 2 again and it should complete successfully without showing the message.

Install your Linux distribution

After reboot, open the microsoft store and install the distribution of your choice, for instance: ==Ubuntu 20.04 LTS==. Once it's done, open it and after a few minutes you'll be prompted for the creation of a user account.

To make sure it's correctly installed and working, you can open Powershell and paste the following command :

wsl.exe --list --running

Now you should see the name of your distribution in the list.

Setup your distribution

  1. Start updating the packages list by typing:

    $ sudo apt update
  2. Install nodejs using the apt package manager

    $ sudo apt install
  3. To verify the Installation execute the following command:

    $ nodejs --version
  4. To be able to download npm package, you need to install the npm, the Node.js package manager. To do so type:

    $ sudo apt install npm
  5. To verify the npm Install check using the command:

    $ npm --version
  6. To Downlaod and Setup Yarn

    $ sudo apt install yarn
  7. To check the installed version of Yarn:

    $ yarn --version

Now you'll probably be in version 0.23+git, if so you'll have to upgrade to 1.22 to make everything work properly. In order to achieve this, you'll have to launch several commands:

sudo apt-get remove cmdtest
sudo apt autoremove
sudo apt-get update
sudo apt install curl -y
curl -o- -L https://yarnpkg.com/install.sh | bash
source ~/.bashrc

Now you should be at least in version ==^1.22== and ready to go on.

Contributing to the documentation

To install and run the documentation on your laptop, follow the steps in the README. Then:

  • Create a branch for your change
  • Add documentation pages to docs, and supporting assets to img.
  • Write some markdown
  • Submit a merge request

europe auvergne