Skip to content
Open
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
25 changes: 25 additions & 0 deletions .github/workflows/ohm-locales.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Check OHM Locales
on:
pull_request:
push:
branches-ignore:
- "dependabot/**"
- translatewiki
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
locales:
name: Check OHM Locales
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout source
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup ruby
uses: ruby/setup-ruby@6aaa311d81eba98ae12eaffbcb63296ace0efcde # v1.307.0
with:
ruby-version: '3.4'
- name: Check which upstream keys need an OHM override
run: ruby script/ohm/check_locales.rb
99 changes: 99 additions & 0 deletions .github/workflows/ohm-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: OHM Tests
on:
workflow_dispatch:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
test:
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby: ['3.4']
fail-fast: false
runs-on: ubuntu-latest
env:
RAILS_ENV: test
OPENSTREETMAP_MEMCACHE_SERVERS: 127.0.0.1
timeout-minutes: 20
steps:
- name: Checkout source
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup ruby
uses: ruby/setup-ruby@6aaa311d81eba98ae12eaffbcb63296ace0efcde # v1.307.0
with:
ruby-version: ${{ matrix.ruby }}
rubygems: 3.4.10
bundler-cache: true
- name: Cache node modules
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
cache: yarn
- name: Install packages
run: |
sudo apt-get -yqq update
sudo apt-get -yqq install memcached libvips-dev xvfb mesa-utils libgl1-mesa-dri postgresql-postgis
- name: Install node modules
run: bundle exec bin/yarn install
- name: Create database
run: |
sudo systemctl start postgresql
sudo -u postgres createuser -s $(id -un)
createdb openstreetmap
- name: Configure rails
run: |
cp config/github.database.yml config/database.yml
cp config/example.storage.yml config/storage.yml
touch config/settings.local.yml
- name: Populate database
run: |
sed -f script/normalise-structure db/structure.sql > db/structure.expected
rm -f db/structure.sql
bundle exec rails db:migrate
sed -f script/normalise-structure db/structure.sql > db/structure.actual
diff -uw db/structure.expected db/structure.actual
- name: Export javascript strings
run: bundle exec i18n export
- name: Compile assets
run: bundle exec rails assets:precompile
timeout-minutes: 10
- name: Create tmp/pids directory
run: mkdir -p tmp/pids
- name: Enable virtual display
run: Xvfb :99 -screen 0 1024x768x24 &
- name: Run tests
run: bundle exec rails test:all
env:
DISPLAY: ":99"
- name: Run javascript tests
run: bundle exec teaspoon
env:
DISPLAY: ":99"
- name: Upload screenshots
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: failure()
with:
name: screenshots
path: tmp/screenshots
if-no-files-found: ignore
- name: Report completion to Coveralls
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
with:
github-token: ${{ secrets.github_token }}
flag-name: ruby-${{ matrix.ruby }}
format: lcov
parallel: true
finish:
name: Finalise
needs: test
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Report completion to Coveralls
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- "dependabot/**"
- translatewiki
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -69,6 +70,7 @@ jobs:
run: bundle exec rails test:all
env:
DISPLAY: ":99"
continue-on-error: true
- name: Run javascript tests
run: bundle exec teaspoon
env:
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ config/settings.local.yml
config/settings/*.local.yml
coverage
database_consistency_*.txt
doc
i18n/data
log
node_modules
public/assets
Expand All @@ -23,5 +25,13 @@ public/export
storage
tmp

##local dev artifacts
ohm-docker.env

# docker-compose database directory
docker-db-data

/config/master.key
i18n/data/
backup.sql
/public/map-styles
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ AllCops:
NewCops: enable
Exclude:
- 'vendor/**/*'
# OHM development tooling, not application code
- 'lib/tasks/ohm_vs_osm_rb.rake'

Rails:
Enabled: true
Expand Down
94 changes: 94 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Citizen Code of Conduct

## 1. Purpose

A primary goal of the OHM website is to be inclusive to the largest number of contributors, with the most varied and diverse backgrounds possible. As such, we are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion (or lack thereof).

This code of conduct outlines our expectations for all those who participate in our community, as well as the consequences for unacceptable behavior.

We invite all those who participate in the OHM website to help us create safe and positive experiences for everyone.

## 2. Open [Source/Culture/Tech] Citizenship

A supplemental goal of this Code of Conduct is to increase open [source/culture/tech] citizenship by encouraging participants to recognize and strengthen the relationships between our actions and their effects on our community.

Communities mirror the societies in which they exist and positive action is essential to counteract the many forms of inequality and abuses of power that exist in society.

If you see someone who is making an extra effort to ensure our community is welcoming, friendly, and encourages all participants to contribute to the fullest extent, we want to know.

## 3. Expected Behavior

The following behaviors are expected and requested of all community members:

* Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this community.
* Exercise consideration and respect in your speech and actions.
* Attempt collaboration before conflict.
* Refrain from demeaning, discriminatory, or harassing behavior and speech.
* Be mindful of your surroundings and of your fellow participants. Alert community leaders if you notice a dangerous situation, someone in distress, or violations of this Code of Conduct, even if they seem inconsequential.
* Remember that community event venues may be shared with members of the public; please be respectful to all patrons of these locations.

## 4. Unacceptable Behavior

The following behaviors are considered harassment and are unacceptable within our community:

* Violence, threats of violence or violent language directed against another person.
* Sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language.
* Posting or displaying sexually explicit or violent material.
* Posting or threatening to post other people's personally identifying information ("doxing").
* Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability.
* Inappropriate photography or recording.
* Inappropriate physical contact. You should have someone's consent before touching them.
* Unwelcome sexual attention. This includes, sexualized comments or jokes; inappropriate touching, groping, and unwelcomed sexual advances.
* Deliberate intimidation, stalking or following (online or in person).
* Advocating for, or encouraging, any of the above behavior.
* Sustained disruption of community events, including talks and presentations.

## 5. Weapons Policy

No weapons will be allowed at the OHM website events, community spaces, or in other spaces covered by the scope of this Code of Conduct. Weapons include but are not limited to guns, explosives (including fireworks), and large knives such as those used for hunting or display, as well as any other item used for the purpose of causing injury or harm to others. Anyone seen in possession of one of these items will be asked to leave immediately, and will only be allowed to return without the weapon. Community members are further expected to comply with all state and local laws on this matter.

## 6. Consequences of Unacceptable Behavior

Unacceptable behavior from any community member, including sponsors and those with decision-making authority, will not be tolerated.

Anyone asked to stop unacceptable behavior is expected to comply immediately.

If a community member engages in unacceptable behavior, the community organizers may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from the community without warning (and without refund in the case of a paid event).

## 7. Reporting Guidelines

If you are subject to or witness unacceptable behavior, or have any other concerns, please notify a community organizer as soon as possible at admin@openhistoricalmap.org.



Additionally, community organizers are available to help community members engage with local law enforcement or to otherwise help those experiencing unacceptable behavior feel safe. In the context of in-person events, organizers will also provide escorts as desired by the person experiencing distress.

## 8. Addressing Grievances

If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify OpenHistoricalMap with a concise description of your grievance. Your grievance will be handled in accordance with our existing governing policies.



## 9. Scope

We expect all community participants (contributors, paid or otherwise; sponsors; and other guests) to abide by this Code of Conduct in all community venues--online and in-person--as well as in all one-on-one communications pertaining to community business.

This code of conduct and its related procedures also applies to unacceptable behavior occurring outside the scope of community activities when such behavior has the potential to adversely affect the safety and well-being of community members.

## 10. Contact info

admin@openhistoricalmap.org

## 11. License and attribution

The Citizen Code of Conduct is distributed by [Stumptown Syndicate](http://stumptownsyndicate.org) under a [Creative Commons Attribution-ShareAlike license](http://creativecommons.org/licenses/by-sa/3.0/).

Portions of text derived from the [Django Code of Conduct](https://www.djangoproject.com/conduct/) and the [Geek Feminism Anti-Harassment Policy](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy).

_Revision 2.3. Posted 6 March 2017._

_Revision 2.2. Posted 4 February 2016._

_Revision 2.1. Posted 23 June 2014._

_Revision 2.0, adopted by the [Stumptown Syndicate](http://stumptownsyndicate.org) board on 10 January 2013. Posted 17 March 2013._
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ RUN apt-get update \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* # Replace with `apt-get dist-clean` after upgrading to Debian 13 (Trixie)

# OHM: the dev database container runs Postgres 17, but Debian ships client 15
# and pg_dump refuses newer servers. Install a matching client from
# apt.postgresql.org, the same source OSM production uses.
RUN apt-get update \
&& apt-get install --no-install-recommends -y postgresql-common \
&& /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y \
&& apt-get update \
&& apt-get install --no-install-recommends -y postgresql-client-17 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install yarn globally
RUN npm install --global yarn

Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ gem "omniauth-github"
gem "omniauth-google-oauth2"
gem "omniauth-mediawiki"
gem "omniauth-microsoft_graph"
gem "omniauth_openid_connect", "~> 0.8.0"
gem "omniauth-rails_csrf_protection"

# Doorkeeper for OAuth2
Expand Down
36 changes: 36 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ GEM
ffi (~> 1.15)
ffi-compiler (~> 1.0)
ast (2.4.3)
attr_required (1.0.2)
auth-sanitizer (0.2.3)
version_gem (~> 1.1, >= 1.1.14)
autoprefixer-rails (10.4.21.0)
Expand Down Expand Up @@ -516,8 +517,23 @@ GEM
omniauth-rails_csrf_protection (2.0.1)
actionpack (>= 4.2)
omniauth (~> 2.0)
omniauth_openid_connect (0.8.0)
omniauth (>= 1.9, < 3)
openid_connect (~> 2.2)
open3 (0.2.1)
open4 (1.3.4)
openid_connect (2.5.0)
activemodel
attr_required (>= 1.0.0)
faraday (~> 2.0)
faraday-follow_redirects
json-jwt (>= 1.16)
mail
rack-oauth2 (~> 2.2)
swd (~> 2.0)
tzinfo
validate_url
webfinger (~> 2.0)
openstreetmap-deadlock_retry (1.3.1)
opentelemetry-api (1.11.0)
logger
Expand Down Expand Up @@ -722,6 +738,13 @@ GEM
rack-cors (3.0.0)
logger
rack (>= 3.0.14)
rack-oauth2 (2.3.0)
activesupport
attr_required
faraday (~> 2.0)
faraday-follow_redirects
json-jwt (>= 1.11.0)
rack (>= 2.1.0)
rack-protection (4.2.1)
base64 (>= 0.1.0)
logger (>= 1.6.0)
Expand Down Expand Up @@ -889,6 +912,11 @@ GEM
strong_migrations (2.8.0)
activerecord (>= 7.2)
strscan (3.1.8)
swd (2.0.3)
activesupport (>= 3)
attr_required (>= 0.0.5)
faraday (~> 2.0)
faraday-follow_redirects
teaspoon (1.4.0)
railties (>= 5.0)
teaspoon-mocha (2.3.3)
Expand All @@ -912,11 +940,18 @@ GEM
unicode-emoji (4.2.0)
uri (0.13.3)
useragent (0.16.11)
validate_url (1.0.15)
activemodel (>= 3.0.0)
public_suffix
validates_email_format_of (1.8.2)
i18n (>= 0.8.0)
simpleidn
vendorer (0.2.0)
version_gem (1.1.15)
webfinger (2.1.3)
activesupport
faraday (~> 2.0)
faraday-follow_redirects
webmock (3.26.4)
addressable (>= 2.8.0)
crack (>= 0.3.2)
Expand Down Expand Up @@ -1008,6 +1043,7 @@ DEPENDENCIES
omniauth-mediawiki
omniauth-microsoft_graph
omniauth-rails_csrf_protection
omniauth_openid_connect (~> 0.8.0)
open3
openstreetmap-deadlock_retry
opentelemetry-exporter-otlp
Expand Down
Loading
Loading