Signup and account management app for Kosmos/LDAP Accounts https://accounts.kosmos.org
Go to file
Râu Cao 8aa3ca9e23
All checks were successful
continuous-integration/drone/push Build is passing
Merge pull request 'Let users upload their OpenPGP public key, and serve WKD response' (#205) from feature/191-gpg_keys_wkd into master
Reviewed-on: #205
Reviewed-by: galfert <garret.alfert@gmail.com>
2024-10-14 14:08:31 +00:00
.gitea Count up minor version on feature merge 2023-07-13 15:26:35 +02:00
app Refactor mailer options usage 2024-10-08 14:06:10 +02: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 Refactor mailer options usage 2024-10-08 14:06:10 +02:00
db Add Web Key Directory endpoint 2024-09-23 19:20:10 +02:00
docker/strfry Improve strfry extras usage 2024-06-19 15:43:24 +02:00
extras/strfry Add note 2024-08-09 12:34:10 +02:00
lib Add OpenPGP key to LDAP directory and User model 2024-09-23 15:20:00 +02:00
log Hello kosmos. 2020-11-07 14:49:52 +01:00
public Add app recommendation for Notes Together 2024-08-14 16:32:06 +02:00
schemas/ldap Merge pull request 'Let users upload their OpenPGP public key, and serve WKD response' (#205) from feature/191-gpg_keys_wkd into master 2024-10-14 14:08:31 +00:00
spec Encrypt outgoing emails when possible 2024-10-08 14:05:50 +02: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 global setting for own nostr relay 2024-06-19 19:57:09 +02:00
.env.test WIP Persist zaps, create and send zap receipts 2024-05-09 14:31:37 +02: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
babel.config.js Hello kosmos. 2020-11-07 14:49:52 +01:00
config.ru Hello kosmos. 2020-11-07 14:49:52 +01:00
docker-compose.yml Add pubkey whitelist to strfry policy 2024-06-20 15:28:17 +02:00
Dockerfile Update Docker base image 2024-08-12 10:34:02 +02:00
Gemfile Add OpenPGP key to LDAP directory and User model 2024-09-23 15:20:00 +02:00
Gemfile.lock Add OpenPGP key to LDAP directory and User model 2024-09-23 15:20:00 +02:00
LICENSE Add AGPL license 2020-11-18 15:32:27 +01:00
package.json 0.10.0 2024-09-18 15:49:07 +02:00
postcss.config.js Switch from Webpacker to cssbundling-rails, upgrade Tailwind 2022-02-11 17:23:31 -06:00
Procfile.dev Add Docker Compose config and 389ds service 2022-12-02 19:21:13 +01:00
Rakefile Hello kosmos. 2020-11-07 14:49:52 +01:00
README.md Update README to account for Docker Compose everywhere 2024-03-02 16:57:07 +01: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

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:

  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):

bin/dev

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

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

Documentation

Rails

Front-end

Testing

LDAP / Auth

Asynchronous jobs/workers

Feature Flags

License

GNU Affero General Public License v3.0