Skip to content

Commit a40ddfb

Browse files
committed
add chinese version
1 parent fddacad commit a40ddfb

File tree

14 files changed

+275
-543
lines changed

14 files changed

+275
-543
lines changed

.github/CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
## Readme
2525

2626
If you would like to change our readme, please __**do not**__ directly edit the readme, as it is auto-generated on each commit.
27-
Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-wps-office/edit/master/readme-vars.yml).
27+
Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-wps-office/edit/chinese/readme-vars.yml).
2828

2929
These variables are used in a template for our [Jenkins Builder](https://github.com/linuxserver/docker-jenkins-builder) as part of an ansible play.
30-
Most of these variables are also carried over to [docs.linuxserver.io](https://docs.linuxserver.io/images/docker-wps-office)
30+
Most of these variables are also carried over to [docs.linuxserver.io](https://docs.linuxserver.io)
3131

3232
### Fixing typos or clarify the text in the readme
3333

@@ -115,7 +115,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
115115

116116
## Update the changelog
117117

118-
If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-wps-office/tree/master/root), add an entry to the changelog
118+
If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-wps-office/tree/chinese/root), add an entry to the changelog
119119

120120
```yml
121121
changelogs:

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ contact_links:
99
about: Post on our community forum.
1010

1111
- name: Documentation
12-
url: https://docs.linuxserver.io/images/docker-wps-office
12+
url: https://docs.linuxserver.io
1313
about: Documentation - information about all of our containers.

.github/ISSUE_TEMPLATE/issue.bug.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@ body:
4747
render: markdown
4848
validations:
4949
required: false
50-
- type: dropdown
51-
attributes:
52-
label: CPU architecture
53-
options:
54-
- x86-64
55-
validations:
56-
required: true
5750
- type: textarea
5851
attributes:
5952
label: Docker creation

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
------------------------------
2323

24-
- [ ] I have read the [contributing](https://github.com/linuxserver/docker-wps-office/blob/master/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications
24+
- [ ] I have read the [contributing](https://github.com/linuxserver/docker-wps-office/blob/chinese/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications
2525

2626
------------------------------
2727

.github/workflows/external_trigger.yml

Lines changed: 92 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,101 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
external-trigger-master:
7+
external-trigger-chinese:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/[email protected]
1111

1212
- name: External Trigger
13-
if: github.ref == 'refs/heads/master'
13+
if: github.ref == 'refs/heads/chinese'
1414
run: |
15-
echo "**** No external release, exiting ****"
16-
echo "No external release, exiting" >> $GITHUB_STEP_SUMMARY
17-
exit 0
15+
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_WPS_OFFICE_CHINESE }}" ]; then
16+
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_WPS_OFFICE_CHINESE is set; skipping trigger. ****"
17+
echo "Github secret \`PAUSE_EXTERNAL_TRIGGER_WPS_OFFICE_CHINESE\` is set; skipping trigger." >> $GITHUB_STEP_SUMMARY
18+
exit 0
19+
fi
20+
echo "**** External trigger running off of chinese branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_WPS_OFFICE_CHINESE\". ****"
21+
echo "External trigger running off of chinese branch. To disable this trigger, set a Github secret named \`PAUSE_EXTERNAL_TRIGGER_WPS_OFFICE_CHINESE\`" >> $GITHUB_STEP_SUMMARY
22+
echo "**** Retrieving external version ****"
23+
EXT_RELEASE=$(curl -u ${{ secrets.CR_USER }}:${{ secrets.CR_PAT }} -sX GET https://api.github.com/repos/linuxserver/docker-baseimage-kasmvnc/releases | jq -r 'first(.[] | select(.tag_name | startswith("arch-"))) | .tag_name' | sed 's|arch-||' | sed 's|-ls.*||')
24+
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
25+
echo "**** Can't retrieve external version, exiting ****"
26+
FAILURE_REASON="Can't retrieve external version for wps-office branch chinese"
27+
GHA_TRIGGER_URL="https://github.com/linuxserver/docker-wps-office/actions/runs/${{ github.run_id }}"
28+
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
29+
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n**Trigger URL:** '"${GHA_TRIGGER_URL}"' \n"}],
30+
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
31+
exit 1
32+
fi
33+
EXT_RELEASE=$(echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g')
34+
echo "**** External version: ${EXT_RELEASE} ****"
35+
echo "External version: ${EXT_RELEASE}" >> $GITHUB_STEP_SUMMARY
36+
echo "**** Retrieving last pushed version ****"
37+
image="linuxserver/wps-office"
38+
tag="chinese"
39+
token=$(curl -sX GET \
40+
"https://ghcr.io/token?scope=repository%3Alinuxserver%2Fwps-office%3Apull" \
41+
| jq -r '.token')
42+
multidigest=$(curl -s \
43+
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
44+
--header "Authorization: Bearer ${token}" \
45+
"https://ghcr.io/v2/${image}/manifests/${tag}" \
46+
| jq -r 'first(.manifests[].digest)')
47+
digest=$(curl -s \
48+
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
49+
--header "Authorization: Bearer ${token}" \
50+
"https://ghcr.io/v2/${image}/manifests/${multidigest}" \
51+
| jq -r '.config.digest')
52+
image_info=$(curl -sL \
53+
--header "Authorization: Bearer ${token}" \
54+
"https://ghcr.io/v2/${image}/blobs/${digest}")
55+
if [[ $(echo $image_info | jq -r '.container_config') == "null" ]]; then
56+
image_info=$(echo $image_info | jq -r '.config')
57+
else
58+
image_info=$(echo $image_info | jq -r '.container_config')
59+
fi
60+
IMAGE_RELEASE=$(echo ${image_info} | jq -r '.Labels.build_version' | awk '{print $3}')
61+
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}')
62+
if [ -z "${IMAGE_VERSION}" ]; then
63+
echo "**** Can't retrieve last pushed version, exiting ****"
64+
FAILURE_REASON="Can't retrieve last pushed version for wps-office tag chinese"
65+
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
66+
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
67+
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
68+
exit 1
69+
fi
70+
echo "**** Last pushed version: ${IMAGE_VERSION} ****"
71+
echo "Last pushed version: ${IMAGE_VERSION}" >> $GITHUB_STEP_SUMMARY
72+
if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then
73+
echo "**** Version ${EXT_RELEASE} already pushed, exiting ****"
74+
echo "Version ${EXT_RELEASE} already pushed, exiting" >> $GITHUB_STEP_SUMMARY
75+
exit 0
76+
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wps-office/job/chinese/lastBuild/api/json | jq -r '.building') == "true" ]; then
77+
echo "**** New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting ****"
78+
echo "New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting" >> $GITHUB_STEP_SUMMARY
79+
exit 0
80+
else
81+
echo "**** New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build ****"
82+
echo "New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build" >> $GITHUB_STEP_SUMMARY
83+
response=$(curl -iX POST \
84+
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wps-office/job/chinese/buildWithParameters?PACKAGE_CHECK=false \
85+
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
86+
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
87+
echo "**** Sleeping 10 seconds until job starts ****"
88+
sleep 10
89+
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
90+
buildurl="${buildurl%$'\r'}"
91+
echo "**** Jenkins job build url: ${buildurl} ****"
92+
echo "Jenkins job build url: ${buildurl}" >> $GITHUB_STEP_SUMMARY
93+
echo "**** Attempting to change the Jenkins job description ****"
94+
curl -iX POST \
95+
"${buildurl}submitDescription" \
96+
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
97+
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
98+
--data-urlencode "Submit=Submit"
99+
echo "**** Notifying Discord ****"
100+
TRIGGER_REASON="A version change was detected for wps-office tag chinese. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
101+
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
102+
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}],
103+
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
104+
fi

.github/workflows/greetings.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ jobs:
99
- uses: actions/first-interaction@v1
1010
with:
1111
issue-message: 'Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.'
12-
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-wps-office/blob/master/.github/PULL_REQUEST_TEMPLATE.md)!'
12+
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-wps-office/blob/chinese/.github/PULL_REQUEST_TEMPLATE.md)!'
1313
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/package_trigger.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
package-trigger-master:
7+
package-trigger-chinese:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/[email protected]
1111

1212
- name: Package Trigger
13-
if: github.ref == 'refs/heads/master'
13+
if: github.ref == 'refs/heads/chinese'
1414
run: |
15-
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_WPS_OFFICE_MASTER }}" ]; then
16-
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_WPS_OFFICE_MASTER is set; skipping trigger. ****"
17-
echo "Github secret \`PAUSE_PACKAGE_TRIGGER_WPS_OFFICE_MASTER\` is set; skipping trigger." >> $GITHUB_STEP_SUMMARY
15+
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_WPS_OFFICE_CHINESE }}" ]; then
16+
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_WPS_OFFICE_CHINESE is set; skipping trigger. ****"
17+
echo "Github secret \`PAUSE_PACKAGE_TRIGGER_WPS_OFFICE_CHINESE\` is set; skipping trigger." >> $GITHUB_STEP_SUMMARY
1818
exit 0
1919
fi
20-
if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wps-office/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
20+
if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wps-office/job/chinese/lastBuild/api/json | jq -r '.building') == "true" ]; then
2121
echo "**** There already seems to be an active build on Jenkins; skipping package trigger ****"
2222
echo "There already seems to be an active build on Jenkins; skipping package trigger" >> $GITHUB_STEP_SUMMARY
2323
exit 0
2424
fi
25-
echo "**** Package trigger running off of master branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_WPS_OFFICE_MASTER\". ****"
26-
echo "Package trigger running off of master branch. To disable, set a Github secret named \`PAUSE_PACKAGE_TRIGGER_WPS_OFFICE_MASTER\`" >> $GITHUB_STEP_SUMMARY
25+
echo "**** Package trigger running off of chinese branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_WPS_OFFICE_CHINESE\". ****"
26+
echo "Package trigger running off of chinese branch. To disable, set a Github secret named \`PAUSE_PACKAGE_TRIGGER_WPS_OFFICE_CHINESE\`" >> $GITHUB_STEP_SUMMARY
2727
response=$(curl -iX POST \
28-
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wps-office/job/master/buildWithParameters?PACKAGE_CHECK=true \
28+
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wps-office/job/chinese/buildWithParameters?PACKAGE_CHECK=true \
2929
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
3030
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
3131
echo "**** Sleeping 10 seconds until job starts ****"

Dockerfile

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/linuxserver/baseimage-kasmvnc:debianbullseye
1+
FROM ghcr.io/linuxserver/baseimage-kasmvnc:arch
22

33
# set version label
44
ARG BUILD_DATE
@@ -9,21 +9,22 @@ LABEL maintainer="thelamer"
99

1010
# title
1111
ENV TITLE=WPS-Office \
12-
WPS_VERSION=11.1.0.11711
12+
LC_ALL=zh_CN.UTF-8
1313

1414
RUN \
1515
echo "**** install packages ****" && \
16-
apt-get update && \
17-
apt-get install --no-install-recommends -y \
16+
pacman -Sy --noconfirm --needed \
1817
chromium \
19-
libqt5gui5 \
20-
thunar \
21-
tint2 && \
18+
noto-fonts-cjk \
19+
git \
20+
tint2 \
21+
thunar && \
2222
echo "**** install wps-office ****" && \
23-
curl -o \
24-
/tmp/wps.deb -L \
25-
"https://wdl1.pcfg.cache.wpscdn.com/wpsdl/wpsoffice/download/linux/${WPS_VERSION##*.}/wps-office_${WPS_VERSION}.XA_amd64.deb" && \
26-
apt install -y /tmp/wps.deb && \
23+
cd /tmp && \
24+
git clone https://aur.archlinux.org/wps-office-cn.git && \
25+
chown -R abc:abc wps-office-cn && \
26+
cd wps-office-cn && \
27+
sudo -u abc makepkg -sAci --skipinteg --noconfirm --needed && \
2728
mkdir /tmp/fonts && \
2829
curl -o \
2930
/tmp/fonts.tar.gz -L \
@@ -33,21 +34,21 @@ RUN \
3334
/tmp/fonts/ --strip-components=1 && \
3435
cd /tmp/fonts && \
3536
bash install.sh && cd / && \
36-
echo "**** openbox tweaks ****" && \
37-
sed -i \
38-
's/NLMC/NLIMC/g' \
39-
/etc/xdg/openbox/rc.xml && \
40-
sed -i 's|</applications>| <application title="WPS" type="normal">\n <maximized>yes</maximized>\n </application>\n</applications>|' /etc/xdg/openbox/rc.xml && \
37+
ln -s \
38+
/usr/lib/libtiff.so.6 \
39+
/usr/lib/libtiff.so.5 && \
4140
echo "**** application tweaks ****" && \
42-
sed -i \
43-
's#^Exec=.*#Exec=/usr/local/bin/wrapped-chromium#g' \
44-
/usr/share/applications/chromium.desktop && \
41+
mv \
42+
/usr/bin/chromium \
43+
/usr/bin/chromium-real && \
4544
echo "**** cleanup ****" && \
46-
apt-get autoclean && \
45+
pacman -Rsn --noconfirm \
46+
git \
47+
$(pacman -Qdtq) && \
4748
rm -rf \
48-
/var/lib/apt/lists/* \
49-
/var/tmp/* \
50-
/tmp/*
49+
/tmp/* \
50+
/var/cache/pacman/pkg/* \
51+
/var/lib/pacman/sync/*
5152

5253
# add local files
5354
COPY /root /

Dockerfile.aarch64

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
FROM ghcr.io/linuxserver/baseimage-kasmvnc:arm64v8-arch
2+
3+
# set version label
4+
ARG BUILD_DATE
5+
ARG VERSION
6+
ARG WPSOFFICE_VERSION
7+
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
8+
LABEL maintainer="thelamer"
9+
10+
# title
11+
ENV TITLE=WPS-Office \
12+
LC_ALL=zh_CN.UTF-8
13+
14+
RUN \
15+
echo "**** install packages ****" && \
16+
pacman -Sy --noconfirm --needed \
17+
chromium \
18+
noto-fonts-cjk \
19+
git \
20+
tint2 \
21+
thunar && \
22+
echo "**** install wps-office ****" && \
23+
cd /tmp && \
24+
git clone https://aur.archlinux.org/wps-office-cn.git && \
25+
chown -R abc:abc wps-office-cn && \
26+
cd wps-office-cn && \
27+
sudo -u abc makepkg -sAci --skipinteg --noconfirm --needed && \
28+
mkdir /tmp/fonts && \
29+
curl -o \
30+
/tmp/fonts.tar.gz -L \
31+
"https://github.com/BannedPatriot/ttf-wps-fonts/archive/refs/heads/master.tar.gz" && \
32+
tar xf \
33+
/tmp/fonts.tar.gz -C \
34+
/tmp/fonts/ --strip-components=1 && \
35+
cd /tmp/fonts && \
36+
bash install.sh && cd / && \
37+
ln -s \
38+
/usr/lib/libtiff.so.6 \
39+
/usr/lib/libtiff.so.5 && \
40+
echo "**** application tweaks ****" && \
41+
mv \
42+
/usr/bin/chromium \
43+
/usr/bin/chromium-real && \
44+
echo "**** cleanup ****" && \
45+
pacman -Rsn --noconfirm \
46+
git \
47+
$(pacman -Qdtq) && \
48+
rm -rf \
49+
/tmp/* \
50+
/var/cache/pacman/pkg/* \
51+
/var/lib/pacman/sync/*
52+
53+
# add local files
54+
COPY /root /
55+
56+
# ports and volumes
57+
EXPOSE 3000
58+
59+
VOLUME /config

0 commit comments

Comments
 (0)