From 8af910aba567043b5aaf5314cdf7297a44aeea95 Mon Sep 17 00:00:00 2001 From: Finn Stutzenstein Date: Sun, 20 Mar 2022 12:05:25 +0100 Subject: [PATCH] initial commit --- .devcontainer/dc.dev.yml | 18 + .devcontainer/devcontainer.json | 16 + .devcontainer/devimage/.bashrc | 17 + .devcontainer/devimage/.vimrc | 422 ++++++++++++++++++++ .devcontainer/devimage/Dockerfile | 30 ++ .devcontainer/devimage/dc | 2 + .devcontainer/devimage/git-prompt/colors.sh | 42 ++ .devcontainer/devimage/git-prompt/prompt.sh | 25 ++ .devcontainer/devimage/psql | 2 + .devcontainer/tmp | 4 + .env | 1 + README.md | 1 + cookboook.code-workspace | 10 + postgres/Dockerfile | 6 + postgres/info.txt | 10 + 15 files changed, 606 insertions(+) create mode 100644 .devcontainer/dc.dev.yml create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/devimage/.bashrc create mode 100644 .devcontainer/devimage/.vimrc create mode 100644 .devcontainer/devimage/Dockerfile create mode 100755 .devcontainer/devimage/dc create mode 100644 .devcontainer/devimage/git-prompt/colors.sh create mode 100644 .devcontainer/devimage/git-prompt/prompt.sh create mode 100755 .devcontainer/devimage/psql create mode 100644 .devcontainer/tmp create mode 100644 .env create mode 100644 README.md create mode 100644 cookboook.code-workspace create mode 100644 postgres/Dockerfile create mode 100644 postgres/info.txt diff --git a/.devcontainer/dc.dev.yml b/.devcontainer/dc.dev.yml new file mode 100644 index 0000000..4a565f5 --- /dev/null +++ b/.devcontainer/dc.dev.yml @@ -0,0 +1,18 @@ + +version: '3' +services: + cookbook: + build: ./devimage + working_dir: /cookbook + tty: true + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - ./..:/cookbook:cached + - ~/.ssh:/root/.ssh:ro + postgres: + build: ../postgres + image: postgres-wal2json + environment: + - POSTGRES_USER=cookbook + - POSTGRES_PASSWORD=cookbook + - POSTGRES_DB=cookbook diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..3743611 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,16 @@ +{ + "name": "cookbook", + "dockerComposeFile": "./dc.dev.yml", + "service": "cookbook", + "workspaceFolder": "/cookbook", + "containerUser": "node", + "remoteUser": "node", + "extensions": [ + "cweijan.vscode-mysql-client2", + "mutantdino.resourcemonitor", + "esbenp.prettier-vscode", + "dbaeumer.vscode-eslint", + "streetsidesoftware.code-spell-checker", + "eamodio.gitlens", + ], +} \ No newline at end of file diff --git a/.devcontainer/devimage/.bashrc b/.devcontainer/devimage/.bashrc new file mode 100644 index 0000000..6e64bb8 --- /dev/null +++ b/.devcontainer/devimage/.bashrc @@ -0,0 +1,17 @@ +export GITAWAREPROMPT=~/.bash/git-aware-prompt +source "/opt/git-prompt/prompt.sh" +PS1='\A \[$txtcyn\]$git_branch\[$bldred\]$git_dirty\[$bldwht\] $? \w>\[$txtrst\] ' +# \u@\h + +source /etc/profile.d/bash_completion.sh + +test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" +alias ls='ls --color=auto' + +alias grep='grep --color=auto' +alias fgrep='fgrep --color=auto' +alias egrep='egrep --color=auto' + +alias ll='ls -l' +alias la='ls -A' +alias l='ls -CF' diff --git a/.devcontainer/devimage/.vimrc b/.devcontainer/devimage/.vimrc new file mode 100644 index 0000000..430b35f --- /dev/null +++ b/.devcontainer/devimage/.vimrc @@ -0,0 +1,422 @@ +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Maintainer: +" Amir Salihefendic +" http://amix.dk - amix@amix.dk +" +" Version: +" 5.0 - 29/05/12 15:43:36 +" +" Blog_post: +" http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github +" +" Awesome_version: +" Get this config, nice color schemes and lots of plugins! +" +" Install the awesome version from: +" +" https://github.com/amix/vimrc +" +" Syntax_highlighted: +" http://amix.dk/vim/vimrc.html +" +" Raw_version: +" http://amix.dk/vim/vimrc.txt +" +" Sections: +" -> General +" -> VIM user interface +" -> Colors and Fonts +" -> Files and backups +" -> Text, tab and indent related +" -> Visual mode related +" -> Moving around, tabs and buffers +" -> Status line +" -> Editing mappings +" -> vimgrep searching and cope displaying +" -> Spell checking +" -> Misc +" -> Helper functions +" +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +set nocompatible " be iMproved, required +filetype off " required + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => General +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Sets how many lines of history VIM has to remember +set history=500 + +" Enable filetype plugins +filetype plugin on +filetype indent on + +" Set to auto read when a file is changed from the outside +set autoread + +" With a map leader it's possible to do extra key combinations +" like w saves the current file +let mapleader = "," +let g:mapleader = "," + +" Fast saving +nmap w :w! + +" :W sudo saves the file +" (useful for handling the permission-denied error) +command W w !sudo tee % > /dev/null + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => VIM user interface +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Set 7 lines to the cursor - when moving vertically using j/k +set so=7 + +" Avoid garbled characters in Chinese language windows OS +let $LANG='en' +set langmenu=en +source $VIMRUNTIME/delmenu.vim +source $VIMRUNTIME/menu.vim + +" Turn on the WiLd menu +set wildmenu + +" Ignore compiled files +set wildignore=*.o,*~,*.pyc +if has("win16") || has("win32") + set wildignore+=.git\*,.hg\*,.svn\* +else + set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store +endif + +"Always show current position +set ruler + +" Height of the command bar +set cmdheight=2 + +" A buffer becomes hidden when it is abandoned +set hid + +" Configure backspace so it acts as it should act +set backspace=eol,start,indent +set whichwrap+=<,>,h,l + +" Ignore case when searching +set ignorecase + +" When searching try to be smart about cases +set smartcase + +" Highlight search results +set hlsearch + +" Makes search act like search in modern browsers +set incsearch + +" Don't redraw while executing macros (good performance config) +set lazyredraw + +" For regular expressions turn magic on +set magic + +" Show matching brackets when text indicator is over them +set showmatch +" How many tenths of a second to blink when matching brackets +set mat=2 + +" No annoying sound on errors +set noerrorbells +set novisualbell +set t_vb= +set tm=500 + +" Add a bit extra margin to the left +set foldcolumn=1 + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => Colors and Fonts +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Enable syntax highlighting +syntax enable + +try + colorscheme desert +catch +endtry + +set background=dark + +" Set extra options when running in GUI mode +if has("gui_running") + set guioptions-=T + set guioptions-=e + set t_Co=256 + set guitablabel=%M\ %t +endif + +" Set utf8 as standard encoding and en_US as the standard language +set encoding=utf8 + +" Use Unix as the standard file type +set ffs=unix,dos,mac + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => Files, backups and undo +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Turn backup off, since most stuff is in SVN, git et.c anyway... +set nobackup +set nowb +set noswapfile + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => Text, tab and indent related +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Use spaces instead of tabs +set expandtab + +" Be smart when using tabs ;) +set smarttab + +" 1 tab == 4 spaces +set shiftwidth=4 +set tabstop=4 + +" Linebreak on 500 characters +set lbr +set tw=500 + +set ai "Auto indent +set si "Smart indent +set wrap "Wrap lines + + +"""""""""""""""""""""""""""""" +" => Visual mode related +"""""""""""""""""""""""""""""" +" Visual mode pressing * or # searches for the current selection +" Super useful! From an idea by Michael Naumann +vnoremap * :call VisualSelection('', '')/=@/ +vnoremap # :call VisualSelection('', '')?=@/ + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => Moving around, tabs, windows and buffers +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Map to / (search) and Ctrl- to ? (backwards search) +map / +map ? + +" Disable highlight when is pressed +map :noh + +" Smart way to move between windows +map j +map k +map h +map l + +" Close the current buffer +map bd :Bclose:tabclosegT + +" Close all the buffers +map ba :bufdo bd + +map l :bnext +map h :bprevious + +" Useful mappings for managing tabs +map tn :tabnew +map to :tabonly +map tc :tabclose +map tm :tabmove +map t :tabnext + +" Let 'tl' toggle between this and the last accessed tab +let g:lasttab = 1 +nmap tl :exe "tabn ".g:lasttab +au TabLeave * let g:lasttab = tabpagenr() + + +" Opens a new tab with the current buffer's path +" Super useful when editing files in the same directory +map te :tabedit =expand("%:p:h")/ + +" Switch CWD to the directory of the open buffer +map cd :cd %:p:h:pwd + +" Specify the behavior when switching between buffers +try + set switchbuf=useopen,usetab,newtab + set stal=2 +catch +endtry + +" Return to last edit position when opening files (You want this!) +au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif + + +"""""""""""""""""""""""""""""" +" => Status line +"""""""""""""""""""""""""""""" +" Always show the status line +set laststatus=2 + +" Format the status line +set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l\ \ Column:\ %c + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => Editing mappings +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Remap VIM 0 to first non-blank character +map 0 ^ + +" Move a line of text using ALT+[jk] or Command+[jk] on mac +nmap mz:m+`z +nmap mz:m-2`z +vmap :m'>+`mzgv`yo`z +vmap :m'<-2`>my` + nmap + vmap + vmap +endif + +" Delete trailing white space on save, useful for Python and CoffeeScript ;) +func! DeleteTrailingWS() + exe "normal mz" + %s/\s\+$//ge + exe "normal `z" +endfunc +autocmd BufWrite *.py :call DeleteTrailingWS() +autocmd BufWrite *.coffee :call DeleteTrailingWS() + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => Ag searching and cope displaying +" requires ag.vim - it's much better than vimgrep/grep +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" When you press gv you Ag after the selected text +vnoremap gv :call VisualSelection('gv', '') + +" Open Ag and put the cursor in the right position +map g :Ag + +" When you press r you can search and replace the selected text +vnoremap r :call VisualSelection('replace', '') + +" Do :help cope if you are unsure what cope is. It's super useful! +" +" When you search with Ag, display your results in cope by doing: +" cc +" +" To go to the next search result do: +" n +" +" To go to the previous search results do: +" p +" +map cc :botright cope +map co ggVGy:tabnew:set syntax=qfpgg +map n :cn +map p :cp + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => Spell checking +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Pressing ,ss will toggle and untoggle spell checking +map ss :setlocal spell! + +" Shortcuts using +map sn ]s +map sp [s +map sa zg +map s? z= + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => Misc +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Remove the Windows ^M - when the encodings gets messed up +noremap m mmHmt:%s///ge'tzt'm + +" Quickly open a buffer for scribble +map q :e ~/buffer + +" Quickly open a markdown buffer for scribble +map x :e ~/buffer.md + +" Toggle paste mode on and off +map pp :setlocal paste! + + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => Helper functions +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +function! CmdLine(str) + exe "menu Foo.Bar :" . a:str + emenu Foo.Bar + unmenu Foo +endfunction + +function! VisualSelection(direction, extra_filter) range + let l:saved_reg = @" + execute "normal! vgvy" + + let l:pattern = escape(@", '\\/.*$^~[]') + let l:pattern = substitute(l:pattern, "\n$", "", "") + + if a:direction == 'gv' + call CmdLine("Ag \"" . l:pattern . "\" " ) + elseif a:direction == 'replace' + call CmdLine("%s" . '/'. l:pattern . '/') + endif + + let @/ = l:pattern + let @" = l:saved_reg +endfunction + + +" Returns true if paste mode is enabled +function! HasPaste() + if &paste + return 'PASTE MODE ' + endif + return '' +endfunction + +" Don't close window, when deleting a buffer +command! Bclose call BufcloseCloseIt() +function! BufcloseCloseIt() + let l:currentBufNum = bufnr("%") + let l:alternateBufNum = bufnr("#") + + if buflisted(l:alternateBufNum) + buffer # + else + bnext + endif + + if bufnr("%") == l:currentBufNum + new + endif + + if buflisted(l:currentBufNum) + execute("bdelete! ".l:currentBufNum) + endif +endfunction + +" Make VIM remember position in file after reopen +" if has("autocmd") +" au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif +"endif diff --git a/.devcontainer/devimage/Dockerfile b/.devcontainer/devimage/Dockerfile new file mode 100644 index 0000000..818022f --- /dev/null +++ b/.devcontainer/devimage/Dockerfile @@ -0,0 +1,30 @@ +FROM node:lts-bullseye +RUN apt-get update && apt-get install -y vim htop lsb-release gnupg sudo locales bash-completion + +RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && dpkg-reconfigure --frontend=noninteractive locales +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US.UTF-8 +ENV LC_ALL en_US.UTF-8 +env TZ=Europe/Berlin +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \ + $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list \ + && apt-get update && apt-get install -y docker-ce-cli \ + && curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \ + && chmod +x /usr/local/bin/docker-compose + +RUN mkdir -p /opt/bin + +COPY psql /opt/bin/psql +COPY dc /opt/bin/dc +COPY git-prompt /opt/git-prompt + +RUN groupadd --gid 998 docker && usermod --append --groups docker root && usermod --append --groups docker node +RUN echo "node ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/node && chmod 0440 /etc/sudoers.d/node + +USER node +COPY .bashrc /home/node/.bashrc +COPY .vimrc /home/node/.vimrc +ENV PATH="/opt/bin/:${PATH}" diff --git a/.devcontainer/devimage/dc b/.devcontainer/devimage/dc new file mode 100755 index 0000000..f65f2f2 --- /dev/null +++ b/.devcontainer/devimage/dc @@ -0,0 +1,2 @@ +#! /bin/bash +docker-compose -f /cookbook/.devcontainer/dc.dev.yml -p cookbook "$@" diff --git a/.devcontainer/devimage/git-prompt/colors.sh b/.devcontainer/devimage/git-prompt/colors.sh new file mode 100644 index 0000000..448ad10 --- /dev/null +++ b/.devcontainer/devimage/git-prompt/colors.sh @@ -0,0 +1,42 @@ +# Regular +txtblk="$(tput setaf 0 2>/dev/null || echo '\e[0;30m')" # Black +txtred="$(tput setaf 1 2>/dev/null || echo '\e[0;31m')" # Red +txtgrn="$(tput setaf 2 2>/dev/null || echo '\e[0;32m')" # Green +txtylw="$(tput setaf 3 2>/dev/null || echo '\e[0;33m')" # Yellow +txtblu="$(tput setaf 4 2>/dev/null || echo '\e[0;34m')" # Blue +txtpur="$(tput setaf 5 2>/dev/null || echo '\e[0;35m')" # Purple +txtcyn="$(tput setaf 6 2>/dev/null || echo '\e[0;36m')" # Cyan +txtwht="$(tput setaf 7 2>/dev/null || echo '\e[0;37m')" # White + +# Bold +bldblk="$(tput setaf 0 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;30m')" # Black +bldred="$(tput setaf 1 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;31m')" # Red +bldgrn="$(tput setaf 2 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;32m')" # Green +bldylw="$(tput setaf 3 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;33m')" # Yellow +bldblu="$(tput setaf 4 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;34m')" # Blue +bldpur="$(tput setaf 5 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;35m')" # Purple +bldcyn="$(tput setaf 6 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;36m')" # Cyan +bldwht="$(tput setaf 7 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;37m')" # White + +# Underline +undblk="$(tput setaf 0 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;30m')" # Black +undred="$(tput setaf 1 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;31m')" # Red +undgrn="$(tput setaf 2 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;32m')" # Green +undylw="$(tput setaf 3 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;33m')" # Yellow +undblu="$(tput setaf 4 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;34m')" # Blue +undpur="$(tput setaf 5 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;35m')" # Purple +undcyn="$(tput setaf 6 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;36m')" # Cyan +undwht="$(tput setaf 7 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;37m')" # White + +# Background +bakblk="$(tput setab 0 2>/dev/null || echo '\e[40m')" # Black +bakred="$(tput setab 1 2>/dev/null || echo '\e[41m')" # Red +bakgrn="$(tput setab 2 2>/dev/null || echo '\e[42m')" # Green +bakylw="$(tput setab 3 2>/dev/null || echo '\e[43m')" # Yellow +bakblu="$(tput setab 4 2>/dev/null || echo '\e[44m')" # Blue +bakpur="$(tput setab 5 2>/dev/null || echo '\e[45m')" # Purple +bakcyn="$(tput setab 6 2>/dev/null || echo '\e[46m')" # Cyan +bakwht="$(tput setab 7 2>/dev/null || echo '\e[47m')" # White + +# Reset +txtrst="$(tput sgr 0 2>/dev/null || echo '\e[0m')" # Text Reset diff --git a/.devcontainer/devimage/git-prompt/prompt.sh b/.devcontainer/devimage/git-prompt/prompt.sh new file mode 100644 index 0000000..27d6ebd --- /dev/null +++ b/.devcontainer/devimage/git-prompt/prompt.sh @@ -0,0 +1,25 @@ +source "/opt/git-prompt/colors.sh" + +find_git_branch() { + # Based on: http://stackoverflow.com/a/13003854/170413 + local branch + if branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null); then + if [[ "$branch" == "HEAD" ]]; then + branch='detached*' + fi + git_branch="($branch)" + else + git_branch="" + fi +} + +find_git_dirty() { + local status=$(git status --porcelain 2> /dev/null) + if [[ "$status" != "" ]]; then + git_dirty='*' + else + git_dirty='' + fi +} + +PROMPT_COMMAND="find_git_branch; find_git_dirty; $PROMPT_COMMAND" diff --git a/.devcontainer/devimage/psql b/.devcontainer/devimage/psql new file mode 100755 index 0000000..06046e7 --- /dev/null +++ b/.devcontainer/devimage/psql @@ -0,0 +1,2 @@ +#! /bin/bash +dc exec postgres psql -U cookbook diff --git a/.devcontainer/tmp b/.devcontainer/tmp new file mode 100644 index 0000000..9c6f957 --- /dev/null +++ b/.devcontainer/tmp @@ -0,0 +1,4 @@ + + "workspaceFolder": "/cookbook", + "workspaceMount": "source=${localWorkspaceFolder},target=/cookbook,type=bind,consistency=cached", + "postCreateCommand": "/home/node/bin/post-create.sh", \ No newline at end of file diff --git a/.env b/.env new file mode 100644 index 0000000..4c4039e --- /dev/null +++ b/.env @@ -0,0 +1 @@ +COMPOSE_PROJECT_NAME=cookbook diff --git a/README.md b/README.md new file mode 100644 index 0000000..3c0728f --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +ssh-add $HOME/.ssh/github_rsa \ No newline at end of file diff --git a/cookboook.code-workspace b/cookboook.code-workspace new file mode 100644 index 0000000..405bb68 --- /dev/null +++ b/cookboook.code-workspace @@ -0,0 +1,10 @@ +{ + "folders": [ + {"path": ".", "name": "root"}, + {"path": ".devcontainer", "name": "devcontainer"}, + ], + "settings": { + "editor.insertSpaces": true, + "gitlens.currentLine.enabled": true, + } +} \ No newline at end of file diff --git a/postgres/Dockerfile b/postgres/Dockerfile new file mode 100644 index 0000000..24c728d --- /dev/null +++ b/postgres/Dockerfile @@ -0,0 +1,6 @@ +FROM postgres:14 +RUN apt-get update \ + && apt-get install -y --no-install-recommends postgresql-14-wal2json \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN echo "wal_level = logical" >> /usr/share/postgresql/postgresql.conf.sample diff --git a/postgres/info.txt b/postgres/info.txt new file mode 100644 index 0000000..391b524 --- /dev/null +++ b/postgres/info.txt @@ -0,0 +1,10 @@ +dc exec postgresql psql "user=cookbook replication=database" + +IDENTIFY_SYSTEM; +CREATE_REPLICATION_SLOT test LOGICAL wal2json; +START_REPLICATION SLOT test 0/0000000 + +https://www.postgresql.org/docs/14/protocol-replication.html +https://github.com/postgres/postgres/blob/master/src/bin/pg_basebackup/pg_recvlogical.c +https://github.com/kibae/pg-logical-replication/blob/master/index.js +https://github.com/eulerto/wal2json