-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
Add Retype script #1102
Changes from 2 commits
7e63368
fb8273b
2b254a3
612c9a7
fd590a2
58e68e3
6309b81
663123d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| ____ __ | ||
| / __ \___ / /___ ______ ___ | ||
| / /_/ / _ \/ __/ / / / __ \/ _ \ | ||
| / _, _/ __/ /_/ /_/ / /_/ / __/ | ||
| /_/ |_|\___/\__/\__, / .___/\___/ | ||
| /____/_/ | ||
|
|
||
| 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
Member
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. new location is ~/.${app}
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. You mean |
||||||
| 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" | ||||||
|
Member
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. Created Backup to align with msg_info |
||||||
|
|
||||||
| 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
Member
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. update to new location |
||||||
| msg_ok "Update Successful" | ||||||
|
Member
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.
Suggested change
|
||||||
| 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}" | ||||||
| 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": [] | ||
| } | ||
| 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 | ||||
|
Member
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. same here, use new location |
||||
| 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 | ||||
|
|
||||
|
Member
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.
Suggested change
|
||||
| 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
|
||||
Uh oh!
There was an error while loading. Please reload this page.