gitbucket / gitbucket-docker

Docker image of GitBucket which is an open source GitHub server powered by Scala
https://github.com/gitbucket/gitbucket-docker/pkgs/container/gitbucket
58 stars 23 forks source link

Japanese text is not saved correctly when entered in the editor screen. #35

Closed hiro345g closed 2 years ago

hiro345g commented 2 years ago

In gitbucket-docker environment, HTML response with wrong lang attribute.

<html prefix="og: http://ogp.me/ns#" lang="en">

1) input text in Japanese. 1

2) commit 2

3) result 3

c.f.

In Ubuntu 20.04 LTS Japanese Remix environment, HTML response with no lang attribute. It works correctly.

<html prefix="og: http://ogp.me/ns#">
takezoe commented 2 years ago

Could you clarify what environment (including web browser) it didn't work?

In Ubuntu 20.04 LTS Japanese Remix environment, HTML response with no lang attribute. It works correctly.

Does this mean you removed lang="en" by modifying the source code of GitBucket? And it didn't work as long as there is lang="en" regardless docker environment?

hiro345g commented 2 years ago

I gave a confusing explanation. I have modified the description.

Does this mean you removed lang="en" by modifying the source code of GitBucket?

No.

And it didn't work as long as there is lang="en" regardless docker environment?

I have not verified that.

Web browser version

gitbucket-docker environment.

The contents of the docker-compose.yml are as follows.

services:
  gitbucket:
    image: gitbucket/gitbucket:4.37.2
    ports:
      - 8080:8080

I have run the command as follows.

docker compose up -d

Ubuntu 20.04 LTS Japanese Remix environment

$ java --version
openjdk 11.0.11 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)

I have run the command as follows.

wget https://github.com/gitbucket/gitbucket/releases/download/4.34.0/gitbucket.war
java -jar gitbucket.war 

It works correctly.

Dockerfile

I tried the following and it did not work. This is the same result as in gitbucket-docker environment.

FROM openjdk:11-jre

ADD https://github.com/gitbucket/gitbucket/releases/download/4.37.2/gitbucket.war /opt/gitbucket.war

RUN apt-get update \
    && apt-get install -y locales \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* \
    && sed -i -E 's/# (ja_JP.UTF-8)/\1/' /etc/locale.gen \
    && locale-gen \
    && ln -s /gitbucket /root/.gitbucket

VOLUME /gitbucket

# Port for web page and Port for SSH access to git repository (Optional)
EXPOSE 8080 29418

CMD ["sh", "-c", "java -jar /opt/gitbucket.war"]

docker-compose.yml

version: '3'
services: 
  gitbucket-a:
    build: .
    image: gitbucket-a
    ports:
      - 8080:8080
      - 29418:29418
    tty: true

I have run the command as follows.

docker compose build
docker compose up -d 
takezoe commented 2 years ago

So you mean you didn't say that GitBucket with no lang attribute works? (= You are not sure if lang="en" is actually the root cause)

By the way, I tried docker on Mac but didn't reproduce and you say raw GitBucket works on your environment, meaning something is different in docker on your environment...?

hiro345g commented 2 years ago

So you mean you didn't say that GitBucket with no lang attribute works? (= You are not sure if lang="en" is actually the root cause)

Yes

By the way, I tried docker on Mac but didn't reproduce

I see that Docker Desktop for macOS works.

and you say raw GitBucket works on your environment, meaning something is different in docker on your environment...?

Yes. I use docker for Linux and compose plugin.

$ docker version
Client: Docker Engine - Community
 Cloud integration: v1.0.25
 Version:           20.10.17
 API version:       1.41
 Go version:        go1.17.11
 Git commit:        100c701
 Built:             Mon Jun  6 23:02:57 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.17
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.17.11
  Git commit:       a89b842
  Built:            Mon Jun  6 23:01:03 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.6
  GitCommit:        10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
 runc:
  Version:          1.1.2
  GitCommit:        v1.1.2-0-ga916309
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

$ docker compose version
Docker Compose version v2.0.1
hiro345g commented 2 years ago

By the way, I tried docker on Mac but didn't reproduce

I tried docker on macOS and reproduce. (Intel Core i5, macOS Monterey 12.4)

% docker version
Client:
 Cloud integration: v1.0.22
 Version:           20.10.11
 API version:       1.41
 Go version:        go1.16.10
 Git commit:        dea9396
 Built:             Thu Nov 18 00:36:09 2021
 OS/Arch:           darwin/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.11
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.9
  Git commit:       847da18
  Built:            Thu Nov 18 00:35:39 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.12
  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
% docker compose version
Docker Compose version v2.2.1

The contents of the docker-compose.yml are as follows.

services:
  gitbucket:
    image: gitbucket/gitbucket:4.37.2
    ports:
      - 8080:8080

I run the command as follows.

docker compose up -d

operation

  1. sigin root /root
  2. New Repository ... sample01, public, Initialize this repository with a README
  3. open http://localhost:8080/root/sample01/edit/master/README.md and edit (input 日本語)
  4. Commit changes
takezoe commented 2 years ago

Thanks! I will try that procedure!

takezoe commented 2 years ago

This is an issue of GitBucket itself, not a Docker image. So we will deal with the issue in https://github.com/gitbucket/gitbucket/issues/3100.