Skip to content

Add Otter Wiki #801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Add Otter Wiki #801

wants to merge 14 commits into from

Conversation

CillyCil
Copy link

🛑 New scripts must first be submitted to ProxmoxVED for testing.
PRs for new scripts that skip this process will be closed.


✍️ Description

Added OtterWiki container script

🔗 Related PR / Issue

Link: #

✅ Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No breaking changes – Existing functionality remains intact.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.
  • 🆕 New script – A fully functional and tested script or script set.
  • 🌍 Website update – Changes to website-related JSON files or metadata.
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.

🔍 Code & Security Review (X in brackets)

  • Follows Code_Audit.md & CONTRIBUTING.md guidelines
  • Uses correct script structure (AppName.sh, AppName-install.sh, AppName.json)
  • No hardcoded credentials

📋 Additional Information (optional)

@CillyCil CillyCil requested review from a team as code owners August 17, 2025 21:58
# Source: https://github.com/redimp/otterwiki

# App Default Values
# Name of the app (e.g. Google, Adventurelog, Apache-Guacamole"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove all comments in this file (expect line 1-6)

# Default OS version (e.g. 12 for debian, 24.04 for ubuntu, 3.20 for alpine)
var_version="${var_version:-12}"
# 1 = unprivileged container, 0 = privileged container
var_unprivileged="${var_unprivileged:-0}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why privileged?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meant to be unprivileged, read it wrong


# Crawling the new version and checking whether an update is required
RELEASE=$(curl -fsSL https://api.github.com/repos/redimp/otterwiki/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ "${RELEASE}" != "$(cat /opt/otterwiki_version.txt)" ]] || [[ ! -f /opt/otterwiki_version.txt ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if [[ "${RELEASE}" != "$(cat ~/.otterwiki 2>/dev/null)" ]] || [[ ! -f ~/.otterwiki ]]; then

tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /opt/otterwiki/app-data /opt/otterwiki/settings.cfg
msg_ok "Backup Created"

# Execute Update
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetch_and_deploy_gh_release "otterwiki" "redimp/otterwiki" "tarball" "latest" "/opt/otterwiki"


# Execute Update
msg_info "Updating $APP to v${RELEASE}"
cd /opt/otterwiki/ || exit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exit not needed

# echo "Database Name: $DB_NAME"
# } >>~/"$APP_NAME".creds
# msg_ok "Set up Database"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetch_and_deploy_gh_release "otterwiki" "redimp/otterwiki" "tarball" "latest" "/opt/otterwiki"

Comment on lines +44 to +47
RELEASE=$(curl -fsSL https://api.github.com/repos/redimp/otterwiki/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
curl -fsSL -o "${RELEASE}.zip" "https://github.com/redimp/otterwiki/archive/refs/tags/${RELEASE}.zip"
unzip -q "${RELEASE}.zip"
mv "otterwiki-${RELEASE:1}/" "/opt/otterwiki"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed because fetch_and_deploy function

python3 -m venv venv
./venv/bin/pip install -U pip uwsgi
./venv/bin/pip install .
echo "${RELEASE}" >/opt/otterwiki_version.txt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed because fetch_and_deploy function

[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed


# Cleanup
msg_info "Cleaning up"
rm -f "${RELEASE}".zip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants