Skip to content
Permalink
Browse files

feat: setup dynamic passphrase in level

  • Loading branch information...
moul committed Mar 7, 2019
1 parent 3f62a55 commit 6e7f2e6c9196d69726c2704c46687312bc71fac0
@@ -1,2 +1,3 @@
FROM nginx
COPY static /usr/share/nginx/html
COPY static /usr/share/nginx/html
COPY on-init /pathwar-hooks/
@@ -0,0 +1,3 @@
#!/bin/sh -e

sed -i "s/THE_PASSPHRASE/$(pwctl passphrase 0)/g" /usr/share/nginx/html/index.html
@@ -1 +1,3 @@
<h1>Hello World!</h1>

<p>Here is a dynamic passphrase: <b>THE_PASSPHRASE</b></p>
@@ -23,10 +23,18 @@ func main() {
rootCmd.AddCommand(&cobra.Command{
Use: "entrypoint",
Args: cobra.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
// FIXME: prepare the level
// FIXME: add a self-destruct mode that allow having root access only at runtime
RunE: func(_ *cobra.Command, args []string) error {
// FIXME: lock to block other commands

// prepare the level
cmd := exec.Command("/pathwar-hooks/on-init")
if err := cmd.Run(); err != nil {
return err
}

// FIXME: add a self-destruct mode that allow having root access only at runtime

// switch to original's entrypoint
binary, err := exec.LookPath(args[0])
if err != nil {
return err

0 comments on commit 6e7f2e6

Please sign in to comment.
You can’t perform that action at this time.