{"id":16413479,"url":"https://github.com/noblemajo/codec","last_synced_at":"2025-03-21T03:31:54.571Z","repository":{"id":111230244,"uuid":"456192935","full_name":"NobleMajo/codec","owner":"NobleMajo","description":"CodeC - containerized web-based multi-user VS-Code like dev env","archived":false,"fork":false,"pushed_at":"2024-09-22T14:10:11.000Z","size":6211,"stargazers_count":15,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-11T06:51:40.764Z","etag":null,"topics":["browser","code-servee","codec","developer-tools","development-environment","devenv","docker","docker-image","docker-image-available","server","vscode","webdevelopment"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NobleMajo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-06T15:39:49.000Z","updated_at":"2024-09-22T14:10:14.000Z","dependencies_parsed_at":"2024-09-06T23:15:20.683Z","dependency_job_id":"9c8fdb2f-9fbc-42c2-943e-26488d9c596b","html_url":"https://github.com/NobleMajo/codec","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NobleMajo%2Fcodec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NobleMajo%2Fcodec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NobleMajo%2Fcodec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NobleMajo%2Fcodec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NobleMajo","download_url":"https://codeload.github.com/NobleMajo/codec/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221811376,"owners_count":16884305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","code-servee","codec","developer-tools","development-environment","devenv","docker","docker-image","docker-image-available","server","vscode","webdevelopment"],"created_at":"2024-10-11T06:51:36.454Z","updated_at":"2024-10-28T09:14:47.705Z","avatar_url":"https://github.com/NobleMajo.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# codec ( [deprecated](#deprecated) )\n![MIT](https://img.shields.io/badge/license-MIT-blue.svg)\n![](https://img.shields.io/badge/dynamic/json?color=green\u0026label=watchers\u0026query=watchers\u0026suffix=x\u0026url=https%3A%2F%2Fapi.github.com%2Frepos%2Fnoblemajo%2Fcodec)\n![](https://img.shields.io/badge/dynamic/json?color=yellow\u0026label=stars\u0026query=stargazers_count\u0026suffix=x\u0026url=https%3A%2F%2Fapi.github.com%2Frepos%2Fnoblemajo%2Fcodec)\n![](https://img.shields.io/badge/dynamic/json?color=orange\u0026label=subscribers\u0026query=subscribers_count\u0026suffix=x\u0026url=https%3A%2F%2Fapi.github.com%2Frepos%2Fnoblemajo%2Fcodec)\n![](https://img.shields.io/badge/dynamic/json?color=navy\u0026label=forks\u0026query=forks\u0026suffix=x\u0026url=https%3A%2F%2Fapi.github.com%2Frepos%2Fnoblemajo%2Fcodec)\n![](https://img.shields.io/badge/dynamic/json?color=darkred\u0026label=open%20issues\u0026query=open_issues\u0026suffix=x\u0026url=https%3A%2F%2Fapi.github.com%2Frepos%2Fnoblemajo%2Fcodec)\n\n# table of contents\n- [codec](#codec)\n- [table of contents](#table-of-contents)\n- [about](#about)\n- [deprecated](#deprecated)\n- [base](#base)\n- [Installation](#installation)\n  - [Requirements](#requirements)\n  - [Clone](#clone)\n  - [Provider CLI](#provider-cli)\n  - [Proxy setup](#proxy-setup)\n  - [Startup](#startup)\n- [Components](#components)\n  - [CLI](#cli)\n  - [Proxy](#proxy)\n  - [Image](#image)\n  - [Mods](#mods)\n  - [Mounts](#mounts)\n- [folder structure](#folder-structure)\n  - [User FS](#user-fs)\n  - [System FS](#system-fs)\n- [Preview](#preview)\n- [Codec v1](#codec-v1)\n  - [v1 Software](#v1-software)\n  - [v1 folder structure](#v1-folder-structure)\n  - [v1 Problems](#v1-problems)\n  - [v2.0.0 changes](#v200-changes)\n- [contribution](#contribution)\n\n# about\nCodeC is a containerized web-based Multi-User VS-Code like development environment based on coder/code-server, Docker, Ubuntu and a lot of CLI, Control and Setup Bash Scripts.\n\nThe CodeC environment consists of several software components, all of which work together to create a complete environment for the users. \n\nThis `README.md` that you read right now is written in a CodeC environment:\n![Makrdown](./docs/img/codec-markdown-preview.png)\n\n# deprecated\nNew features for this software will not be developed and support will be discontinued.\nToday, the developer of this software would choose a completely different conceptual approach for the software.\n\n# base\n\nCodeC is based on the following Software:\n| Software     | Description                                                                      |\n| ------------ | -------------------------------------------------------------------------------- |\n| Code-Server  | VS-Code in web by [Coder](https://github.com/coder/code-server)                  |\n| Ubuntu       | The Ubuntu Docker Image on [hub.docker.com](https://hub.docker.com/_/ubuntu)     |\n| Docker       | The Image is based on and tested with [Docker](https://www.docker.com)           |\n| Bash scripts | The own CodeC Provider and User CLI Tools and the Setup Scripts are Bash scripts |\n| More...      | Take a look at the `Dockerfile`                                                  |\n\n# Installation\nIf you want to use CodeC here is the installation guide.\nPlease note that the CodeC is under development, may have some security issues and the CodeC provider (the person who installs and/or hosts the codec) is responsible for bugs, risks and problems.\n\n## Requirements\n\n![One does not simply do that job](./docs/img/one-does-not-simply.png)\n\n| Required  | Explanation                                                                                                 |\n| --------- | ----------------------------------------------------------------------------------------------------------- |\n| ubuntu os | Tested with `20.04`. Should also work with `16.04` and newer.                                               |\n| docker    | Working Docker CLI Tools.                                                                                   |\n| sudo      | Root privileges and `sudo installed`. For Docker and changes to user data managed by CodeC user containers. |\n| git       | To clone and update the repository.                                                                         |\n\n\n## Clone\n\n\n```bash\ngit clone git@github.com:NobleMajo/codec.git codec\n```\n\n## Provider CLI\n```bash\ncd codec\n./codeccli install  # installs the CodeC CLI tool\ncodeccli help  # check the CLI installation\ncodeccli build  # triggers the build of the CodeC container image\n```\n\n## Proxy setup\nUse the following commands to start a simple `CProX` proxy server for the wildcard domain `*.codec.example.com`.\n\n### Secure\n```bash\ndocker run \\\n  -v /path/to/certs:/app/certs \\\n  -e CERT_PATH=\"/app/certs\" \\\n  -e CERT_NAME=\"cert1.pem\" \\\n  -e KEY_NAME=\"privkey1.pem\" \\\n  -e CA_NAME=\"fullchain1.pem\" \\\n  -e VERBOSE=\"true\" \\\n  --network=\"codec_net\" \\\n  -p 80:80 \\\n  -p 443:443 \\\n  noblemajo/cprox \\\n  *.codec.example.com=PROXY:http://codec_{-4}:8080\n```\n### Unsecure\nFor an HTTP-only proxy, use the following command instead:\n```bash\ndocker run \\\n  -e HTTP_PORT=\"80\" \\\n  -e VERBOSE=\"true\" \\\n  --network=\"codec_net\" \\\n  -p 80:80 \\\n  noblemajo/cprox \\\n  *.codec.example.com=PROXY:http://codec_{-4}:8080\n```\n\n### Proxy Configuration\nHere is the `CProx` Proxy Dokumentation:  \n[https://github.com/noblemajo/cprox](https://github.com/noblemajo/cprox)\n\nIn the above commands, the `{-4}` is the wildcard index and defines the names of the user containers in the subdomains.  \nSome examples:\n- `*.codec.example.com` = `PROXY:http://codec_{-4}:8080`\n- `*.codec.test.example.com` = `PROXY:http://codec_{-5}:8080`\n- `*.example.com` = `PROXY:http://codec_{-3}:8080`\n- `*.codec.test.intern.example.com` = `PROXY:http://codec_{-6}:8080`\n\n## Startup\nNow you are ready to start a CodeC container!\n\n![CodeC works](./docs/img/Success-Kid.png)\n\nHere is a explaination how to use the `codeccli start` to start a CodeC user container:\n[codeccli start](#start)\n\n\n\n# Components\nCodeC is a containerized development environment that is built using different software components to create a unified environment. \n\n## CLI\nThe CodeC CLI, also known as `codeccli`, is a provider CLI that allows a CodeC provider to control CodeC user containers on a host by starting or stopping them, modifying passwords, building or updating, and more. \n\n### start\n\n![One does not simply do that job](./docs/img/cat1.png)\n\nTo start or restart a CodeC user container, use the following command:\n\n```bash\ncodeccli start \u003cUSER_NAME\u003e \u003cSTART_PORT\u003e \u003cPORT_COUNT\u003e\n```\n\nAdditional options for the start command include:\n- `--not-privileged/-n`: Disables privileged mode for the user CodeC Docker container for `more security` and does not allow the user to use Docker in Docker. To use docker in a CodeC instance also read about the CodeC [docker mod](#mod-docker).\n- `--mount-sock/-s`: Mounts the Docker socket to the starting container to `allow access to the host Docker containers`, system, and ports.\n- `--read-only/-r`: Starts the container in read-only mode. CodeC is `not built to run in read-only mode`, but the option is available anyways.\n- `--force/-f`: Dont ask the user if the container really should be started.\n\n*The flags and arguments that are used will be stored for the next startup of the user except `-f` and the user name.*\n\nAfter the start the container opens the code-server on port 8080.\nYou can access the code-server just with a configured proxy server.\n\nLogin using the given password of the `codeccli` command or change it:\n![Login Hover](./docs/img/login-hover.png)\n\n### pass\nChange the password of an existing users:\n```bash\ncodeccli pass \u003cNAME\u003e\n```\n\n### build\nThe following command builds the CodeC docker image. Since the build script is executed when the start command is used, the command usually does not need to be used.\n```bash\ncodeccli build\n```\n\nAdditional options for the start command include:\n- `--scratch/-s`: Build the image from scratch. That can take a few minutes.\n\n### list\nShow a list of all existing container users:\n```bash\ncodeccli list\n```\n\n### logs\nShow the systemd and CodeC service logs of an existing and running user container:\n```bash\ncodeccli logs \u003cNAME\u003e\n```\n\n### close\nStop and remove an existing container:\n```bash\ncodeccli close \u003cNAME\u003e\n```\n\n### reset\n(This command will not delete the persisted user data except the user CodeC configuration in the listed folders below)*\n\nReset all files in /codec/mounts and /codec/.codec of an existing container:\n```bash\ncodeccli reset \u003cNAME\u003e\n```\n\n### delete\nDelete all peristend CodeC user files and configurations:\n```bash\ncodeccli delete \u003cNAME\u003e\n```\n\n## Proxy\nAs CodeC Proxy you can use any proxy that can proxy the requests to the user container the right way.\n\n![One does not simply do that job](./docs/img/what-if-i-told.png)\n\nWe recommend to use [CProX](https://github.com/noblemajo/cprox), because it provides a working and easy to use/setup proxy functionality.  \nIn the [installation guide](#proxy-setup), you can view how to use CProX as CodeC Proxy server.\n\nA CodeC Proxy provides users the access to their own container via their own hostname (`sub domain`).  \nFor example, if the CodeC is running under the wildcard subdomain `*.codec.example.com`, the user `foobar` gets access their oen CodeC instance vie the hostname `foobar.codec.example.com`.\nThe proxy server determines which container to proxy the incoming HTTP requests to based on the host.\nFor that, the proxy server needs to be in the same docker network as the CodeC container instances.\n\nA proxy server is necessary to publish all CodeC containers http web server ports via the same tcp port (80/443).\n\n## Image\nIn the context of CodeC, the image refers to the Docker image from which all CodeC user containers are started.   The image is based on one of the newest Ubuntu versions (often LTS) and includes various development tools like: `NPM`, `Node.js`, `Git`, the `code-server` (vs-code web abstraction built by [Coder](https://github.com/coder/code-server)). \n\nAdditionally, it contains some persistent scripts that adapt all files to the CodeC persistence behavior.  \nEach user gets one running CodeC container instance based on the CodeC Docker image.\n\nThe blueprint for the image is in the `Dockerfile` and can be built by the `codeccli` [build](#build) command.\n\n### Persistence\n\nInstead of storing all the data on disk, which would take up a lot of storage space for each Codec user, Codec just stores one folder (`/codec`) that persists across container restarts.\n\nThis way the codec provider dont needs to store a huge amount of data, but the user needs to organize their persistent data.\n\nTo manage the persistent data accross the maschine the user can use [Mods](#mods) and [Mounts](#mounts).\n\n### Instance\nIn the CodeC environment, a CodeC container instance refers to a running Docker container based on the CodeC Docker image and started by the CodeC CLI-Tool.   \nEach instance is running for one or more users that share one password to access the instance.  \nThe user can customize the instance with CodeC [Mods](#mods), CodeC [Mounts](#mounts) and build in configuration files.\n\n### User CLI\nThe `codec` command is the CodeC-User-CLI Tools that users can use in the CodeC instance in their terminal.\nThey can use the tool to restart their own container, change passwords, and make other settings, such as enabling and disabling Mods.\n\n#### restart\nRestart the current user instance:\n```\ncodec -r\n```\n\nThe command above will restart the whole instance.\nIf `just the code server` makes trouble, the user can alse perform a fast restart:\n```\ncodec -fd\n```\n\n#### password\nChange the user's password of the login of the current instance:\n```\ncodec -i\n```\n\n#### help\n```\ncodec -h\n```\n\n#### mod cli\nEnable CodeC Mods:\n```\ncodec modon \u003cModName\u003e\n```\nDisable CodeC Mods:\n```\ncodec modon \u003cModName\u003e\n```\n\nAfter the state of a Mod has changed you can perform a container restart to make the change take effect.\nBy disabling a Mod, the apt/npm/package-manager dependencies, configurations and changes will not immediately take effect.\n\n![One does not simply do that job](./docs/img/cat2.png)\nAlso take a look how to code [own Mods](#custom-mod).\n\n#### clear cache\nClears some cache files in the codec instance:\n```\ncodec -cc\n```\n\n#### free disk space\nFrees up some disk space in emergency situations if the disk runs out of space:\n```\ncodec -fd\n```\n\n## Mods\nCodeC provides users with the ability to customize their experience with the use of `Mods`.  \nMods are custom Bash scripts that can be created and `adjusted by users` to alter their CodeC experience.  \nMods can be used to make changes that range from minor modifications to full-scale adjustments. \nThey are intended to provide flexibility and allow users to customize their environment to their liking.  \n\n#### Mod Folders\nThe CodeC Mods are located in the `/codec/.codec/mods` directory inside the user's codec container.\nCodeC already provides a set of predefined Mods,\nwhere some of them are ready to be used and some of them are just examples that need to be adjusted in order to be used.\n\n##### Mod Status\nEnabled Mods are in the `/codec/.codec/enabled-mods` folder inside the user's persistent codec folder.  \n\nIf you use the `codeccli` to enable a Mod the Mod Bash scripts get symlinked from the `mods` folder into the `enabled-mods` folder.  \n\nIf you disable the Mod all scripts/symlinks of the Mod in the `/codec/.codec/enabled-mods` folder get deleted.\n\nYou can find the mod commands in the [mod cli](#mod-cli) part.\n\n#### Custom Mod\n\n![One does not simply do that job](./docs/img/challenge-accepted-meme.png)\n\nThe Mods can be created by writing minimum one Bash script that follows a specific naming convention and placing it in the appropriate directory.  \nThere are four types of Mod scripts available:\n - `\u003cModName\u003e.env.sh`,\n - `\u003cModName\u003e.boot.sh`,\n - `\u003cModName\u003e.async.sh` and \n - `\u003cModName\u003e.bash.sh`.\n\nAll Bash scripts with the same `\u003cModName\u003e` are automatically count as one CodeC Mod.\n\nHere is an table that explains the Mod script types:\n| Type  | Processing | Delay container startup | Delay bash startup | Script Name          |\n| ----- | ---------- | ----------------------- | ------------------ | -------------------- |\n| ENV   | `sync`     | `yes`                   | `no`               | `\u003cModName\u003e.env.sh`   |\n| BOOT  | `sync`     | `yes`                   | `no`               | `\u003cModName\u003e.boot.sh`  |\n| ASYNC | `async`    | `no`                    | `no`               | `\u003cModName\u003e.async.sh` |\n| BASH  | `semi`     | `no`                    | `yes`              | `\u003cModName\u003e.bash.sh`  |\n\n#### Environment Mod Script\nEnvironment scripts in CodeC are bash scripts that are executed at the boot of the container after each other. These scripts are located in the `/codec/.codec/mods` directory and `\u003cModName\u003e.env.sh` is the mandatory defined naming that must be used.  \nThe purpose of these scripts is to install apt and npm packages and to change the configuration of tools that are used in the following boot scripts.  \nThe environment scripts delay the start of the CodeC web server until they finish executing.  \nIn the environment script, you can define apt and npm packages that should be installed using the following syntax:\n```bash\nexport CODEC_NPM_PACKAGES=\"typescript\"\nexport CODEC_APT_PACKAGES=\"nano\"\n```\nAll defined apt and npm packages will be collected and installed after all environment scripts are finished. In addition to installing packages, environment scripts can be used to add apt repositories or configure npm and apt, among other things.  \nOverall, environment scripts provide a way to customize and prepare the environment before the container and the boot scrips starts up.\n\n#### Boot Mod Script\nThe CodeC Boot scripts are executed at the boot of the container after each other. These scripts are used to perform tasks that cannot be run in parallel with other tasks, such as preparing some applications.  \n`\u003cModName\u003e.boot.sh` is the mandatory defined naming that must be used.\n\nDuring the Boot-script phase, the environment scripts have already been run, and any apt and npm packages defined there have already been installed. Therefore, the Boot-scripts can assume that these packages are available for use.\n\nOne important aspect of the Boot-scripts is that they delay the start of the CodeC webserver until the scripts have finished executing. This ensures that any necessary preparations have been completed before the webserver starts serving requests.\n\nOverall, Boot-scripts are an important part of the CodeC container environment, allowing for synchronization tasks and other necessary preparations to be performed before the webserver starts serving requests.\n\n#### Async Mod Script\nAsync scripts are scripts that are executed after the boot scripts of the CodeC container and after the code-server webserver is available.\n`\u003cModName\u003e.async.sh` is the mandatory defined naming that must be used.\n\nThese scripts can be used to execute tasks that can run in parallel, such as installing additional packages, running tests, or performing other initialization tasks.  \nThe Async-scripts do not delay the start of the CodeC webserver because they are executed after the webserver has already started.\n\nIf there are tasks in the Boot scripts that can run in parallel with other tasks, they should be moved to the Async-scripts to decrease the container startup time and install all apps faster.  \nThis can help speed up the initialization process and reduce the overall time it takes for the container to become fully operational.\n\n#### Bash Mod Script\nBash scripts are executed when a bash shell is initialized. They delay the startup of a bash terminal or shell for the user, allowing tasks that should run at initialization of a bash shell to be executed.  \n`\u003cModName\u003e.bash.sh` is the mandatory defined naming that must be used.\n\nThese scripts are typically used to set environment variables, aliases, or functions that should be available when the user opens a bash terminal or shell.  \nFor example, if a user wants to set a specific `$PATH` for a project they are working on, they can add the necessary export statements to the Bash script.\n\nAll enabled mod's Bash scripts run `synchronized` after each other. However, if the user starts a `second bash shell` or an `async script is still executed` in parallel, then the Bash script will run `in parallel` to these scripts.\n\nThe Bash-scripts do not delay the start of the CodeC webserver because they are executed after the webserver has already started.\n\nOverall, Bash scripts are a powerful tool for configuring the user's environment and automating common tasks that need to be executed when a bash terminal or shell is initialized.\n\n### Example Mod\nHere is some examples that explain how the script types are used in different mods:\n\n- ##### Mod: `starship`\n  StarShip Shell is the minimal, blazing fast, and extremely customizable prompt for any shell!\n  - `Boot`: Installation via CURL\n  - `Bash`: Inizialization of StarShip in users prompt\n- ##### Mod: `devtools`\n  Some commonly used developments tools.\n  - `Env`: Defines API Packages to install\n  - `Async`: Enables the ssh agent via systemctl\n- ##### Mod: `unmin`\n  Installes `man` and unminifies and installes the ubuntu documentation that is normally not included in the ubuntu docker image.\n  - `Env`: Installs the `man` apt package\n  - `Async`: Executes the long taking unminify process\n- ##### Mod: `git`\n  Git is a version control system that is very commonly used.  \n  Free Remote versioning solutions are GitLab and GitHub. \n  - `Bash`: Sets some git configuration and sets the user name and email\n- ##### Mod: `jdk`\n  Installes the java development kit based in the version inside the env script.\n  - `Env`: Defines the jdk version and the apt package\n- ##### Mod: `cd`\n  Creates some bash scripts named `cd.`, `cd..`, `cd...` and make them executable as shortcuts.\n  The count of the `.` (dots) defines how many folders the shell should go above the current working directory.\n  - `Async`: Creates the bash scripts in a binary directory ($PATH variable)\n- ##### Mod: `docker`\n  Allows the user to use docker (for the provider: docker in docker) in their own CodeC instance.\n  For this you need to have a [privileged](#start) CodeC docker container running.\n  - `Async`: Enables all pre installed docker processes.\n\n## Mounts\n`!!! This section not describes Docker volumes mounts !!!`  \nFirst, read about why we need CodeC mounts for [persistent data](#persistence).\n\nTo prevent data loss, CodeC offers a feature called `Mounts`. CodeC Mounts are symbolic links to directories outside the persistent CodeC folder (`/codec`) that are mounted into the persistent folder.\n\nMounts can be set in the `/codec/.codec/mounts.json` JSON file as a `key-value object`. The key is the name (*without slashes*) for mount-folder in the `/codec/mounts/` folder, and the value is the target that should be mounted into there. If the folder named by the key does not exist, the mount script at the CodeC container startup copies the existing folder into the mount folder location in `/codec/mounts/` to get the default/existing files not deleted.\n\n# folder structure\n\n## User FS\nBecause most of the following files are in the persistent `/codec` folder, all user data in there will be persistent.\n\n- `/root/`  \n  - `ws/` \u003c- /codec\n- `/usr/`\n  - `bin/` \u003c- codec bins moved to here\n- `/codec/` \u003c- persistent folder\n  - `mounts/`\n    - `shared/` \u003c- `a shared folder between all CodeC instances as share and exchange folder`\n    - `logs/` \u003c- logs folder for the CodeC System and Mods,\n    - `ssh/` \u003c- `/root/.ssh`,\n    - `vscode/` \u003c- `/root/.local/share/code-server`\n  - `.codec/`\n    - `bin/` \u003c- custom executable user scripts \n    - `enabled-mods` \u003c- links to `/mods`-files\n    - `mods/` \u003c- folder with optional CodeC [Mods](#mods)\n    - `mounts.json` \u003c- file with CodeC [Mount](#mounts) configuration\n  - `main/`\n  - `todo/`\n  - `archieved/`\n\n| Folder/File                    | Description                                                                                                                          |\n| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |\n| `/codec`                       | The only [persistent folder](#persistence) for the user                                                                              |\n| `/codec/.codec/`               | Folder for the user with CodeC infos, configs, mods, mounts and scripts                                                              |\n| `/codec/.codec/ports.info.txt` | Text file containing the ports the user can use to test/run apps on (more infos [here](#start))                                      |\n| `/codec/.codec/bin/`           | Contains custom executable files used by the CodeC system                                                                            |\n| `/codec/.codec/enabled-mods/`  | Directory for enabled [Mods](#mods)                                                                                                  |\n| `/codec/.codec/mods/`          | Directory for optional [Mods](#mods)                                                                                                 |\n| `/codec/.codec/mounts.json`    | JSON file for the user to [mount](#mounts) non-persistent files                                                                      |\n| `/codec/mounts/systemd/`       | [Mount point](#mounts) for custom systemd configuration files                                                                        |\n| `/codec/mounts/ssh/`           | [Mount point](#mounts) for the SSH server configuration files                                                                        |\n| `/codec/mounts/vscode/`        | [Mount point](#mounts) for the code-server configuration files                                                                       |\n| `/codec/workspace/`            | Directory for the main projects                                                                                                      |\n| `/codec/todo/`                 | Directory for to-do projects                                                                                                         |\n| `/codec/archived/`             | Directory for archived projects                                                                                                      |\n| `/root/`                       | CodeC user home folder                                                                                                               |\n| `/root/ws/`                    | Link to the `/codec` directory inside the users home folder (user can execute `cd; cd ws` to get into the `/codec` workspace folder) |\n\n## System FS\nThe following files are intended for the CodeC container boot and health system rather than the user.  \nChanges here can lead to unforeseen problems.\nWe recommend to use [Mods](#mods) (or [Mounts](#mounts)) for dev env customization.\n\n- `/etc/`\n  - `codec/`\n    - `boot.sh`\n    - `bash.sh`\n    - `health.sh`\n    - `skel`\n      - `.codec`\n        - `...skel...\n      - `mounts`\n        - `vscode`\n    - `ports.info.txt`\n\n| Folder/File            | Description                                                                                                         |\n| ---------------------- | ------------------------------------------------------------------------------------------------------------------- |\n| `/etc/codec`           | System CodeC folder with all needed boot, skeleton and initialization files                                         |\n| `/etc/codec/boot.sh`   | Bash script that runs on container start-up. This will trigger the [Env, Async and Boot Mod Scripts](#custom-mod).  |\n| `/etc/codec/bash.sh`   | Bash script that runs on bash shell start-up like `.bashrc`. This will trigger the [Bash Mod Scripts](#custom-mod). |\n| `/etc/codec/health.sh` | Bash script to check and repair desired CodeC state of folder and file structures                                   |\n| `/etc/codec/skel/`     | Skeleton directory used for the [user's CodeC folder](#user-fs) `/codec/.codec` below                               |\n\n# Preview\n![AssemblyScript](./docs/img/codec-wasm-preview.png)\n![Images](./docs/img/codec-image-preview.png)\n![Makrdown](./docs/img/codec-markdown-preview.png)\n![Login](./docs/img/login.png)\n\n# Codec v1\n'Codec' v1 was successful, but not very well thought-out software.  \n'Codec' stands for **Code-C**ontainer* and wasn't written as \"CodeC\" back then.  \n\n## v1 Software \n\nThe software used by Codec back then included `Ubuntu v20.04`, `Code Server v3` (*by Coder*), `dind` (*docker-in-docker docker-hub image*), `Git`, `Node v16`, and `NPM v8`, with an `unminimized ubuntu docker image`. Codec components included `Codec bins`, a own  `Codec Linux user`, and a `boot` and a `bash script`.\n\n## v1 folder structure \n\nIn codec version 1, the folder structure consisted of a home directory with a Codec folder. Inside the Codec folder, there was a hidden \".codec\" directory that contained bin and skel folders, as well as a docker-entrypoint.sh script. \n\n- `/home`\n  - `/codec`\n    - `/.codec`\n      - `/bin`\n      - `/skel`\n      - `/docker-entrypoint.sh`\n    - `/ws` \u003c- Persistend directory\n      - `/.codec`\n        - `/bin`\n        - `/boot.sh`\n        - `/bash.sh`\n        - `/default.code-workspace`\n        - `/ports.txt`\n        - ...etc...\n      - `/main`\n      - `/todo`\n      - `/test`\n    - ...etc...\n\nThe `~` folder was the users home folder at `/home/codec`.\n\n| Folder/File                          | Description                                                         |\n| ------------------------------------ | ------------------------------------------------------------------- |\n| `~/.codec/bin`                       | Contains executable files used by the codec system                  |\n| `~/.codec/skel`                      | Skeleton directory used for users codec folder `~/ws/.codec` below  |\n| `~/.codec/docker-entrypoint.sh`      | Entrypoint script for the codec container                           |\n| `~/ws`                               | Only persistent folder for the user                                 |\n| `~/ws/main`                          | Directory for the main projects                                     |\n| `~/ws/todo`                          | Directory for to-do projects                                        |\n| `~/ws/.codec/boot.sh`                | Bash script that runs on container start up                         |\n| `~/ws/.codec/bash.sh`                | Bash script that runs on bash shell start up like `.bashrc`         |\n| `~/ws/.codec/ports.txt`              | Text file containing the ports the user can use to test/run apps on |\n| `~/ws/.codec/default.code-workspace` | Default workspace file for the code-server                          |\n\n## v1 Problems\nWith Codec 1 we gained experience and analyzed some pain points and difficulties that were not easy to patch out.  \nTherefore, CodeC 2.0.0 was developed, which was completely overhauled, solved many issues and brought many new features and possibilities with it.\n\n## v2.0.0 changes\nSoftware Changes:\n- `+` Added Systemd\n- `*` Updated to Ubuntu v22.04 LTS (until then v20.04)\n- `*` Updated to VSCode Server v4.* (until then v3.*)\n\nComponent Changes:\n- `-` Removed Codec Linux user\n- `-` Removed the boot and bash-init script\n- `+` Added Codec mods system\n- `+` Added Codec systemd service\n- `+` Added health check boot script\n- `*` Updated custom CLI tools\n- `*` Updated Codec user CLI\n\n# Contributing\nContributions to this project are welcome!  \nInterested users can refer to the guidelines provided in the [CONTRIBUTING.md](CONTRIBUTING.md) file to contribute to the project and help improve its functionality and features.\n\n# License\nThis project is licensed under the [MIT license](LICENSE), providing users with flexibility and freedom to use and modify the software according to their needs.\n\n# Disclaimer\nThis project is provided without warranties.  \nUsers are advised to review the accompanying license for more information on the terms of use and limitations of liability.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoblemajo%2Fcodec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoblemajo%2Fcodec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoblemajo%2Fcodec/lists"}