Skip to content

Gitea can write to S3-compatiable instances, but cannot read back #36075

@hustler-not-chatty

Description

@hustler-not-chatty

Description

I configured gitea to use a RustFS (S3-compatiable) instance as storage. Gitea seems to upload files just fine, but cannot read them.

Gitea Version

1.25.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/hustler-not-chatty/492cf26411727fd2d5f76a1f39f42eb8

Screenshots

Image

Git Version

2.49.1

Operating System

Linux

How are you running Gitea?

Using a customized gitea container.

Snippet of docker-compose.yml

  gitea:
    image: gitea
    build:
      context: ./build/gitea-custom
      dockerfile: Dockerfile
      target: gitea
    container_name: gitea
    restart: always
    depends_on:
      - postgres
      - rustfs
    env_file:
      - ./gitea.env
    volumes:
      - gitea_data:/data
      - gitea_config:/data/config
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    networks:
      - web
      - internal_db
    ports:
      - "2222:22"

Dockerfile to build this image:

FROM rust:1-alpine AS builder
USER root
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
RUN apk update; apk add --update --no-cache --no-progress alpine-sdk build-base sudo curl openssl-libs-static openssl-dev clang
# Create user for building
COPY APKBUILD use-mirror.patch /package/typst/
RUN adduser -D -G abuild builder && chown -R builder /package && echo 'builder ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/builder;
USER builder
ENV HOME=/package
WORKDIR /package/typst
ENV CARGO_HOME=/package/cargo_home
# Setup Rust mirror
RUN mkdir -p /package/cargo_home/tmp
COPY config.toml /package/cargo_home/
# Build the package. Package stored in REPODEST/package/aarch64/*.apk
RUN abuild-keygen -n -a --install && abuild checksum && REPODEST=/package/dest abuild -r

FROM gitea/gitea:1 AS gitea
COPY --from=builder /package/.abuild/*.pub /etc/apk/keys/
COPY --from=builder /package/dest/package/ /tmp/package
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories && \
    apk add /tmp/package/*/*.apk && \
    rm -r /tmp/package

Database

PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions