Merge branch 'main' of https://github.com/Websoft9/websoft9 into main

This commit is contained in:
qiaofeng1227 2023-10-24 15:45:34 +08:00
commit ea702ef35b
4 changed files with 27 additions and 29 deletions

View File

@ -1,36 +1,42 @@
# modify time: 202310241440, you can modify here to trigger Docker Build action
# modify time: 202310241540, you can modify here to trigger Docker Build action
FROM python:3.10-bullseye AS buildstage
LABEL maintainer="Websoft9<help@websoft9.com>"
LABEL version="0.0.6"
ENV LIBRARY_VERSION=v0.5.8
ENV MEDIA_VERSION=0.0.3
ENV websoft9_repo="https://github.com/Websoft9/websoft9"
ENV docker_library_repo="https://github.com/Websoft9/docker-library"
ENV media_repo="https://github.com/Websoft9/media"
# Prepare library
RUN wget https://github.com/Websoft9/docker-library/archive/refs/tags/$LIBRARY_VERSION.zip -O ./library.zip && \
# Prepare source files
RUN wget $docker_library_repo/archive/refs/tags/$LIBRARY_VERSION.zip -O ./library.zip && \
unzip library.zip && \
mv docker-library-* library && \
mkdir credentials && \
echo "This folder stored the credentials of other services that apphub will connect" > credentials/readme && \
mv docker-library-* w9library && \
rm -rf w9library/.github && \
wget $media_repo/archive/refs/tags/$MEDIA_VERSION.zip -O ./media.zip && \
unzip media.zip && \
mv media-* w9media && \
rm -rf w9media/.github && \
# Prepare Media and master data from Contentful
git clone --depth=1 https://github.com/swagger-api/swagger-ui.git && \
wget https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js && \
cp redoc.standalone.js swagger-ui/dist && \
git clone --depth=1 https://github.com/Websoft9/plugin-appstore && \
mv -f plugin-appstore/data ./media && \
git clone --depth=1 https://github.com/Websoft9/websoft9
git clone --depth=1 $websoft9_repo
FROM python:3.10-slim-bullseye
WORKDIR /websoft9
COPY --from=buildstage /media/data ./media
COPY --from=buildstage /library ./library
COPY --from=buildstage /w9media ./media
COPY --from=buildstage /w9library ./library
COPY --from=buildstage /websoft9/apphub ./apphub
COPY --from=buildstage /swagger-ui/dist ./apphub/swagger-ui
RUN apt update && apt install git jq iproute2 supervisor -y && \
mkdir credentials && \
echo "This folder stored the credentials of other services that integrated with apphub" > credentials/readme
RUN apt update && apt install curl git jq iproute2 supervisor -y
RUN pip install --no-cache-dir --upgrade -r apphub/requirements.txt
RUN pip install -e ./apphub
@ -41,10 +47,8 @@ RUN chmod +r /etc/supervisor/conf.d/supervisord.conf
COPY config/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
VOLUME /websoft9/apphub/logs
VOLUME /websoft9/apphub/src/config
VOLUME /websoft9/media
# Clean cache and install files
RUN rm -rf apphub/docs apphub/tests library.zip plugin-appstore && \

View File

@ -7,7 +7,6 @@ services:
restart: always
volumes:
- apphub_logs:/websoft9/apphub/logs
- apphub_media:/websoft9/media
- apphub_config:/websoft9/apphub/src/config
depends_on:
- deployment
@ -74,7 +73,6 @@ networks:
volumes:
apphub_logs:
apphub_media:
apphub_config:
portainer:
gitea:

View File

@ -198,18 +198,14 @@ check_ports() {
echo "Stop Websoft9 Proxy and Cockpit service for reserve ports..."
sudo docker stop websoft9-proxy 2>/dev/null || echo "docker stop websoft9-proxy not need "
sudo systemctl stop cockpit 2>/dev/null || echo "systemctl stop cockpit not need"
sudo systemctl stop cockpit.socket 2>/dev/null || echo "systemctl stop cockpit.socket not need"
for port in "${ports[@]}"; do
if ss -tuln | grep ":$port " >/dev/null; then
echo "Port $port is in use, install failed"
if ss -tuln | grep ":$port " >/dev/null && ! systemctl status cockpit.socket | grep "$port" >/dev/null; then
echo "Port $port is in use or not in cockpit.socket, install failed"
exit
fi
done
echo "All ports are available"
}
@ -334,8 +330,9 @@ install_backends() {
install_systemd() {
echo -e "\n\n-------- Systemd --------"
echo_prefix_systemd=$'\n[Systemd] - '
echo "$echo_prefix_systemdInstall Systemd service"
echo "$echo_prefix_systemd Install Systemd service"
if [ ! -d "$systemd_path" ]; then
sudo mkdir -p "$systemd_path"
@ -382,6 +379,8 @@ fi
install_backends
install_systemd
bash $install_path/install/install_cockpit.sh
if [ $? -ne 0 ]; then
echo "install_cockpit failed with error $?. Exiting."
@ -397,9 +396,6 @@ fi
echo "Restart Docker for Firewalld..."
sudo systemctl restart docker
install_systemd
endtime=$(date +%s)
runtime=$((endtime-starttime))
echo "Script execution time: $runtime seconds"

View File

@ -82,7 +82,7 @@ echo "install_path:$install_path"
related_containers=("websoft9-apphub")
echo_prefix_cockpit=$'\n[Cockpit] - '
# package cockpit depends_on [cockpit-bridge,cockpit-ws,cockpit-system], but update cockpit the depends don't update
cockpit_packages="cockpit cockpit-ws cockpit-bridge cockpit-system cockpit-pcp cockpit-storaged cockpit-networkmanager cockpit-session-recording cockpit-doc cockpit-packagekit cockpit-sosreport"
cockpit_packages="cockpit cockpit-ws cockpit-bridge cockpit-system cockpit-pcp cockpit-networkmanager cockpit-session-recording cockpit-doc cockpit-packagekit cockpit-sosreport"
menu_overrides_github_page_url="https://websoft9.github.io/websoft9/cockpit/menu_override"
cockpit_config_github_page_url="https://websoft9.github.io/websoft9/cockpit/cockpit.conf"
cockpit_menu_overrides=()