Râu Cao
2e1d930e0f
continuous-integration/drone/push Build is passing
Details
Reviewed-on: #74 |
||
---|---|---|
app | ||
bin | ||
config | ||
db | ||
docker | ||
lib | ||
log | ||
public | ||
spec | ||
tmp | ||
vendor | ||
.browserslistrc | ||
.drone.yml | ||
.env.example | ||
.env.production | ||
.env.test | ||
.gitignore | ||
.rspec | ||
.ruby-version | ||
Dockerfile | ||
Gemfile | ||
Gemfile.lock | ||
LICENSE | ||
Procfile.dev | ||
README.md | ||
Rakefile | ||
babel.config.js | ||
config.ru | ||
docker-compose.yml | ||
package.json | ||
postcss.config.js | ||
tailwind.config.js | ||
yarn.lock |
README.md
Akkounts
This app allows Kosmos/LDAP users to manage their accounts, including credentials, invites, donations, etc..
Development
Quick Start
The easiest way to get a working development setup is using Docker Compose like so:
- Make sure Docker Compose is installed and Docker is running (included in Docker Desktop)
- Uncomment the
web
section indocker-compose.yml
- Run
docker compose up
and wait until 389ds announces its successful start in the log output docker-compose exec ldap dsconf localhost backend create --suffix="dc=kosmos,dc=org" --be-name="dev"
docker compose run web rails ldap:setup
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.
Log in with username "admin" and password "admin is admin". All users listed on http://localhost:3000/admin/ldap_users have the password "user is user".
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
if
you want to use them.
LDAP server
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:setup
The setup task will first delete any existing entries in the directory tree ("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.