From 5a616ff2a3ccd0e1658d507b9db709d07739ced2 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Tue, 11 Jun 2024 13:46:03 +0200 Subject: [PATCH] initial commit --- .gitea/workflows/container.yaml | 12 ++++++++++ .gitignore | 3 +++ Containerfile | 39 +++++++++++++++++++++++++++++++++ README.md | 11 ++++++++++ 4 files changed, 65 insertions(+) create mode 100644 .gitea/workflows/container.yaml create mode 100644 .gitignore create mode 100644 Containerfile create mode 100644 README.md diff --git a/.gitea/workflows/container.yaml b/.gitea/workflows/container.yaml new file mode 100644 index 0000000..e48b3fd --- /dev/null +++ b/.gitea/workflows/container.yaml @@ -0,0 +1,12 @@ +name: Build Multiarch Container Image +on: [push] +jobs: + call-reusable-workflow: + uses: container/multiarch-build-workflow/.gitea/workflows/build.yaml@main + with: + repository: ${{ gitea.repository }} + ref_name: ${{ gitea.ref_name }} + sha: ${{ gitea.sha }} + registry_url: ${{ secrets.REGISTRY_URL }} + registry_user: ${{ secrets.REGISTRY_USER }} + registry_pw: ${{ secrets.REGISTRY_PW }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..af0faab --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*~ +.DS_Store +*.swp diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..c573e63 --- /dev/null +++ b/Containerfile @@ -0,0 +1,39 @@ +FROM docker.io/rust:1-alpine3.20 AS builder + +RUN apk --no-cache add \ + git \ + protoc \ + protobuf-dev \ + musl-dev + +ENV CARGO_CARGO_NEW_VCS="none" +ENV CARGO_BUILD_RUSTFLAGS="-C target-feature=+crt-static" + +RUN echo "atuin:x:2222:2222:Linux User,,,:/atuin:/atuin" > /passwd +RUN mkdir /atuin + +ENV VERSION=v18.3.0 + +RUN git clone https://github.com/atuinsh/atuin.git /work +WORKDIR /work +RUN git checkout $VERSION + +RUN cargo build --release --target=$(arch)-unknown-linux-musl +RUN cp "./target/$(arch)-unknown-linux-musl/release/atuin" /app + + +FROM scratch + +COPY --from=builder --chown=2222:2222 /atuin /atuin +COPY --from=builder /passwd /etc/passwd + +ENV ATUIN_HOST="0.0.0.0" +ENV ATUIN_PORT=8888 +ENV ATUIN_OPEN_REGISTRATION=true +ENV RUST_LOG=info,atuin_server=debug + +USER atuin +COPY --from=builder /app /app +CMD ["/app", "server", "start"] + +EXPOSE 8888 diff --git a/README.md b/README.md new file mode 100644 index 0000000..3db7b75 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +[Atuin](https://atuin.sh/) server to sync shell history. + +# Environment Variables + +See the [docs](https://docs.atuin.sh/self-hosting/server-setup/) for +configuration with environment variables. At least `ATUIN_DB_URI` has to be +provided. + +# Ports + +- 8888