Compare commits
1 Commits
add-script
...
48f583d052
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48f583d052 |
@@ -1,6 +0,0 @@
|
|||||||
____ ___ __ _
|
|
||||||
/ __ \____ ___ ____ / | __________/ /_ (_) _____ _____
|
|
||||||
/ / / / __ \/ _ \/ __ \______/ /| | / ___/ ___/ __ \/ / | / / _ \/ ___/
|
|
||||||
/ /_/ / /_/ / __/ / / /_____/ ___ |/ / / /__/ / / / /| |/ / __/ /
|
|
||||||
\____/ .___/\___/_/ /_/ /_/ |_/_/ \___/_/ /_/_/ |___/\___/_/
|
|
||||||
/_/
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
|
||||||
# Copyright (c) 2021-2025 community-scripts ORG
|
|
||||||
# Author: Slaviša Arežina (tremor021)
|
|
||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
||||||
# Source: https://openarchiver.com/
|
|
||||||
|
|
||||||
APP="Open-Archiver"
|
|
||||||
var_tags="${var_tags:-os}"
|
|
||||||
var_cpu="${var_cpu:-2}"
|
|
||||||
var_ram="${var_ram:-3072}"
|
|
||||||
var_disk="${var_disk:-8}"
|
|
||||||
var_os="${var_os:-debian}"
|
|
||||||
var_version="${var_version:-13}"
|
|
||||||
var_unprivileged="${var_unprivileged:-1}"
|
|
||||||
|
|
||||||
header_info "$APP"
|
|
||||||
variables
|
|
||||||
color
|
|
||||||
catch_errors
|
|
||||||
|
|
||||||
function update_script() {
|
|
||||||
header_info
|
|
||||||
check_container_storage
|
|
||||||
check_container_resources
|
|
||||||
if [[ ! -d /opt/openarchiver ]]; then
|
|
||||||
msg_error "No Open Archiver Installation Found!"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
if check_for_gh_release "openarchiver" "LogicLabs-OU/OpenArchiver"; then
|
|
||||||
msg_info "Stopping Services"
|
|
||||||
systemctl stop openarchiver
|
|
||||||
msg_ok "Stopped Services"
|
|
||||||
|
|
||||||
cp /opt/openarchiver/.env /opt/openarchiver.env
|
|
||||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "openarchiver" "LogicLabs-OU/OpenArchiver" "tarball" "latest" "/opt/openarchiver"
|
|
||||||
mv /opt/openarchiver.env /opt/openarchiver/.env
|
|
||||||
|
|
||||||
msg_info "Updating Open Archiver"
|
|
||||||
$STD pnpm install --shamefully-hoist --frozen-lockfile --prod=false
|
|
||||||
$STD pnpm build
|
|
||||||
$STD pnpm db:migrate
|
|
||||||
msg_ok "Updated Open Archiver"
|
|
||||||
|
|
||||||
msg_info "Starting Services"
|
|
||||||
systemctl start openarchiver
|
|
||||||
msg_ok "Started Services"
|
|
||||||
msg_ok "Updated Successfully"
|
|
||||||
fi
|
|
||||||
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 URL:${CL}"
|
|
||||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"
|
|
||||||
@@ -34,7 +34,7 @@ function update_script() {
|
|||||||
|
|
||||||
fetch_and_deploy_gh_release "photoprism" "photoprism/photoprism" "prebuild" "latest" "/opt/photoprism" "*linux-amd64.tar.gz"
|
fetch_and_deploy_gh_release "photoprism" "photoprism/photoprism" "prebuild" "latest" "/opt/photoprism" "*linux-amd64.tar.gz"
|
||||||
|
|
||||||
LIBHEIF_URL=$(curl -fsSL "https://dl.photoprism.app/dist/libheif/" | grep -oP "libheif-bookworm-amd64-v[0-9\.]+\.tar\.gz" | sort -V | tail -n 1)
|
LIBHEIF_URL=$(curl -fsSL "https://dl.photoprism.app/dist/libheif/" | grep -oP "libheif-$(lsb_release -cs)-amd64-v[0-9\.]+\.tar\.gz" | sort -V | tail -n 1)
|
||||||
if [[ "${LIBHEIF_URL}" != "$(cat ~/.photoprism_libheif 2>/dev/null)" ]] || [[ ! -f ~/.photoprism_libheif ]]; then
|
if [[ "${LIBHEIF_URL}" != "$(cat ~/.photoprism_libheif 2>/dev/null)" ]] || [[ ! -f ~/.photoprism_libheif ]]; then
|
||||||
msg_info "Updating PhotoPrism LibHeif"
|
msg_info "Updating PhotoPrism LibHeif"
|
||||||
$STD apt install -y libvips42
|
$STD apt install -y libvips42
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "Open-Archiver",
|
|
||||||
"slug": "open-archiver",
|
|
||||||
"categories": [
|
|
||||||
7
|
|
||||||
],
|
|
||||||
"date_created": "2025-09-30",
|
|
||||||
"type": "ct",
|
|
||||||
"updateable": true,
|
|
||||||
"privileged": false,
|
|
||||||
"interface_port": 3000,
|
|
||||||
"documentation": "https://docs.openarchiver.com/",
|
|
||||||
"config_path": "/opt/openarchiver/.env",
|
|
||||||
"website": "https://openarchiver.com/",
|
|
||||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/OpenArchiver.webp",
|
|
||||||
"description": "Open Archiver is a secure, self-hosted email archiving solution, and it's completely open source. Get an email archiver that enables full-text search across email and attachments. Create a permanent, searchable, and compliant mail archive from Google Workspace, Microsoft 35, and any IMAP server.",
|
|
||||||
"install_methods": [
|
|
||||||
{
|
|
||||||
"type": "default",
|
|
||||||
"script": "ct/open-archiver.sh",
|
|
||||||
"resources": {
|
|
||||||
"cpu": 2,
|
|
||||||
"ram": 3072,
|
|
||||||
"hdd": 8,
|
|
||||||
"os": "debian",
|
|
||||||
"version": "13"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"default_credentials": {
|
|
||||||
"username": null,
|
|
||||||
"password": null
|
|
||||||
},
|
|
||||||
"notes": [
|
|
||||||
{
|
|
||||||
"text": "Data directory is: `/opt/openarchiver-data`. If you have a lot of email, you might consider mounting external storage to this directory.",
|
|
||||||
"type": "info"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,124 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Copyright (c) 2021-2025 community-scripts ORG
|
|
||||||
# Author: Slaviša Arežina (tremor021)
|
|
||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
||||||
# Source: https://openarchiver.com/
|
|
||||||
|
|
||||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
|
||||||
color
|
|
||||||
verb_ip6
|
|
||||||
catch_errors
|
|
||||||
setting_up_container
|
|
||||||
network_check
|
|
||||||
update_os
|
|
||||||
|
|
||||||
msg_info "Installing dependendencies"
|
|
||||||
$STD apt install -y valkey
|
|
||||||
msg_ok "Installed dependendencies"
|
|
||||||
|
|
||||||
NODE_VERSION="22" NODE_MODULE="pnpm" setup_nodejs
|
|
||||||
PG_VERSION="17" setup_postgresql
|
|
||||||
fetch_and_deploy_gh_release "meilisearch" "meilisearch/meilisearch" "binary"
|
|
||||||
fetch_and_deploy_gh_release "openarchiver" "LogicLabs-OU/OpenArchiver" "tarball"
|
|
||||||
JWT_KEY="$(openssl rand -hex 32)"
|
|
||||||
SECRET_KEY="$(openssl rand -hex 32)"
|
|
||||||
IP_ADDR=$(hostname -I | awk '{print $1}')
|
|
||||||
|
|
||||||
msg_info "Setting up PostgreSQL"
|
|
||||||
DB_NAME="openarchiver_db"
|
|
||||||
DB_USER="openarchiver"
|
|
||||||
DB_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-18)"
|
|
||||||
$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 "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 "Open Archiver DB Credentials"
|
|
||||||
echo "Database Name: $DB_NAME"
|
|
||||||
echo "Database User: $DB_USER"
|
|
||||||
echo "Database Password: $DB_PASS"
|
|
||||||
} >>~/openarchiver.creds
|
|
||||||
msg_ok "Set up PostgreSQL"
|
|
||||||
|
|
||||||
msg_info "Configuring MeiliSearch"
|
|
||||||
curl -fsSL https://raw.githubusercontent.com/meilisearch/meilisearch/latest/config.toml -o /etc/meilisearch.toml
|
|
||||||
MASTER_KEY=$(openssl rand -base64 12)
|
|
||||||
sed -i \
|
|
||||||
-e 's|^env =.*|env = "production"|' \
|
|
||||||
-e "s|^# master_key =.*|master_key = \"$MASTER_KEY\"|" \
|
|
||||||
-e 's|^db_path =.*|db_path = "/var/lib/meilisearch/data"|' \
|
|
||||||
-e 's|^dump_dir =.*|dump_dir = "/var/lib/meilisearch/dumps"|' \
|
|
||||||
-e 's|^snapshot_dir =.*|snapshot_dir = "/var/lib/meilisearch/snapshots"|' \
|
|
||||||
-e 's|^# no_analytics = true|no_analytics = true|' \
|
|
||||||
-e 's|^http_addr =.*|http_addr = "127.0.0.1:7700"|' \
|
|
||||||
/etc/meilisearch.toml
|
|
||||||
|
|
||||||
cat <<EOF >/etc/systemd/system/meilisearch.service
|
|
||||||
[Unit]
|
|
||||||
Description=Meilisearch
|
|
||||||
After=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
ExecStart=/usr/bin/meilisearch --config-file-path /etc/meilisearch.toml
|
|
||||||
Restart=always
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
EOF
|
|
||||||
systemctl enable -q --now meilisearch
|
|
||||||
sleep 5
|
|
||||||
msg_ok "Configured MeiliSearch"
|
|
||||||
|
|
||||||
msg_info "Setting up Open Archiver"
|
|
||||||
mkdir -p /opt/openarchiver-data
|
|
||||||
cd /opt/openarchiver
|
|
||||||
cp .env.example .env
|
|
||||||
sed -i "s|^NODE_ENV=.*|NODE_ENV=production|g" /opt/openarchiver/.env
|
|
||||||
sed -i "s|^POSTGRES_DB=.*|POSTGRES_DB=openarchiver_db|g" /opt/openarchiver/.env
|
|
||||||
sed -i "s|^POSTGRES_USER=.*|POSTGRES_USER=openarchiver|g" /opt/openarchiver/.env
|
|
||||||
sed -i "s|^POSTGRES_PASSWORD=.*|POSTGRES_PASSWORD=$DB_PASS|g" /opt/openarchiver/.env
|
|
||||||
sed -i "s|^DATABASE_URL=.*|DATABASE_URL=\"postgresql://openarchiver:$DB_PASS@localhost:5432/openarchiver_db\"|g" /opt/openarchiver/.env
|
|
||||||
sed -i "s|^MEILI_HOST=.*|MEILI_HOST=http://localhost:7700|g" /opt/openarchiver/.env
|
|
||||||
sed -i "s|^MEILI_MASTER_KEY=.*|MEILI_MASTER_KEY=$MASTER_KEY|g" /opt/openarchiver/.env
|
|
||||||
sed -i "s|^REDIS_HOST=.*|REDIS_HOST=localhost|g" /opt/openarchiver/.env
|
|
||||||
sed -i "s|^REDIS_PASSWORD=.*|REDIS_PASSWORD=|g" /opt/openarchiver/.env
|
|
||||||
sed -i "s|^STORAGE_LOCAL_ROOT_PATH=.*|STORAGE_LOCAL_ROOT_PATH=/opt/openarchiver-data|g" /opt/openarchiver/.env
|
|
||||||
sed -i "s|^JWT_SECRET=.*|JWT_SECRET=$JWT_KEY|g" /opt/openarchiver/.env
|
|
||||||
sed -i "s|^ENCRYPTION_KEY=.*|ENCRYPTION_KEY=$SECRET_KEY|g" /opt/openarchiver/.env
|
|
||||||
sed -i "s|^TIKA_URL=.*|TIKA_URL=|g" /opt/openarchiver/.env
|
|
||||||
echo "ORIGIN=http://$IP_ADDR:3000" >> /opt/openarchiver/.env
|
|
||||||
$STD pnpm install --shamefully-hoist --frozen-lockfile --prod=false
|
|
||||||
$STD pnpm build
|
|
||||||
$STD pnpm db:migrate
|
|
||||||
msg_ok "Setup Open Archiver"
|
|
||||||
|
|
||||||
msg_info "Creating Service"
|
|
||||||
cat <<EOF >/etc/systemd/system/openarchiver.service
|
|
||||||
[Unit]
|
|
||||||
Description=Open Archiver Service
|
|
||||||
After=network-online.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
User=root
|
|
||||||
EnvironmentFile=/opt/openarchiver/.env
|
|
||||||
WorkingDirectory=/opt/openarchiver
|
|
||||||
ExecStart=/usr/bin/pnpm docker-start
|
|
||||||
Restart=on-failure
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
EOF
|
|
||||||
systemctl enable -q --now openarchiver
|
|
||||||
msg_ok "Created Service"
|
|
||||||
|
|
||||||
motd_ssh
|
|
||||||
customize
|
|
||||||
|
|
||||||
msg_info "Cleaning up"
|
|
||||||
$STD apt -y autoremove
|
|
||||||
$STD apt -y autoclean
|
|
||||||
$STD apt -y clean
|
|
||||||
msg_ok "Cleaned"
|
|
||||||
@@ -37,7 +37,7 @@ msg_info "Installing PhotoPrism (Patience)"
|
|||||||
mkdir -p /opt/photoprism/{cache,config,photos,storage,temp}
|
mkdir -p /opt/photoprism/{cache,config,photos,storage,temp}
|
||||||
mkdir -p /opt/photoprism/photos/{originals,import}
|
mkdir -p /opt/photoprism/photos/{originals,import}
|
||||||
mkdir -p /opt/photoprism_backups
|
mkdir -p /opt/photoprism_backups
|
||||||
LIBHEIF_URL=$(curl -fsSL "https://dl.photoprism.app/dist/libheif/" | grep -oP "libheif-bookworm-amd64-v[0-9\.]+\.tar\.gz" | sort -V | tail -n 1)
|
LIBHEIF_URL=$(curl -fsSL "https://dl.photoprism.app/dist/libheif/" | grep -oP "libheif-$(lsb_release -cs)-amd64-v[0-9\.]+\.tar\.gz" | sort -V | tail -n 1)
|
||||||
curl -fsSL "https://dl.photoprism.app/dist/libheif/$LIBHEIF_URL" -o /tmp/libheif.tar.gz
|
curl -fsSL "https://dl.photoprism.app/dist/libheif/$LIBHEIF_URL" -o /tmp/libheif.tar.gz
|
||||||
tar -xzf /tmp/libheif.tar.gz -C /usr/local
|
tar -xzf /tmp/libheif.tar.gz -C /usr/local
|
||||||
ldconfig
|
ldconfig
|
||||||
|
|||||||
Reference in New Issue
Block a user