Skip to content

Commit d51c37d

Browse files
authored
Refactor (#9810)
1 parent 938a66a commit d51c37d

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed

frontend/public/json/wikijs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"interface_port": 3000,
1212
"documentation": "https://docs.requarks.io/",
1313
"website": "https://js.wiki/",
14-
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@master/webp/wiki-js.webp",
14+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/wiki-js.webp",
1515
"config_path": "/opt/wikijs/config.yml",
1616
"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.",
1717
"install_methods": [

install/wikijs-install.sh

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,18 @@ network_check
1414
update_os
1515

1616
msg_info "Installing Dependencies"
17-
$STD apt install -y \
18-
git
17+
$STD apt install -y git
1918
msg_ok "Installed Dependencies"
2019

2120
NODE_VERSION="22" NODE_MODULE="yarn,node-gyp" setup_nodejs
2221
PG_VERSION="17" setup_postgresql
22+
PG_DB_NAME="wiki" PG_DB_USER="wikijs_user" PG_DB_EXTENSIONS="pg_trgm" setup_postgresql_db
2323
fetch_and_deploy_gh_release "wikijs" "requarks/wiki" "prebuild" "latest" "/opt/wikijs" "wiki-js.tar.gz"
2424

25-
msg_info "Set up PostgreSQL"
26-
DB_NAME="wiki"
27-
DB_USER="wikijs_user"
28-
DB_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"
29-
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
30-
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;"
31-
$STD sudo -u postgres psql -c "CREATE EXTENSION IF NOT EXISTS pg_trgm;" $DB_NAME
32-
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
33-
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
34-
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';"
35-
{
36-
echo "WikiJS-Credentials"
37-
echo "WikiJS Database User: $DB_USER"
38-
echo "WikiJS Database Password: $DB_PASS"
39-
echo "WikiJS Database Name: $DB_NAME"
40-
} >>~/wikijs.creds
41-
msg_ok "Set up PostgreSQL"
42-
4325
msg_info "Configuring Wiki.js"
4426
mv /opt/wikijs/config.sample.yml /opt/wikijs/config.yml
45-
sed -i -E 's|^( *user: ).*|\1'"$DB_USER"'|' /opt/wikijs/config.yml
46-
sed -i -E 's|^( *pass: ).*|\1'"$DB_PASS"'|' /opt/wikijs/config.yml
27+
sed -i -E 's|^( *user: ).*|\1'"$PG_DB_USER"'|' /opt/wikijs/config.yml
28+
sed -i -E 's|^( *pass: ).*|\1'"$PG_DB_PASS"'|' /opt/wikijs/config.yml
4729
msg_ok "Configured Wiki.js"
4830

4931
msg_info "Creating Service"

0 commit comments

Comments
 (0)