Repository navigation
feat (ct): add atuin #2173
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
Closed
pascaldevink
wants to merge
1
commit into
community-scripts:main
from
pascaldevink:pascaldevink/atuin
Closed
feat (ct): add atuin #2173
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| #!/usr/bin/env bash | ||
| # Engine comes from community-scripts/core; this repo only ships the scripts. | ||
| # A local core checkout wins (COMMUNITY_SCRIPTS_CORE_DIR, else a sibling ../core), | ||
| # so a fork or branch of core can be tested without editing this file. | ||
| _cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" | ||
| source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") | ||
|
|
||
| # Copyright (c) 2021-2026 community-scripts ORG | ||
| # Author: Pascal de Vink (pascaldevink) | ||
| # License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE | ||
| # Source: https://atuin.sh/ | ||
|
|
||
| APP="Atuin server" | ||
| var_tags="${var_tags:-cli}" | ||
| var_cpu="${var_cpu:-2}" | ||
| var_ram="${var_ram:-1024}" | ||
| var_disk="${var_disk:-10}" | ||
| var_os="${var_os:-debian}" | ||
| var_version="${var_version:-13}" | ||
| var_arm64="${var_arm64:-no}" | ||
| 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/atuin ]]; then | ||
| msg_error "No ${APP} Installation Found!" | ||
| exit | ||
| fi | ||
|
|
||
| if check_for_gh_release "atuin" "atuinsh/atuin"; then | ||
| msg_info "Stopping Service" | ||
| systemctl stop atuin | ||
| msg_ok "Service stopped" | ||
|
|
||
| msg_info "Updating Atuin" | ||
| curl --proto '=https' --tlsv1.2 -LsSf https://github.com/atuinsh/atuin/releases/latest/download/atuin-server-installer.sh | ATUIN_SERVER_INSTALL_DIR="/opt/atuin" $STD sh | ||
| cat <<EOF >~/.atuin | ||
| $(get_latest_github_release "atuinsh/atuin") | ||
| EOF | ||
| msg_ok "Updated Atuin" | ||
|
|
||
| msg_info "Starting Service" | ||
| systemctl start atuin | ||
| msg_ok "Service started" | ||
| 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 "${GATEWAY}${BGN}http://${IP}:8888${CL}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ___ __ _ | ||
| / | / /___ __(_)___ | ||
| / /| |/ __/ / / / / __ \ | ||
| / ___ / /_/ /_/ / / / / / | ||
| /_/ |_\__/\__,_/_/_/ /_/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Copyright (c) 2021-2026 community-scripts ORG | ||
| # Author: Pascal de Vink (pascaldevink) | ||
| # License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE | ||
| # Source: https://atuin.sh/ | ||
|
|
||
| source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" | ||
| color | ||
| verb_ip6 | ||
| catch_errors | ||
| setting_up_container | ||
| network_check | ||
| update_os | ||
|
|
||
| PG_VERSION="17" setup_postgresql | ||
| PG_DB_NAME="atuin" PG_DB_USER="atuin" setup_postgresql_db | ||
|
|
||
| msg_info "Installing Atuin" | ||
| curl --proto '=https' --tlsv1.2 -LsSf https://github.com/atuinsh/atuin/releases/latest/download/atuin-server-installer.sh | ATUIN_SERVER_INSTALL_DIR="/opt/atuin" $STD sh | ||
| cat <<EOF >/opt/atuin/server.toml | ||
| host = "0.0.0.0" | ||
| port = 8888 | ||
| open_registration = true | ||
| db_uri = "postgres://${PG_DB_USER}:${PG_DB_PASS}@localhost:5432/${PG_DB_NAME}" | ||
| EOF | ||
| msg_ok "Installed Atuin" | ||
|
|
||
| msg_info "Creating Service" | ||
| cat <<'EOF' >/etc/systemd/system/atuin.service | ||
| [Unit] | ||
| Description=Atuin | ||
| After=network.target postgresql.service | ||
| Requires=postgresql.service | ||
|
|
||
| [Service] | ||
| Type=simple | ||
| WorkingDirectory=/opt/atuin/ | ||
| ExecStart=/opt/atuin/atuin-server start | ||
| Restart=always | ||
| RestartSec=5 | ||
|
|
||
| Environment=ATUIN_CONFIG_DIR=/opt/atuin | ||
| ReadWritePaths=/opt/atuin | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target | ||
| EOF | ||
|
|
||
| systemctl enable -q --now atuin | ||
|
|
||
| cat <<EOF >~/.atuin | ||
| $(get_latest_github_release "atuinsh/atuin") | ||
| EOF | ||
| msg_ok "Created Service" | ||
|
|
||
| motd_ssh | ||
| customize | ||
| cleanup_lxc | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| { | ||
| "name": "Atuin", | ||
| "slug": "atuin", | ||
| "categories": [ | ||
| 0 | ||
| ], | ||
| "date_created": "2026-08-11", | ||
| "type": "ct", | ||
| "updateable": true, | ||
| "privileged": false, | ||
| "architectures": ["amd64"], | ||
| "interface_port": 8888, | ||
| "documentation": "https://docs.atuin.sh/latest/", | ||
| "website": "https://atuin.sh", | ||
| "repository": "https://github.com/atuinsh/atuin", | ||
| "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/atuin.webp", | ||
| "description": "Sync your shell history across all of your machines with end-to-end encryption, and search with extra recorded context around shell commands. Self-hosted Atuin server for maximum privacy.", | ||
| "install_methods": [ | ||
| { | ||
| "type": "default", | ||
| "script": "ct/atuin.sh", | ||
| "config_path": "/opt/atuin/server.toml", | ||
| "resources": { | ||
| "cpu": 2, | ||
| "ram": 1024, | ||
| "hdd": 10, | ||
| "os": "Debian", | ||
| "version": "13" | ||
| } | ||
| } | ||
| ], | ||
| "default_credentials": { | ||
| "username": null, | ||
| "password": null | ||
| }, | ||
| "notes": [ | ||
| { | ||
| "text": "Configuration lives in /opt/atuin/server.toml", | ||
| "type": "info" | ||
| }, | ||
| { | ||
| "text": "Registration is open by default, do not forget to close if required", | ||
| "type": "info" | ||
| }, | ||
| { | ||
| "text": "Credentials are saved in /root/atuin.creds", | ||
| "type": "info" | ||
| } | ||
|
Comment on lines
+42
to
+48
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've updated the notes, are there more notes needed? |
||
| ] | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied it directly from the atuin server documentation: https://docs.atuin.sh/latest/self-hosting/server-setup/