-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Added Github codespaces configurations #1541 #1557
Feature: Added Github codespaces configurations #1541 #1557
Conversation
@akhilgkrishnan Please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Shrest4647, This is really great 🎉 . Thanks for working on this :)
I have a small suggestion, and in addition, we should modify the development.rb
configuration to allow requests from the CodeSpaces URL. To do this, please add the following code block inside the development.rb
file:
if ENV["CODESPACES"] == "true"
codespace_domain = ENV['GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN']
codespace_host = "#{ENV['CODESPACE_NAME']}-3000.#{codespace_domain}"
config.hosts << codespace_host
end
If possible could you also work on the adding a documentation.
.devcontainer/script.sh
Outdated
@@ -0,0 +1,3 @@ | |||
bin/rails db:prepare |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we are not using this file. Or we can use this file by moving all the postAttachCommand
values here and run this script inside the postAttachCommand.
…m/Shrest4647/miru-web into feature/codespaces-configurations
e3b5da5
to
437025a
Compare
Hi @akhilgkrishnan . I have updated the configuration for development.rb. Also, I have decided not to move the |
…m/Shrest4647/miru-web into feature/codespaces-configurations
Can you fix the rubocop issue? |
@@ -0,0 +1,61 @@ | |||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the indentation is correct for this page. Use 2 spaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ActionController::InvalidAuthenticityToken (HTTP Origin header (http://localhost:3000) didn't match request.base_url (https://fluffy-space-zebra-v79wj99x7vw3wg6x-3000.app.github.dev)):
actionpack (7.0.8) lib/action_controller/metal/request_forgery_protection.rb:253:in `handle_unverified_request'
actionpack (7.0.8) lib/action_controller/metal/request_forgery_protection.rb:286:in `handle_unverified_request'
devise (4.8.1) lib/devise/controllers/helpers.rb:255:in `handle_unverified_request'
actionpack (7.0.8) lib/action_controller/metal/request_forgery_protection.rb:275:in `verify_authenticity_token'
activesupport (7.0.8) lib/active_support/callbacks.rb:400:in `block in make_lambda'
activesupport (7.0.8) lib/active_support/callbacks.rb:199:in `block (2 levels) in halting'
actionpack (7.0.8) lib/abstract_controller/callbacks.rb:34:in `block (2 levels) in <module:Callbacks>'
activesupport (7.0.8) lib/active_support/callbacks.rb:200:in `block in halting'
activesupport (7.0.8) lib/active_support/callbacks.rb:595:in `block in invoke_before'
activesupport (7.0.8) lib/active_support/callbacks.rb:595:in `each'
activesupport (7.0.8) lib/active_support/callbacks.rb:595:in `invoke_before'
activesupport (7.0.8) lib/active_support/callbacks.rb:116:in `block in run_callbacks'
activesupport (7.0.8) lib/active_support/callbacks.rb:138:in `run_callbacks'
actionpack (7.0.8) lib/abstract_controller/callbacks.rb:233:in `process_action'
I can see this error on the logs, so avoiding this we might need to add below code in developement.rb
config.action_dispatch.default_headers = {
'X-Frame-Options' => "ALLOW-FROM #{codespace_domain}"
}
Also we want to set the APP_BASE_URL
env with codespace app url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Shrest4647 I made couple of changes. It working fine now.
Thanks for taking an initiative on working this ❤️
Good going! I was also kind of trying it out, but what I ended up doing was pointing the Here are the commits for reference. Anyway, thanks for this! Will make contributions just one click away! 🚀 |
@akhilgkrishnan apparently the error shown here still exists when you try to submit a form/to a JSON end-point. Let me know if a separate issue should be created. |
Related issue: Issue #1541
Change Logs: