Removed work directory from 5.x

Signed-off-by: Matt Bentley <mbentley@mbentley.net>
This commit is contained in:
Matt Bentley
2022-08-11 17:12:05 -04:00
parent f332675e9f
commit bf142fce0d
5 changed files with 18 additions and 17 deletions
+1 -1
View File
@@ -21,6 +21,6 @@ COPY entrypoint-5.x.sh /entrypoint.sh
WORKDIR /opt/tplink/EAPController/lib
EXPOSE 8088 8043 8843 29810/udp 29811 29812 29813 29814
HEALTHCHECK --start-period=5m CMD /healthcheck.sh
VOLUME ["/opt/tplink/EAPController/data","/opt/tplink/EAPController/work","/opt/tplink/EAPController/logs"]
VOLUME ["/opt/tplink/EAPController/data","/opt/tplink/EAPController/logs"]
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/usr/bin/java","-server","-Xms128m","-Xmx1024m","-XX:MaxHeapFreeRatio=60","-XX:MinHeapFreeRatio=30","-XX:+HeapDumpOnOutOfMemoryError","-XX:HeapDumpPath=/opt/tplink/EAPController/logs/java_heapdump.hprof","-Djava.awt.headless=true","-cp","/opt/tplink/EAPController/lib/*::/opt/tplink/EAPController/properties:","com.tplink.smb.omada.starter.OmadaLinuxMain"]
+3 -9
View File
@@ -112,7 +112,7 @@ If you have issues running the controller, feel free to [file an issue](https://
## Upgrading to 5.0.x from 4.1.x or above
There are no manual upgrade steps directly related to the software itself required when upgrading to 5.0.x if you are already running at least 4.1.x. For full details, please refer to the [TP-Link upgrade documentation](https://www.tp-link.com/en/omada-sdn/controller-upgrade/).
There are no manual upgrade steps directly related to the software itself required when upgrading to 5.0.x if you are already running at least 4.1.x. The only thing to note is that the `work` volume is no longer required as the application is no longer extracted before it is run in the move to Spring Boot. If you do nothing, there will be no impact except for an extra directory sitting around. For full details, please refer to the [TP-Link upgrade documentation](https://www.tp-link.com/en/omada-sdn/controller-upgrade/).
As always, I would recommend taking a backup through the controller software as well as save a copy of the persistent data while the controller is not running when you do upgrade to simplify the rollback process, if required.
@@ -223,7 +223,6 @@ docker run -d \
-e SSL_KEY_NAME="tls.key" \
-e TZ=Etc/UTC \
-v omada-data:/opt/tplink/EAPController/data \
-v omada-work:/opt/tplink/EAPController/work \
-v omada-logs:/opt/tplink/EAPController/logs \
mbentley/omada-controller:5.4
```
@@ -247,7 +246,6 @@ docker run -d \
-e SSL_KEY_NAME="tls.key" \
-e TZ=Etc/UTC \
-v omada-data:/opt/tplink/EAPController/data \
-v omada-work:/opt/tplink/EAPController/work \
-v omada-logs:/opt/tplink/EAPController/logs \
mbentley/omada-controller:5.4
```
@@ -281,7 +279,6 @@ docker run -d \
-e SSL_KEY_NAME="tls.key" \
-e TZ=Etc/UTC \
-v omada-data:/opt/tplink/EAPController/data \
-v omada-work:/opt/tplink/EAPController/work \
-v omada-logs:/opt/tplink/EAPController/logs \
mbentley/omada-controller:5.4-armv7l
```
@@ -305,7 +302,6 @@ docker run -d \
-e SSL_KEY_NAME="tls.key" \
-e TZ=Etc/UTC \
-v omada-data:/opt/tplink/EAPController/data \
-v omada-work:/opt/tplink/EAPController/work \
-v omada-logs:/opt/tplink/EAPController/logs \
mbentley/omada-controller:5.4-armv7l
```
@@ -341,7 +337,6 @@ docker run -d \
-e SSL_KEY_NAME="tls.key" \
-e TZ=Etc/UTC \
-v omada-data:/opt/tplink/EAPController/data \
-v omada-work:/opt/tplink/EAPController/work \
-v omada-logs:/opt/tplink/EAPController/logs \
mbentley/omada-controller:5.4-arm64
```
@@ -365,7 +360,6 @@ docker run -d \
-e SSL_KEY_NAME="tls.key" \
-e TZ=Etc/UTC \
-v omada-data:/opt/tplink/EAPController/data \
-v omada-work:/opt/tplink/EAPController/work \
-v omada-logs:/opt/tplink/EAPController/logs \
mbentley/omada-controller:5.4-arm64
```
@@ -397,10 +391,10 @@ docker run -d \
If you utilize bind mounts instead of Docker named volumes (e.g. - `-v /path/to/data:/opt/tplink/EAPController/data`) in your run command, you will want to make sure that you have set the permissions appropriately on the filesystem otherwise you will run into permissions errors and the container will not run because it won't have the permissions to write data since this container uses a non-root user. To resolve that, you need to `chown` the directory to `508:508` on the host as that is the UID and GID that we use inside the container. For example:
```
chown -R 508:508 /data/omada/data /data/omada/work /data/omada/logs
chown -R 508:508 /data/omada/data /data/omada/logs
```
In the examples, there are three directories where persistent data is stored: `data`, `work`, and `logs`. The `data` directory is where the persistent database data is stored where all of your settings, app configuration, etc is stored. The `work` directory is where the web application is extracted to and is just ephemeral data that is replaced on each run. The `log` directory is where logs are written and stored. I would suggest that you use a bind mounted volume for the `data` directory to ensure that your persistent data is directly under your control and of course take regular backups within the Omada Controller application itself.
In the examples, there are two directories where persistent data is stored: `data` and `logs`. The `data` directory is where the persistent database data is stored where all of your settings, app configuration, etc is stored. The `log` directory is where logs are written and stored. I would suggest that you use a bind mounted volume for the `data` directory to ensure that your persistent data is directly under your control and of course take regular backups within the Omada Controller application itself.
## Custom Certificates
-2
View File
@@ -20,10 +20,8 @@ services:
- TZ=Etc/UTC
volumes:
- omada-data:/opt/tplink/EAPController/data
- omada-work:/opt/tplink/EAPController/work
- omada-logs:/opt/tplink/EAPController/logs
volumes:
omada-data:
omada-work:
omada-logs:
+3 -3
View File
@@ -65,11 +65,11 @@ else
# user ID exists but has a different user name
EXISTING_USER="$(grep ":${PUID}:" /etc/passwd | awk -F ':' '{print $1}')"
echo "INFO: User (omada) already exists with a different name; renaming '${EXISTING_USER}' to 'omada'"
usermod -g "${PGID}" -d /opt/tplink/EAPController/work -l omada -s /bin/sh -c "" "${EXISTING_USER}"
usermod -g "${PGID}" -d /opt/tplink/EAPController/data -l omada -s /bin/sh -c "" "${EXISTING_USER}"
else
# create the user
echo "INFO: User (omada) doesn't exist; creating"
useradd -u "${PUID}" -g "${PGID}" -d /opt/tplink/EAPController/work -s /bin/sh -c "" omada
useradd -u "${PUID}" -g "${PGID}" -d /opt/tplink/EAPController/data -s /bin/sh -c "" omada
fi
fi
@@ -138,7 +138,7 @@ then
fi
# make sure permissions are set appropriately on each directory
for DIR in data logs work
for DIR in data logs
do
OWNER="$(stat -c '%u' /opt/tplink/EAPController/${DIR})"
GROUP="$(stat -c '%g' /opt/tplink/EAPController/${DIR})"
+11 -2
View File
@@ -173,8 +173,17 @@ done
ln -sf "$(command -v mongod)" "${OMADA_DIR}/bin/mongod"
chmod 755 "${OMADA_DIR}"/bin/*
# create logs and work directories
mkdir "${OMADA_DIR}/logs" "${OMADA_DIR}/work"
# starting with 5.0.x, the work directory is no longer needed
case "${OMADA_MAJOR_VER}" in
5)
# create logs directory
mkdir "${OMADA_DIR}/logs"
;;
*)
# create logs and work directories
mkdir "${OMADA_DIR}/logs" "${OMADA_DIR}/work"
;;
esac
# for v5.1 & above, create backup of data/html directory in case it is missing (to be extracted at runtime)
if [ -d /opt/tplink/EAPController/data/html ]