Improve README, add quick start instructions
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
Râu Cao 2022-12-07 18:15:04 +01:00
parent 67e2e45dd8
commit 80ef75ff42
Signed by: raucao
GPG Key ID: 15E65F399D084BA9

View File

@ -7,6 +7,27 @@ credentials, invites, donations, etc..
## Development ## Development
### Quick Start
The easiest way to get a working development setup is using Docker Compose like
so:
1. Make sure [Docker Compose is installed][1] and Docker is running (included in
Docker Desktop)
2. Uncomment the `web` section in `docker-compose.yml`
3. Run `docker compose up` and wait until 389ds announces its successful start
in the log output
4. `docker-compose exec ldap dsconf localhost backend create --suffix="dc=kosmos,dc=org" --be-name="dev"`
5. `docker compose run web rails ldap:setup`
5. `docker compose run web rails db:setup`
After these steps, you should have a working Rails app with a handful of test
users running on [http://localhost:3000](http://localhost:3000).
Log in with username "admin" and password "admin is admin". All users listed on
[http://localhost:3000/admin/ldap_users](http://localhost:3000/admin/ldap_users)
have the password "user is user".
### Rails app ### Rails app
Installing dependencies: Installing dependencies:
@ -37,15 +58,10 @@ There is a working Docker Compose config file, which allows you to spin up both
an app server for Rails as well as a local 389ds (LDAP) server. an app server for Rails as well as a local 389ds (LDAP) server.
By default, `docker-compose up` will only start the LDAP server, listening on By default, `docker-compose up` will only start the LDAP server, listening on
port 389 on your machine. Uncomment other services in `docker-compose.yml`. port 389 on your machine. Uncomment other services in `docker-compose.yml` if
you want to use them.
Note that all 389ds data is stored in `tmp/389ds`. So if you want to start over #### LDAP server
with a fresh installation, delete both that directory as well as the container.
### LDAP server
See the previous section for quickly spinning up an LDAP server with Docker (or
edit your environment configuration to use an existing one).
After creating the Docker container for the first time (or after deleting it), After creating the Docker container for the first time (or after deleting it),
you need to run the following command once, in order to create the dirsrv you need to run the following command once, in order to create the dirsrv
@ -55,10 +71,13 @@ back-end:
Now you can seed the back-end with data using this Rails task: Now you can seed the back-end with data using this Rails task:
bundle exec rails ldap:seed bundle exec rails ldap:setup
The seeds task will first delete any existing entries in the directory tree The setup task will first delete any existing entries in the directory tree
("dc=kosmos,dc=org"), and then create our example/development entries. ("dc=kosmos,dc=org"), and then create our development entries.
Note that all 389ds data is stored in `tmp/389ds`. So if you want to start over
with a fresh installation, delete both that directory as well as the container.
## Documentation ## Documentation
@ -87,3 +106,5 @@ The seeds task will first delete any existing entries in the directory tree
## License ## License
[GNU Affero General Public License v3.0](https://choosealicense.com/licenses/agpl-3.0/) [GNU Affero General Public License v3.0](https://choosealicense.com/licenses/agpl-3.0/)
[1]: https://docs.docker.com/compose/install/