Compare commits

..

No commits in common. "025d688be3666595f688c19841ffc1726413ec03" and "62f68959c74b193bc6ab497262608f08240ed652" have entirely different histories.

3 changed files with 16 additions and 39 deletions

View File

@ -8,10 +8,10 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV
APP="Anytype" APP="Anytype"
var_tags="${var_tags:-notes;productivity;sync}" var_tags="${var_tags:-notes;productivity;sync}"
var_cpu="${var_cpu:-2}" var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-4096}" var_ram="${var_ram:-2048}"
var_disk="${var_disk:-16}" var_disk="${var_disk:-10}"
var_os="${var_os:-ubuntu}" var_os="${var_os:-debian}"
var_version="${var_version:-24.04}" var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}" var_unprivileged="${var_unprivileged:-1}"
header_info "$APP" header_info "$APP"

View File

@ -13,17 +13,17 @@
"website": "https://anytype.io/", "website": "https://anytype.io/",
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/anytype.webp", "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/anytype.webp",
"config_path": "/opt/anytype/.env", "config_path": "/opt/anytype/.env",
"description": "Anytype is a local-first, privacy-focused alternative to Notion. This script deploys the any-sync-bundle which provides a self-hosted sync server for Anytype clients with external MongoDB and Redis Stack.", "description": "Anytype is a local-first, privacy-focused alternative to Notion. This script deploys the any-sync-bundle which provides a self-hosted sync server for Anytype clients with embedded MongoDB and Redis.",
"install_methods": [ "install_methods": [
{ {
"type": "default", "type": "default",
"script": "ct/anytype.sh", "script": "ct/anytype.sh",
"resources": { "resources": {
"cpu": 2, "cpu": 2,
"ram": 4096, "ram": 2048,
"hdd": 16, "hdd": 10,
"os": "Ubuntu", "os": "Debian",
"version": "24.04" "version": "13"
} }
} }
], ],

View File

@ -13,43 +13,21 @@ setting_up_container
network_check network_check
update_os update_os
setup_mongodb msg_info "Installing Dependencies"
$STD apt install -y ca-certificates
msg_info "Configuring MongoDB Replica Set" msg_ok "Installed Dependencies"
cat <<EOF >>/etc/mongod.conf
replication:
replSetName: "rs0"
EOF
systemctl restart mongod
sleep 3
$STD mongosh --eval 'rs.initiate({_id: "rs0", members: [{_id: 0, host: "127.0.0.1:27017"}]})'
msg_ok "Configured MongoDB Replica Set"
msg_info "Installing Redis Stack"
setup_deb822_repo \
"redis-stack" \
"https://packages.redis.io/gpg" \
"https://packages.redis.io/deb" \
"jammy" \
"main"
$STD apt-get install -y \
redis-stack-server
systemctl enable -q --now redis-stack-server
msg_ok "Installed Redis Stack"
fetch_and_deploy_gh_release "anytype" "grishy/any-sync-bundle" "prebuild" "latest" "/opt/anytype" "any-sync-bundle_*_linux_amd64.tar.gz" fetch_and_deploy_gh_release "anytype" "grishy/any-sync-bundle" "prebuild" "latest" "/opt/anytype" "any-sync-bundle_*_linux_amd64.tar.gz"
chmod +x /opt/anytype/any-sync-bundle chmod +x /opt/anytype/any-sync-bundle
msg_info "Configuring Anytype" msg_info "Configuring Anytype"
mkdir -p /opt/anytype/data/storage mkdir -p /opt/anytype/data
cat <<EOF >/opt/anytype/.env cat <<EOF >/opt/anytype/.env
ANY_SYNC_BUNDLE_CONFIG=/opt/anytype/data/bundle-config.yml ANY_SYNC_BUNDLE_CONFIG=/opt/anytype/data/bundle-config.yml
ANY_SYNC_BUNDLE_CLIENT_CONFIG=/opt/anytype/data/client-config.yml ANY_SYNC_BUNDLE_CLIENT_CONFIG=/opt/anytype/data/client-config.yml
ANY_SYNC_BUNDLE_INIT_STORAGE=/opt/anytype/data/storage/ ANY_SYNC_BUNDLE_INIT_STORAGE=/opt/anytype/data/storage/
ANY_SYNC_BUNDLE_INIT_EXTERNAL_ADDRS=${LOCAL_IP} ANY_SYNC_BUNDLE_INIT_EXTERNAL_ADDRS=${LOCAL_IP}
ANY_SYNC_BUNDLE_INIT_MONGO_URI=mongodb://127.0.0.1:27017/
ANY_SYNC_BUNDLE_INIT_REDIS_URI=redis://127.0.0.1:6379/
ANY_SYNC_BUNDLE_LOG_LEVEL=info ANY_SYNC_BUNDLE_LOG_LEVEL=info
EOF EOF
msg_ok "Configured Anytype" msg_ok "Configured Anytype"
@ -58,16 +36,15 @@ msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/anytype.service cat <<EOF >/etc/systemd/system/anytype.service
[Unit] [Unit]
Description=Anytype Sync Server (any-sync-bundle) Description=Anytype Sync Server (any-sync-bundle)
After=network-online.target mongod.service redis-stack-server.service After=network-online.target
Wants=network-online.target Wants=network-online.target
Requires=mongod.service redis-stack-server.service
[Service] [Service]
Type=simple Type=simple
User=root User=root
WorkingDirectory=/opt/anytype WorkingDirectory=/opt/anytype
EnvironmentFile=/opt/anytype/.env EnvironmentFile=/opt/anytype/.env
ExecStart=/opt/anytype/any-sync-bundle start-bundle ExecStart=/opt/anytype/any-sync-bundle start-all-in-one
Restart=on-failure Restart=on-failure
RestartSec=10 RestartSec=10