Skip to content

Diff between official play with docker and play with compiler

Chunhua "Leo" Liao edited this page Nov 9, 2019 · 7 revisions

Just to record the initial customization of PWD to make PWC work, by Anjia Wang The revision of PWD is based on git rev-list -n 1 --before="2019-05-31 00:00" master

cat ~/diff.pwd.pwc.txt
Only in play-with-docker/: .git
diff -r play-with-docker/config/config.go /home/liao/freeCompilerCamp/play-with-compilers/config/config.go
58c58
<       flag.StringVar(&PlaygroundDomain, "playground-domain", "localhost", "Domain to use for the playground")
---
>       flag.StringVar(&PlaygroundDomain, "playground-domain", "lab.freecompilercamp.org", "Domain to use for the playground")
diff -r play-with-docker/dockerfiles/dind/.profile /home/liao/freeCompilerCamp/play-with-compilers/dockerfiles/dind/.profile
1,3c1,4
< export PS1='\e[1m\e[31m[\h] \e[32m($(docker-prompt)) \e[34m\u@$(hostname -i)\e[35m \w\e[0m\n$ '
< alias vi='vim'
< export PATH=$PATH:/root/go/bin
---
> export PS1='\[\033[01;32m\]\u@\h:\W$ \[\033[0m\]'
>
> export PATH=$HOME/bin:$HOME/.local/bin:$PATH
> clear
5c6,12
< echo $BASHPID > /var/run/cwd
---
> #echo $BASHPID > /var/run/cwd
>
> alias ll='ls -alF'
> alias la='ls -A'
> alias l='ls -CF'
> alias ls='ls --color=auto'
> alias vi='vim'
diff -r play-with-docker/dockerfiles/dind/.vimrc /home/liao/freeCompilerCamp/play-with-compilers/dockerfiles/dind/.vimrc
0a1
>
3d3
< set expandtab
5,6c5,27
< set shiftwidth=2
< set softtabstop=2
---
> set printoptions=number:y
> set encoding=utf-8
> set wrap
> set shiftwidth=4
> set showmode
> set warn
> set tabstop=4
> set expandtab
> set stal=1
> set wrapscan
> set dir=~
> set backupdir=~
> set autochdir
> set nospell
> set ruler
> set paste
> set cole=0
> if has("autocmd")
>     au FileType html,css setlocal shiftwidth=2 tabstop=2
>     au BufRead,BufNewFile *.md set filetype=markdown
>     au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
>         \| exe "normal! g'\"" | endif
> endif

Only in play-with-docker/dockerfiles/dind: Dockerfile
Only in play-with-docker/dockerfiles/dind: Dockerfile.dind-ee

Only in /home/liao/freeCompilerCamp/play-with-compilers/dockerfiles/dind: Dockerfile.base
Only in /home/liao/freeCompilerCamp/play-with-compilers/dockerfiles/dind: Dockerfile.dind
Only in /home/liao/freeCompilerCamp/play-with-compilers/dockerfiles/dind: Dockerfile.middle

Only in /home/liao/freeCompilerCamp/play-with-compilers/dockerfiles/dind: docker-entrypoint.sh
Only in /home/liao/freeCompilerCamp/play-with-compilers/dockerfiles/dind: dockerd-entrypoint.sh
Only in /home/liao/freeCompilerCamp/play-with-compilers/dockerfiles/dind: modprobe.sh

diff -r play-with-docker/dockerfiles/dind/motd /home/liao/freeCompilerCamp/play-with-compilers/dockerfiles/dind/motd
7c7
< # The PWD team.                                               #
---
> # The FreeCompilerCamp team, based on PWD.                    #
Only in /home/liao/freeCompilerCamp/play-with-compilers/haproxy: cors.lua
diff -r play-with-docker/haproxy/haproxy.cfg /home/liao/freeCompilerCamp/play-with-compilers/haproxy/haproxy.cfg
4a5,7
> global
>     lua-load /usr/local/etc/haproxy/cors.lua
>
12a16,21
>
>     # Add CORS headers when Origin header is present
>     capture request header origin len 128
>     http-response add-header Access-Control-Allow-Origin %[capture.req.hdr(0)] if { capture.req.hdr(0) -m found }
>     http-request use-service lua.cors-response if METH_OPTIONS { req.hdr(origin) -m found }
>     rspadd Access-Control-Allow-Credentials:\ true  if { capture.req.hdr(0) -m found }

the content of cors.lua

~/play-with-docker$ cat haproxy/cors.lua 

core.register_service("cors-response", "http", function(applet)
    applet:set_status(200)
    applet:add_header("Content-Length", "0")
    applet:add_header("Access-Control-Allow-Headers", "Access-Control-Request-Method, Access-Control-Request-Headers, Authorization, X-Requested-With, Content-Type, Origin, User-Agent, If-Modified-Since, Cache-Control, Accept")
    applet:add_header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS")
    applet:start_response()
end)