welcome ipfs
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
hardstatus alwayslastline "%{= kw}[%{G}%H%{-}] \# %?%-Lw%?[%{G}%n%f %t%{-}]%?%+Lw%?%?%=%-17< [%{B}%l%{-}]"
|
||||
defscrollback 1048576
|
||||
shell -$SHELL
|
||||
@@ -0,0 +1,32 @@
|
||||
# this is aya's tmux configuration !
|
||||
bind r source-file ~/.tmux.conf\; display-message "tmux.conf reloaded!"
|
||||
bind R move-window -r
|
||||
bind C-n switch-client -n\; refresh-client -S
|
||||
bind C-p switch-client -p\; refresh-client -S
|
||||
bind Escape copy-mode
|
||||
bind Y run "tmux save-buffer - |xsel -i"
|
||||
bind P run "xsel -o |tmux load-buffer -; tmux paste-buffer"
|
||||
bind C-c run "tmux save-buffer - | xclip -i -sel clipboard >/dev/null"
|
||||
bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"
|
||||
bind -n S-down new-window
|
||||
bind -n S-left prev
|
||||
bind -n S-right next
|
||||
bind -n C-left swap-window -t -1
|
||||
bind -n C-right swap-window -t +1
|
||||
set -g aggressive-resize on
|
||||
set -g status-keys vi
|
||||
setw -g mode-keys vi
|
||||
setw -g window-status-current-bg blue
|
||||
setw -g window-status-current-fg white
|
||||
setw -g monitor-activity on
|
||||
set -g visual-activity on
|
||||
setw -g automatic-rename on
|
||||
set -g default-terminal "screen"
|
||||
set -g history-limit 4242
|
||||
set -g status-bg black
|
||||
set -g status-fg white
|
||||
set -g status-interval 60
|
||||
set -g status-left-length 30
|
||||
set -g status-left '<#[fg=green]#S#[default]> '
|
||||
set -g status-right '#[fg=yellow] %d/%m %H:%M#[default]'
|
||||
set -g update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION"
|
||||
@@ -0,0 +1,173 @@
|
||||
FROM alpine:latest as dist
|
||||
LABEL maintainer aynic.os <support+docker@asycn.io>
|
||||
ARG DOCKER_BUILD_DIR
|
||||
ARG GIT_AUTHOR_NAME
|
||||
ARG GIT_AUTHOR_EMAIL
|
||||
ARG OPERATING_SYSTEM=Linux
|
||||
ARG PROCESSOR_ARCHITECTURE=x86_64
|
||||
|
||||
ENV GIT_AUTHOR_NAME=${GIT_AUTHOR_NAME}
|
||||
ENV GIT_AUTHOR_EMAIL=${GIT_AUTHOR_EMAIL}
|
||||
ENV GIT_COMMITTER_NAME=${GIT_AUTHOR_NAME}
|
||||
ENV GIT_COMMITTER_EMAIL=${GIT_AUTHOR_EMAIL}
|
||||
|
||||
RUN apk upgrade --no-cache \
|
||||
&& apk add --no-cache \
|
||||
bash \
|
||||
curl \
|
||||
gettext \
|
||||
git \
|
||||
gpg \
|
||||
gpg-agent \
|
||||
make \
|
||||
nano \
|
||||
netcat-openbsd \
|
||||
openssh \
|
||||
screen \
|
||||
socat \
|
||||
tmux \
|
||||
wget \
|
||||
xz
|
||||
|
||||
RUN git clone https://github.com/ingydotnet/git-subrepo \
|
||||
&& cd git-subrepo \
|
||||
&& git fetch origin +refs/heads/release/0.4.0: \
|
||||
&& git checkout release/0.4.0 \
|
||||
&& git fetch origin pull/314/head \
|
||||
&& git rebase 9cbe7ba2f61552ce97fb312c8133813f970ab4a5 \
|
||||
&& sed -i 's/install -C/install/' Makefile \
|
||||
&& make install \
|
||||
&& cd .. \
|
||||
&& rm -rf git-subrepo
|
||||
|
||||
ARG IPFS_VERSION=0.13.0
|
||||
|
||||
RUN { OS="$(echo ${OPERATING_SYSTEM} |awk '{print tolower($0)}')"; \
|
||||
ARCH="$(echo ${PROCESSOR_ARCHITECTURE})"; \
|
||||
wget -qO - https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.${OS}.${ARCH}.tar.xz \
|
||||
|tar --strip-components 1 -C /usr/local/bin -xJf - shellcheck-stable/shellcheck; } \
|
||||
&& { ARCH="$(echo ${PROCESSOR_ARCHITECTURE} |awk '/x86_64/ {print "amd64"}; /aarch64/ {print "arm64"}')"; \
|
||||
wget -qO - https://github.com/ipfs/go-ipfs/releases/download/v${IPFS_VERSION}/go-ipfs_v${IPFS_VERSION}_${OS}-${ARCH}.tar.gz \
|
||||
|tar --strip-components 1 -C /usr/local/bin -xzf - go-ipfs/ipfs; } \
|
||||
&& mkdir -p /usr/local/lib/shellspec \
|
||||
&& wget -qO - https://github.com/shellspec/shellspec/archive/refs/heads/master.tar.gz \
|
||||
|tar --strip-components 1 -C /usr/local/lib/shellspec -xzf - \
|
||||
&& ln -s /usr/local/lib/shellspec/shellspec /usr/local/bin/shellspec
|
||||
|
||||
ADD https://raw.github.com/kvz/cronlock/master/cronlock /usr/local/bin/cronlock
|
||||
RUN chmod +rx /usr/local/bin/cronlock
|
||||
|
||||
# Setup environment variables; export SSH_AUTH_SOCK from socket directory
|
||||
ENV SOCKET_DIR /tmp/ssh-agent
|
||||
ENV SSH_AUTH_SOCK ${SOCKET_DIR}/socket
|
||||
ENV SSH_AUTH_PROXY_SOCK ${SOCKET_DIR}/proxy-socket
|
||||
|
||||
COPY ${DOCKER_BUILD_DIR}/docker-entrypoint.sh /docker-entrypoint.sh
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
|
||||
CMD ["start"]
|
||||
|
||||
FROM dist as master
|
||||
ARG DOCKER_BUILD_DIR
|
||||
ARG DOCKER_GID
|
||||
ARG SHELL=/bin/bash
|
||||
ARG SSH_BASTION_HOSTNAME
|
||||
ARG SSH_BASTION_USERNAME
|
||||
ARG SSH_PRIVATE_IP_RANGE
|
||||
ARG SSH_PUBLIC_HOSTS
|
||||
ARG UID
|
||||
ARG USER
|
||||
ENV UID=${UID}
|
||||
ENV GID=${UID}
|
||||
ENV USER=${USER}
|
||||
|
||||
RUN apk add --no-cache \
|
||||
# docker \
|
||||
# docker-compose \
|
||||
# mysql-client \
|
||||
# postgresql-client \
|
||||
sudo
|
||||
# vim \
|
||||
# zsh
|
||||
|
||||
# If we provide a numeric UID
|
||||
RUN [ "$UID" -eq "$UID" ] 2>/dev/null \
|
||||
# Remove user with $UID if it is not our $USER
|
||||
&& if [ "$(getent passwd $UID |awk -F: '{print $1}')" != "$USER" ]; then \
|
||||
sed -i '/^'$(getent passwd $UID |awk -F: '{print $1}')':x:'$UID':/d' /etc/passwd; \
|
||||
sed -i '/^'$(getent group $GID |awk -F: '{print $1}')':x:'$GID':/d' /etc/group; \
|
||||
fi \
|
||||
# Force $UID if our $USER already exists
|
||||
&& sed -i 's/^'$USER':x:[0-9]\+:[0-9]\+:/'$USER':x:'$UID':'$GID':/' /etc/passwd \
|
||||
&& sed -i 's/^'$USER':x:[0-9]\+:/'$USER':x:'$GID':/' /etc/group \
|
||||
# Create $USER if it does not exist
|
||||
&& if [ "$(getent passwd $UID)" = "" ]; then \
|
||||
echo "$USER:x:$UID:$GID::/home/$USER:$SHELL" >> /etc/passwd; \
|
||||
echo "$USER:\!:$(($(date +%s) / 60 / 60 / 24)):0:99999:7:::" >> /etc/shadow; \
|
||||
echo "$USER:x:$GID:" >> /etc/group; \
|
||||
fi \
|
||||
&& mkdir -p /home/$USER \
|
||||
&& chown $UID:$GID /home/$USER \
|
||||
|| true
|
||||
|
||||
# If we provide a numeric DOCKER_GID
|
||||
RUN [ "$DOCKER_GID" -eq "$DOCKER_GID" ] 2>/dev/null \
|
||||
&& if [ "$(getent group docker |awk -F: '{print $3}')" != "$DOCKER_GID" ]; then \
|
||||
sed -i 's/^docker:x:[0-9]\+:/docker:x:'$DOCKER_GID':/' /etc/group; \
|
||||
fi \
|
||||
|| true
|
||||
|
||||
## User groups
|
||||
RUN adduser $USER wheel \
|
||||
# && adduser $USER docker \
|
||||
&& echo '%wheel ALL=(ALL:ALL) NOPASSWD: ALL' >> /etc/sudoers
|
||||
|
||||
RUN echo -e "\n\
|
||||
Host *\n\
|
||||
LogLevel quiet\n\
|
||||
Compression yes\n\
|
||||
" >> /etc/ssh/ssh_config \
|
||||
&& if [ -n "${SSH_PRIVATE_IP_RANGE}" ] && [ -n "${SSH_BASTION_HOSTNAME}" ]; then \
|
||||
echo -e "\
|
||||
Host ${SSH_PRIVATE_IP_RANGE}\n\
|
||||
ProxyCommand ssh -q ssh-bastion nc -q0 %h 22\n\
|
||||
HostName %h\n\
|
||||
StrictHostKeyChecking no\n\
|
||||
UserKnownHostsFile /dev/null\n\
|
||||
Host ssh-bastion\n\
|
||||
HostName ${SSH_BASTION_HOSTNAME}\
|
||||
" >> /etc/ssh/ssh_config; \
|
||||
if [ -n "${SSH_BASTION_USERNAME}" ]; then \
|
||||
echo -e "\
|
||||
User ${SSH_BASTION_USERNAME}\n\
|
||||
" >> /etc/ssh/ssh_config; \
|
||||
fi \
|
||||
fi
|
||||
|
||||
# Custom rc functions
|
||||
COPY ansible/roles/hosts/files/etc/profile.d/rc*.sh /etc/profile.d/
|
||||
|
||||
RUN mkdir -p $SOCKET_DIR && chown $USER $SOCKET_DIR
|
||||
|
||||
VOLUME ${SOCKET_DIR}
|
||||
|
||||
USER $USER
|
||||
ENV SHELL=${SHELL}
|
||||
WORKDIR /home/$USER
|
||||
|
||||
# git config
|
||||
RUN mkdir -p ~/.ssh ~/.config/git \
|
||||
&& ssh-keyscan -t rsa -H ${SSH_PUBLIC_HOSTS} >> ~/.ssh/known_hosts \
|
||||
&& echo -e "\
|
||||
.DS_Store\n\
|
||||
.idea/\n\
|
||||
.nfs*\n\
|
||||
.theia/settings.json\n\
|
||||
*~\n\
|
||||
*.log\n\
|
||||
*.swp\n\
|
||||
Thumbs.db\n\
|
||||
" > ~/.config/git/ignore
|
||||
|
||||
# dot files
|
||||
COPY ${DOCKER_BUILD_DIR}/.* /home/$USER/
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env sh
|
||||
set -euo errexit
|
||||
|
||||
# Print a debug message if debug mode is on ($DEBUG is not empty)
|
||||
# @param message
|
||||
debug_msg ()
|
||||
{
|
||||
if [ -n "${DEBUG:-}" -a "${DEBUG:-}" != "false" ]; then
|
||||
echo "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
case "${1:-start}" in
|
||||
|
||||
start)
|
||||
debug_msg "Starting..."
|
||||
|
||||
# Create proxy-socket for ssh-agent (to give everyone access to the ssh-agent socket)
|
||||
debug_msg "Create proxy socket..."
|
||||
rm -f ${SSH_AUTH_SOCK} ${SSH_AUTH_PROXY_SOCK} > /dev/null 2>&1
|
||||
socat UNIX-LISTEN:${SSH_AUTH_PROXY_SOCK},perm=0666,fork UNIX-CONNECT:${SSH_AUTH_SOCK} &
|
||||
|
||||
debug_msg "Launch ssh-agent..."
|
||||
exec /usr/bin/ssh-agent -a ${SSH_AUTH_SOCK} -D >/dev/null
|
||||
;;
|
||||
|
||||
*)
|
||||
debug_msg "Exec: $@"
|
||||
exec "$@"
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user