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
22 changes: 22 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// For format details, see https://containers.dev/implementors/json_reference/.
{
"name": "otwarchive",
"image": "mcr.microsoft.com/devcontainers/base:debian",

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": false
},
"ghcr.io/devcontainers/features/github-cli:1": {}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "sh script/docker/init.sh && docker compose up -d web",

"remoteUser": "root"
}

21 changes: 0 additions & 21 deletions .gitpod.yml

This file was deleted.

17 changes: 10 additions & 7 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,14 @@
Bullet.counter_cache_enable = false
end

# GitPod preview support; the preview URL begins with `port#-`, then details about the individual workspace.
# For more information about this, refer to https://www.gitpod.io/docs/configure/workspaces/ports#accessing-port-urls.
# Example:
# GITPOD_WORKSPACE_ID=brianjaustin-otwarchive-w2lj9jd79gm (username-repo-uuid)
# GITPOD_WORKSPACE_CLUSTER_HOST=ws-us114.gitpod.io
# results in 3000-brianjaustin-otwarchive-w2lj9jd79gm.ws-us114.gitpod.io
config.hosts << "3000-#{ENV['GITPOD_WORKSPACE_ID']}.#{ENV['GITPOD_WORKSPACE_CLUSTER_HOST']}" if ENV["GITPOD_WORKSPACE_ID"]
# GitHub codespaces support
if ENV["CODESPACES"]
# Unfortunately, the environment variables we need to set a specific codespace prefix are not available soon enough.
# Instead, we target the GitHub preview domain. Accessing the URL requires logging in with the right GitHub account
# anyways, so this should be OK.
config.hosts << "#{ENV['CODESPACE_NAME']}-3000.#{ENV['GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN']}"
# GitHub also messes with Origin header value(s), which does not play nicely with Rails' CSRF safety :(
# Just disable it for now as a workaround.
config.action_controller.forgery_protection_origin_check = false
end
end
7 changes: 4 additions & 3 deletions docker-compose.yml
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker supports compose.yaml now, and it seems to be the standard based on how often it shows up in the docs

Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ services:
RAILS_ENV: development
# Disable rack-timeout
RACK_TIMEOUT_SERVICE_TIMEOUT: 0
GITPOD_WORKSPACE_ID: ${GITPOD_WORKSPACE_ID:-}
GITPOD_WORKSPACE_CLUSTER_HOST: ${GITPOD_WORKSPACE_CLUSTER_HOST:-}
Comment on lines -78 to -79
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The devcontainer URL needs to be added to the list of allowed hosts.

config.hosts << "3000-#{ENV['GITPOD_WORKSPACE_ID']}.#{ENV['GITPOD_WORKSPACE_CLUSTER_HOST']}" if ENV["GITPOD_WORKSPACE_ID"]

CODESPACES: ${CODESPACES:-}
CODESPACE_NAME: ${CODESPACE_NAME:-}
GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN: ${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN:-}
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY: bEZjYLY9tCYGh6WlcMtEJpIi7GO2plZC
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY: PpLWizzsQHIWnIihtECw8nDHZQd0amzf
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT: 3S99KdpdEWLnCYudBgUfdCFDBWePWCud
Expand Down Expand Up @@ -132,7 +133,7 @@ services:
- CUCUMBER_PUBLISH_QUIET=true
# Silence ebook-convert warning about running as root
- QTWEBENGINE_CHROMIUM_FLAGS=--no-sandbox
command: bundle exec cucumber
command: sleep infinity
volumes:
- .:/otwa
ports:
Expand Down
Loading