Skip to content

Commit

Permalink
Fix #31: Wrap Jekyll around Chpst around Jekyll.
Browse files Browse the repository at this point in the history
  • Loading branch information
envygeeks committed Sep 9, 2015
1 parent 8047f96 commit 8ac08bb
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 36 deletions.
15 changes: 9 additions & 6 deletions copy/usr/local/bin/jekyll
@@ -1,8 +1,5 @@
#!/usr/bin/env ruby

Process::Sys.setuid(1000) rescue nil
Process::Sys.setgid(1000) rescue nil

# Because of a bug in Jekyll 2.4 that was resolved somewhere between 2.4 and 2.5
# we work around problems with `s` and host by just changing s to serve for you
# so that you get -H that works.
Expand All @@ -22,6 +19,12 @@ if %W(serve server).include?(ARGV[0])
)
end

load Gem.bin_path(
"jekyll", "jekyll"
)
# Pass it onto chpst.
if Process.uid == 0
exec "chpst", "-u", "jekyll:jekyll", Gem.bin_path("jekyll", "jekyll"), \
*ARGV
else
load Gem.bin_path(
"jekyll", "jekyll"
)
end
18 changes: 12 additions & 6 deletions tags/beta/copy/usr/local/bin/jekyll
@@ -1,8 +1,5 @@
#!/usr/bin/env ruby

Process::Sys.setuid(1000) rescue nil
Process::Sys.setgid(1000) rescue nil

# Because of a bug in Jekyll 2.4 that was resolved somewhere between 2.4 and 2.5
# we work around problems with `s` and host by just changing s to serve for you
# so that you get -H that works.
Expand All @@ -13,12 +10,21 @@ if "s" == ARGV[0]
)
end

# Give a default listener of everything for Jekyll inside of Docker so that you
# can view your site if you are using the server provided by Jekyll.

if %W(serve server).include?(ARGV[0])
ARGV.unshift(ARGV.shift,
"-H", "0.0.0.0"
)
end

load Gem.bin_path(
"jekyll", "jekyll"
)
# Pass it onto chpst.
if Process.uid == 0
exec "chpst", "-u", "jekyll:jekyll", Gem.bin_path("jekyll", "jekyll"), \
*ARGV
else
load Gem.bin_path(
"jekyll", "jekyll"
)
end
18 changes: 12 additions & 6 deletions tags/latest/copy/usr/local/bin/jekyll
@@ -1,8 +1,5 @@
#!/usr/bin/env ruby

Process::Sys.setuid(1000) rescue nil
Process::Sys.setgid(1000) rescue nil

# Because of a bug in Jekyll 2.4 that was resolved somewhere between 2.4 and 2.5
# we work around problems with `s` and host by just changing s to serve for you
# so that you get -H that works.
Expand All @@ -13,12 +10,21 @@ if "s" == ARGV[0]
)
end

# Give a default listener of everything for Jekyll inside of Docker so that you
# can view your site if you are using the server provided by Jekyll.

if %W(serve server).include?(ARGV[0])
ARGV.unshift(ARGV.shift,
"-H", "0.0.0.0"
)
end

load Gem.bin_path(
"jekyll", "jekyll"
)
# Pass it onto chpst.
if Process.uid == 0
exec "chpst", "-u", "jekyll:jekyll", Gem.bin_path("jekyll", "jekyll"), \
*ARGV
else
load Gem.bin_path(
"jekyll", "jekyll"
)
end
18 changes: 12 additions & 6 deletions tags/master/copy/usr/local/bin/jekyll
@@ -1,8 +1,5 @@
#!/usr/bin/env ruby

Process::Sys.setuid(1000) rescue nil
Process::Sys.setgid(1000) rescue nil

# Because of a bug in Jekyll 2.4 that was resolved somewhere between 2.4 and 2.5
# we work around problems with `s` and host by just changing s to serve for you
# so that you get -H that works.
Expand All @@ -13,12 +10,21 @@ if "s" == ARGV[0]
)
end

# Give a default listener of everything for Jekyll inside of Docker so that you
# can view your site if you are using the server provided by Jekyll.

if %W(serve server).include?(ARGV[0])
ARGV.unshift(ARGV.shift,
"-H", "0.0.0.0"
)
end

load Gem.bin_path(
"jekyll", "jekyll"
)
# Pass it onto chpst.
if Process.uid == 0
exec "chpst", "-u", "jekyll:jekyll", Gem.bin_path("jekyll", "jekyll"), \
*ARGV
else
load Gem.bin_path(
"jekyll", "jekyll"
)
end
18 changes: 12 additions & 6 deletions tags/pages/copy/usr/local/bin/jekyll
@@ -1,8 +1,5 @@
#!/usr/bin/env ruby

Process::Sys.setuid(1000) rescue nil
Process::Sys.setgid(1000) rescue nil

# Because of a bug in Jekyll 2.4 that was resolved somewhere between 2.4 and 2.5
# we work around problems with `s` and host by just changing s to serve for you
# so that you get -H that works.
Expand All @@ -13,12 +10,21 @@ if "s" == ARGV[0]
)
end

# Give a default listener of everything for Jekyll inside of Docker so that you
# can view your site if you are using the server provided by Jekyll.

if %W(serve server).include?(ARGV[0])
ARGV.unshift(ARGV.shift,
"-H", "0.0.0.0"
)
end

load Gem.bin_path(
"jekyll", "jekyll"
)
# Pass it onto chpst.
if Process.uid == 0
exec "chpst", "-u", "jekyll:jekyll", Gem.bin_path("jekyll", "jekyll"), \
*ARGV
else
load Gem.bin_path(
"jekyll", "jekyll"
)
end
18 changes: 12 additions & 6 deletions tags/stable/copy/usr/local/bin/jekyll
@@ -1,8 +1,5 @@
#!/usr/bin/env ruby

Process::Sys.setuid(1000) rescue nil
Process::Sys.setgid(1000) rescue nil

# Because of a bug in Jekyll 2.4 that was resolved somewhere between 2.4 and 2.5
# we work around problems with `s` and host by just changing s to serve for you
# so that you get -H that works.
Expand All @@ -13,12 +10,21 @@ if "s" == ARGV[0]
)
end

# Give a default listener of everything for Jekyll inside of Docker so that you
# can view your site if you are using the server provided by Jekyll.

if %W(serve server).include?(ARGV[0])
ARGV.unshift(ARGV.shift,
"-H", "0.0.0.0"
)
end

load Gem.bin_path(
"jekyll", "jekyll"
)
# Pass it onto chpst.
if Process.uid == 0
exec "chpst", "-u", "jekyll:jekyll", Gem.bin_path("jekyll", "jekyll"), \
*ARGV
else
load Gem.bin_path(
"jekyll", "jekyll"
)
end

0 comments on commit 8ac08bb

Please sign in to comment.