This example runs on docker and demonstrates the database authentication adapter.
Uses the official distribution template and runs on http://localhost:8000 by default.
After the first time you've run this setup procedure you can simply use docker-compose up
and skip the steps below.
First set up database:
docker-compose up db
echo "CREATE DATABASE osjsv3;" | docker-compose exec db mysql -uroot -psecret
echo "CREATE USER 'osjsv3'@'localhost' IDENTIFIED BY 'secret';" | docker-compose exec db mysql -uroot -psecret
echo "GRANT ALL ON osjsv3.* TO 'osjsv3'@'localhost';" | docker-compose exec db mysql -uroot -psecret
Then start OS.js:
Note that the first time this is run it might take a while.
docker-compose up
Now you can add users (you will get prompted for a password):
docker-compose exec osjs npx osjs-cli user:add --username=name --groups=admin
- Become a Patreon
- Support on Open Collective
- Contribution Guide
See the Official Manuals for articles, tutorials and guides.