diff --git a/ct/typesense.sh b/ct/typesense.sh new file mode 100644 index 00000000..bf239796 --- /dev/null +++ b/ct/typesense.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: tlissak | Co-Author MickLesk +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://typesense.org/ + +# App Default Values +APP="TypeSense" +var_tags="database" +var_cpu="1" +var_ram="1024" +var_disk="4" +var_os="debian" +var_version="12" +var_unprivileged="1" + +# App Output & Base Settings +header_info "$APP" +base_settings + +# Core +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -f /etc/typesense/typesense-server.ini ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_info "Updating ${APP} LXC" + apt-get update &>/dev/null + apt-get -y upgrade &>/dev/null + msg_ok "Updated Successfully" + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following IP:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}${IP}:8108${CL}" diff --git a/install/typesense-install.sh b/install/typesense-install.sh new file mode 100644 index 00000000..cde371b8 --- /dev/null +++ b/install/typesense-install.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: tlissak +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://typesense.org/ + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y \ + curl \ + mc \ + sudo +msg_ok "Installed Dependencies" + +msg_info "Installing TypeSense" +RELEASE=$(curl -s https://api.github.com/repos/typesense/typesense/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') +cd /opt +wget -q -O https://dl.typesense.org/releases/${RELEASE}/typesense-server-${RELEASE}-amd64.deb +$STD apt install -y /opt/typesense-server-${RELEASE}-amd64.deb +echo 'enable-cors = true' >> /etc/typesense/typesense-server.ini +echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" +msg_ok "Installed TypeSense" + +motd_ssh +customize + +msg_info "Cleaning up" +rm -rf /opt/typesense-server-${RELEASE}-amd64.deb +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" diff --git a/json/typesense.json b/json/typesense.json new file mode 100644 index 00000000..53f596c9 --- /dev/null +++ b/json/typesense.json @@ -0,0 +1,39 @@ +{ + "name": "TypeSense", + "slug": "typesense", + "categories": [ + 5 + ], + "date_created": "2025-01-06", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": null, + "documentation": "https://typesense.org/docs/", + "website": "https://typesense.org/", + "logo": "https://typesense.org/_nuxt/img/typesense_logo_white.0f9fb0a.svg", + "description": "Typesense is an open-source, fast, and lightweight search engine optimized for delivering instant, relevant, and typo-tolerant search results. Designed for ease of use and high performance, it offers features like real-time indexing, fuzzy matching, customizable relevance ranking, and a simple API for integration. Typesense is particularly well-suited for applications requiring instant search capabilities, such as e-commerce, documentation, or any content-rich websites. It is often compared to tools like Elasticsearch but is more developer-friendly and less resource-intensive.", + "install_methods": [ + { + "type": "default", + "script": "ct/typesense.sh", + "resources": { + "cpu": 1, + "ram": 1024, + "hdd": 4, + "os": "debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "This script requires some extra steps after the installation, Please checkout the 'documentation' Button", + "type": "info" + } + ] +}