Skip to content

Commit

Permalink
NEW PROVIDER: CentralNic Reseller (CNR) - Formerly RRPProxy
Browse files Browse the repository at this point in the history
  • Loading branch information
AsifNawaz-cnic committed Nov 21, 2024
1 parent c2a551d commit c0f6c21
Show file tree
Hide file tree
Showing 15 changed files with 2,218 additions and 112 deletions.
84 changes: 50 additions & 34 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,56 @@
# [Choice] Alpine version: 3.16, 3.15, 3.14, 3.13 or leave blank for latest
FROM mcr.microsoft.com/vscode/devcontainers/base:alpine
# Use the official Microsoft Go development container image
FROM mcr.microsoft.com/devcontainers/go

# ** [Optional] Uncomment this section to install additional packages. **
# RUN apk update \
# && apk add --no-cache <your-package-list-here>
# Set environment variables
ENV TZ=Europe/Berlin
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
ENV DEBIAN_FRONTEND noninteractive
ENV CONFIGURATION_DIR_PATH supporting_files/configuration
ENV SCRIPTS_DIR_PATH supporting_files/scripts

ARG USERNAME=vscode
ARG USERHOME=/home/${USERNAME}

RUN apk add --no-cache shadow

# fixes vcs_info: function definition file not found For Oh-my-zsh
RUN apk add zsh-vcs

# REFRESHED_AT YYYY-MM-DD
ENV REFRESHED_AT 2022-01-10

# # Install dependencies
RUN apk update && \
apk add --update postfix wget sudo git pwgen zip unzip curl go nodejs npm

# Add image configuration and scripts
ADD ${SCRIPTS_DIR_PATH}/post-create.sh /post-create.sh
RUN chown vscode:vscode /post-create.sh

# Time Zone
ENV DEBIAN_FRONTEND=noninteractive

# Define paths for configuration and scripts
ENV CONFIGURATION_DIR_PATH=supporting_files/configuration
ENV SCRIPTS_DIR_PATH=supporting_files/scripts
# Set a default value for ZSH_CUSTOM if it's not already set
ENV ZSH_CUSTOM=/home/vscode/.oh-my-zsh/custom

# Install necessary packages
RUN apt-get update && apt-get install -y \
postfix \
wget \
sudo \
git \
pwgen \
zip \
unzip \
curl \
nodejs \
npm \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Set the time zone
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# configuration for zsh and commitizen
COPY ${CONFIGURATION_DIR_PATH}/.zshrc ${USERHOME}/.zshrc
COPY ${CONFIGURATION_DIR_PATH}/.czrc ${USERHOME}/.czrc
RUN chown vscode:vscode ${USERHOME}/.zshrc ${USERHOME}/.czrc

# Specifics to user vscode
ARG USERNAME="vscode"
ARG USERHOME="/home/${USERNAME}"

# Copy scripts and configuration files
COPY --chown=${USERNAME}:${USERNAME} ${SCRIPTS_DIR_PATH}/*.sh /

# Clone the powerlevel10k theme for zsh and change owner
RUN git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k \
&& chown -R ${USERNAME}:${USERNAME} $ZSH_CUSTOM/themes/powerlevel10k

# Clone the zsh-autosuggestions repository and change owner
RUN git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions \
&& chown -R ${USERNAME}:${USERNAME} $ZSH_CUSTOM/plugins/zsh-autosuggestions

# copy zsh and committizen configuration file
COPY --chown=${USERNAME}:${USERNAME} ${CONFIGURATION_DIR_PATH}/.zshrc ${USERHOME}/.zshrc
COPY --chown=${USERNAME}:${USERNAME} ${CONFIGURATION_DIR_PATH}/.czrc ${USERHOME}/.czrc
# zsh theme powerline10k
COPY --chown=${USERNAME}:${USERNAME} ${CONFIGURATION_DIR_PATH}/.p10k.zsh ${USERHOME}/.p10k.zsh
COPY --chown=${USERNAME}:${USERNAME} ${CONFIGURATION_DIR_PATH}/p10k-instant-prompt-vscode.zsh ${USERHOME}/.cache/p10k-instant-prompt-vscode.zsh

# Set the working directory
WORKDIR /usr/share/rtldev-middleware-dnscontrol-dnsconfig
11 changes: 11 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,19 @@
"GitHub.vscode-pull-request-github",
"ms-vscode-remote.remote-containers"
]
},
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/bin/zsh"
}
}
}
},
"mounts": [
"source=${localEnv:HOME}${localEnv:USERPROFILE},target=/WSL_USER,type=bind,consistency=cached"
],
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
// Use 'onCreateCommand' to run commands after the container is created (first time).
Expand Down
1,735 changes: 1,735 additions & 0 deletions .devcontainer/supporting_files/configuration/.p10k.zsh

Large diffs are not rendered by default.

58 changes: 31 additions & 27 deletions .devcontainer/supporting_files/configuration/.zshrc
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
########### DOCS ###########
# zi snippet <URL> # Raw syntax with URL
# zi snippet OMZ::<PATH> # Shorthand OMZ:: (http://github.com/ohmyzsh/ohmyzsh/raw/master/)
# zi snippet OMZL::<PATH> # Shorthand OMZ::lib (http://github.com/ohmyzsh/ohmyzsh/raw/master/lib)
# zi snippet OMZT::<PATH> # Shorthand OMZ::themes (http://github.com/ohmyzsh/ohmyzsh/raw/master/themes)
# zi snippet OMZP::<PATH> # Shorthand OMZ::plugins (http://github.com/ohmyzsh/ohmyzsh/raw/master/plugins)
source "$HOME/.zi/bin/zi.zsh"
zi snippet OMZT::agnoster
zi snippet OMZP::git
zi snippet OMZP::vi-mode
zi snippet OMZP::pip
zi snippet OMZP::golang
zi snippet OMZP::command-not-found
zi snippet OMZP::colored-man-pages
zi light zsh-users/zsh-syntax-highlighting
zi light zsh-users/zsh-autosuggestions
zi light zsh-users/zsh-completions
###### Executes only on a local machine ######
if [[ "$GITHUB_CLI" != true ]]; then
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

export AGNOSTER_DISABLE_CONTEXT=1
prompt_context() {
if [[ ! -z "$DEFAULT_USER" && "$USER" -ne "$DEFAULT_USER" ]] || [[ -n "$SSH_CLIENT" ]]; then
prompt_segment black default "%(!.%{%F{yellow}%}.)$USER"
fi
}
#zsh-configurations
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
ZSH_THEME="powerlevel10k/powerlevel10k"

# fix for prompt_git:14: command not found: parse_git_dirty
parse_git_dirty(){}
plugins=(git zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh

# fix $(prompt_agnoster_main)
setopt promptsubst
## php xdebug configuration
export XDEBUG_CONFIG="client_host=host.docker.internal client_port=9003"
# enable terminal commands history
HISTFILE=~/.zsh_history
HISTSIZE=1000
SAVEHIST=1000

# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
DISABLE_AUTO_UPDATE=true
DISABLE_UPDATE_PROMPT=true

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

fi
Loading

0 comments on commit c0f6c21

Please sign in to comment.