KwartzlabOS
KwartzlabOS (kOS for short) is a member management and access control system originally designed for Kwartzlab Makerspace in Kitchener, Ontario.
Installation of Docker is required for the Docker setup development path. Please make sure both the docker and docker compose commands are available as they are used throughout setup.
NOTE: Different installation methods of Docker provide Docker Compose under different names. The following instructions reference Docker Compose as docker compose. If however your environment uses docker-compose, use that instead.
Begin by navigating to the directory where you want to clone kOS in your terminal, then run the following:
git clone https://github.com/kwartzlab/kos-base.git
This will clone the repository from GitHub. Once cloned, navigate into the new directory:
cd kos-base
As part of the repository we have an example environment file with a '.example' extension. Create a copy of this file with the example extension removed.
cp .env.example .env
Files provided in the repository are pre-configured to build Kos from the application source code previously cloned in the last step. The Kos Docker image is built in steps. Once each step completes, it's stored in a cache for later to speed up following builds.
To build the application image, run:
docker compose build
If the build fails, the composer dependencies may be out of date. A short term solution is to delete the "composer.lock" file.
With the application image built, we can now stand up Kos with necessary dependencies. To run Kos, run:
docker compose up
When Kos is ready, you should see a message in your console like this:
INFO Server running on [http://0.0.0.0:8000].
Open your browser and navigate to http://localhost:8000/. You should be presented with the login page. See details below to login.
To shut down Kos, go back to your terminal and press Control+C. You can remove resources once shut down with:
docker compose down
Once you've tested running Kos for the first time, you can optionally run Kos in the background instead. To run Kos in the background, run:
docker compose up -d
phpunit is available within the container to test the built image. To unit test the image, run the following command in another terminal with the Kos container running.
docker compose exec app ./vendor/bin/phpunit
phpMyAdmin is a PHP based web interface for MySQL databases. phpMyAdmin has been pre-configured to connect to and manage the Kos database for local debugging. To access the interface, navigate to http://localhost:8001/ with Kos running.
Commit hooks have been installed in this repository to perform checks prior to committing code back to the main code base. These hooks are installed and maintained into your local repository based on the configration maintained in this repository.
First install pre-commit, follow the steps outlined in the Pre-Commit docs https://pre-commit.com/. This is usually as simple as pip install pre-commit or brew install pre-commit.
Then install the hooks to your local repository by running pre-commit install from the base directory of the repository.
Once pre-commit is installed, every time you commit changes, you will see a sequence of checks run to verify that your changes meet our coding standards. If all checks pass, the changes will be committed. If the checks don't all pass, the commit will be cancelled and you will be prompted to refactor and resubmit. Many of the checks in the pre-commit configuration can and will perform automatic remediation of issues it finds. In this case, remediation is as simple as re-adding the effected files with modified changes and re-committing.
kOS requires the following external dependencies:
note: this has only been tested on ubuntu, your millage may very
php 8.0 or higher https://www.php.net/manual/en/install.php
sudo apt install php
enable php extensions mbstring xml curl mysql sqlite3
*nix - install packages (only tested on ubuntu, your mileage may very)
sudo apt install php-mbstring php-xml php-curl php-mysql php-sqlite3 php-gd php-xdebug
windows - modify php.ini file
php -r "phpinfo();" | grep php.iniextension=mbstringmysql 5.6 or higher https://dev.mysql.com/doc/mysql-installation-excerpt/5.7/en/
sudo apt install mysql
consider running secure install if this is your first time installing
sudo mysql_secure_installation utility
sqlite3 https://www.sqlite.org/download.html
sudo apt install sqlite3
Begin by navigating to the directory where you want to clone kOS in your terminal, then run the following:
git clone https://github.com/kwartzlab/kos-base.git
This will clone the repository from GitHub. Once cloned, navigate into the new directory:
cd kos-base
And then install the package dependencies:
composer install
This will install everything needed to run the application.
note: if install fails it's most likely due to incorrect dependencies. Check the dependency section to see if anything was missed.
Start mysql as the root user (sudo mysql in *nix).
In the mysql prompt execute the following commands:
key:generate in docker-entrypoint.sh replaces APP_KEY on every container start
https://github.com/kwartzlab/kos-base/issues/141
Labels: 없음
Handle when loading external assets not available.
https://github.com/kwartzlab/kos-base/issues/136
Labels: 없음
Optionally restrict team position assignment to members who have been given a specific role
https://github.com/kwartzlab/kos-base/issues/134
Labels: enhancement
Team leads can't add memebers to their teams
https://github.com/kwartzlab/kos-base/issues/133
Labels: 없음
Currently a trainer can change authorizations for any tool
https://github.com/kwartzlab/kos-base/issues/132
Labels: 없음
Blank screen dashboard for tool not owned by a team for some users
https://github.com/kwartzlab/kos-base/issues/121
Labels: 없음
Development Docker Container Does Not Start Correctly
https://github.com/kwartzlab/kos-base/issues/119
Labels: 없음
kOS (kwartzlab OS) runs the kwartzlab makerspace: member records, key-fob access, tool authorizations and entry logs. A bug here can lock people out, leave a door open or expose someone's private details, so we keep things simple, clear, secure and safe.
The agreement every contributor works under is GOVERNANCE.md. Please read it first. This file is the practical "start here".
The Docker development environment is the standard. Setup steps live in The README.
Use synthetic data only. Never put production data on your machine or paste it into an AI tool.
main. Keep one purpose per pull request. Above roughly 500 changed lines (not counting lockfiles, generated files and tests), expect to be asked to split it.Merging to main deploys to production automatically, so merge only what you are ready to have live.
Changes to authentication, access control, private member data, privileged reports, audit logs, the deploy pipeline or backups need two reviewers, one of them a maintainer, and a heads-up to the board before merge. See GOVERNANCE.md for the full list.
A new framework, library or language, a refactor of a core area, an infrastructure change or a change to an established member workflow needs a short decision record first. See docs/decisions.
Ask in #team-IT or open a GitHub issue. Be kind and respectful.