akkounts/README.md
2023-01-10 14:09:07 +08:00

90 lines
2.5 KiB
Markdown

[![Build Status](https://drone.kosmos.org/api/badges/kosmos/akkounts/status.svg)](https://drone.kosmos.org/kosmos/akkounts)
# Akkounts
This app allows Kosmos/LDAP users to manage their accounts, including
credentials, invites, donations, etc..
## Development
### Rails app
Installing dependencies:
bundle install
yarn install
Setting up local database (SQLite):
bundle exec rails db:create
bundle exec rails db:migrate
Running the dev server and auto-building CSS files on change:
bin/dev
Running the background workers (requires Redis):
bundle exec sidekiq -C config/sidekiq.yml
Running all specs:
bundle exec rspec
### Docker (Compose)
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.
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`.
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.
### 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),
you need to run the following command once, in order to create the dirsrv
back-end:
docker-compose exec ldap dsconf localhost backend create --suffix="dc=kosmos,dc=org" --be-name="dev"
Now you can seed the back-end with data using this Rails task:
bundle exec rails ldap:seed
The seeds task will first delete any existing entries in the directory tree
("dc=kosmos,dc=org"), and then create our example/development entries.
## Documentation
* [Ruby on Rails](https://guides.rubyonrails.org/)
* [Sass](https://sass-lang.com/documentation)
### Front-end
* [Tailwind CSS](https://tailwindcss.com/)
### Testing
* [RSpec](https://rspec.info/documentation/)
* [Capybara](https://rubydoc.info/github/teamcapybara/capybara/master)
### LDAP / Auth
* [devise_ldap_authenticatable](https://github.com/cschiewek/devise_ldap_authenticatable)
* [net/ldap](https://www.rubydoc.info/gems/net-ldap/Net/LDAP)
### Asynchronous jobs/workers
* [Sidekiq](https://github.com/mperham/sidekiq/wiki/)
* [ActiveJob](https://github.com/mperham/sidekiq/wiki/Active-Job)
## License
[GNU Affero General Public License v3.0](https://choosealicense.com/licenses/agpl-3.0/)