Repository navigation
Revert "fix(atuin): record failed commands in history" #1608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| # syntax=docker/dockerfile:1.7 | ||
|
|
||
| FROM ubuntu:26.04 | ||
|
|
||
| # Set DEBIAN_FRONTEND to noninteractive to avoid prompts during package installations | ||
|
|
@@ -29,6 +27,10 @@ | |
| ARG USER=runner | ||
| ARG USER_UID=1001 | ||
| ARG USER_GID=$USER_UID | ||
| ARG COMMIT_SHA=main | ||
| ARG GITHUB_TOKEN | ||
|
Check warning on line 31 in Dockerfile
|
||
| ARG GITHUB_PR | ||
| ENV GITHUB_PR=${GITHUB_PR} | ||
|
|
||
| RUN set -e; \ | ||
| groupadd --gid $USER_GID $USER; \ | ||
|
|
@@ -47,30 +49,17 @@ | |
| echo "trusted-users = root $USER" > /etc/nix/nix.conf && \ | ||
| echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf && \ | ||
| echo "filter-syscalls = false" >> /etc/nix/nix.conf && \ | ||
| echo "sandbox = true" >> /etc/nix/nix.conf | ||
|
|
||
| COPY --chown=$USER:$USER Makefile flake.nix flake.lock /tmp/dotfiles-cache/ | ||
| COPY --chown=$USER:$USER lib /tmp/dotfiles-cache/lib | ||
| COPY --chown=$USER:$USER scripts/nix-cache-warmup.sh /tmp/dotfiles-cache/scripts/nix-cache-warmup.sh | ||
|
|
||
| RUN --mount=type=secret,id=github_token,mode=0444 \ | ||
| set -e; \ | ||
| /usr/bin/nix-daemon & \ | ||
| sleep 5 && \ | ||
| sudo -u "$USER" -H env GITHUB_TOKEN_FILE=/run/secrets/github_token IN_DOCKER=true USER="$USER" \ | ||
| make -C /tmp/dotfiles-cache nix-cache-warmup | ||
|
|
||
| ARG COMMIT_SHA=main | ||
| ARG GITHUB_PR= | ||
| echo "sandbox = true" >> /etc/nix/nix.conf && \ | ||
| if [ -n "$GITHUB_TOKEN" ]; then \ | ||
| echo "access-tokens = github.com=$GITHUB_TOKEN" >> /etc/nix/nix.conf ; \ | ||
| fi | ||
|
|
||
| RUN --mount=type=secret,id=github_token,mode=0444 \ | ||
| set -e; \ | ||
| /usr/bin/nix-daemon & \ | ||
| RUN /usr/bin/nix-daemon & \ | ||
| sleep 5 && \ | ||
| # Run your dotfiles installation script. | ||
| # This script is expected to install fish and other tools. | ||
| # Make sure this script is idempotent or handles being run in a fresh environment. | ||
| sudo -u "$USER" -H env GITHUB_PR="$GITHUB_PR" GITHUB_TOKEN_FILE=/run/secrets/github_token IN_DOCKER=true USER="$USER" bash -c "curl -fsSL https://raw.githubusercontent.com/shunkakinoki/dotfiles/$COMMIT_SHA/install.sh | bash" | ||
| sudo -u $USER -E -H bash -c "curl -fsSL https://raw.githubusercontent.com/shunkakinoki/dotfiles/$COMMIT_SHA/install.sh | bash" | ||
|
Comment on lines
+57
to
+62
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
|
||
| # Switch to the non-root user | ||
| USER $USER | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,11 +12,11 @@ ARCH := $(shell uname -m) | |
| OS := $(shell uname -s) | ||
|
|
||
| # Git variables | ||
| GIT_REMOTE_ORIGIN_URL := $(shell git config --get remote.origin.url 2>/dev/null) | ||
| GIT_REMOTE_ORIGIN_URL := $(shell git config --get remote.origin.url) | ||
| GITHUB_REPO_PATH := $(shell echo $(GIT_REMOTE_ORIGIN_URL) | sed -n 's/.*github.com[:/]\(.*\)\.git/\1/p') | ||
| GITHUB_REPO_OWNER := $(shell echo $(GITHUB_REPO_PATH) | cut -d'/' -f1) | ||
| GITHUB_REPO_NAME := $(shell echo $(GITHUB_REPO_PATH) | cut -d'/' -f2) | ||
| GIT_COMMIT_SHA := $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown) | ||
| GIT_COMMIT_SHA := $(shell git rev-parse --short HEAD) | ||
|
Comment on lines
+15
to
+19
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing the error suppression ( |
||
|
|
||
| # Env ironment variables | ||
| NIX_ALLOW_UNFREE := NIXPKGS_ALLOW_UNFREE=1 | ||
|
|
@@ -151,7 +151,7 @@ help: ## Show this help message. | |
| ##@ General | ||
|
|
||
| .PHONY: install | ||
| install: setup git-submodule-sync nix-cache-warmup nix-build nix-switch shell-install ## Set up full environment (setup, cache warmup, build, switch, shell-install). | ||
| install: setup git-submodule-sync nix-build nix-switch shell-install ## Set up full environment (setup, flake-update, build, switch, shell-install). | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The help description for the |
||
|
|
||
| .PHONY: build | ||
| build: nix-build ## Build Nix configuration. | ||
|
|
@@ -432,16 +432,6 @@ nix-install: ## Install Nix if not already installed. | |
| fi | ||
| @echo "✅ Nix environment installed!" | ||
|
|
||
| .PHONY: nix-cache-warmup | ||
| nix-cache-warmup: nix-connect nix-trust ## Warm flake input metadata before build/switch. | ||
| @echo "🔥 Warming Nix flake cache..." | ||
| @if command -v nix >/dev/null 2>&1; then \ | ||
| $(NIX_ALLOW_UNFREE) sh ./scripts/nix-cache-warmup.sh . $(NIX_FLAGS); \ | ||
| echo "✅ Nix flake cache warmed"; \ | ||
| else \ | ||
| echo "⚠️ Nix unavailable; skipping cache warmup"; \ | ||
| fi | ||
|
|
||
| ##@ Nix | ||
|
|
||
| .PHONY: nix-update | ||
|
|
||
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Writing the
GITHUB_TOKENdirectly into/etc/nix/nix.confwithin aRUNcommand persists the sensitive token in the image's filesystem and layer history. This is a security risk as the token can be extracted by anyone with access to the image. It is highly recommended to use Docker secrets (--mount=type=secret) to provide the token only during the build process without storing it in the final image.