From d51c37d134f93766cc587955255bc7c88f98b055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Tue, 9 Dec 2025 16:02:07 +0100 Subject: [PATCH] Refactor (#9810) --- frontend/public/json/wikijs.json | 2 +- install/wikijs-install.sh | 26 ++++---------------------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/frontend/public/json/wikijs.json b/frontend/public/json/wikijs.json index 1016490b1..2898f18fe 100644 --- a/frontend/public/json/wikijs.json +++ b/frontend/public/json/wikijs.json @@ -11,7 +11,7 @@ "interface_port": 3000, "documentation": "https://docs.requarks.io/", "website": "https://js.wiki/", - "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@master/webp/wiki-js.webp", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/wiki-js.webp", "config_path": "/opt/wikijs/config.yml", "description": "Wiki.js is a free, open-source, and modern wiki application built using Node.js. It is designed to be fast, easy to use, and flexible, with a range of features for collaboration, knowledge management, and content creation. Wiki.js supports Markdown syntax for editing pages, and includes features such as version control, page history, and access control, making it easy to manage content and collaborate with others. The software is fully customizable, with a range of themes and extensions available, and can be deployed on a local server or in the cloud, making it an ideal choice for small teams and organizations looking to create and manage a wiki. Wiki.js provides a modern, user-friendly interface, and supports a range of data sources, including local file systems, databases, and cloud storage services.", "install_methods": [ diff --git a/install/wikijs-install.sh b/install/wikijs-install.sh index 4bcc0fae2..0ce531a7e 100644 --- a/install/wikijs-install.sh +++ b/install/wikijs-install.sh @@ -14,36 +14,18 @@ network_check update_os msg_info "Installing Dependencies" -$STD apt install -y \ - git +$STD apt install -y git msg_ok "Installed Dependencies" NODE_VERSION="22" NODE_MODULE="yarn,node-gyp" setup_nodejs PG_VERSION="17" setup_postgresql +PG_DB_NAME="wiki" PG_DB_USER="wikijs_user" PG_DB_EXTENSIONS="pg_trgm" setup_postgresql_db fetch_and_deploy_gh_release "wikijs" "requarks/wiki" "prebuild" "latest" "/opt/wikijs" "wiki-js.tar.gz" -msg_info "Set up PostgreSQL" -DB_NAME="wiki" -DB_USER="wikijs_user" -DB_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)" -$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';" -$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;" -$STD sudo -u postgres psql -c "CREATE EXTENSION IF NOT EXISTS pg_trgm;" $DB_NAME -$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';" -$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';" -$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';" -{ - echo "WikiJS-Credentials" - echo "WikiJS Database User: $DB_USER" - echo "WikiJS Database Password: $DB_PASS" - echo "WikiJS Database Name: $DB_NAME" -} >>~/wikijs.creds -msg_ok "Set up PostgreSQL" - msg_info "Configuring Wiki.js" mv /opt/wikijs/config.sample.yml /opt/wikijs/config.yml -sed -i -E 's|^( *user: ).*|\1'"$DB_USER"'|' /opt/wikijs/config.yml -sed -i -E 's|^( *pass: ).*|\1'"$DB_PASS"'|' /opt/wikijs/config.yml +sed -i -E 's|^( *user: ).*|\1'"$PG_DB_USER"'|' /opt/wikijs/config.yml +sed -i -E 's|^( *pass: ).*|\1'"$PG_DB_PASS"'|' /opt/wikijs/config.yml msg_ok "Configured Wiki.js" msg_info "Creating Service"