Element Synapse: switched from development to production mode and fixed update (#5066)

* Update elementsynapse.sh

* Update elementsynapse-install.sh

* Update elementsynapse.sh

removed comment
This commit is contained in:
Frankmaaan 2025-06-10 20:13:00 +02:00 committed by GitHub
parent 7cf8300b47
commit b8ba409e5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 2 deletions

View File

@ -47,7 +47,7 @@ function update_script() {
$STD apt-get -y upgrade $STD apt-get -y upgrade
msg_ok "Updated $APP LXC" msg_ok "Updated $APP LXC"
if [[ -f /systemd/system/synapse-admin.service ]]; then if [[ -f /etc/systemd/system/synapse-admin.service ]]; then
msg_info "Updating Synapse-Admin" msg_info "Updating Synapse-Admin"
RELEASE=$(curl -fsSL https://api.github.com/repos/etkecc/synapse-admin/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') RELEASE=$(curl -fsSL https://api.github.com/repos/etkecc/synapse-admin/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ "${RELEASE}" != "$(cat /opt/"${APP}"_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then if [[ "${RELEASE}" != "$(cat /opt/"${APP}"_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
@ -58,7 +58,16 @@ function update_script() {
curl -fsSL "https://github.com/etkecc/synapse-admin/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file" curl -fsSL "https://github.com/etkecc/synapse-admin/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
tar xzf "$temp_file" -C /opt/synapse-admin --strip-components=1 tar xzf "$temp_file" -C /opt/synapse-admin --strip-components=1
cd /opt/synapse-admin cd /opt/synapse-admin
$STD yarn global add serve
$STD yarn install --ignore-engines $STD yarn install --ignore-engines
$STD yarn build
mv ./dist ../ && \
rm -rf * && \
mv ../dist ./
if [[ -z $(grep "ExecStart=/usr/local/bin/serve" /etc/systemd/system/synapse-admin.service) ]]; then
sed -i 's|^ExecStart=.*|ExecStart=/usr/local/bin/serve -s dist -l 5173|' /etc/systemd/system/synapse-admin.service
systemctl reenable synapse-admin
fi
systemctl start synapse-admin systemctl start synapse-admin
echo "${RELEASE}" >/opt/"${APP}"_version.txt echo "${RELEASE}" >/opt/"${APP}"_version.txt
rm -f "$temp_file" rm -f "$temp_file"

View File

@ -54,7 +54,12 @@ RELEASE=$(curl -fsSL https://api.github.com/repos/etkecc/synapse-admin/releases/
curl -fsSL "https://github.com/etkecc/synapse-admin/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file" curl -fsSL "https://github.com/etkecc/synapse-admin/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
tar xzf "$temp_file" -C /opt/synapse-admin --strip-components=1 tar xzf "$temp_file" -C /opt/synapse-admin --strip-components=1
cd /opt/synapse-admin cd /opt/synapse-admin
$STD yarn global add serve
$STD yarn install --ignore-engines $STD yarn install --ignore-engines
$STD yarn build
mv ./dist ../ && \
rm -rf * && \
mv ../dist ./
msg_ok "Installed Element Synapse" msg_ok "Installed Element Synapse"
msg_info "Creating Service" msg_info "Creating Service"
@ -67,7 +72,7 @@ Requires=matrix-synapse.service
[Service] [Service]
Type=simple Type=simple
WorkingDirectory=/opt/synapse-admin WorkingDirectory=/opt/synapse-admin
ExecStart=/usr/bin/yarn start --host ExecStart=/usr/local/bin/serve -s dist -l 5173
Restart=always Restart=always
[Install] [Install]