bridgetown-core 1.0.0.alpha3 → 1.0.0.alpha4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c5f6a5f0fc27c9e3f7d45161e91317fd42e7dbeb789d8c38a103a610efb9d46
4
- data.tar.gz: 68431d8ead8cdb11107db03aa57ae3d4607d0809e60f3fd30d7045d58e1c67f0
3
+ metadata.gz: 27c0421da5ef9512cd562b25dc8a8362ce5ec3b1a5f2421f03272218f5e7ba5d
4
+ data.tar.gz: d7456c59fe166e34360267efb6d4320ac1632aeb2acdc81235273178bd4fe4a5
5
5
  SHA512:
6
- metadata.gz: 57daec3a249941fc6303a22e470cd8fc8e1641be8527a6533c7c73527a93fc04321b774407865a07fb99df95566902d035cfdf84fd68f8aa6e440fac6860d266
7
- data.tar.gz: f42ce24666c948ad8616ef25cb36a766392279e216716a397d27308ae5b06acb58305887264f04c83faedf3ed6a68fcdbbf716e648935bb92de8c019997c1c03
6
+ metadata.gz: 5ca5bce5112a869e3520c3662e221b21af7f64b0146cc879157a3dd720ffea2f9abd95f5dc704d9f5239ca941d143aa08882090edcbfb4d3d44301821029e313
7
+ data.tar.gz: a0236293b0e7342bcfe864497fac47cd270541ae3c97fc19d6edb6d50d4fe730d0b030bc1cb06e9647b763280e5929119cffc444e663c0fe00b3cf08b4f4af58
@@ -40,6 +40,12 @@ module Bridgetown
40
40
  # Load Bridgetown configuration into thread memory
41
41
  bt_options = configuration_with_overrides(options)
42
42
 
43
+ if Bridgetown.env.development? && !options["url"]
44
+ scheme = bt_options.bind&.split("://")&.first == "ssl" ? "https" : "http"
45
+ port = bt_options.bind&.split(":")&.last || ENV["BRIDGETOWN_PORT"] || 4000
46
+ bt_options.url = "#{scheme}://localhost:#{port}"
47
+ end
48
+
43
49
  puma_pid =
44
50
  Process.fork do
45
51
  require "puma/cli"
@@ -83,12 +89,6 @@ module Bridgetown
83
89
  Process.setproctitle("bridgetown #{Bridgetown::VERSION} [#{File.basename(Dir.pwd)}]")
84
90
 
85
91
  build_args = ["-w"] + ARGV.reject { |arg| arg == "start" }
86
- if Bridgetown.env.development? && !options["url"]
87
- scheme = bt_options.bind&.split("://")&.first == "ssl" ? "https" : "http"
88
- port = bt_options.bind&.split(":")&.last || ENV["BRIDGETOWN_PORT"] || 4000
89
- build_args << "--url"
90
- build_args << "#{scheme}://localhost:#{port}"
91
- end
92
92
  Bridgetown::Commands::Build.start(build_args)
93
93
  rescue StandardError => e
94
94
  Process.kill "SIGINT", puma_pid
@@ -17,6 +17,14 @@ module Bridgetown
17
17
  def self.boot
18
18
  autoload_server_folder(root: Dir.pwd)
19
19
  RodaApp.opts[:bridgetown_preloaded_config] = Bridgetown::Current.preloaded_configuration
20
+ rescue Roda::RodaError => e
21
+ if e.message.include?("sessions plugin :secret option")
22
+ raise Bridgetown::Errors::InvalidConfigurationError,
23
+ "The Roda sessions plugin can't find a valid secret. Run `bin/bridgetown secret'" \
24
+ " and put the key in a ENV var you can use to configure the session in `roda_app.rb'"
25
+ end
26
+
27
+ raise e
20
28
  end
21
29
 
22
30
  def self.autoload_server_folder(root:)
@@ -1,5 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ desc "Generate a secret key for use in sessions, token generation, and beyond"
4
+ task :secret do
5
+ require "securerandom"
6
+ puts SecureRandom.hex(64) # rubocop:disable Bridgetown/NoPutsAllowed
7
+ end
8
+
3
9
  namespace :frontend do
4
10
  desc "Run frontend bundler independently"
5
11
  task :watcher, :sidecar do |_task, args|
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bridgetown
4
- VERSION = "1.0.0.alpha3"
4
+ VERSION = "1.0.0.alpha4"
5
5
  CODE_NAME = "Pearl"
6
6
  end
@@ -1,5 +1,5 @@
1
1
  <!doctype html>
2
- <html lang="en">
2
+ <html lang="{{ site.locale }}">
3
3
  <head>
4
4
  {% render "head", metadata: site.metadata, title: page.title %}
5
5
  </head>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha3
4
+ version: 1.0.0.alpha4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-18 00:00:00.000000000 Z
11
+ date: 2021-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel