Skip to content

Commit bcec3c4

Browse files
push-app-to-main[bot]MickLesktremor021
authored
Ignis (#16330)
* Add ignis (ct) * Fix source line to always use community scripts URL Updated the source line to always fetch from the community scripts repository. * Apply suggestion from @tremor021 --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: CanbiZ (MickLesk) <47820557+MickLesk@users.noreply.github.com> Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
1 parent 4c8f5bd commit bcec3c4

3 files changed

Lines changed: 198 additions & 0 deletions

File tree

ct/headers/ignis

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
____ _
2+
/ _/___ _____ (_)____
3+
/ // __ `/ __ \/ / ___/
4+
_/ // /_/ / / / / (__ )
5+
/___/\__, /_/ /_/_/____/
6+
/____/

ct/ignis.sh

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2026 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/Nystik-gh/ignis
7+
8+
APP="Ignis"
9+
var_tags="${var_tags:-notes;obsidian}"
10+
var_cpu="${var_cpu:-2}"
11+
var_ram="${var_ram:-4096}"
12+
var_disk="${var_disk:-10}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-13}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
var_arm64="${var_arm64:-yes}"
17+
18+
header_info "$APP"
19+
variables
20+
color
21+
catch_errors
22+
23+
function update_script() {
24+
header_info
25+
check_container_storage
26+
check_container_resources
27+
28+
if [[ ! -d /opt/ignis ]]; then
29+
msg_error "No ${APP} Installation Found!"
30+
exit
31+
fi
32+
33+
if check_for_gh_release "ignis" "Nystik-gh/ignis"; then
34+
msg_info "Stopping Service"
35+
systemctl stop ignis
36+
msg_ok "Stopped Service"
37+
38+
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "ignis" "Nystik-gh/ignis" "tarball"
39+
40+
msg_info "Building Ignis"
41+
cd /opt/ignis
42+
export NODE_OPTIONS="--max-old-space-size=4096"
43+
export IGNIS_BUILD="$(cat ~/.ignis)"
44+
$STD npm ci --ignore-scripts
45+
$STD npm run build
46+
$STD npm install -g @electron/asar
47+
msg_ok "Built Ignis"
48+
49+
msg_info "Checking Obsidian Web Assets"
50+
OBSIDIAN_VERSION=$(grep -oP 'OBSIDIAN_VERSION=\K[0-9.]+' /opt/ignis/apps/ignis-server/Dockerfile | head -n1)
51+
[[ -z "$OBSIDIAN_VERSION" ]] && OBSIDIAN_VERSION="$(cat /opt/ignis_data/obsidian.version 2>/dev/null)"
52+
if [[ -n "$OBSIDIAN_VERSION" && "$OBSIDIAN_VERSION" != "$(cat /opt/ignis_data/obsidian.version 2>/dev/null)" ]]; then
53+
rm -rf /opt/ignis_data/obsidian-app
54+
mkdir -p /opt/ignis_data/obsidian-app
55+
curl -fsSL -o /tmp/obsidian.asar.gz "https://github.com/obsidianmd/obsidian-releases/releases/download/v${OBSIDIAN_VERSION}/obsidian-${OBSIDIAN_VERSION}.asar.gz"
56+
gunzip -f /tmp/obsidian.asar.gz
57+
$STD asar extract /tmp/obsidian.asar /opt/ignis_data/obsidian-app
58+
rm -f /tmp/obsidian.asar
59+
echo "${OBSIDIAN_VERSION}" >/opt/ignis_data/obsidian.version
60+
fi
61+
msg_ok "Checked Obsidian Web Assets"
62+
63+
msg_info "Starting Service"
64+
systemctl start ignis
65+
systemctl reload nginx
66+
msg_ok "Started Service"
67+
msg_ok "Updated successfully!"
68+
fi
69+
exit
70+
}
71+
72+
start
73+
build_container
74+
description
75+
76+
msg_ok "Completed Successfully!\n"
77+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
78+
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
79+
echo -e "${GATEWAY}${BGN}https://${IP}${CL}"

install/ignis-install.sh

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2026 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/Nystik-gh/ignis
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt install -y nginx
18+
msg_ok "Installed Dependencies"
19+
20+
NODE_VERSION="22" setup_nodejs
21+
22+
fetch_and_deploy_gh_release "ignis" "Nystik-gh/ignis" "tarball"
23+
24+
msg_info "Building Ignis"
25+
cd /opt/ignis
26+
export NODE_OPTIONS="--max-old-space-size=4096"
27+
export IGNIS_BUILD="$(cat ~/.ignis)"
28+
$STD npm ci --ignore-scripts
29+
$STD npm run build
30+
$STD npm install -g @electron/asar
31+
msg_ok "Built Ignis"
32+
33+
msg_info "Downloading Obsidian Web Assets"
34+
mkdir -p /opt/ignis_data/{obsidian-app,vaults,data}
35+
OBSIDIAN_VERSION=$(grep -oP 'OBSIDIAN_VERSION=\K[0-9.]+' /opt/ignis/apps/ignis-server/Dockerfile | head -n1)
36+
[[ -z "$OBSIDIAN_VERSION" ]] && OBSIDIAN_VERSION="1.12.7"
37+
curl -fsSL -o /tmp/obsidian.asar.gz "https://github.com/obsidianmd/obsidian-releases/releases/download/v${OBSIDIAN_VERSION}/obsidian-${OBSIDIAN_VERSION}.asar.gz"
38+
gunzip -f /tmp/obsidian.asar.gz
39+
$STD asar extract /tmp/obsidian.asar /opt/ignis_data/obsidian-app
40+
rm -f /tmp/obsidian.asar
41+
echo "${OBSIDIAN_VERSION}" >/opt/ignis_data/obsidian.version
42+
msg_ok "Downloaded Obsidian Web Assets"
43+
44+
msg_info "Creating Service"
45+
cat <<EOF >/etc/systemd/system/ignis.service
46+
[Unit]
47+
Description=Ignis (Obsidian in the browser)
48+
After=network-online.target
49+
Wants=network-online.target
50+
51+
[Service]
52+
Type=simple
53+
User=root
54+
WorkingDirectory=/opt/ignis
55+
Environment=NODE_ENV=production
56+
Environment=PORT=8080
57+
Environment=VAULT_ROOT=/opt/ignis_data/vaults
58+
Environment=DATA_ROOT=/opt/ignis_data/data
59+
Environment=OBSIDIAN_ASSETS_PATH=/opt/ignis_data/obsidian-app
60+
Environment=AUTO_CREATE_DEFAULT=true
61+
ExecStart=/usr/bin/node /opt/ignis/apps/ignis-server/server/index.js
62+
Restart=always
63+
RestartSec=5
64+
65+
[Install]
66+
WantedBy=multi-user.target
67+
EOF
68+
systemctl enable -q --now ignis
69+
msg_ok "Created Service"
70+
71+
msg_info "Generating Self-Signed Certificate"
72+
create_self_signed_cert "ignis"
73+
msg_ok "Generated Self-Signed Certificate"
74+
75+
msg_info "Configuring Nginx"
76+
cat <<'EOF' >/etc/nginx/sites-available/ignis.conf
77+
server {
78+
listen 80 default_server;
79+
server_name _;
80+
return 301 https://$host$request_uri;
81+
}
82+
83+
server {
84+
listen 443 ssl default_server;
85+
http2 on;
86+
server_name _;
87+
88+
ssl_certificate /etc/ssl/ignis/ignis.crt;
89+
ssl_certificate_key /etc/ssl/ignis/ignis.key;
90+
91+
client_max_body_size 1024m;
92+
93+
location / {
94+
proxy_pass http://127.0.0.1:8080;
95+
proxy_http_version 1.1;
96+
proxy_set_header Upgrade $http_upgrade;
97+
proxy_set_header Connection "upgrade";
98+
proxy_set_header Host $host;
99+
proxy_set_header X-Real-IP $remote_addr;
100+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
101+
proxy_set_header X-Forwarded-Proto $scheme;
102+
proxy_read_timeout 3600s;
103+
}
104+
}
105+
EOF
106+
ln -sf /etc/nginx/sites-available/ignis.conf /etc/nginx/sites-enabled/ignis.conf
107+
rm -f /etc/nginx/sites-enabled/default
108+
systemctl restart nginx
109+
msg_ok "Configured Nginx"
110+
111+
motd_ssh
112+
customize
113+
cleanup_lxc

0 commit comments

Comments
 (0)