Skip to content

Commit b095cf0

Browse files
committed
Revert "Change onlyoffice to euro-office"
This reverts commit 475f995.
1 parent 22bb56f commit b095cf0

26 files changed

Lines changed: 201 additions & 142 deletions

.github/workflows/clean-registry.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ jobs:
1515
steps:
1616
- uses: NethServer/ns8-github-actions/.github/actions/delete-image@v1
1717
with:
18-
images: "euro-office"
18+
images: "onlyoffice"
1919
delete_image_token: ${{ secrets.IMAGES_CLEANUP_TOKEN }}

README.md

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,70 @@
1-
# ns8-euro-office
1+
# ns8-onlyoffice
22

3-
This is the Euro-Office app for NethServer 8.
3+
This is the Onlyoffice app for NethServer 8.
44

55
## Install
66

77
Install via Software center:
88

99
- Add a Software repository pointing to `https://repo.mrmarkuz.com/ns8/updates/`, check out the [repo webpage](https://repo.mrmarkuz.com) how to do it.
10-
- Install Euro-Office via Software Center
10+
- Install Onlyoffice via Software Center
1111

1212
Instantiate the module on CLI with:
1313

14-
add-module ghcr.io/mrmarkuz/euro-office:latest 1
14+
add-module ghcr.io/mrmarkuz/onlyoffice:latest 1
1515

1616
The output of the command will return the instance name.
1717
Output example:
1818

19-
{"module_id": "euro-office1", "image_name": "euro-office", "image_url": "ghcr.io/mrmarkuz/euro-office:latest"}
19+
{"module_id": "onlyoffice1", "image_name": "onlyoffice", "image_url": "ghcr.io/mrmarkuz/onlyoffice:latest"}
2020

2121
## Configure
2222

23-
The FQDN needs to be configured in the Web UI app settings. The FQDN is required. It should be a unique FQDN that's not already used in your NS8 else Euro Office won't be reachable.
23+
The FQDN needs to be configured in the Web UI app settings. The FQDN is required. It should be a unique FQDN that's not already used in your NS8 else Onlyoffice won't be reachable.
2424

2525
## JWT Secret
2626

27-
To get the JWT secret that needs to be configured in client apps like Nextcloud: (in this example the instance is named euro-office1)
27+
To get the JWT secret that needs to be configured in client apps like Nextcloud: (in this example the instance is named onlyoffice1)
2828

29-
runagent -m euro-office1 grep JWT_SECRET environment
29+
runagent -m onlyoffice1 grep JWT_SECRET environment
3030

3131
## Nextcloud
3232

33-
- Install the Nextcloud Office 11.0.0 app
34-
- Go to Nextcloud administration Nextcloud Office app settings
35-
- Set the "Nextcloud Office address" that is the FQDN of the Eurooffice app like `https://eurooffice.domain.tld`
36-
- Set the "Secret key" that you got from the previous chapter
33+
- Install the ONLYOFFICE app
34+
- Go to Nextcloud administration Onlyoffice app settings
35+
- Set the "Onlyoffice Docs address" that is the FQDN of the Onlyoffice app.
36+
- Set the "Secret key" that you got from the previous chapter.
3737

38-
## Fetch documents from a private IP
38+
## Ad blockers
3939

40-
If Nextcloud resolves to a private IP an environment variable needs to be added.
40+
Since Onlyoffice 9.4 (ns8-onlyoffice 1.1.7) ad blockers may block Onlyoffice so you may need to add an exception.
4141

42-
In the following examples euro-office1 is used as app instance name, please change it to match your environment.
42+
## Customize configuration
4343

44-
Edit the environment file and add "ALLOW_PRIVATE_IP_ADDRESS=true":
44+
Since this setup uses the official Docker image, the local.json file is regenerated each time the container starts, meaning it’s not directly mappable or persistent on the host. Any manual changes made to local.json inside the container are lost after a restart.
4545

46-
runagent -m euro-office1 nano environment
46+
The proper workaround is to create the file `/home/onlyoffice1/.local/share/containers/storage/volumes/onlyoffice-etc/_data/local-production-linux.json`. This file takes precedence over the default configuration and remains persistent across container restarts. Any changes made there are applied automatically on startup.
47+
48+
## Use a self signed cert or how to disable the certificate check
49+
50+
Open the Onlyoffice web app in your browser and allow the self-signed certificate to avoid an `ONLYOFFICE cannot be reached. Please contact admin` error in Nextcloud.
51+
52+
In the following examples onlyoffice6 is used as app instance name, please change it to match your environment.
53+
54+
Edit the environment file and add "USE_UNAUTHORIZED_STORAGE=true":
55+
56+
runagent -m onlyoffice1 nano environment
4757

4858
Alternative command to add the environment variable:
4959

50-
runagent -m euro-office1 bash -c "grep -q ALLOW_PRIVATE_IP_ADDRESS environment || echo ALLOW_PRIVATE_IP_ADDRESS=true >> environment"
60+
runagent -m onlyoffice1 bash -c "grep -q USE_UNAUTHORIZED_STORAGE environment || echo USE_UNAUTHORIZED_STORAGE=true >> environment"
5161

52-
Restart euro-office to apply the changes:
62+
Restart onlyoffice to apply the changes:
5363

54-
runagent -m euro-office1 systemctl --user restart euro-office-app
64+
runagent -m onlyoffice1 systemctl --user restart onlyoffice-app
5565

5666
## Uninstall
5767

5868
To uninstall the instance:
5969

60-
remove-module --no-preserve euro-office1
70+
remove-module --no-preserve onlyoffice1

build-images.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ images=()
1313
# The image will be pushed to GitHub container registry
1414
repobase="${REPOBASE:-ghcr.io/mrmarkuz}"
1515
# Configure the image name
16-
reponame="euro-office"
16+
reponame="onlyoffice"
1717

1818
# Create a new empty container image
1919
container=$(buildah from scratch)
2020

21-
# Reuse existing nodebuilder-euro-office container, to speed up builds
22-
if ! buildah containers --format "{{.ContainerName}}" | grep -q nodebuilder-euro-office; then
21+
# Reuse existing nodebuilder-onlyoffice container, to speed up builds
22+
if ! buildah containers --format "{{.ContainerName}}" | grep -q nodebuilder-onlyoffice; then
2323
echo "Pulling NodeJS runtime..."
24-
buildah from --name nodebuilder-euro-office -v "${PWD}:/usr/src:Z" docker.io/library/node:lts
24+
buildah from --name nodebuilder-onlyoffice -v "${PWD}:/usr/src:Z" docker.io/library/node:lts
2525
fi
2626

2727
echo "Build static UI files with node..."
2828
buildah run \
2929
--workingdir=/usr/src/ui \
3030
--env="NODE_OPTIONS=--openssl-legacy-provider" \
31-
nodebuilder-euro-office \
31+
nodebuilder-onlyoffice \
3232
sh -c "yarn install && yarn build"
3333

3434
# Add imageroot directory to the container image
@@ -46,7 +46,7 @@ buildah config --entrypoint=/ \
4646
--label="org.nethserver.tcp-ports-demand=1" \
4747
--label="org.nethserver.rootfull=0" \
4848
--label="org.nethserver.min-core=3.12.4-0" \
49-
--label="org.nethserver.images=ghcr.io/euro-office/documentserver:v9.3.1" \
49+
--label="org.nethserver.images=docker.io/onlyoffice/documentserver:9.4.0.1" \
5050
"${container}"
5151
# Commit the image
5252
buildah commit "${container}" "${repobase}/${reponame}"

imageroot/actions/clone-module/50Traefik

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import agent
99
import os
1010

1111
configure_retval = agent.tasks.run(agent_id=os.environ['AGENT_ID'], action='configure-module', data={
12+
"lets_encrypt": os.environ["TRAEFIK_LETS_ENCRYPT"] == "True",
1213
"host": os.environ["TRAEFIK_HOST"],
1314
"http2https": os.environ["TRAEFIK_HTTP2HTTPS"] == "True",
1415
})

imageroot/actions/configure-module/80start_services

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ grep -q JWT_SECRET environment || echo "JWT_SECRET=$(head -c 1024 /dev/urandom |
1717

1818
touch smarthost.env
1919

20-
systemctl --user enable euro-office.service
21-
systemctl --user restart euro-office.service
20+
systemctl --user enable onlyoffice.service
21+
systemctl --user restart onlyoffice.service

imageroot/actions/configure-module/validate-input.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"title": "Configure euro-office",
4-
"$id": "http://nethserver.org/json-schema/task/input/euro-office/configure-module",
5-
"description": "Configure euro-office",
3+
"title": "Configure onlyoffice",
4+
"$id": "http://nethserver.org/json-schema/task/input/onlyoffice/configure-module",
5+
"description": "Configure onlyoffice",
66
"examples": [
77
{
8-
"host": "euro-office.domain.org",
8+
"host": "onlyoffice.domain.org",
99
"http2https": true,
1010
"lets_encrypt": true
1111
}
@@ -17,7 +17,7 @@
1717
"properties": {
1818
"host": {
1919
"type": "string",
20-
"description": "Host name for the application, like 'euro-office.domain.org'",
20+
"description": "Host name for the application, like 'onlyoffice.domain.org'",
2121
"format": "hostname",
2222
"pattern": "\\."
2323
},

imageroot/actions/get-configuration/validate-output.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"title": "Get euro-office settings",
4-
"$id": "http://nethserver.org/json-schema/task/input/euro-office/get-configuration",
5-
"description": "Get euro-office settings",
3+
"title": "Get onlyoffice settings",
4+
"$id": "http://nethserver.org/json-schema/task/input/onlyoffice/get-configuration",
5+
"description": "Get onlyoffice settings",
66
"examples": [
77
{
8-
"host": "euro-office.domain.org",
8+
"host": "onlyoffice.domain.org",
99
"http2https": true,
1010
"lets_encrypt": true
1111
}
@@ -19,7 +19,7 @@
1919
"properties": {
2020
"host": {
2121
"type": "string",
22-
"description": "Host name for the application, like 'euro-office.domain.org'",
22+
"description": "Host name for the application, like 'onlyoffice.domain.org'",
2323
"format": "idn-hostname"
2424
},
2525
"lets_encrypt": {

imageroot/actions/restore-module/06copyenv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ original_environment = request['environment']
1616
for evar in [
1717
"TRAEFIK_HOST",
1818
"TRAEFIK_HTTP2HTTPS",
19-
"JWT_SECRET",
2019
]:
2120
agent.set_env(evar, original_environment[evar])
2221

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
3+
#
4+
# Copyright (C) 2022 Nethesis S.r.l.
5+
# SPDX-License-Identifier: GPL-3.0-or-later
6+
#
7+
8+
set -e -o pipefail
9+
exec 1>&2 # Redirect any output to the journal (stderr)
10+
11+
# Prepare an initialization script that restores the dump file
12+
mkdir -vp initdb.d
13+
mv -v onlyoffice.sql initdb.d
14+
#do the bash file to restore and exit once done
15+
cat - >initdb.d/zz_onlyoffice_restore.sh <<'EOS'
16+
# Print additional information:
17+
mysql --version
18+
# The script is sourced, override entrypoint args and exit:
19+
set -- true
20+
docker_temp_server_stop
21+
exit 0
22+
EOS
23+
24+
# once we exit we remove initdb.d
25+
trap 'rm -rfv initdb.d/' EXIT
26+
27+
# we start a container to initiate a database and load the dump
28+
# at the end of onlyoffice_restore.sh the dump is loaded and
29+
# we exit the container
30+
podman run \
31+
--rm \
32+
--interactive \
33+
--network=none \
34+
--volume=./initdb.d:/docker-entrypoint-initdb.d:z \
35+
--volume mysql-data:/var/lib/mysql/:Z \
36+
--env MARIADB_ROOT_PASSWORD=Nethesis,1234 \
37+
--env MARIADB_DATABASE=onlyoffice \
38+
--env MARIADB_USER=onlyoffice \
39+
--env MARIADB_PASSWORD=onlyoffice \
40+
--replace --name=restore_db \
41+
${MARIADB_IMAGE}

imageroot/actions/restore-module/50traefik

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ request = json.load(sys.stdin)
1414
renv = request['environment']
1515

1616
configure_retval = agent.tasks.run(agent_id=os.environ['AGENT_ID'], action='configure-module', data={
17+
"lets_encrypt": renv["TRAEFIK_LETS_ENCRYPT"] == "True",
1718
"host": renv["TRAEFIK_HOST"],
1819
"http2https": renv["TRAEFIK_HTTP2HTTPS"] == "True",
1920
})

0 commit comments

Comments
 (0)