Skip to content
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

Openeuler #6

Merged
merged 6 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions Dockerfile_openeuler
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM openeuler/openeuler:23.09
LABEL maintainer="Etherpad team, https://github.com/ether/etherpad-lite"
RUN yum install -y ca-certificates git shadow wget xz
RUN mkdir -p /opt/soft/ && mkdir -p /opt/soft/node && mkdir -p /opt/etherpad-lite
RUN cd /opt/soft/ && wget https://nodejs.org/dist/v18.20.0/node-v18.20.0-linux-x64.tar.xz && tar -xf node-v18.20.0-linux-x64.tar.xz -C /opt/soft/node && rm -rf /opt/soft/node-v18.20.0-linux-x64.tar.xz
RUN ln -s /opt/soft/node/node-v18.20.0-linux-x64/bin/npm /usr/bin/npm && ln -s /opt/soft/node/node-v18.20.0-linux-x64/bin/node /usr/bin/node
RUN npm config set registry https://registry.npmmirror.com && npm install pnpm -g && npm install typescript -g
RUN ln -s /opt/soft/node/node-v18.20.0-linux-x64/bin/pnpm /usr/bin/pnpm

ARG INSTALL_ABIWORD=
ARG INSTALL_SOFFICE=
ARG EP_HOME=
ARG EP_SHELL=
ARG EP_UID=5001
ARG EP_GID=0
ARG EP_DIR=/opt/etherpad-lite
ARG ETHERPAD_PLUGINS="ep_font_size ep_font_color ep_font_family ep_headings2 ep_themes"
RUN groupadd --system ${EP_GID:+--gid "${EP_GID}" --non-unique} etherpad && \
useradd --system ${EP_UID:+--uid "${EP_UID}" --non-unique} --gid etherpad \
${EP_HOME:+--home-dir "${EP_HOME}"} --create-home \
${EP_SHELL:+--shell "${EP_SHELL}"} etherpad
RUN mkdir -p "${EP_DIR}" && chown etherpad:etherpad "${EP_DIR}"
RUN mkdir -p /usr/share/man/man1

COPY --chown=etherpad:etherpad ./ /opt/etherpad-lite
COPY --chown=etherpad:etherpad ./settings.json.docker "${EP_DIR}"/settings.json
RUN cd /opt/etherpad-lite/admin && pnpm install && pnpm run build --outDir ./dist
RUN cd /opt/etherpad-lite/ui && pnpm install && pnpm run build --outDir ./dist
RUN cp -r /opt/etherpad-lite/admin/dist /opt/etherpad-lite/src/templates/admin
RUN cp -r /opt/etherpad-lite/ui/dist /opt/etherpad-lite/src/static/oidc

# RUN { [ -z "${ETHERPAD_PLUGINS}" ] || npm install --no-save ${ETHERPAD_PLUGINS}; } && src/bin/installDeps.sh && rm -rf ~/.npm
RUN sh -x /opt/etherpad-lite/bin/installDeps.sh
RUN cd /opt/etherpad-lite/ && pnpm config set registry https://registry.npm.taobao.org && pnpm run install-plugins ${ETHERPAD_PLUGINS};
RUN chown -R etherpad:etherpad /opt/etherpad-lite && chmod -R 750 /opt/etherpad-lite

USER etherpad
ENV NODE_ENV=production
WORKDIR "${EP_DIR}"

HEALTHCHECK --interval=20s --timeout=3s CMD curl -f http://localhost:9001 || exit 1

EXPOSE 9001
CMD ["pnpm", "run", "prod"]
18 changes: 6 additions & 12 deletions settings.json.docker
Original file line number Diff line number Diff line change
Expand Up @@ -655,18 +655,12 @@
"issuer": "${SSO_ISSUER:http://localhost:9001}",
"clients": [
{
"client_id": "${ADMIN_CLIENT:admin_client}",
"client_secret": "${ADMIN_SECRET:admin}",
"grant_types": ["authorization_code"],
"response_types": ["code"],
"redirect_uris": ["${ADMIN_REDIRECT:http://localhost:9001/admin/}"]
},
{
"client_id": "${USER_CLIENT:user_client}",
"client_secret": "${USER_SECRET:user}",
"grant_types": ["authorization_code"],
"response_types": ["code"],
"redirect_uris": ["${USER_REDIRECT:http://localhost:9001/}"]
"client_id": "${CLIENT_ID}",
"client_secret": "${CLIENT_SECRET}",
"grant_types": ["client_credentials"],
"redirect_uris": [],
"response_types": [],
"extraParams": [{"name":"admin", "value":"true"}]
}
]
},
Expand Down
15 changes: 15 additions & 0 deletions src/static/img/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/static/img/information.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions src/templates/pad.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,23 @@
<script type="text/javascript" src="../static/js/l10n.js?v=<%=settings.randomVersionString%>"></script>
</head>
<body>
<div style="height: 76px; background: #002FA7; display: flex; align-items: center; justify-content: space-between" class="notice-div">
<div style="display: flex; align-items: center">
<img src='../static/img/information.svg' class='notice-information-svg' style="height: 24px; width: 24px;">
<font style="color:#FFFFFF;
font-family: PingFangSC-Regular;
font-size: 14px;
letter-spacing: 0;
line-height: 22px;
font-weight: 400;
display: inline-block;
vertical-align: middle;
margin-left: 10px"
>注意:这是共享记事本,请勿留存敏感信息!/ Note: This is a shared notepad, please do not save sensitive information!</font>
</div>
<img src='../static/img/close.svg' class='notice-close-svg' style="height: 24px; width: 24px; display: flex; align-items: center; margin-right: 8px">
</div>

<% e.begin_block("body"); %>

<!----------------------------->
Expand Down Expand Up @@ -499,6 +516,11 @@ <h1>Skin Builder</h1>
padimpexp = require('ep_etherpad-lite/static/js/pad_impexp').padimpexp;
require('ep_etherpad-lite/static/js/skin_variants');

// click to hide the notice form
$('.notice-close-svg').on("click", ()=> {
$('.notice-div').hide();
})

}());
// @license-end
</script>
Expand Down
20 changes: 20 additions & 0 deletions src/templates/timeslider.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@

<% e.begin_block("timesliderBody"); %>
<body id="padbody" class="timeslider limwidth">
<div style="height: 76px; background: #002FA7; display: flex; align-items: center; justify-content: space-between" class="notice-div">
<div style="display: flex; align-items: center">
<img src='../../static/img/information.svg' class='notice-information-svg' style="height: 24px; width: 24px;">
<font style="color:#FFFFFF;
font-family: PingFangSC-Regular;
font-size: 14px;
letter-spacing: 0;
line-height: 22px;
font-weight: 400;
display: inline-block;
vertical-align: middle;
margin-left: 10px"
>注意:这是共享记事本,请勿留存敏感信息!/ Note: This is a shared notepad, please do not save sensitive information!</font>
</div>
<img src='../../static/img/close.svg' class='notice-close-svg' style="height: 24px; width: 24px; display: flex; align-items: center; margin-right: 8px">
</div>

<!----------------------------->
<!--------- TOOLBAR ----------->
Expand Down Expand Up @@ -298,6 +314,10 @@ <h1 data-l10n-id="pad.settings.padSettings"></h1>

padeditbar.init()
});

$('.notice-close-svg').on("click", ()=> {
$('.notice-div').hide();
})
})();
// @license-end
</script>
Expand Down
Loading