Signup and account management app for Kosmos/LDAP Accounts
Go to file
Râu Cao 46fa42e387
continuous-integration/drone/push Build is passing Details
Merge pull request 'Refactor Nostr auth, add login via Nostr (web extension)' (#188) from feature/nostr_login into master
Reviewed-on: #188
Reviewed-by: bumi <>
2024-05-10 11:01:00 +00:00
.gitea Count up minor version on feature merge 2023-07-13 15:26:35 +02:00
app Merge branch 'master' into feature/nostr_login 2024-04-15 12:03:12 +00:00
bin Support vendoring npm module code 2023-06-16 13:51:09 +02:00
ci New CI image Dockerfile 2024-02-03 11:36:06 +02:00
config Add login via nostr (web extension) 2024-04-01 19:04:48 +03:00
db Merge pull request 'Add custom LDAP attributes to schema' (#181) from feature/custom_ldap_attributes into master 2024-03-19 14:46:44 +00:00
lib Add tasks for modifying schema, first custom attributes 2024-03-13 14:30:03 +01:00
log Hello kosmos. 2020-11-07 14:49:52 +01:00
public Add Phanpy to recommended Mastodon apps 2024-03-29 09:21:17 +04:00
schemas/ldap Add tasks for modifying schema, first custom attributes 2024-03-13 14:30:03 +01:00
spec Merge branch 'master' into feature/nostr_login 2024-04-15 12:03:12 +00:00
tmp Remove pid dir from git 2022-12-07 18:14:49 +01:00
vendor Update nostr gem, switch to Ruby for bech32 encoding 2024-01-15 12:54:58 +03:00
.browserslistrc Hello kosmos. 2020-11-07 14:49:52 +01:00
.drone.yml Use new CI image with Ruby 3.3.0 2024-02-02 17:28:33 +02:00
.env.example Add missing env var to example config 2024-03-28 10:56:42 +04:00
.env.test Merge branch 'master' into feature/nostr_login 2024-04-15 12:03:12 +00:00
.gitignore Add/configure ActiveStorage 2023-09-06 12:14:28 +02:00
.rspec Hello kosmos. 2020-11-07 14:49:52 +01:00
.ruby-version Update dependencies, upgrade to Rails 7.1, require Ruby 3.x 2024-02-02 14:25:47 +02:00
Dockerfile Add pkg-config 2024-02-22 11:29:56 +01:00
Gemfile Update nostr gem 2024-04-01 18:27:08 +03:00
Gemfile.lock Update nostr gem 2024-04-01 18:27:08 +03:00
LICENSE Add AGPL license 2020-11-18 15:32:27 +01:00 Add Docker Compose config and 389ds service 2022-12-02 19:21:13 +01:00 Update README to account for Docker Compose everywhere 2024-03-02 16:57:07 +01:00
Rakefile Hello kosmos. 2020-11-07 14:49:52 +01:00
babel.config.js Hello kosmos. 2020-11-07 14:49:52 +01:00 Hello kosmos. 2020-11-07 14:49:52 +01:00
docker-compose.yml Update liquor-cabinet image, fix LC/redis networking issue on Linux 2024-03-06 22:07:35 +01:00
package.json 0.9.0 2024-03-07 14:48:27 +01:00
postcss.config.js Switch from Webpacker to cssbundling-rails, upgrade Tailwind 2022-02-11 17:23:31 -06:00
tailwind.config.js Add QR code icon, button, modal for invites 2023-06-27 19:23:20 +02:00
yarn.lock Settings page for adding verified nostr pubkeys 2023-06-16 14:22:30 +02:00

Build Status


This app allows Kosmos/LDAP users to manage their accounts, including credentials, invites, donations, etc..


Quick Start

The easiest way to get a working development setup is using Docker Compose like so:

  1. Make sure Docker Compose is installed and Docker is running (included in Docker Desktop)
  2. Run docker compose up --build and wait until all services have started (389ds might take an extra minute to be ready). This will take a while when running for the first time, so you might want to do something else in the meantime.
  3. docker-compose exec ldap dsconf localhost backend create --suffix="dc=kosmos,dc=org" --be-name="dev"
  4. 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. Log in with username "admin" and password "admin is admin". All users listed on http://localhost:3000/admin/users have the password "user is user".

Rails app

Note: when using Docker Compose, prefix the following commands with docker-compose run web.

Installing dependencies:

bundle install
yarn install

Migrating the local database (after schema changes):

bundle exec rails db:migrate

Running the dev server, and auto-building CSS files on change (automatic with Docker Compose):


Running the background workers (requires Redis) (automatic with Docker Compose):

bundle exec sidekiq -C config/sidekiq.yml

Running the test suite:

bundle exec rspec

Running the test suite with Docker Compose requires overriding the Rails environment:

docker-compose run -e "RAILS_ENV=test" web rspec

Docker Compose

Services/containers are configured in docker-compose.yml.

You can run services selectively, for example if you want to run the Rails app and test suite on the host machine. Just add the service names of the containers you want to run to the up command, like so:

docker-compose up ldap redis

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 the 389ds-data volume. So if you want to start over with a fresh installation, delete both that volume as well as the container.

Minio / remoteStorage

If you want to run remoteStorage accounts locally, you will have to create the respective bucket first. With the minio container running (run by default when using Docker Compose), follow these steps:

  • docker compose up web redis minio liquor-cabinet
  • Head to http://localhost:9001 and log in with user minioadmin, password minioadmin
  • Create a new bucket called remotestorage (or whatever you change the S3_BUCKET config to)
  • Create a new key with ID "dev-key" and secret "123456789" (or whatever you change S3_ACCESS_KEY and S3_SECRET_KEY to). Leave the policy field empty, as it will automatically allow access to the bucket you created.

Adding npm modules to use with Stimulus controllers

The following command downloads the specified npm module to vendor/javascript and adds an entry for it to config/importmap.rb.

bin/importmap pin bech32 --download


Solargraph is a Ruby language server, which you may use with your editor to add features like auto-completion and syntax validation. You can add inline documentation for bundled gems with this command:

bundle exec yard gems





LDAP / Auth

Asynchronous jobs/workers

Feature Flags


GNU Affero General Public License v3.0