-
-
Notifications
You must be signed in to change notification settings - Fork 135
Add Retype script #1102
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
kairosys-dev
wants to merge
7
commits into
community-scripts:main
Choose a base branch
from
kairosys-dev:retype
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+144
−0
Open
Add Retype script #1102
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7e63368
Add Retype script
kairosys-dev fb8273b
fix source URL in ct/retype.sh
kairosys-dev 2b254a3
remove ct/headers/retype, as it's automatically generated
kairosys-dev 612c9a7
add all requested changes (except fetch_and_deploy_gh_release, for now)
kairosys-dev fd590a2
Proxmox VED
kairosys-dev 58e68e3
update GitHub logo to selfh.st
kairosys-dev 6309b81
switch from GitHub + npm version combination to npm registry query
kairosys-dev 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,7 @@ | ||
| ____ __ | ||
| / __ \___ / /___ ______ ___ | ||
| / /_/ / _ \/ __/ / / / __ \/ _ \ | ||
| / _, _/ __/ /_/ /_/ / /_/ / __/ | ||
| /_/ |_|\___/\__/\__, / .___/\___/ | ||
| /____/_/ | ||
|
|
||
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 | ||
| source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) | ||
kairosys-dev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # Copyright (c) 2021-2025 community-scripts ORG | ||
| # Author: kairosys-dev | ||
| # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE | ||
| # Source: https://retype.com/ | ||
|
|
||
| APP="Retype" | ||
| var_tags="${var_tags:-docs}" | ||
| var_cpu="${var_cpu:-2}" | ||
| var_ram="${var_ram:-2048}" | ||
| var_disk="${var_disk:-8}" | ||
| var_os="${var_os:-ubuntu}" | ||
| var_version="${var_version:-24.04}" | ||
| var_unprivileged="${var_unprivileged:-1}" | ||
|
|
||
| header_info "$APP" | ||
| variables | ||
| color | ||
| catch_errors | ||
|
|
||
| function update_script() { | ||
| header_info | ||
| check_container_storage | ||
| check_container_resources | ||
|
|
||
| if [[ ! -f "/root/retype.yml" ]]; then | ||
| msg_error "No ${APP} Installation Found!" | ||
| exit | ||
| fi | ||
|
|
||
| RELEASE=$(curl -fsSL https://api.github.com/repos/retypeapp/retype/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') | ||
| if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then | ||
kairosys-dev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| msg_info "Stopping $APP" | ||
| systemctl stop $APP | ||
| msg_ok "Stopped $APP" | ||
kairosys-dev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| msg_info "Creating Backup" | ||
| tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /root/* | ||
kairosys-dev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| msg_ok "Backup Created" | ||
|
|
||
| msg_info "Updating $APP to v${RELEASE}" | ||
| $STD npm install retypeapp --global | ||
| msg_ok "Updated $APP to v${RELEASE}" | ||
kairosys-dev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| msg_info "Starting $APP" | ||
| systemctl start $APP | ||
| msg_ok "Started $APP" | ||
kairosys-dev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| echo "${RELEASE}" >/opt/${APP}_version.txt | ||
kairosys-dev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| msg_ok "Update Successful" | ||
| else | ||
| msg_ok "No update required. ${APP} is already at v${RELEASE}" | ||
kairosys-dev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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}:5001${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,35 @@ | ||
| { | ||
| "name": "Retype", | ||
| "slug": "retype", | ||
| "categories": [ | ||
| 12 | ||
| ], | ||
| "date_created": "2025-11-11", | ||
| "type": "ct", | ||
| "updateable": false, | ||
| "privileged": false, | ||
| "interface_port": 5001, | ||
| "documentation": "https://retype.com/", | ||
| "config_path": "/root/retype.yml", | ||
| "website": "https://retype.com/", | ||
| "logo": "https://avatars.githubusercontent.com/u/76267054", | ||
kairosys-dev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "description": "Retype is a static website generator that builds a website based on simple Markdown (.md) text files. Focus on your writing while Retype builds the rest.", | ||
| "install_methods": [ | ||
| { | ||
| "type": "default", | ||
| "script": "ct/retype.sh", | ||
| "resources": { | ||
| "cpu": 2, | ||
| "ram": 2048, | ||
| "hdd": 8, | ||
| "os": "Ubuntu", | ||
kairosys-dev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "version": "24.04" | ||
| } | ||
| } | ||
| ], | ||
| "default_credentials": { | ||
| "username": null, | ||
| "password": null | ||
| }, | ||
| "notes": [] | ||
| } | ||
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,53 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Copyright (c) 2021-2025 community-scripts ORG | ||
| # Author: kairosys-dev | ||
| # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE | ||
| # Source: https://retype.com/ | ||
|
|
||
| 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 \ | ||
| nodejs \ | ||
| npm | ||
| msg_ok "Installed Dependencies" | ||
kairosys-dev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| NODE_VERSION="22" NODE_MODULE="node-gyp" setup_nodejs | ||
|
|
||
| msg_info "Setup ${APPLICATION}" | ||
kairosys-dev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| $STD npm install retypeapp --global | ||
| RELEASE=$(curl -fsSL https://api.github.com/repos/retypeapp/retype/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') | ||
| echo "${RELEASE}" >/opt/"${APPLICATION}"_version.txt | ||
| msg_ok "Setup ${APPLICATION}" | ||
kairosys-dev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| msg_info "Creating Service" | ||
| cat <<EOF >/etc/systemd/system/"${APPLICATION}".service | ||
| [Unit] | ||
| Description=${APPLICATION} Service | ||
kairosys-dev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| After=network.target | ||
| [Service] | ||
| ExecStart=retype start --host 0.0.0.0 | ||
| Restart=always | ||
| WorkingDirectory=/root | ||
| [Install] | ||
| WantedBy=multi-user.target | ||
| EOF | ||
| systemctl enable -q --now "${APPLICATION}" | ||
kairosys-dev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| msg_ok "Created Service" | ||
|
|
||
| motd_ssh | ||
| customize | ||
|
|
||
| msg_info "Cleaning up" | ||
| $STD apt-get -y autoremove | ||
| $STD apt-get -y autoclean | ||
| msg_ok "Cleaned" | ||
kairosys-dev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.