Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Make a contributing.md (closes #102) #148

Merged
merged 4 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Contributing to Obl.ong

First of all, thank you for wanting to contribute to Obl.ong! Everyone is welcome to help and encouraged to help.

## 📜 Code of Conduct

Obl.ong is governed by the [Code of Conduct](https://github.com/obl-ong/code-of-conduct). You are expected to follow it. Basically, treat other humans with respect and don't discriminate based on any characteristic. You can report any violation to [email protected], and we will take care of it ASAP.

## 🪳 Bug Reporting

Bug Reports are vital to development. You can report bugs using GitHub issues. However, we need information to help squash the bug. Basically:

- Ensure you are using the latest commit or version of Obl.ong.
- Make sure the issue hasn't already been posted by searching the issues.
- Give information about the bug: OS, OS version, Browser Version (if it occured in the browser), ruby version (`ruby -v`), git commit (`git rev-parse --short HEAD`), screenshot (if needed).

Also, please do **not** submit security issues via GitHub issues. Please send an E-mail to [email protected].

## 💻 Setting up a development environment

1. Install the currently supported version Ruby. You can use a tool like [rbenv](https://github.com/rbenv/rbenv) to install ruby. Check the `.ruby-version` file to find it. Usually, it's the latest version, but it never hurts to check.
2. Install Rails. A lot of times it may come preinstalled. Run `rails -v` to check.
3. Install [bun.sh](https://bun.sh). You can do this by running `curl -fsSL https://bun.sh/install | bash
4. Pull the submodules. Run `git submodule init && git submodule update`
5. Compile the CSS. Run `rails css:build` to do this.
6. Generate active record encryption keys. Save those keys for step 7.
7. Add all of the API keys and credentials using `rails credentials:edit`

```yaml
dnsimple:
access_token: DNSIMPLE_ACCESS_TOKEN
account_id: ACCOUNT_ID

postmark_api_token: "POSTMARK_API_TOKEN"
sentry: SENTRY_URI
active_record_encryption:
primary_key: PRIMARY_KEY
deterministic_key: DETERMINISTIC_KEY
key_derivation_salt: KEY_DERIVATION_SALT
```
Sentry isn't required, so you don't need to provide a URI. Everything else is though, but you can setup a dnsimple and postmark sandbox for free.
8. Modify `config/application.rb` to fit the development environment. Set `config.sentry` to false if you disabled sentry.
9. Remove config/application.rb from your worktree so you don't push test configuration into the repo. (`git update-index --skip-worktree config/application.rb`)
10. Start the development server using `bin/rails server`.

## 👗 Code Styling & Formatting
We use [Standard Ruby](https://github.com/standardrb/standard) ([VSCode Edition](https://marketplace.visualstudio.com/items?itemName=testdouble.vscode-standard-ruby)) to lint and format code. Please run it on changes you make. It keeps the code human-readable and improves code quality.

## 🌐 Translating Obl.ong
We use [Weblate](https://hosted.weblate.org/projects/oblong/) to translate. You can make an account there and start translating!

## ❓ Questions and Comments
If you need help with anything, we have a [forum](https://forum.obl.ong) to help you with anything and everything in regards to Obl.ong.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ Built by Obl.ong, a membership-first nonprofit -- we encourage contributions!

- Install Ruby **3.3.0**
- Install Ruby on Rails with Bundler
- Install Bun for compiling tailwind
- Pull submodules
- Install [Bun](https://bun.sh) for compiling tailwind (`curl -fsSL https://bun.sh/install | bash`)
- Pull submodules (`git submoudle init && git submodule update`)
- Compile tailwind (`rails css:build`)
- Generate active record encryption keys (`bin/rails db:encryption:init`)
- Run `rails credentials:edit` and add these keys:

```
Expand All @@ -30,11 +32,15 @@ Built by Obl.ong, a membership-first nonprofit -- we encourage contributions!

postmark_api_token: "POSTMARK_API_TOKEN"
sentry: SENTRY_URI
active_record_encryption:
primary_key: PRIMARY_KEY
deterministic_key: DETERMINISTIC_KEY
key_derivation_salt: KEY_DERIVATION_SALT
```

- Run `rails assets:precompile` (if building for prod - DO NOT DO IN DEVELOPMENT)
Note: Sentry isn't required.
- If you are building for production, run `rails assets:precompile`. Don't do this in development.
- Copy `app/javascript/application.js` to `public/assets/application-{hash}.js` (must be done every time assets is recompiled)
- Edit `config/application.rb` to reflect your environment
- Edit `config/application.rb` to reflect your environment. If you didn't provide a Sentry URI, please set `config.sentry` to false.
- Start the server with `bin/rails server`

## Translations
Expand All @@ -46,4 +52,3 @@ We are working to integrate with [Weblate](https://hosted.weblate.org/projects/o
![Domains index showing 3 domains](https://github.com/obl-ong/admin/assets/19589006/227d0a2e-70a2-4227-befc-7d3ce6fdc1bb)

![DNS page for fionaho.obl.ong showing 2 records, an A record to 1.1.1.1, and a CNAME at demo to example.com](https://github.com/obl-ong/admin/assets/19589006/b3cd0329-9380-4758-b5e6-22afc7601333)