Skip to content

Commit

Permalink
gg
Browse files Browse the repository at this point in the history
  • Loading branch information
boborder committed Jan 16, 2025
1 parent 717ac56 commit 91d9ae6
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 44 deletions.
33 changes: 16 additions & 17 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,21 @@ RUN apt-get clean
RUN rm -rf /var/cache/apt /var/lib/apt/lists/*

# devユーザー設定
ARG USER_NAME=dev
ARG USER_ID=1024
ARG GROUP_ID=$USER_ID
ARG DEV=dev

RUN groupadd -g $GROUP_ID -f $USER_NAME && \
useradd --uid $USER_ID --gid $GROUP_ID -m $USER_NAME -G sudo -s /usr/bin/zsh && \
echo "$USER_NAME:$USER_NAME" | chpasswd && \
echo "dev ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \
mkdir -p /home/dev && \
chown -R dev:dev /home/dev
RUN groupadd -g 1024 -f $DEV && \
useradd --uid 1024 --gid 1024 -m $DEV -G sudo -s /usr/bin/zsh && \
echo "$DEV:$DEV" | chpasswd && \
echo "$DEV ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \
mkdir -p /home/$DEV && \
chown -R $DEV:$DEV /home/$DEV

# RUN git clone https://github.com/budybye/dotfiles.git /home/dev/dotfiles
# USER ${USER_NAME}
# ユーザーを切り替え dotfiles ディレクトリに移動
# WORKDIR /home/${USER_NAME}/dotfiles
# ホームディレクトリに dotfiles をクローンしてインストール
# RUN make init

# ubuntuユーザー設定
RUN usermod -aG sudo ubuntu && \
Expand All @@ -136,20 +141,14 @@ COPY ./entrypoint.sh /usr/bin/
RUN ln -s /usr/bin/entrypoint.sh /usr/bin/entrypoint
RUN chmod +x /usr/bin/entrypoint

# ホームディレクトリに dotfiles をクローン
RUN git clone https://github.com/budybye/dotfiles.git /home/ubuntu/dotfiles
USER ubuntu
WORKDIR /home/ubuntu/dotfiles
# ホームディレクトリに dotfiles をクローン
RUN make init

# RUN git clone https://github.com/budybye/dotfiles.git /home/dev/dotfiles
# ユーザーを切り替え dotfiles ディレクトリに移動
# USER ${USER_NAME}
# WORKDIR /home/${USER_NAME}/dotfiles
# ホームディレクトリに dotfiles をクローンしてインストール
# RUN make init

FROM base
# USER root

EXPOSE 3389
# エントリーポイントを実行
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,4 @@ jobs:
docker buildx imagetools create -t ${{ env.REGISTRY_IMAGE }}:${{ matrix.flavor.name }} \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
# マニフェストリストを確認
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ matrix.flavor.name }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,18 +644,18 @@ multipass launch \

---

## 参考文献
## 📚 参考文献

- [Chezmoi](https://chezmoi.io/)
- [Makefile](https://www.gnu.org/software/make/manual/make.html)
- [Mise](https://mise.jdx.dev/)
- [Multipass](https://multipass.run/)
- [Docker](https://docker.com/)
- [Docker Compose](https://docs.docker.com/compose/)
- [Git](https://git-scm.com/)
- [Github Actions](https://docs.github.com/en/actions)
- [Github Desktop](https://desktop.github.com/)
- [Github CLI](https://cli.github.com/)
- [Git](https://git-scm.com/)
- [ghcr](https://github.com/features/packages)
- [codespaces](https://docs.github.com/en/codespaces)
- [Dev Container](https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/creating-a-dev-container-configuration)
Expand Down
60 changes: 44 additions & 16 deletions home/.chezmoiscripts/run_after_activate.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ echo "--------------------------------"

# .env の確認と作成
echo ".env && ENVIRONMENT checking..."
cat {{ .chezmoi.sourceDir }}/.env || echo "no {{ .chezmoi.sourceDir }}/.env file"
mise set || echo "mise set failed."
if [ -f {{ .chezmoi.sourceDir }}/.env ]; then
cat {{ .chezmoi.sourceDir }}/.env
mise set
else
echo "no {{ .chezmoi.sourceDir }}/.env file"
fi
echo "--------------------------------"
env
echo "--------------------------------"
Expand All @@ -26,20 +30,40 @@ echo "--------------------------------"
echo "SSH key ..."
cat /etc/ssh/sshd_config
echo "--------------------------------"
chmod 700 ~/.ssh
chmod 644 ~/.ssh/id_ed25519.pub
chmod 600 ~/.ssh/id_ed25519
chmod 600 ~/.ssh/authorized_keys
echo "authorized_keys..."
cat ~/.ssh/authorized_keys
echo "--------------------------------"
ls -la ~/.ssh
echo "--------------------------------"
echo "SSH key pub ..."
cat ~/.ssh/id_ed25519.pub
echo "--------------------------------"
if [ -d ~/.ssh ]; then
chmod 700 ~/.ssh
if [ -f ~/.ssh/id_ed25519 ]; then
chmod 600 ~/.ssh/id_ed25519
else
echo "no ~/.ssh/id_ed25519 file"
fi
echo "authorized_keys..."
if [ -f ~/.ssh/authorized_keys ]; then
cat ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
else
echo "no ~/.ssh/authorized_keys file"
fi
echo "--------------------------------"
ls -la ~/.ssh
echo "SSH key pub ..."
if [ -f ~/.ssh/id_ed25519.pub ]; then
chmod 644 ~/.ssh/id_ed25519.pub
cat ~/.ssh/id_ed25519.pub
else
echo "no ~/.ssh/id_ed25519.pub file"
fi
echo "--------------------------------"
echo "SSH Config ..."
cat ~/.ssh/config
if [ -f ~/.ssh/config ]; then
cat ~/.ssh/config
else
echo "no ~/.ssh/config file"
fi
echo "--------------------------------"
else
echo "no ~/.ssh directory"
fi
echo "--------------------------------"

{{- else }}
Expand All @@ -53,7 +77,10 @@ echo "--------------------------------"

echo "github yes"
echo "git config ..."
ls -la ~/.config/git
echo "--------------------------------"
cat ~/.config/git/user.conf
echo "--------------------------------"
echo "git config user.name"
git config user.name
echo "git config user.email"
Expand All @@ -62,6 +89,7 @@ echo "--------------------------------"
cat ~/.config/git/config
echo "--------------------------------"
cat ~/.config/git/commit.template
echo "--------------------------------"
git config --global commit.template ${HOME}/.config/git/commit.template
echo "--------------------------------"

Expand Down Expand Up @@ -101,7 +129,7 @@ echo "--------------------------------"
# Music の確認

if [ -f ~/Music/riddim ]; then
ls -la ~/Music/riddim
ls ~/Music/riddim
echo "--------------------------------"
else
echo "$HOME/Music/riddim not found."
Expand Down
16 changes: 8 additions & 8 deletions home/.chezmoiscripts/run_once_after_youtube.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ if command -v yt-dlp > /dev/null 2>&1 && [ ! -d "$PLAYLIST_DIR" ]; then
mkdir -p "$PLAYLIST_DIR"
# youtube-dlを使って音声をダウンロード
yt-dlp \
--ignore-errors \
--format bestaudio \
--extract-audio \
--audio-format mp3 \
--audio-quality 0 \
--output "$OUTPUT_DIR" \
--no-warnings \
"$URL"
--ignore-errors \
--format bestaudio \
--extract-audio \
--audio-format mp3 \
--audio-quality 0 \
--output "$OUTPUT_DIR" \
--no-warnings \
"$URL"

echo "ダウンロードが完了しました"
echo "--------------------------------"
Expand Down

0 comments on commit 91d9ae6

Please sign in to comment.