forked from TheWrightServer/ProxmoxVE
Compare commits
9 Commits
main
...
rework_cor
Author | SHA1 | Date | |
---|---|---|---|
|
945d55f423 | ||
|
30bf69c5e5 | ||
|
11e1768e78 | ||
|
852ab6065f | ||
|
addb48bd52 | ||
|
81d5b163a6 | ||
|
d07274ce7b | ||
|
4f521d4b28 | ||
|
99fdc2f17e |
17
.github/CODEOWNERS
vendored
Normal file
17
.github/CODEOWNERS
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
#
|
||||
# CODEOWNERS for ProxmoxVE
|
||||
#
|
||||
|
||||
# Order is important; the last matching pattern takes the most
|
||||
# precedence.
|
||||
|
||||
|
||||
# Codeowners for specific folders and files
|
||||
# Remember ending folders with /
|
||||
|
||||
|
||||
# Set default reviewers
|
||||
* @community-scripts/Contributor
|
||||
|
||||
# All changes in frontend
|
||||
/frontend/ @community-scripts/Frontend-Dev
|
132
.github/CODE_OF_CONDUCT.md
vendored
Normal file
132
.github/CODE_OF_CONDUCT.md
vendored
Normal file
@ -0,0 +1,132 @@
|
||||
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, religion, or sexual identity
|
||||
and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the
|
||||
overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series
|
||||
of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or
|
||||
permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.0, available at
|
||||
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
|
||||
|
||||
Community Impact Guidelines were inspired by
|
||||
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
|
||||
at [https://www.contributor-covenant.org/translations][translations].
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
|
||||
[Mozilla CoC]: https://github.com/mozilla/diversity
|
||||
[FAQ]: https://www.contributor-covenant.org/faq
|
||||
[translations]: https://www.contributor-covenant.org/translations
|
14
.github/CONTRIBUTING.md
vendored
Normal file
14
.github/CONTRIBUTING.md
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
<div align="center">
|
||||
<a href="#">
|
||||
<img src="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/images/logo.png" height="100px" />
|
||||
</a>
|
||||
</div>
|
||||
<h2 align="center">Contributing to Proxmox VE Helper Scripts</h2>
|
||||
|
||||
Everybody is invited and welcome to contribute to Proxmox VE Helper Scripts.
|
||||
|
||||
- Pull requests submitted against [**main**](https://github.com/community-scripts/ProxmoxVE/tree/main) are meticulously scrutinized, so please do not take it personally if the project maintainer rejects your request. By adhering to the established patterns and conventions throughout the codebase, you greatly increase the likelihood that your changes will get merged into [**main**](https://github.com/community-scripts/ProxmoxVE/tree/main).
|
||||
|
||||
- It is important to stress that complaining about a decision after it has been made is not productive behavior for the pull request submitter. It is crucial for all contributors to respect the decision-making process and collaborate effectively towards achieving the best possible outcome for the project.
|
||||
|
||||
- The repository will only accept Alpine applications that make use of the Alpine Package Keeper.
|
37
.github/DISCUSSION_TEMPLATE/request-script.yml
vendored
Normal file
37
.github/DISCUSSION_TEMPLATE/request-script.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
title: "[Script request] "
|
||||
labels: ["enhancement"]
|
||||
body:
|
||||
- type: input
|
||||
attributes:
|
||||
label: Application Name
|
||||
description: Enter the application name.
|
||||
placeholder: "e.g., Home Assistant"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Website
|
||||
description: Official website or github page.
|
||||
placeholder: "e.g., https://www.home-assistant.io/"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Description
|
||||
description: Explain what the application does and why it should be added to Proxmox VE Helper-Scripts.
|
||||
placeholder: "e.g., Home Assistant is a popular open-source platform that brings all your smart home devices together in one place. Adding it to Proxmox VE Helper-Scripts would make setup and management on Proxmox easy, letting users quickly get a powerful, self-hosted smart home system up and running."
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Due Diligence
|
||||
options:
|
||||
- label: "I have searched existing [scripts](https://community-scripts.github.io/Proxmox/scripts) and found no duplicates."
|
||||
required: true
|
||||
- label: "I have searched existing [discussions](https://github.com/community-scripts/ProxmoxVE/discussions?discussions_q=) and found no duplicate requests."
|
||||
required: true
|
||||
- label: "This is not a game-related request."
|
||||
required: true
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "Thanks for submitting your request! The team will review it and reach out if we need more information."
|
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1 @@
|
||||
ko_fi: community_scripts
|
71
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
71
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
name: "🐞 Script Issue Report"
|
||||
description: Report a specific issue with a script. For other inquiries, please use the Discussions section.
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**IMPORTANT:** Failure to comply with the following guidelines may result in immediate closure.
|
||||
- Prior to submitting, kindly search the closed issues to check if the problem you are reporting has already been addressed and resolved. If you come across a closed issue that pertains to your problem, please leave a comment on that issue instead of creating a new one.
|
||||
- If the default Linux distribution is not adhered to, script support will be discontinued.
|
||||
- When encountering the error message `[ERROR] in line 23: exit code *: while executing command "$@" > /dev/null 2>&1`, make sure to run the script in verbose mode to accurately determine the underlying issue.
|
||||
- For suggestions, questions, or feature/script requests, please use the [Discussions section.](https://github.com/community-scripts/ProxmoxVE/discussions)
|
||||
|
||||
- type: input
|
||||
id: guidelines
|
||||
attributes:
|
||||
label: Please verify that you have read and understood the guidelines.
|
||||
placeholder: "yes"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: bug
|
||||
attributes:
|
||||
label: A clear and concise description of the issue.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
validations:
|
||||
required: true
|
||||
attributes:
|
||||
label: What settings are you currently utilizing?
|
||||
options:
|
||||
- label: Default Settings
|
||||
- label: Advanced Settings
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "If using Advanced Settings, please try Default Settings before creating an issue."
|
||||
|
||||
- type: dropdown
|
||||
id: distribution
|
||||
attributes:
|
||||
label: Which Linux distribution are you employing?
|
||||
options:
|
||||
-
|
||||
- Alpine
|
||||
- Debian 11
|
||||
- Debian 12
|
||||
- Ubuntu 20.04
|
||||
- Ubuntu 22.04
|
||||
- Ubuntu 24.04
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: screenshot
|
||||
attributes:
|
||||
label: If relevant, including screenshots or a code block can be helpful in clarifying the issue.
|
||||
placeholder: "Code blocks begin and conclude by enclosing the code with three backticks (```) above and below it."
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: reproduce
|
||||
attributes:
|
||||
label: Please provide detailed steps to reproduce the issue.
|
||||
placeholder: "First do this, then this ..."
|
||||
validations:
|
||||
required: false
|
11
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
11
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: 🤔 Questions and Help
|
||||
url: https://github.com/community-scripts/ProxmoxVE/discussions
|
||||
about: For suggestions or questions, please use the Discussions section.
|
||||
- name: 🌟 Feature request
|
||||
url: https://github.com/community-scripts/ProxmoxVE/discussions/new?category=request-script
|
||||
about: For feature/script requests, please use the Discussions section.
|
||||
- name: 💻 Discord
|
||||
url: https://discord.gg/UHrpNWGwkH
|
||||
about: Join our Discord server to chat with other users in the Proxmox Helper Scripts community.
|
75
.github/ISSUE_TEMPLATE/frontend_report.yml
vendored
Normal file
75
.github/ISSUE_TEMPLATE/frontend_report.yml
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
name: "🌐 Website Issue Report"
|
||||
description: Report an issue, an optimization request or an documentation issue specifically related to the website.
|
||||
labels: "website"
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**IMPORTANT:** Failure to comply with the following guidelines may result in immediate closure.
|
||||
- Prior to submitting, kindly search the closed issues to check if the problem you are reporting has already been addressed and resolved. If you come across a closed issue that pertains to your problem, please leave a comment on that issue instead of creating a new one.
|
||||
- If the problem is related to a bug in the website, kindly check for browser compatibility and ensure the issue occurs in multiple browsers before submitting.
|
||||
- For suggestions, questions, or feature requests, please use the [Discussions section.](https://github.com/community-scripts/ProxmoxVE/discussions)
|
||||
|
||||
- type: input
|
||||
id: guidelines
|
||||
attributes:
|
||||
label: Please verify that you have read and understood the guidelines.
|
||||
placeholder: 'yes'
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: issue_type
|
||||
validations:
|
||||
required: true
|
||||
attributes:
|
||||
label: What type of issue is this?
|
||||
options:
|
||||
-
|
||||
- Bug
|
||||
- Optimization
|
||||
- Documentation
|
||||
- Other
|
||||
|
||||
- type: textarea
|
||||
id: bug_description
|
||||
attributes:
|
||||
label: A clear and concise description of the issue.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: browser
|
||||
validations:
|
||||
required: true
|
||||
attributes:
|
||||
label: Which browser are you using?
|
||||
options:
|
||||
-
|
||||
- Chrome
|
||||
- Firefox
|
||||
- Safari
|
||||
- Edge
|
||||
- Other
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**If the issue is browser-related**, please provide information on the version and platform (Windows, MacOS, Linux, etc.).
|
||||
|
||||
- type: textarea
|
||||
id: screenshot
|
||||
attributes:
|
||||
label: If relevant, including screenshots or a code block can be helpful in clarifying the issue.
|
||||
placeholder: "Code blocks begin and conclude by enclosing the code with three backticks (```) above and below it."
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: reproduce
|
||||
attributes:
|
||||
label: Please provide detailed steps to reproduce the issue.
|
||||
placeholder: "First do this, then this ..."
|
||||
validations:
|
||||
required: false
|
64
.github/autolabeler-config.json
vendored
Normal file
64
.github/autolabeler-config.json
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
|
||||
{
|
||||
"breaking change": [
|
||||
{
|
||||
"fileStatus": "renamed",
|
||||
"includeGlobs": ["ct/**", "install/**", "misc/**", "turnkey/**", "vm/**"],
|
||||
"excludeGlobs": []
|
||||
},
|
||||
{
|
||||
"fileStatus": "removed",
|
||||
"includeGlobs": ["ct/**", "install/**", "misc/**", "turnkey/**", "vm/**"],
|
||||
"excludeGlobs": []
|
||||
}
|
||||
],
|
||||
"new script": [
|
||||
{
|
||||
"fileStatus": "added",
|
||||
"includeGlobs": ["ct/**", "install/**", "misc/**", "turnkey/**", "vm/**"],
|
||||
"excludeGlobs": []
|
||||
}
|
||||
],
|
||||
"update script": [
|
||||
{
|
||||
"fileStatus": "modified",
|
||||
"includeGlobs": ["ct/**", "install/**", "misc/**", "turnkey/**", "vm/**"],
|
||||
"excludeGlobs": ["misc/build.func", "misc/install.func"]
|
||||
}
|
||||
],
|
||||
"delete script": [
|
||||
{
|
||||
"fileStatus": "removed",
|
||||
"includeGlobs": ["ct/**", "install/**", "misc/**", "turnkey/**", "vm/**"],
|
||||
"excludeGlobs": []
|
||||
}
|
||||
],
|
||||
"rename script": [
|
||||
{
|
||||
"fileStatus": "renamed",
|
||||
"includeGlobs": ["ct/**", "install/**", "misc/**", "turnkey/**", "vm/**"],
|
||||
"excludeGlobs": []
|
||||
}
|
||||
],
|
||||
"website": [
|
||||
{
|
||||
"fileStatus": null,
|
||||
"includeGlobs": ["frontend/**", "json/**"],
|
||||
"excludeGlobs": []
|
||||
}
|
||||
],
|
||||
"maintenance": [
|
||||
{
|
||||
"fileStatus": null,
|
||||
"includeGlobs": ["*.md", ".github/**"],
|
||||
"excludeGlobs": []
|
||||
}
|
||||
],
|
||||
"high risk": [
|
||||
{
|
||||
"fileStatus": null,
|
||||
"includeGlobs": ["misc/build.func", "misc/install.func"],
|
||||
"excludeGlobs": []
|
||||
}
|
||||
]
|
||||
}
|
30
.github/changelog-pr-config.json
vendored
Normal file
30
.github/changelog-pr-config.json
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
[
|
||||
{
|
||||
"title": "💥 Breaking Changes",
|
||||
"labels": ["breaking change"]
|
||||
},
|
||||
{
|
||||
"title": "✨ New Scripts",
|
||||
"labels": ["new script"]
|
||||
},
|
||||
{
|
||||
"title": "🚀 Updated Scripts",
|
||||
"labels": ["update script"]
|
||||
},
|
||||
{
|
||||
"title": "🌐 Website",
|
||||
"labels": ["website"]
|
||||
},
|
||||
{
|
||||
"title": "🐞 Bug Fixes",
|
||||
"labels": ["bug fix"]
|
||||
},
|
||||
{
|
||||
"title": "🧰 Maintenance",
|
||||
"labels": ["maintenance"]
|
||||
},
|
||||
{
|
||||
"title": "❔ Unlabelled",
|
||||
"labels": []
|
||||
}
|
||||
]
|
54
.github/check-script.yml
vendored
Normal file
54
.github/check-script.yml
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
name: Check Shell Scripts
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '**/*.sh' # Führt den Check nur für Shell-Skripte aus
|
||||
|
||||
jobs:
|
||||
check-scripts:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Check `source` Line in Scripts
|
||||
shell: bash
|
||||
run: |
|
||||
set -e
|
||||
ERROR_COUNT=0
|
||||
FILES=$(find . -name "*.sh")
|
||||
|
||||
for FILE in $FILES; do
|
||||
# Check for exact match of the source line in line 2
|
||||
if [[ $(sed -n '2p' "$FILE") =~ ^source[[:space:]]+<(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) ]]; then
|
||||
echo "Check passed for: $FILE"
|
||||
else
|
||||
echo "Error in $FILE: Line 2 must be exactly 'source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)' if a source line is used."
|
||||
ERROR_COUNT=$((ERROR_COUNT + 1))
|
||||
fi
|
||||
|
||||
# Check for shebang line at the top
|
||||
if [[ $(head -n 1 "$FILE") != "#!/usr/bin/env bash" ]]; then
|
||||
echo "Error in $FILE: The first line must be '#!/usr/bin/env bash'."
|
||||
ERROR_COUNT=$((ERROR_COUNT + 1))
|
||||
fi
|
||||
|
||||
# Check for executable permissions
|
||||
if [[ ! -x "$FILE" ]]; then
|
||||
echo "Warning in $FILE: This script is not executable. Consider running 'chmod +x $FILE'."
|
||||
fi
|
||||
|
||||
# Check for empty lines at the beginning of the script
|
||||
if [[ $(head -n 10 "$FILE" | grep -c '^$') -gt 0 ]]; then
|
||||
echo "Warning in $FILE: There are empty lines at the beginning of the script. Consider removing them."
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ "$ERROR_COUNT" -gt 0 ]]; then
|
||||
echo "$ERROR_COUNT script(s) failed validation."
|
||||
exit 1
|
||||
else
|
||||
echo "All scripts passed."
|
||||
fi
|
31
.github/pull_request_template.md
vendored
Normal file
31
.github/pull_request_template.md
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
> [!NOTE]
|
||||
> We are meticulous when it comes to merging code into the main branch, so please understand that we may reject pull requests that do not meet the project's standards. It's never personal. Also, game-related scripts have a lower chance of being merged.
|
||||
|
||||
## Description
|
||||
|
||||
Provide a summary of the changes made and/or reference the issue being addressed.
|
||||
|
||||
Fixes # (issue)
|
||||
|
||||
## Type of change
|
||||
Please check the relevant option(s):
|
||||
|
||||
- [ ] Bug fix (non-breaking change that resolves an issue)
|
||||
- [ ] New feature (non-breaking change that adds functionality)
|
||||
- [ ] Breaking change (a fix or feature that would cause existing functionality to change unexpectedly)
|
||||
- [ ] New script (a fully functional and thoroughly tested script or set of scripts.)
|
||||
|
||||
## Prerequisites
|
||||
The following efforts must be made for the PR to be considered. Please check when completed:
|
||||
- [ ] Self-review performed (I have reviewed my code, ensuring it follows established patterns and conventions)
|
||||
- [ ] Testing performed (I have tested my changes, ensuring everything works as expected)
|
||||
- [ ] Documentation updated (I have updated any relevant documentation)
|
||||
|
||||
## Additional Information (optional)
|
||||
Provide any additional context or screenshots about the feature or fix here.
|
||||
|
||||
|
||||
## Related Pull Requests / Discussions
|
||||
|
||||
If there are other pull requests or discussions related to this change, please link them here:
|
||||
- Related PR #
|
62
.github/workflows/autolabeler.yml
vendored
Normal file
62
.github/workflows/autolabeler.yml
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
name: Auto Label Pull Requests
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
branches: ["main"]
|
||||
types: [opened, synchronize, reopened, edited]
|
||||
|
||||
jobs:
|
||||
autolabeler:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
env:
|
||||
CONFIG_PATH: .github/autolabeler-config.json
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install minimatch
|
||||
run: npm install minimatch
|
||||
|
||||
- name: Label PR based on config rules
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs').promises;
|
||||
const path = require('path');
|
||||
const { minimatch } = require('minimatch');
|
||||
|
||||
const configPath = path.resolve(process.env.CONFIG_PATH);
|
||||
const fileContent = await fs.readFile(configPath, 'utf-8');
|
||||
const autolabelerConfig = JSON.parse(fileContent);
|
||||
|
||||
const prNumber = context.payload.pull_request.number;
|
||||
const prListFilesResponse = await github.rest.pulls.listFiles({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: prNumber,
|
||||
});
|
||||
const prFiles = prListFilesResponse.data;
|
||||
|
||||
for (const [label, rules] of Object.entries(autolabelerConfig)) {
|
||||
const shouldAddLabel = prFiles.some((prFile) => {
|
||||
return rules.some((rule) => {
|
||||
const isFileStatusMatch = rule.fileStatus ? rule.fileStatus === prFile.status : true;
|
||||
const isIncludeGlobMatch = rule.includeGlobs.some((glob) => minimatch(prFile.filename, glob));
|
||||
const isExcludeGlobMatch = rule.excludeGlobs.some((glob) => minimatch(prFile.filename, glob));
|
||||
|
||||
return isFileStatusMatch && isIncludeGlobMatch && !isExcludeGlobMatch;
|
||||
});
|
||||
});
|
||||
|
||||
if (shouldAddLabel) {
|
||||
console.log(`Adding label ${label} to PR ${prNumber}`);
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: prNumber,
|
||||
labels: [label],
|
||||
});
|
||||
}
|
||||
}
|
158
.github/workflows/changelog-pr.yml
vendored
Normal file
158
.github/workflows/changelog-pr.yml
vendored
Normal file
@ -0,0 +1,158 @@
|
||||
name: Create Changelog Pull Request
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update-changelog-pull-request:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CONFIG_PATH: .github/changelog-pr-config.json
|
||||
BRANCH_NAME: github-action-update-changelog
|
||||
AUTOMATED_PR_LABEL: "automated pr"
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Generate a token
|
||||
id: generate-token
|
||||
uses: actions/create-github-app-token@v1
|
||||
with:
|
||||
app-id: ${{ vars.APP_ID }}
|
||||
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get latest dates in changelog
|
||||
run: |
|
||||
# Extract the latest and second latest dates from changelog
|
||||
DATES=$(grep '^## [0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}' CHANGELOG.md | head -n 2 | awk '{print $2}')
|
||||
|
||||
LATEST_DATE=$(echo "$DATES" | sed -n '1p')
|
||||
SECOND_LATEST_DATE=$(echo "$DATES" | sed -n '2p')
|
||||
TODAY=$(date -u +%Y-%m-%d)
|
||||
|
||||
echo "TODAY=$TODAY" >> $GITHUB_ENV
|
||||
if [ "$LATEST_DATE" == "$TODAY" ]; then
|
||||
echo "LATEST_DATE=$SECOND_LATEST_DATE" >> $GITHUB_ENV
|
||||
else
|
||||
echo "LATEST_DATE=$LATEST_DATE" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Get categorized pull requests
|
||||
id: get-categorized-prs
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs').promises;
|
||||
const path = require('path');
|
||||
|
||||
const configPath = path.resolve(process.env.CONFIG_PATH);
|
||||
const fileContent = await fs.readFile(configPath, 'utf-8');
|
||||
const changelogConfig = JSON.parse(fileContent);
|
||||
const categorizedPRs = changelogConfig.map((obj) => ({ ...obj, notes: [] }));
|
||||
|
||||
const latestDateInChangelog = new Date(process.env.LATEST_DATE);
|
||||
latestDateInChangelog.setUTCHours(23,59,59,999);
|
||||
|
||||
const { data: pulls } = await github.rest.pulls.list({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: "closed",
|
||||
sort: "updated",
|
||||
direction: "desc",
|
||||
per_page: 100,
|
||||
});
|
||||
|
||||
pulls.filter((pr) =>
|
||||
pr.merged_at && new Date(pr.merged_at) > latestDateInChangelog
|
||||
).forEach((pr) => {
|
||||
const prLabels = pr.labels.map((label) => label.name.toLowerCase());
|
||||
const prNote = `- ${pr.title} [@${pr.user.login}](https://github.com/${pr.user.login}) ([#${pr.number}](${pr.html_url}))`;
|
||||
|
||||
for (const { labels, notes } of categorizedPRs) {
|
||||
const prHasCategoryLabel = labels.some((label) => prLabels.includes(label));
|
||||
const isUnlabelledCategory = labels.length === 0;
|
||||
const prShouldBeExcluded = prLabels.includes(process.env.AUTOMATED_PR_LABEL);
|
||||
if ((prHasCategoryLabel || isUnlabelledCategory) && !prShouldBeExcluded) {
|
||||
notes.push(prNote);
|
||||
break;
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
return categorizedPRs;
|
||||
|
||||
- name: Update CHANGELOG.md
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs').promises;
|
||||
const path = require('path');
|
||||
|
||||
const today = process.env.TODAY;
|
||||
const latestDateInChangelog = process.env.LATEST_DATE;
|
||||
const changelogPath = path.resolve('CHANGELOG.md');
|
||||
const categorizedPRs = ${{ steps.get-categorized-prs.outputs.result }};
|
||||
|
||||
let newReleaseNotes = `## ${today}\n\n### Changed\n\n`;
|
||||
for (const { title, notes } of categorizedPRs) {
|
||||
if (notes.length > 0) {
|
||||
newReleaseNotes += `### ${title}\n\n${notes.join("\n")}\n\n`;
|
||||
}
|
||||
}
|
||||
|
||||
const changelogContent = await fs.readFile(changelogPath, 'utf-8');
|
||||
const changelogIncludesTodaysReleaseNotes = changelogContent.includes(`\n## ${today}`);
|
||||
|
||||
// Replace todays release notes or insert release notes above previous release notes
|
||||
const regex = changelogIncludesTodaysReleaseNotes ?
|
||||
new RegExp(`## ${today}.*(?=## ${latestDateInChangelog})`, "gs") :
|
||||
new RegExp(`(?=## ${latestDateInChangelog})`, "gs");
|
||||
|
||||
const newChangelogContent = changelogContent.replace(regex, newReleaseNotes)
|
||||
await fs.writeFile(changelogPath, newChangelogContent);
|
||||
|
||||
- name: Check if there are any changes
|
||||
id: verify-diff
|
||||
run: |
|
||||
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Commit and push changes to separate branch
|
||||
if: steps.verify-diff.outputs.changed == 'true'
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add CHANGELOG.md
|
||||
git commit -m "Update CHANGELOG.md"
|
||||
git checkout -b $BRANCH_NAME || git checkout $BRANCH_NAME
|
||||
git push origin $BRANCH_NAME --force
|
||||
|
||||
- name: Create pull request if not exists
|
||||
if: steps.verify-diff.outputs.changed == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
run: |
|
||||
PR_EXISTS=$(gh pr list --head "${BRANCH_NAME}" --json number --jq '.[].number')
|
||||
if [ -z "$PR_EXISTS" ]; then
|
||||
gh pr create --title "[Github Action] Update CHANGELOG.md" \
|
||||
--body "This PR is auto-generated by a Github Action to update the CHANGELOG.md file." \
|
||||
--head $BRANCH_NAME \
|
||||
--base main \
|
||||
--label "$AUTOMATED_PR_LABEL"
|
||||
fi
|
||||
|
||||
- name: Approve pull request
|
||||
if: steps.verify-diff.outputs.changed == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
PR_NUMBER=$(gh pr list --head "${BRANCH_NAME}" --json number --jq '.[].number')
|
||||
if [ -n "$PR_NUMBER" ]; then
|
||||
gh pr review $PR_NUMBER --approve
|
||||
fi
|
79
.github/workflows/deploy-pages.yml
vendored
Normal file
79
.github/workflows/deploy-pages.yml
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
# Sample workflow for building and deploying a Next.js site to GitHub Pages
|
||||
#
|
||||
# To get started with Next.js see: https://nextjs.org/docs/getting-started
|
||||
#
|
||||
name: Deploy Next.js site to Pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
paths:
|
||||
- frontend/**
|
||||
- json/**
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: frontend # Set default working directory for all run steps
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Detect package manager
|
||||
id: detect-package-manager
|
||||
run: |
|
||||
if [ -f "${{ github.workspace }}/frontend/yarn.lock" ]; then
|
||||
echo "manager=yarn" >> $GITHUB_OUTPUT
|
||||
echo "command=install" >> $GITHUB_OUTPUT
|
||||
echo "runner=yarn" >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
elif [ -f "${{ github.workspace }}/frontend/package.json" ]; then
|
||||
echo "manager=npm" >> $GITHUB_OUTPUT
|
||||
echo "command=ci" >> $GITHUB_OUTPUT
|
||||
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
else
|
||||
echo "Unable to determine package manager"
|
||||
exit 1
|
||||
fi
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "20"
|
||||
cache: ${{ steps.detect-package-manager.outputs.manager }}
|
||||
cache-dependency-path: frontend/package-lock.json # Specify the path to package-lock.json
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v5
|
||||
with:
|
||||
static_site_generator: next
|
||||
- name: Install dependencies
|
||||
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} --legacy-peer-deps
|
||||
- name: Build with Next.js
|
||||
run: ${{ steps.detect-package-manager.outputs.runner }} next build
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: frontend/out
|
||||
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
25
.github/workflows/github-release.yml
vendored
Normal file
25
.github/workflows/github-release.yml
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
name: Create new release
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# Runs "At 00:01 every night" (UTC)
|
||||
- cron: '1 0 * * *'
|
||||
|
||||
jobs:
|
||||
create-new-release:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
- name: Parse CHANGELOG.md for yesterday's entries and create a new release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
YESTERDAY=$(date -u --date="yesterday" +%Y-%m-%d)
|
||||
YESTERDAY_CHANGELOG_NOTES=$(awk '/^## '"$YESTERDAY"'/ {f=1; next} f && /^## [0-9]{4}-[0-9]{2}-[0-9]{2}/ {f=0} f && !/^## / {print}' CHANGELOG.md)
|
||||
|
||||
if [ -n "$YESTERDAY_CHANGELOG_NOTES" ]; then
|
||||
gh release create "$YESTERDAY" -t "$YESTERDAY" -n "$YESTERDAY_CHANGELOG_NOTES" --latest
|
||||
fi
|
118
CHANGELOG.md
118
CHANGELOG.md
@ -16,121 +16,15 @@ All LXC instances created using this repository come pre-installed with Midnight
|
||||
> [!IMPORTANT]
|
||||
Do not break established syntax in this file, as it is automatically updated by a Github Workflow
|
||||
|
||||
## 2024-12-12
|
||||
|
||||
### Changed
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- Update jellyfin.sh / Fix infinite loop [@gerpo](https://github.com/gerpo) ([#792](https://github.com/community-scripts/ProxmoxVE/pull/792))
|
||||
|
||||
### 🌐 Website
|
||||
|
||||
- Fix port and website in nextcloudpi.json [@PhoenixEmik](https://github.com/PhoenixEmik) ([#790](https://github.com/community-scripts/ProxmoxVE/pull/790))
|
||||
- Add post-install note to mqtt.json [@havardthom](https://github.com/havardthom) ([#783](https://github.com/community-scripts/ProxmoxVE/pull/783))
|
||||
|
||||
### 🧰 Maintenance
|
||||
|
||||
- Filter pull requests on main branch in changelog-pr.yml [@havardthom](https://github.com/havardthom) ([#793](https://github.com/community-scripts/ProxmoxVE/pull/793))
|
||||
- Fix Z-Wave JS UI Breaking Change in CHANGELOG.md [@havardthom](https://github.com/havardthom) ([#781](https://github.com/community-scripts/ProxmoxVE/pull/781))
|
||||
|
||||
## 2024-12-09
|
||||
|
||||
### Changed
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- Fix PostgreSQL password bug in Umami install [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#750](https://github.com/community-scripts/ProxmoxVE/pull/750))
|
||||
|
||||
## 2024-12-08
|
||||
|
||||
### Changed
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- Use MongoDB 4.4 in Unifi for non-AVX users [@havardthom](https://github.com/havardthom) ([#691](https://github.com/community-scripts/ProxmoxVE/pull/691))
|
||||
|
||||
### 🌐 Website
|
||||
|
||||
- Move homarr to Dashboards section [@CrazyWolf13](https://github.com/CrazyWolf13) ([#740](https://github.com/community-scripts/ProxmoxVE/pull/740))
|
||||
|
||||
## 2024-12-07
|
||||
|
||||
### Changed
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- Zigbee2MQTT: Remove dev branch choice until v2.0.0 release [@havardthom](https://github.com/havardthom) ([#702](https://github.com/community-scripts/ProxmoxVE/pull/702))
|
||||
- Fix Hoarder build failure by installing Chromium stable [@vhsdream](https://github.com/vhsdream) ([#723](https://github.com/community-scripts/ProxmoxVE/pull/723))
|
||||
|
||||
### 🌐 Website
|
||||
|
||||
- Bugfix: Include script name in website search [@havardthom](https://github.com/havardthom) ([#731](https://github.com/community-scripts/ProxmoxVE/pull/731))
|
||||
|
||||
### ❔ Unlabelled
|
||||
|
||||
- Fix broken build.func [@havardthom](https://github.com/havardthom) ([#736](https://github.com/community-scripts/ProxmoxVE/pull/736))
|
||||
|
||||
## 2024-12-06
|
||||
|
||||
### Changed
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- Fix bugs in Komga update [@DysfunctionalProgramming](https://github.com/DysfunctionalProgramming) ([#717](https://github.com/community-scripts/ProxmoxVE/pull/717))
|
||||
- Bookstack: Fix Update function composer [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#700](https://github.com/community-scripts/ProxmoxVE/pull/700))
|
||||
|
||||
### 🌐 Website
|
||||
|
||||
- fix: note component in json-editor getting out of focus when typing and revert theme switch animation [@BramSuurdje](https://github.com/BramSuurdje) ([#706](https://github.com/community-scripts/ProxmoxVE/pull/706))
|
||||
|
||||
### 🧰 Maintenance
|
||||
|
||||
- Update frontend CI/CD workflow [@havardthom](https://github.com/havardthom) ([#703](https://github.com/community-scripts/ProxmoxVE/pull/703))
|
||||
|
||||
## 2024-12-05
|
||||
|
||||
### Changed
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- PostgreSQL: Change authentication method from peer to md5 for UNIX sockets [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#650](https://github.com/community-scripts/ProxmoxVE/pull/650))
|
||||
- Fix stdout in unifi.sh [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#688](https://github.com/community-scripts/ProxmoxVE/pull/688))
|
||||
- Fix `rm` bug in Vikunja update [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#692](https://github.com/community-scripts/ProxmoxVE/pull/692))
|
||||
|
||||
## 2024-12-04
|
||||
|
||||
### Changed
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- Update Spelling 'Environment' in nginxproxymanager [@MathijsG](https://github.com/MathijsG) ([#676](https://github.com/community-scripts/ProxmoxVE/pull/676))
|
||||
|
||||
### 🌐 Website
|
||||
|
||||
- Update homepage.json documentation and website links [@patchmonkey](https://github.com/patchmonkey) ([#668](https://github.com/community-scripts/ProxmoxVE/pull/668))
|
||||
|
||||
## 2024-12-03
|
||||
|
||||
### Changed
|
||||
|
||||
### ✨ New Scripts
|
||||
|
||||
- New Script: Onedev [@quantumryuu](https://github.com/quantumryuu) ([#612](https://github.com/community-scripts/ProxmoxVE/pull/612))
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- Script Update: SnipeIT [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#641](https://github.com/community-scripts/ProxmoxVE/pull/641))
|
||||
|
||||
## 2024-12-02
|
||||
|
||||
### Changed
|
||||
|
||||
### ✨ New Scripts
|
||||
|
||||
- New Script: Hoarder LXC [@vhsdream](https://github.com/vhsdream) ([#567](https://github.com/community-scripts/ProxmoxVE/pull/567))
|
||||
- New script: SnipeIT LXC [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#538](https://github.com/community-scripts/ProxmoxVE/pull/538))
|
||||
- New Script: Glance [@quantumryuu](https://github.com/quantumryuu) ([#595](https://github.com/community-scripts/ProxmoxVE/pull/595))
|
||||
- New script: SnipeIT LXC [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#538](https://github.com/community-scripts/ProxmoxVE/pull/538))
|
||||
- New Script: Hoarder LXC [@vhsdream](https://github.com/vhsdream) ([#567](https://github.com/community-scripts/ProxmoxVE/pull/567))
|
||||
- New script: Unbound LXC [@wimb0](https://github.com/wimb0) ([#547](https://github.com/community-scripts/ProxmoxVE/pull/547))
|
||||
- New script: Mylar3 LXC [@davalanche](https://github.com/davalanche) ([#554](https://github.com/community-scripts/ProxmoxVE/pull/554))
|
||||
|
||||
@ -141,8 +35,6 @@ Do not break established syntax in this file, as it is automatically updated by
|
||||
|
||||
### 🌐 Website
|
||||
|
||||
- chore: Update unbound logo to have only the actual logo [@BramSuurdje](https://github.com/BramSuurdje) ([#648](https://github.com/community-scripts/ProxmoxVE/pull/648))
|
||||
- fix: vaultwarden info mismatch [@BramSuurdje](https://github.com/BramSuurdje) ([#645](https://github.com/community-scripts/ProxmoxVE/pull/645))
|
||||
- Wallos json fix [@quantumryuu](https://github.com/quantumryuu) ([#630](https://github.com/community-scripts/ProxmoxVE/pull/630))
|
||||
|
||||
## 2024-11-30
|
||||
@ -176,17 +68,13 @@ Do not break established syntax in this file, as it is automatically updated by
|
||||
|
||||
### Changed
|
||||
|
||||
### 💥 Breaking Changes
|
||||
|
||||
- Fix Z-Wave JS UI script [@MickLesk](https://github.com/MickLesk) ([#546](https://github.com/community-scripts/ProxmoxVE/pull/546))
|
||||
- [Migration guide](https://github.com/community-scripts/ProxmoxVE/discussions/635)
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- Add vitest, add json validation tests, fix broken json files [@havardthom](https://github.com/havardthom) ([#566](https://github.com/community-scripts/ProxmoxVE/pull/566))
|
||||
- Add update script to Pocketbase [@dsiebel](https://github.com/dsiebel) ([#535](https://github.com/community-scripts/ProxmoxVE/pull/535))
|
||||
- Fix MongoDB install in Unifi script [@havardthom](https://github.com/havardthom) ([#564](https://github.com/community-scripts/ProxmoxVE/pull/564))
|
||||
- Remove changing DISK_REF for zfspool mikrotik-routeros.sh [@tjcomserv](https://github.com/tjcomserv) ([#529](https://github.com/community-scripts/ProxmoxVE/pull/529))
|
||||
- Fix Z-Wave JS UI script [@MickLesk](https://github.com/MickLesk) ([#546](https://github.com/community-scripts/ProxmoxVE/pull/546))
|
||||
|
||||
### 🌐 Website
|
||||
|
||||
|
109
README.md
109
README.md
@ -1,7 +1,112 @@
|
||||
This project is intended for personal use. You likely won't find my versions of these scripts to be all that helpful.
|
||||
<div align="center">
|
||||
<p align="center">
|
||||
<a href="#">
|
||||
<img src="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/images/logo.png" height="100px" />
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Visit https://helper-scripts.com for the originals
|
||||
<div style="border: 2px solid #d1d5db; padding: 20px; border-radius: 8px; background-color: #f9fafb;">
|
||||
<h2 align="center">Proxmox VE Helper-Scripts: A Community Legacy</h2>
|
||||
<p>Dear Community,</p>
|
||||
<p>In agreement with <a href="https://github.com/tteck">tteck</a> and <a href="https://github.com/community-scripts">Community-Scripts</a>, this project has now transitioned into a community-driven effort. We aim to continue his work, building on the foundation he laid to support Proxmox users worldwide. Tteck sadly <a href="https://github.com/community-scripts/ProxmoxVE/discussions/237">passed away in early November 2024</a>. This project will be a memorial for his incredible contribution to the community.</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://helper-scripts.com">
|
||||
<img src="https://img.shields.io/badge/Website-4c9b3f?style=for-the-badge&logo=github&logoColor=white" alt="Website" />
|
||||
</a>
|
||||
<a href="https://github.com/community-scripts/ProxmoxVE/blob/main/.github/CONTRIBUTING.md">
|
||||
<img src="https://img.shields.io/badge/Contribute-ff4785?style=for-the-badge&logo=git&logoColor=white" alt="Contribute" />
|
||||
</a>
|
||||
<a href="https://github.com/community-scripts/ProxmoxVE/blob/main/USER_SUBMITTED_GUIDES.md">
|
||||
<img src="https://img.shields.io/badge/Guides-0077b5?style=for-the-badge&logo=read-the-docs&logoColor=white" alt="Guides" />
|
||||
</a>
|
||||
<a href="https://discord.gg/UHrpNWGwkH">
|
||||
<img src="https://img.shields.io/badge/Discord-7289da?style=for-the-badge&logo=discord&logoColor=white" alt="Discord" />
|
||||
</a>
|
||||
<a href="https://github.com/community-scripts/ProxmoxVE/blob/main/CHANGELOG.md">
|
||||
<img src="https://img.shields.io/badge/Changelog-6c5ce7?style=for-the-badge&logo=git&logoColor=white" alt="Changelog" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
|
||||
## 🚀 Introduction
|
||||
|
||||
**Proxmox VE Helper-Scripts** is a community-driven initiative that simplifies the setup of Proxmox Virtual Environment (VE). Originally created by [tteck](https://github.com/tteck), these scripts automate and streamline the process of creating and configuring Linux containers (LXC) and virtual machines (VMs) on Proxmox VE.
|
||||
|
||||
---
|
||||
|
||||
## 📦 Features
|
||||
|
||||
- **Interactive Setup**: Select simple or advanced options for your VM or LXC container configurations.
|
||||
- **Customizable Configuration**: Advanced setup allows you to fine-tune your environment.
|
||||
- **Ease of Use**: Scripts automatically validate inputs to generate the final configuration.
|
||||
- **Proxmox Integration**: Seamlessly integrates with Proxmox VE to provide a user-friendly experience.
|
||||
- **Community-Driven**: This project is actively maintained and improved by the community.
|
||||
|
||||
<hr>
|
||||
|
||||
## 🚀 Installation
|
||||
|
||||
To install the Proxmox Helper Scripts, simply follow these steps:
|
||||
|
||||
1. Open the [Website](https://helper-scripts.com/)
|
||||
2. Search for the desired script, e.g. **"Home Assistant OS VM"**.
|
||||
3. In the **"How To Install"** section, copy the provided **Bash command**.
|
||||
4. Open the Proxmox shell on your **main node**.
|
||||
5. Paste the command into the console, hit enter, and you are away! 🚀
|
||||
|
||||
For detailed instructions, check out our [official guides](https://github.com/community-scripts/ProxmoxVE/blob/main/USER_SUBMITTED_GUIDES.md).
|
||||
|
||||
---
|
||||
|
||||
## ❤️ Community and Contributions
|
||||
|
||||
The Proxmox Helper Scripts project is community-driven, and we highly appreciate any contributions — whether it's through reporting bugs, suggesting features, improving documentation, or spreading the word. We are committed to maintaining transparency and sustainability in this open-source effort.
|
||||
|
||||
### 💖 Donate to Support the Project
|
||||
|
||||
We offer two donation options to help maintain and grow this project:
|
||||
|
||||
- **Ko-Fi for tteck**: [Donate to tteck's wife](https://ko-fi.com/proxmoxhelperscripts) - All donations will go directly to Angie, wife of the founder of this project [who passed away in early November 2024](https://github.com/community-scripts/ProxmoxVE/discussions/237).
|
||||
- **Ko-Fi for Community Edition**: [Donate to this project](https://ko-fi.com/community_scripts) - All funds will go towards script maintenance infrastructure and server costs. **Our most immediate need is funding testing infrastructure**. Your contributions help keep the project running. To honor tteck's legacy this project will also raise money for charity (cancer research, hospice care). Of the money donated to this project, 30% will be donated to charity. Income, expenditure and charitable donations will be disclosed annually in a transparent manner.
|
||||
|
||||
<hr>
|
||||
|
||||
## 💬 Get Help
|
||||
|
||||
Have a question or ran into an issue? Join the conversation and get help from fellow community members:
|
||||
|
||||
- **Discord**: Join our [Proxmox Helper Scripts Discord server](https://discord.gg/UHrpNWGwkH) to chat with other users and get support.
|
||||
- **GitHub Discussions**: [Ask questions or report issues](https://github.com/community-scripts/ProxmoxVE/discussions).
|
||||
|
||||
<hr>
|
||||
|
||||
## 🤝 Found a bug or missing feature?
|
||||
|
||||
If you’ve encountered an issue or identified an area for improvement, please file a new issue on our [GitHub issues page](https://github.com/community-scripts/ProxmoxVE/issues). If you’ve already found a solution or improvement, feel free to submit a pull request! We’d love to review and merge your contributions.
|
||||
|
||||
<hr>
|
||||
|
||||
## ✅ Requirements
|
||||
|
||||
To use the Proxmox VE Helper-Scripts, your system should meet the following requirements:
|
||||
|
||||
- **Proxmox VE version**: 8.x or higher
|
||||
- **Linux**: Compatible with most distributions
|
||||
- **Dependencies**: Ensure that your system has bash and curl installed.
|
||||
|
||||
<hr>
|
||||
|
||||
## 📜 License
|
||||
|
||||
This project is licensed under the terms of the [MIT License](LICENSE).
|
||||
|
||||
---
|
||||
|
||||
## 📢 Acknowledgments
|
||||
|
||||
This community project is a memorial to the memory of [tteck](https://github.com/tteck). His foundational work created a thriving Proxmox community. Tteck worked on this project right until the end, even while in hospice. We are dedicated to keeping his vision alive and expanding upon it with the continued support of this vibrant community.
|
||||
|
||||
Proxmox® is a registered trademark of [Proxmox Server Solutions GmbH](https://www.proxmox.com/en/about/company).
|
@ -1,5 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -s https://git.thewrightserver.net/josh/ProxmoxVE/raw/branch/main/misc/build.func)
|
||||
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2021-2024 tteck
|
||||
# Author: tteck (tteckster)
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
@ -29,7 +33,7 @@ function default_settings() {
|
||||
CT_TYPE="1"
|
||||
PW=""
|
||||
CT_ID=$NEXTID
|
||||
HN="VaultWarden"
|
||||
HN=$NSAPP
|
||||
DISK_SIZE="$var_disk"
|
||||
CORE_COUNT="$var_cpu"
|
||||
RAM_SIZE="$var_ram"
|
||||
@ -41,7 +45,7 @@ function default_settings() {
|
||||
DISABLEIP6="no"
|
||||
MTU=""
|
||||
SD=""
|
||||
NS="-nameserver=1.1.1.1"
|
||||
NS=""
|
||||
MAC=""
|
||||
VLAN=""
|
||||
SSH="no"
|
||||
|
@ -24,7 +24,7 @@ var_disk="0.1"
|
||||
var_cpu="1"
|
||||
var_ram="512"
|
||||
var_os="alpine"
|
||||
var_version="3.19"
|
||||
var_version="3.20"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
@ -70,10 +70,9 @@ if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_v
|
||||
unzip -q v${RELEASE}.zip
|
||||
mv BookStack-${RELEASE} /opt/bookstack
|
||||
mv /opt/.env /opt/bookstack/.env
|
||||
cd /opt/bookstack
|
||||
COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev &>/dev/null
|
||||
php artisan key:generate --force &>/dev/null
|
||||
php artisan migrate --force &>/dev/null
|
||||
php artisan key:generate &>/dev/null
|
||||
php artisan migrate &>/dev/null
|
||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||
msg_ok "Updated ${APP}"
|
||||
|
||||
|
@ -1,15 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2024 tteck
|
||||
# Author: tteck (tteckster)
|
||||
# Co-Author: MickLesk
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
# This sets verbose mode if the global variable is set to "yes"
|
||||
# if [ "$VERBOSE" == "yes" ]; then set -x; fi
|
||||
|
||||
# This function sets color variables for formatting output in the terminal
|
||||
# Colors
|
||||
YW=$(echo "\033[33m")
|
||||
YWB=$(echo "\033[93m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BGN=$(echo "\033[4;92m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
DGN=$(echo "\033[32m")
|
||||
|
||||
# Formatting
|
||||
CL=$(echo "\033[m")
|
||||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
UL=$(echo "\033[4m")
|
||||
BOLD=$(echo "\033[1m")
|
||||
BFR="\\r\\033[K"
|
||||
HOLD=" "
|
||||
TAB=" "
|
||||
|
||||
# Icons
|
||||
CM="${TAB}✔️${TAB}${CL}"
|
||||
CROSS="${TAB}✖️${TAB}${CL}"
|
||||
INFO="${TAB}💡${TAB}${CL}"
|
||||
|
||||
# This sets error handling options and defines the error_handler function to handle errors
|
||||
set -Eeuo pipefail
|
||||
@ -28,19 +49,24 @@ function error_handler() {
|
||||
|
||||
# This function displays a spinner.
|
||||
function spinner() {
|
||||
local chars="/-\|"
|
||||
local spin_i=0
|
||||
printf "\e[?25l"
|
||||
while true; do
|
||||
printf "\r \e[36m%s\e[0m" "${chars:spin_i++%${#chars}:1}"
|
||||
sleep 0.1
|
||||
done
|
||||
local frames=('⠋' '⠙' '⠹' '⠸' '⠼' '⠴' '⠦' '⠧' '⠇' '⠏')
|
||||
local spin_i=0
|
||||
local interval=0.1
|
||||
printf "\e[?25l"
|
||||
|
||||
local color="${YWB}"
|
||||
|
||||
while true; do
|
||||
printf "\r ${color}%s${CL}" "${frames[spin_i]}"
|
||||
spin_i=$(( (spin_i + 1) % ${#frames[@]} ))
|
||||
sleep "$interval"
|
||||
done
|
||||
}
|
||||
|
||||
# This function displays an informational message with a yellow color.
|
||||
function msg_info() {
|
||||
local msg="$1"
|
||||
echo -ne " ${HOLD} ${YW}${msg} "
|
||||
echo -ne "${TAB}${YW}${msg}"
|
||||
spinner &
|
||||
SPINNER_PID=$!
|
||||
}
|
||||
@ -50,7 +76,7 @@ function msg_ok() {
|
||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi
|
||||
printf "\e[?25h"
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
||||
echo -e "${BFR}${CM}${GN}${msg}${CL}"
|
||||
}
|
||||
|
||||
# This function displays a error message with a red color.
|
||||
@ -58,7 +84,7 @@ function msg_error() {
|
||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi
|
||||
printf "\e[?25h"
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
echo -e "${BFR}${CROSS}${RD}${msg}${CL}"
|
||||
}
|
||||
|
||||
# This checks for the presence of valid Container Storage and Template Storage locations
|
||||
@ -97,7 +123,7 @@ function select_storage() {
|
||||
local TAG=$(echo $line | awk '{print $1}')
|
||||
local TYPE=$(echo $line | awk '{printf "%-10s", $2}')
|
||||
local FREE=$(echo $line | numfmt --field 4-6 --from-unit=K --to=iec --format %.2f | awk '{printf( "%9sB", $6)}')
|
||||
local ITEM=" Type: $TYPE Free: $FREE "
|
||||
local ITEM="Type: $TYPE Free: $FREE "
|
||||
local OFFSET=2
|
||||
if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
|
||||
local MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
|
||||
|
@ -61,7 +61,7 @@ if [[ ! -d /usr/lib/jellyfin ]]; then msg_error "No ${APP} Installation Found!";
|
||||
msg_info "Updating ${APP} LXC"
|
||||
apt-get update &>/dev/null
|
||||
apt-get -y upgrade &>/dev/null
|
||||
apt-get -y --with-new-pkgs upgrade jellyfin jellyfin-server &>/dev/null
|
||||
apt-get --with-new-pkgs upgrade jellyfin jellyfin-server &>/dev/null
|
||||
msg_ok "Updated ${APP} LXC"
|
||||
exit
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -f /opt/komga/komga.jar ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||
if [[ ! -f /opt/komga/komga*.jar ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||
msg_info "Updating ${APP}"
|
||||
RELEASE=$(curl -s https://api.github.com/repos/gotson/komga/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
||||
@ -65,8 +65,8 @@ if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_v
|
||||
msg_ok "Stopped ${APP}"
|
||||
|
||||
msg_info "Updating ${APP} to ${RELEASE}"
|
||||
wget -q "https://github.com/gotson/komga/releases/download/${RELEASE}/komga-${RELEASE}.jar"
|
||||
rm -rf /opt/komga/komga.jar
|
||||
rm -rf /opt/komga/komga*.jar
|
||||
wget -q "https://github.com/gotson/komga/releases/download/v${RELEASE}/komga-${RELEASE}.jar"
|
||||
mv -f komga-${RELEASE}.jar /opt/komga/komga.jar
|
||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||
msg_ok "Updated ${APP} to ${RELEASE}"
|
||||
|
99
ct/onedev.sh
99
ct/onedev.sh
@ -1,99 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2021-2024 community-scripts ORG
|
||||
# Author: kristocopani
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
____ ____
|
||||
/ __ \____ ___ / __ \___ _ __
|
||||
/ / / / __ \/ _ \/ / / / _ \ | / /
|
||||
/ /_/ / / / / __/ /_/ / __/ |/ /
|
||||
\____/_/ /_/\___/_____/\___/|___/
|
||||
|
||||
EOF
|
||||
}
|
||||
header_info
|
||||
echo -e "Loading..."
|
||||
APP="OneDev"
|
||||
var_disk="4"
|
||||
var_cpu="2"
|
||||
var_ram="2048"
|
||||
var_os="debian"
|
||||
var_version="12"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function default_settings() {
|
||||
CT_TYPE="1"
|
||||
PW=""
|
||||
CT_ID=$NEXTID
|
||||
HN=$NSAPP
|
||||
DISK_SIZE="$var_disk"
|
||||
CORE_COUNT="$var_cpu"
|
||||
RAM_SIZE="$var_ram"
|
||||
BRG="vmbr0"
|
||||
NET="dhcp"
|
||||
GATE=""
|
||||
APT_CACHER=""
|
||||
APT_CACHER_IP=""
|
||||
DISABLEIP6="no"
|
||||
MTU=""
|
||||
SD=""
|
||||
NS=""
|
||||
MAC=""
|
||||
VLAN=""
|
||||
SSH="no"
|
||||
VERB="no"
|
||||
echo_default
|
||||
}
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -f /etc/systemd/system/onedev.service ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
GITHUB_RELEASE=$(curl -s https://api.github.com/repos/theonedev/onedev/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${GITHUB_RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop onedev
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
msg_info "Updating ${APP} to v${GITHUB_RELEASE}"
|
||||
cd /opt
|
||||
wget -q https://code.onedev.io/onedev/server/~site/onedev-latest.tar.gz
|
||||
tar -xzf onedev-latest.tar.gz
|
||||
/opt/onedev-latest/bin/upgrade.sh /opt/onedev >/dev/null
|
||||
RELEASE=$(cat /opt/onedev/release.properties | grep "version" | cut -d'=' -f2)
|
||||
echo "${RELEASE}" >"/opt/${APP}_version.txt"
|
||||
msg_ok "Updated ${APP} to v${RELEASE}"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start onedev
|
||||
msg_ok "Started Service"
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -rf /opt/onedev-latest
|
||||
rm -rf /opt/onedev-latest.tar.gz
|
||||
msg_ok "Cleaned"
|
||||
msg_ok "Updated Successfully"
|
||||
else
|
||||
msg_ok "No update required. ${APP} is already at v${RELEASE}."
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${APP} should be reachable by going to the following URL.
|
||||
${BL}http://${IP}:6610${CL} \n"
|
@ -58,36 +58,32 @@ header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -d /opt/snipe-it ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||
msg_info "Updating ${APP} LXC"
|
||||
apt-get update &>/dev/null
|
||||
apt-get -y upgrade &>/dev/null
|
||||
mv /opt/snipe-it /opt/snipe-it-backup
|
||||
cd /opt
|
||||
RELEASE=$(curl -s https://api.github.com/repos/snipe/snipe-it/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
||||
msg_info "Updating ${APP} to v${RELEASE}"
|
||||
apt-get update &>/dev/null
|
||||
apt-get -y upgrade &>/dev/null
|
||||
mv /opt/snipe-it /opt/snipe-it-backup
|
||||
cd /opt
|
||||
wget -q "https://github.com/snipe/snipe-it/archive/refs/tags/v${RELEASE}.zip" &>/dev/null
|
||||
unzip -q v${RELEASE}.zip
|
||||
mv snipe-it-${RELEASE} /opt/snipe-it
|
||||
cp /opt/snipe-it-backup/.env /opt/snipe-it/.env
|
||||
cp -r /opt/snipe-it-backup/public/uploads/ /opt/snipe-it/public/uploads/
|
||||
cp -r /opt/snipe-it-backup/storage/private_uploads /opt/snipe-it/storage/private_uploads
|
||||
cd /opt/snipe-it/
|
||||
export COMPOSER_ALLOW_SUPERUSER=1
|
||||
composer install --no-dev --prefer-source &>/dev/null
|
||||
composer dump-autoload &>/dev/null
|
||||
php artisan migrate --force &>/dev/null
|
||||
php artisan config:clear &>/dev/null
|
||||
php artisan route:clear &>/dev/null
|
||||
php artisan cache:clear &>/dev/null
|
||||
php artisan view:clear &>/dev/null
|
||||
chown -R www-data: /opt/snipe-it
|
||||
chmod -R 755 /opt/snipe-it
|
||||
rm -rf /opt/v${RELEASE}.zip
|
||||
rm -rf /opt/snipe-it-backup
|
||||
msg_ok "Updated ${APP} LXC"
|
||||
else
|
||||
msg_ok "No update required. ${APP} is already at v${RELEASE}."
|
||||
fi
|
||||
wget -q "https://github.com/snipe/snipe-it/archive/refs/tags/v${RELEASE}.zip" &>/dev/null
|
||||
unzip -q v${RELEASE}.zip
|
||||
mv snipe-it-${RELEASE} /opt/snipe-it
|
||||
cp /opt/snipe-it-backup/.env /opt/snipe-it/.env
|
||||
cp -r /opt/snipe-it-backup/public/uploads/ /opt/snipe-it/public/uploads/
|
||||
cp -r /opt/snipe-it-backup/storage/private_uploads /opt/snipe-it/storage/private_uploads
|
||||
cd /opt/snipe-it/
|
||||
export COMPOSER_ALLOW_SUPERUSER=1
|
||||
composer install --no-dev --prefer-source &>/dev/null
|
||||
composer dump-autoload &>/dev/null
|
||||
php artisan migrate --force &>/dev/null
|
||||
php artisan config:clear &>/dev/null
|
||||
php artisan route:clear &>/dev/null
|
||||
php artisan cache:clear &>/dev/null
|
||||
php artisan view:clear &>/dev/null
|
||||
chown -R www-data: /opt/snipe-it
|
||||
chmod -R 755 /opt/snipe-it
|
||||
rm -rf /opt/v${RELEASE}.zip
|
||||
rm -rf /opt/snipe-it-backup
|
||||
msg_ok "Updated ${APP} LXC"
|
||||
exit
|
||||
}
|
||||
|
||||
|
@ -58,8 +58,8 @@ check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -d /usr/lib/unifi ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||
msg_info "Updating ${APP}"
|
||||
apt-get update --allow-releaseinfo-change &>/dev/null
|
||||
apt-get install -y unifi &>/dev/null
|
||||
apt-get update --allow-releaseinfo-change
|
||||
apt-get install -y unifi
|
||||
msg_ok "Updated Successfully"
|
||||
exit
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_v
|
||||
|
||||
msg_info "Updating ${APP} to ${RELEASE}"
|
||||
cd /opt
|
||||
rm -rf /opt/vikunja/vikunja
|
||||
rm -rf /opt/*
|
||||
wget -q "https://dl.vikunja.io/vikunja/$RELEASE/vikunja-$RELEASE-amd64.deb"
|
||||
DEBIAN_FRONTEND=noninteractive dpkg -i vikunja-$RELEASE-amd64.deb &>/dev/null
|
||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||
|
@ -12,7 +12,7 @@ import { cn } from "@/lib/utils";
|
||||
import { PlusCircle, Trash2 } from "lucide-react";
|
||||
import { z } from "zod";
|
||||
import { ScriptSchema, type Script } from "../_schemas/schemas";
|
||||
import { memo, useCallback, useRef } from "react";
|
||||
import { memo, useCallback } from "react";
|
||||
|
||||
type NoteProps = {
|
||||
script: Script;
|
||||
@ -27,8 +27,6 @@ function Note({
|
||||
setIsValid,
|
||||
setZodErrors,
|
||||
}: NoteProps) {
|
||||
const inputRefs = useRef<(HTMLInputElement | null)[]>([]);
|
||||
|
||||
const addNote = useCallback(() => {
|
||||
setScript({
|
||||
...script,
|
||||
@ -51,12 +49,6 @@ function Note({
|
||||
setIsValid(result.success);
|
||||
setZodErrors(result.success ? null : result.error);
|
||||
setScript(updated);
|
||||
// Restore focus after state update
|
||||
if (key === "text") {
|
||||
setTimeout(() => {
|
||||
inputRefs.current[index]?.focus();
|
||||
}, 0);
|
||||
}
|
||||
}, [script, setScript, setIsValid, setZodErrors]);
|
||||
|
||||
const removeNote = useCallback((index: number) => {
|
||||
@ -66,51 +58,46 @@ function Note({
|
||||
});
|
||||
}, [script, setScript]);
|
||||
|
||||
const NoteItem = memo(
|
||||
({ note, index }: { note: Script["notes"][number]; index: number }) => (
|
||||
<div className="space-y-2 border p-4 rounded">
|
||||
<Input
|
||||
placeholder="Note Text"
|
||||
value={note.text}
|
||||
onChange={(e) => updateNote(index, "text", e.target.value)}
|
||||
ref={(el) => {
|
||||
inputRefs.current[index] = el;
|
||||
}}
|
||||
/>
|
||||
<Select
|
||||
value={note.type}
|
||||
onValueChange={(value) => updateNote(index, "type", value)}
|
||||
>
|
||||
<SelectTrigger className="flex-1">
|
||||
<SelectValue placeholder="Type" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{Object.keys(AlertColors).map((type) => (
|
||||
<SelectItem key={type} value={type}>
|
||||
<span className="flex items-center gap-2">
|
||||
{type.charAt(0).toUpperCase() + type.slice(1)}{" "}
|
||||
<div
|
||||
className={cn(
|
||||
"size-4 rounded-full border",
|
||||
AlertColors[type as keyof typeof AlertColors],
|
||||
)}
|
||||
/>
|
||||
</span>
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="destructive"
|
||||
type="button"
|
||||
onClick={() => removeNote(index)}
|
||||
>
|
||||
<Trash2 className="mr-2 h-4 w-4" /> Remove Note
|
||||
</Button>
|
||||
</div>
|
||||
),
|
||||
);
|
||||
const NoteItem = memo(({ note, index }: { note: Script["notes"][number], index: number }) => (
|
||||
<div className="space-y-2 border p-4 rounded">
|
||||
<Input
|
||||
placeholder="Note Text"
|
||||
value={note.text}
|
||||
onChange={(e) => updateNote(index, "text", e.target.value)}
|
||||
/>
|
||||
<Select
|
||||
value={note.type}
|
||||
onValueChange={(value) => updateNote(index, "type", value)}
|
||||
>
|
||||
<SelectTrigger className="flex-1">
|
||||
<SelectValue placeholder="Type" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{Object.keys(AlertColors).map((type) => (
|
||||
<SelectItem key={type} value={type}>
|
||||
<span className="flex items-center gap-2">
|
||||
{type.charAt(0).toUpperCase() + type.slice(1)}{" "}
|
||||
<div
|
||||
className={cn(
|
||||
"size-4 rounded-full border",
|
||||
AlertColors[type as keyof typeof AlertColors],
|
||||
)}
|
||||
/>
|
||||
</span>
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="destructive"
|
||||
type="button"
|
||||
onClick={() => removeNote(index)}
|
||||
>
|
||||
<Trash2 className="mr-2 h-4 w-4" /> Remove Note
|
||||
</Button>
|
||||
</div>
|
||||
));
|
||||
|
||||
NoteItem.displayName = 'NoteItem';
|
||||
|
||||
|
@ -56,7 +56,7 @@ export default function ScriptAccordion({
|
||||
value={expandedItem}
|
||||
onValueChange={handleAccordionChange}
|
||||
collapsible
|
||||
className="overflow-y-scroll max-h-[calc(100vh-220px)] overflow-x-hidden mt-3 p-2"
|
||||
className="overflow-y-scroll max-h-[calc(100vh-210px)] overflow-x-hidden mt-3 p-2"
|
||||
>
|
||||
{items.map((category) => (
|
||||
<AccordionItem
|
||||
|
@ -95,7 +95,7 @@ export default function CommandMenu() {
|
||||
{category.scripts.map((script) => (
|
||||
<CommandItem
|
||||
key={`script:${script.slug}`}
|
||||
value={`${script.slug}-${script.name}`}
|
||||
value={script.slug}
|
||||
onSelect={() => {
|
||||
setOpen(false);
|
||||
router.push(`/scripts?id=${script.slug}`);
|
||||
|
@ -30,6 +30,24 @@
|
||||
--chart-3: 197 37% 24%;
|
||||
--chart-4: 43 74% 66%;
|
||||
--chart-5: 27 87% 67%;
|
||||
--expo-out: linear(
|
||||
0 0%,
|
||||
0.1684 2.66%,
|
||||
0.3165 5.49%,
|
||||
0.446 8.52%,
|
||||
0.5581 11.78%,
|
||||
0.6535 15.29%,
|
||||
0.7341 19.11%,
|
||||
0.8011 23.3%,
|
||||
0.8557 27.93%,
|
||||
0.8962 32.68%,
|
||||
0.9283 38.01%,
|
||||
0.9529 44.08%,
|
||||
0.9711 51.14%,
|
||||
0.9833 59.06%,
|
||||
0.9915 68.74%,
|
||||
1 100%
|
||||
);
|
||||
}
|
||||
|
||||
::selection {
|
||||
@ -63,6 +81,42 @@
|
||||
--chart-4: 280 65% 60%;
|
||||
--chart-5: 340 75% 55%;
|
||||
}
|
||||
|
||||
::view-transition-group(root) {
|
||||
animation-duration: 0.7bun s;
|
||||
animation-timing-function: var(--expo-out);
|
||||
}
|
||||
|
||||
::view-transition-new(root) {
|
||||
animation-name: reveal-light;
|
||||
}
|
||||
|
||||
::view-transition-old(root),
|
||||
.dark::view-transition-old(root) {
|
||||
animation: none;
|
||||
z-index: -1;
|
||||
}
|
||||
.dark::view-transition-new(root) {
|
||||
animation-name: reveal-dark;
|
||||
}
|
||||
|
||||
@keyframes reveal-dark {
|
||||
from {
|
||||
clip-path: polygon(50% -71%, -50% 71%, -50% 71%, 50% -71%);
|
||||
}
|
||||
to {
|
||||
clip-path: polygon(50% -71%, -50% 71%, 50% 171%, 171% 50%);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes reveal-light {
|
||||
from {
|
||||
clip-path: polygon(171% 50%, 50% 171%, 50% 171%, 171% 50%);
|
||||
}
|
||||
to {
|
||||
clip-path: polygon(171% 50%, 50% 171%, -50% 71%, 50% -71%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@layer base {
|
||||
|
@ -22,8 +22,7 @@ $STD apt-get install -y \
|
||||
sudo \
|
||||
gnupg \
|
||||
ca-certificates \
|
||||
chromium/stable \
|
||||
chromium-common/stable \
|
||||
chromium \
|
||||
mc
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
|
@ -80,7 +80,7 @@ else
|
||||
cd ./nginx-proxy-manager-${RELEASE}
|
||||
msg_ok "Downloaded Nginx Proxy Manager v${RELEASE}"
|
||||
fi
|
||||
msg_info "Setting up Environment"
|
||||
msg_info "Setting up Enviroment"
|
||||
ln -sf /usr/bin/python3 /usr/bin/python
|
||||
ln -sf /usr/bin/certbot /opt/certbot/bin/certbot
|
||||
ln -sf /usr/local/openresty/nginx/sbin/nginx /usr/sbin/nginx
|
||||
|
@ -1,44 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2024 community-scripts ORG
|
||||
# Author: kristocopani
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
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 \
|
||||
curl \
|
||||
mc \
|
||||
sudo \
|
||||
default-jdk \
|
||||
git
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
|
||||
msg_info "Installing OneDev"
|
||||
cd /opt
|
||||
wget -q https://code.onedev.io/onedev/server/~site/onedev-latest.tar.gz
|
||||
tar -xzf onedev-latest.tar.gz
|
||||
mv /opt/onedev-latest /opt/onedev
|
||||
$STD /opt/onedev/bin/server.sh install
|
||||
systemctl start onedev
|
||||
RELEASE=$(cat /opt/onedev/release.properties | grep "version" | cut -d'=' -f2)
|
||||
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
|
||||
msg_ok "Installed OneDev"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -rf /opt/onedev-latest.tar.gz
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
@ -35,7 +35,7 @@ cat <<EOF >/etc/postgresql/17/main/pg_hba.conf
|
||||
local all postgres peer
|
||||
# TYPE DATABASE USER ADDRESS METHOD
|
||||
# "local" is for Unix domain socket connections only
|
||||
local all all md5
|
||||
local all all peer
|
||||
# IPv4 local connections:
|
||||
host all all 127.0.0.1/32 scram-sha-256
|
||||
host all all 0.0.0.0/24 md5
|
||||
|
@ -45,7 +45,6 @@ msg_ok "Set up database"
|
||||
msg_info "Installing Snipe-IT"
|
||||
cd /opt
|
||||
RELEASE=$(curl -s https://api.github.com/repos/snipe/snipe-it/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
|
||||
wget -q "https://github.com/snipe/snipe-it/archive/refs/tags/v${RELEASE}.zip"
|
||||
unzip -q v${RELEASE}.zip
|
||||
mv snipe-it-${RELEASE} /opt/snipe-it
|
||||
|
@ -37,7 +37,7 @@ msg_ok "Installed Node.js"
|
||||
msg_info "Setting up postgresql"
|
||||
DB_NAME=umamidb
|
||||
DB_USER=umami
|
||||
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
||||
DB_PASS="$(openssl rand -base64 18 | cut -c1-13)"
|
||||
SECRET_KEY="$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)"
|
||||
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
|
||||
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;"
|
||||
|
@ -30,15 +30,16 @@ msg_ok "Installed Eclipse Temurin JRE"
|
||||
|
||||
if ! grep -q -m1 'avx[^ ]*' /proc/cpuinfo; then
|
||||
msg_ok "No AVX Support Detected"
|
||||
msg_info "Installing MongoDB 4.4"
|
||||
msg_info "Installing MongoDB 4.2"
|
||||
if ! dpkg -l | grep -q "libssl1.1"; then
|
||||
wget -q http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.1n-0+deb10u6_amd64.deb
|
||||
$STD dpkg -i libssl1.1_1.1.1n-0+deb10u6_amd64.deb
|
||||
$STD apt-get install -f -y # Fix any broken dependencies
|
||||
fi
|
||||
wget -qO- https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor > /usr/share/keyrings/mongodb-server-4.4.gpg
|
||||
echo "deb [signed-by=/usr/share/keyrings/mongodb-server-4.4.gpg] https://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" >/etc/apt/sources.list.d/mongodb-org-4.4.list
|
||||
wget -qO- https://www.mongodb.org/static/pgp/server-4.2.asc | gpg --dearmor > /usr/share/keyrings/mongodb-server-4.2.gpg
|
||||
echo "deb [signed-by=/usr/share/keyrings/mongodb-server-4.2.gpg] https://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" >/etc/apt/sources.list.d/mongodb-org-4.2.list
|
||||
$STD apt-get update
|
||||
$STD apt-get install -y mongodb-org
|
||||
$STD apt-get install -y mongodb-org=4.2.17
|
||||
else
|
||||
msg_info "Installing MongoDB 7.0"
|
||||
wget -qO- https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor >/usr/share/keyrings/mongodb-server-7.0.gpg
|
||||
|
@ -40,8 +40,20 @@ msg_info "Setting up Zigbee2MQTT Repository"
|
||||
$STD git clone --depth 1 https://github.com/Koenkk/zigbee2mqtt.git /opt/zigbee2mqtt
|
||||
msg_ok "Set up Zigbee2MQTT Repository"
|
||||
|
||||
read -r -p "Switch to Edge/dev branch? (y/N) " prompt
|
||||
if [[ $prompt == "y" ]]; then
|
||||
DEV="y"
|
||||
else
|
||||
DEV="n"
|
||||
fi
|
||||
|
||||
msg_info "Installing Zigbee2MQTT"
|
||||
cd /opt/zigbee2mqtt
|
||||
if [[ $DEV == "y" ]]; then
|
||||
$STD git fetch origin dev:dev
|
||||
$STD git checkout dev
|
||||
$STD git pull
|
||||
fi
|
||||
$STD npm ci
|
||||
msg_ok "Installed Zigbee2MQTT"
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
"name": "Homarr",
|
||||
"slug": "homarr",
|
||||
"categories": [
|
||||
15
|
||||
18
|
||||
],
|
||||
"date_created": "2024-05-02",
|
||||
"type": "ct",
|
||||
|
@ -9,8 +9,8 @@
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 3000,
|
||||
"documentation": "https://gethomepage.dev/configs/",
|
||||
"website": "https://gethomepage.dev",
|
||||
"documentation": "https://gethomepage.dev/latest/configs/",
|
||||
"website": "https://github.com/benphelps/homepage",
|
||||
"logo": "https://avatars.githubusercontent.com/u/122929872?v=4",
|
||||
"description": "Homepage is a self-hosted dashboard solution for centralizing and organizing data and information.",
|
||||
"install_methods": [
|
||||
@ -36,4 +36,4 @@
|
||||
"type": "warning"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -30,10 +30,5 @@
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "You can find post-install info here: `https://github.com/community-scripts/ProxmoxVE/discussions/782`",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
"notes": []
|
||||
}
|
@ -8,9 +8,9 @@
|
||||
"type": "ct",
|
||||
"updateable": false,
|
||||
"privileged": false,
|
||||
"interface_port": 4443,
|
||||
"interface_port": 433,
|
||||
"documentation": null,
|
||||
"website": "https://github.com/nextcloud/nextcloudpi",
|
||||
"website": "https://www.turnkeylinux.org/nextcloud",
|
||||
"logo": "https://raw.githubusercontent.com/loganmarchione/homelab-svg-assets/main/assets/nextcloud.svg",
|
||||
"description": "NextCloudPi is a popular self-hosted solution for file collaboration and data storage. It is built on the NextCloud software, which is an open-source platform for data management.",
|
||||
"install_methods": [
|
||||
@ -42,4 +42,4 @@
|
||||
"password": null
|
||||
},
|
||||
"notes": []
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
{
|
||||
"name": "OneDev",
|
||||
"slug": "onedev",
|
||||
"categories": [
|
||||
3
|
||||
],
|
||||
"date_created": "2024-11-30",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 6610,
|
||||
"documentation": "https://docs.onedev.io/",
|
||||
"website": "https://onedev.io/",
|
||||
"logo": "https://docs.onedev.io/img/logo.svg",
|
||||
"description": "Git server with CI/CD, kanban, and packages.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/onedev.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 4,
|
||||
"os": "Debian",
|
||||
"version": "12"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": []
|
||||
}
|
@ -8,7 +8,7 @@
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 80,
|
||||
"interface_port": 3000,
|
||||
"documentation": "https://snipe-it.readme.io/docs/overview",
|
||||
"website": "https://snipeitapp.com/",
|
||||
"logo": "https://raw.githubusercontent.com/snipe/snipe-it/refs/heads/master/public/img/snipe-logo-bug.png",
|
||||
|
@ -11,7 +11,7 @@
|
||||
"interface_port": 5335,
|
||||
"documentation": null,
|
||||
"website": "https://www.nlnetlabs.nl/projects/unbound/about/",
|
||||
"logo": "https://netdata.cloud/img/unbound.png",
|
||||
"logo": "https://nlnetlabs.nl/static/logos/Unbound/Unbound_FC_Shaded_cropped.svg",
|
||||
"description": "Unbound is a validating, recursive, caching DNS resolver. It is designed to be fast and lean and incorporates modern features based on open standards.",
|
||||
"install_methods": [
|
||||
{
|
||||
|
@ -32,7 +32,7 @@
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "For non-AVX CPUs, MongoDB 4.4 is installed. Please note this is a legacy solution that may present security risks and could become unsupported in future updates.",
|
||||
"text": "For non-AVX CPUs, MongoDB 4.2 is installed. Please note this is a legacy solution that may present security risks and could become unsupported in future updates.",
|
||||
"type": "warning"
|
||||
}
|
||||
]
|
||||
|
@ -47,7 +47,7 @@
|
||||
"type": "warning"
|
||||
},
|
||||
{
|
||||
"text": "Build Settings for normal LXC: 6GB RAM - 6GB Storage - 4vCPU",
|
||||
"text": "Build Settings for normal LXC: 4GB RAM - 6GB Storage - 4vCPU",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
|
@ -1,20 +1,42 @@
|
||||
# Copyright (c) 2021-2024 tteck
|
||||
# Author: tteck (tteckster)
|
||||
# Co-Author: MickLesk
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
# This function sets color variables for formatting output in the terminal
|
||||
color() {
|
||||
# Colors
|
||||
YW=$(echo "\033[33m")
|
||||
YWB=$(echo "\033[93m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BGN=$(echo "\033[4;92m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
DGN=$(echo "\033[32m")
|
||||
|
||||
# Formatting
|
||||
CL=$(echo "\033[m")
|
||||
BFR="\\r\\033[K"
|
||||
BOLD=$(echo "\033[1m")
|
||||
TAB=" "
|
||||
|
||||
# System
|
||||
RETRY_NUM=10
|
||||
RETRY_EVERY=3
|
||||
i=$RETRY_NUM
|
||||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
|
||||
# Icons
|
||||
CM="${TAB}✔️${TAB}${CL}"
|
||||
CROSS="${TAB}✖️${TAB}${CL}"
|
||||
INFO="${TAB}💡${TAB}${CL}"
|
||||
NETWORK="${TAB}📡${TAB}${CL}"
|
||||
OS="${TAB}🖥️${TAB}${CL}"
|
||||
OSVERSION="${TAB}🌟${TAB}${CL}"
|
||||
HOSTNAME="${TAB}🏠${TAB}${CL}"
|
||||
GATEWAY="${TAB}🌐${TAB}${CL}"
|
||||
DEFAULT="${TAB}⚙️${TAB}${CL}"
|
||||
}
|
||||
|
||||
# This function enables IPv6 if it's not disabled and sets verbose mode if the global variable is set to "yes"
|
||||
verb_ip6() {
|
||||
if [ "$VERBOSE" = "yes" ]; then
|
||||
STD=""
|
||||
@ -27,11 +49,13 @@ verb_ip6() {
|
||||
fi
|
||||
}
|
||||
|
||||
# This function catches errors and handles them with the error handler function
|
||||
catch_errors() {
|
||||
set -Eeuo pipefail
|
||||
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
|
||||
}
|
||||
|
||||
# This function handles errors
|
||||
error_handler() {
|
||||
local exit_code="$?"
|
||||
local line_number="$1"
|
||||
@ -40,21 +64,25 @@ error_handler() {
|
||||
echo -e "\n$error_message\n"
|
||||
}
|
||||
|
||||
# This function displays an informational message with a yellow color.
|
||||
msg_info() {
|
||||
local msg="$1"
|
||||
echo -ne " ${HOLD} ${YW}${msg}..."
|
||||
echo -ne " ${TAB}${YW}${msg}"
|
||||
}
|
||||
|
||||
# This function displays a success message with a green color.
|
||||
msg_ok() {
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
||||
echo -e "${BFR}${CM}${GN}${msg}${CL}"
|
||||
}
|
||||
|
||||
# This function displays a error message with a red color.
|
||||
msg_error() {
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
echo -e "${BFR}${CROSS}${RD}${msg}${CL}"
|
||||
}
|
||||
|
||||
# This function sets up the Container OS by generating the locale, setting the timezone, and checking the network connection
|
||||
setting_up_container() {
|
||||
msg_info "Setting up Container OS"
|
||||
while [ $i -gt 0 ]; do
|
||||
@ -68,23 +96,26 @@ setting_up_container() {
|
||||
|
||||
if [ "$(ip addr show | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | cut -d'/' -f1)" = "" ]; then
|
||||
echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
|
||||
echo -e " 🖧 Check Network Settings"
|
||||
echo -e "${NETWORK}Check Network Settings"
|
||||
exit 1
|
||||
fi
|
||||
msg_ok "Set up Container OS"
|
||||
msg_ok "Network Connected: ${BL}$(ip addr show | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1 | tail -n1)${CL}"
|
||||
}
|
||||
|
||||
# This function checks the network connection by pinging a known IP address and prompts the user to continue if the internet is not connected
|
||||
network_check() {
|
||||
set +e
|
||||
trap - ERR
|
||||
if ping -c 1 -W 1 1.1.1.1 &>/dev/null; then msg_ok "Internet Connected"; else
|
||||
if ping -c 1 -W 1 1.1.1.1 &>/dev/null || ping -c 1 -W 1 8.8.8.8 &>/dev/null || ping -c 1 -W 1 9.9.9.9 &>/dev/null; then
|
||||
msg_ok "Internet Connected";
|
||||
else
|
||||
msg_error "Internet NOT Connected"
|
||||
read -r -p "Would you like to continue anyway? <y/N> " prompt
|
||||
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
|
||||
echo -e "${INFO}${RD}Expect Issues Without Internet${CL}"
|
||||
else
|
||||
echo -e " 🖧 Check Network Settings"
|
||||
echo -e "${NETWORK}Check Network Settings"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
@ -94,6 +125,7 @@ network_check() {
|
||||
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
|
||||
}
|
||||
|
||||
# This function updates the Container OS by running apt-get update and upgrade
|
||||
update_os() {
|
||||
msg_info "Updating Container OS"
|
||||
$STD apk update
|
||||
@ -101,19 +133,46 @@ update_os() {
|
||||
msg_ok "Updated Container OS"
|
||||
}
|
||||
|
||||
# This function modifies the message of the day (motd) and SSH settings
|
||||
motd_ssh() {
|
||||
# Set terminal to 256-color mode
|
||||
echo "export TERM='xterm-256color'" >>/root/.bashrc
|
||||
IP=$(ip -4 addr show eth0 | awk '/inet / {print $2}' | cut -d/ -f1 | head -n 1)
|
||||
# Get OS information
|
||||
if [ -f "/etc/os-release" ]; then
|
||||
OS_NAME=$(grep ^NAME /etc/os-release | cut -d= -f2 | tr -d '"')
|
||||
OS_VERSION=$(grep ^VERSION_ID /etc/os-release | cut -d= -f2 | tr -d '"')
|
||||
else
|
||||
OS_NAME="Alpine Linux"
|
||||
OS_VERSION="Unknown"
|
||||
fi
|
||||
# Set MOTD with application info and system details
|
||||
MOTD_FILE="/etc/motd"
|
||||
if [ -f "$MOTD_FILE" ]; then
|
||||
echo -e "\n${BOLD}${APPLICATION} LXC Container${CL}" > "$MOTD_FILE"
|
||||
echo -e "${TAB}${GATEWAY}${YW} Provided by: ${GN}community-scripts ORG ${YW}| Project: ${GN}ProxmoxVE ${YW}| GitHub: ${GN}https://github.com/community-scripts/ProxmoxVE${CL}\n" >> "$MOTD_FILE"
|
||||
echo -e "${TAB}${OS}${YW} OS: ${GN}${OS_NAME} ${OS_VERSION}${CL}" >> "$MOTD_FILE"
|
||||
echo -e "${TAB}${HOSTNAME}${YW} Hostname: ${GN}$(hostname)${CL}" >> "$MOTD_FILE"
|
||||
echo -e "${TAB}${INFO}${YW} IP Address: ${GN}${IP}${CL}" >> "$MOTD_FILE"
|
||||
else
|
||||
echo -e "${RD}[WARNING] MOTD file does not exist!${CL}" >&2
|
||||
fi
|
||||
# Configure SSH if enabled
|
||||
if [[ "${SSH_ROOT}" == "yes" ]]; then
|
||||
# Enable sshd service
|
||||
$STD rc-update add sshd
|
||||
# Allow root login via SSH
|
||||
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
|
||||
# Start the sshd service
|
||||
$STD /etc/init.d/sshd start
|
||||
fi
|
||||
}
|
||||
|
||||
# This function customizes the container and enables passwordless login for the root user
|
||||
customize() {
|
||||
if [[ "$PASSWORD" == "" ]]; then
|
||||
msg_info "Customizing Container"
|
||||
bash -c "passwd -d root" >/dev/null 2>&1
|
||||
msg_ok "Customized Container"
|
||||
fi
|
||||
}
|
||||
}
|
346
misc/build.func
346
misc/build.func
@ -1,3 +1,9 @@
|
||||
# Copyright (c) 2021-2024 tteck
|
||||
# Author: tteck (tteckster)
|
||||
# Co-Author: MickLesk
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
variables() {
|
||||
NSAPP=$(echo ${APP,,} | tr -d ' ') # This function sets the NSAPP variable by converting the value of the APP variable to lowercase and removing any spaces.
|
||||
var_install="${NSAPP}-install" # sets the var_install variable by appending "-install" to the value of NSAPP.
|
||||
@ -6,6 +12,7 @@ variables() {
|
||||
|
||||
# This function sets various color variables using ANSI escape codes for formatting text in the terminal.
|
||||
color() {
|
||||
# Colors
|
||||
YW=$(echo "\033[33m")
|
||||
YWB=$(echo "\033[93m")
|
||||
BL=$(echo "\033[36m")
|
||||
@ -13,11 +20,39 @@ color() {
|
||||
BGN=$(echo "\033[4;92m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
DGN=$(echo "\033[32m")
|
||||
|
||||
# Formatting
|
||||
CL=$(echo "\033[m")
|
||||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
UL=$(echo "\033[4m")
|
||||
BOLD=$(echo "\033[1m")
|
||||
BFR="\\r\\033[K"
|
||||
HOLD=" "
|
||||
TAB=" "
|
||||
|
||||
# Icons
|
||||
CM="${TAB}✔️${TAB}${CL}"
|
||||
CROSS="${TAB}✖️${TAB}${CL}"
|
||||
INFO="${TAB}💡${TAB}${CL}"
|
||||
OS="${TAB}🖥️${TAB}${CL}"
|
||||
OSVERSION="${TAB}🌟${TAB}${CL}"
|
||||
CONTAINERTYPE="${TAB}📦${TAB}${CL}"
|
||||
DISKSIZE="${TAB}💾${TAB}${CL}"
|
||||
CPUCORE="${TAB}🧠${TAB}${CL}"
|
||||
RAMSIZE="${TAB}🛠️${TAB}${CL}"
|
||||
SEARCH="${TAB}🔍${TAB}${CL}"
|
||||
VERIFYPW="${TAB}🔐${TAB}${CL}"
|
||||
CONTAINERID="${TAB}🆔${TAB}${CL}"
|
||||
HOSTNAME="${TAB}🏠${TAB}${CL}"
|
||||
BRIDGE="${TAB}🌉${TAB}${CL}"
|
||||
NETWORK="${TAB}📡${TAB}${CL}"
|
||||
GATEWAY="${TAB}🌐${TAB}${CL}"
|
||||
DISABLEIPV6="${TAB}🚫${TAB}${CL}"
|
||||
DEFAULT="${TAB}⚙️${TAB}${CL}"
|
||||
MACADDRESS="${TAB}🔗${TAB}${CL}"
|
||||
VLANTAG="${TAB}🏷️${TAB}${CL}"
|
||||
ROOTSSH="${TAB}🔑${TAB}${CL}"
|
||||
CREATING="${TAB}🚀${TAB}${CL}"
|
||||
ADVANCED="${TAB}🧩${TAB}${CL}"
|
||||
}
|
||||
|
||||
# This function enables error handling in the script by setting options and defining a trap for the ERR signal.
|
||||
@ -39,19 +74,24 @@ error_handler() {
|
||||
|
||||
# This function displays a spinner.
|
||||
spinner() {
|
||||
local chars="/-\|"
|
||||
local spin_i=0
|
||||
printf "\e[?25l"
|
||||
while true; do
|
||||
printf "\r \e[36m%s\e[0m" "${chars:spin_i++%${#chars}:1}"
|
||||
sleep 0.1
|
||||
done
|
||||
local frames=('⠋' '⠙' '⠹' '⠸' '⠼' '⠴' '⠦' '⠧' '⠇' '⠏')
|
||||
local spin_i=0
|
||||
local interval=0.1
|
||||
printf "\e[?25l"
|
||||
|
||||
local color="${YWB}"
|
||||
|
||||
while true; do
|
||||
printf "\r ${color}%s${CL}" "${frames[spin_i]}"
|
||||
spin_i=$(( (spin_i + 1) % ${#frames[@]} ))
|
||||
sleep "$interval"
|
||||
done
|
||||
}
|
||||
|
||||
# This function displays an informational message with a yellow color.
|
||||
msg_info() {
|
||||
local msg="$1"
|
||||
echo -ne " ${HOLD} ${YW}${msg} "
|
||||
echo -ne "${TAB}${YW}${msg}"
|
||||
spinner &
|
||||
SPINNER_PID=$!
|
||||
}
|
||||
@ -61,7 +101,7 @@ msg_ok() {
|
||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi
|
||||
printf "\e[?25h"
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
||||
echo -e "${BFR}${CM}${GN}${msg}${CL}"
|
||||
}
|
||||
|
||||
# This function displays a error message with a red color.
|
||||
@ -69,7 +109,7 @@ msg_error() {
|
||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi
|
||||
printf "\e[?25h"
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
echo -e "${BFR}${CROSS}${RD}${msg}${CL}"
|
||||
}
|
||||
|
||||
# Check if the shell is using bash
|
||||
@ -97,7 +137,7 @@ root_check() {
|
||||
# This function checks the version of Proxmox Virtual Environment (PVE) and exits if the version is not supported.
|
||||
pve_check() {
|
||||
if ! pveversion | grep -Eq "pve-manager/8.[1-3]"; then
|
||||
msg_error "This version of Proxmox Virtual Environment is not supported"
|
||||
msg_error "${CROSS}${RD}This version of Proxmox Virtual Environment is not supported"
|
||||
echo -e "Requires Proxmox Virtual Environment Version 8.1 or later."
|
||||
echo -e "Exiting..."
|
||||
sleep 2
|
||||
@ -108,17 +148,27 @@ fi
|
||||
# This function checks the system architecture and exits if it's not "amd64".
|
||||
arch_check() {
|
||||
if [ "$(dpkg --print-architecture)" != "amd64" ]; then
|
||||
echo -e "\n ${CROSS} This script will not work with PiMox! \n"
|
||||
echo -e "\n Visit https://github.com/asylumexp/Proxmox for ARM64 support. \n"
|
||||
echo -e "\n ${INFO}${YWB}This script will not work with PiMox! \n"
|
||||
echo -e "\n ${YWB}Visit https://github.com/asylumexp/Proxmox for ARM64 support. \n"
|
||||
echo -e "Exiting..."
|
||||
sleep 2
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
# This function sets the APP-Name into an ASCII Header in Slant, figlet needed on proxmox main node.
|
||||
header_info() {
|
||||
apt-get install -y figlet &> /dev/null
|
||||
ascii_art=$(figlet -f slant "$APP")
|
||||
clear
|
||||
cat <<EOF
|
||||
$ascii_art
|
||||
EOF
|
||||
}
|
||||
|
||||
# This function checks if the script is running through SSH and prompts the user to confirm if they want to proceed or exit.
|
||||
ssh_check() {
|
||||
if command -v pveversion >/dev/null 2>&1 && [ -n "${SSH_CLIENT:+x}" ]; then
|
||||
if [ -n "${SSH_CLIENT:+x}" ]; then
|
||||
if whiptail --backtitle "Proxmox VE Helper Scripts" --defaultno --title "SSH DETECTED" --yesno "It's advisable to utilize the Proxmox shell rather than SSH, as there may be potential complications with variable retrieval. Proceed using SSH?" 10 72; then
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "Proceed using SSH" "You've chosen to proceed using SSH. If any issues arise, please run the script in the Proxmox shell before creating a repository issue." 10 72
|
||||
else
|
||||
@ -129,36 +179,74 @@ ssh_check() {
|
||||
fi
|
||||
}
|
||||
|
||||
base_settings() {
|
||||
# Default Settings
|
||||
CT_TYPE="1"
|
||||
DISK_SIZE="4"
|
||||
CORE_COUNT="1"
|
||||
RAM_SIZE="1024"
|
||||
VERBOSE="no"
|
||||
PW=""
|
||||
CT_ID=$NEXTID
|
||||
HN=$NSAPP
|
||||
BRG="vmbr0"
|
||||
NET="dhcp"
|
||||
GATE=""
|
||||
APT_CACHER=""
|
||||
APT_CACHER_IP=""
|
||||
DISABLEIP6="no"
|
||||
MTU=""
|
||||
SD=""
|
||||
NS=""
|
||||
MAC=""
|
||||
VLAN=""
|
||||
SSH="no"
|
||||
TAGS="community-script;"
|
||||
|
||||
# Override default settings with variables from ct script
|
||||
CT_TYPE=${var_privileged:-$CT_TYPE}
|
||||
DISK_SIZE=${var_disk:-$DISK_SIZE}
|
||||
CORE_COUNT=${var_cpu:-$CORE_COUNT}
|
||||
RAM_SIZE=${var_ram:-$RAM_SIZE}
|
||||
VERB=${var_verbose:-$VERBOSE}
|
||||
TAGS="${TAGS}${var_tags:-}"
|
||||
|
||||
# Since these 2 are only defined outside of default_settings function, we add a temporary fallback. TODO: To align everything, we should add these as constant variables (e.g. OSTYPE and OSVERSION), but that would currently require updating the default_settings function for all existing scripts
|
||||
if [ -z "$var_os" ]; then
|
||||
var_os="debian"
|
||||
fi
|
||||
if [ -z "$var_version" ]; then
|
||||
var_version="12"
|
||||
fi
|
||||
}
|
||||
|
||||
# This function displays the default values for various settings.
|
||||
echo_default() {
|
||||
echo -e "${DGN}Using Distribution: ${BGN}$var_os${CL}"
|
||||
echo -e "${DGN}Using $var_os Version: ${BGN}$var_version${CL}"
|
||||
echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
|
||||
echo -e "${DGN}Using Root Password: ${BGN}Automatic Login${CL}"
|
||||
echo -e "${DGN}Using Container ID: ${BGN}$NEXTID${CL}"
|
||||
echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
|
||||
echo -e "${DGN}Using Disk Size: ${BGN}$var_disk${CL}${DGN}GB${CL}"
|
||||
echo -e "${DGN}Allocated Cores ${BGN}$var_cpu${CL}"
|
||||
echo -e "${DGN}Allocated Ram ${BGN}$var_ram${CL}"
|
||||
echo -e "${DGN}Using Bridge: ${BGN}vmbr0${CL}"
|
||||
echo -e "${DGN}Using Static IP Address: ${BGN}dhcp${CL}"
|
||||
echo -e "${DGN}Using Gateway IP Address: ${BGN}Default${CL}"
|
||||
echo -e "${DGN}Using Apt-Cacher IP Address: ${BGN}Default${CL}"
|
||||
echo -e "${DGN}Disable IPv6: ${BGN}No${CL}"
|
||||
echo -e "${DGN}Using Interface MTU Size: ${BGN}Default${CL}"
|
||||
echo -e "${DGN}Using DNS Search Domain: ${BGN}Host${CL}"
|
||||
echo -e "${DGN}Using DNS Server Address: ${BGN}1.1.1.1${CL}"
|
||||
echo -e "${DGN}Using MAC Address: ${BGN}Default${CL}"
|
||||
echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
|
||||
echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
|
||||
echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
|
||||
echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
|
||||
# Convert CT_TYPE to description
|
||||
CT_TYPE_DESC="Unprivileged"
|
||||
if [ "$CT_TYPE" -eq 0 ]; then
|
||||
CT_TYPE_DESC="Privileged"
|
||||
fi
|
||||
|
||||
# Output the selected values with icons
|
||||
echo -e "${OS}${BOLD}${DGN}Operating System: ${BGN}$var_os${CL}"
|
||||
echo -e "${OSVERSION}${BOLD}${DGN}Version: ${BGN}$var_version${CL}"
|
||||
echo -e "${CONTAINERTYPE}${BOLD}${DGN}Container Type: ${BGN}$CT_TYPE_DESC${CL}"
|
||||
echo -e "${DISKSIZE}${BOLD}${DGN}Disk Size: ${BGN}${DISK_SIZE}GB${CL}"
|
||||
echo -e "${CPUCORE}${BOLD}${DGN}CPU Cores: ${BGN}${CORE_COUNT}${CL}"
|
||||
echo -e "${RAMSIZE}${BOLD}${DGN}RAM Size: ${BGN}${RAM_SIZE}MB${CL}"
|
||||
echo -e "${CONTAINERID}${BOLD}${DGN}Container ID: ${BGN}${CT_ID}${CL}"
|
||||
if [ "$VERB" == "yes" ]; then
|
||||
echo -e "${SEARCH}${BOLD}${DGN}Verbose Mode: ${BGN}Enabled${CL}"
|
||||
fi
|
||||
echo -e "${CREATING}${BOLD}${BL}Creating a ${APP} LXC using the above default settings${CL}"
|
||||
echo -e " "
|
||||
}
|
||||
|
||||
# This function is called when the user decides to exit the script. It clears the screen and displays an exit message.
|
||||
exit-script() {
|
||||
exit_script() {
|
||||
clear
|
||||
echo -e "⚠ User exited script \n"
|
||||
echo -e "\n${CROSS}${RD}User exited script${CL}\n"
|
||||
exit
|
||||
}
|
||||
|
||||
@ -174,10 +262,10 @@ advanced_settings() {
|
||||
"ubuntu" "" OFF \
|
||||
3>&1 1>&2 2>&3); then
|
||||
if [ -n "$var_os" ]; then
|
||||
echo -e "${DGN}Using Distribution: ${BGN}$var_os${CL}"
|
||||
echo -e "${OS}${BOLD}${DGN}Operating System: ${BGN}$var_os${CL}"
|
||||
fi
|
||||
else
|
||||
exit-script
|
||||
exit_script
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@ -190,10 +278,10 @@ advanced_settings() {
|
||||
"12" "Bookworm" OFF \
|
||||
3>&1 1>&2 2>&3); then
|
||||
if [ -n "$var_version" ]; then
|
||||
echo -e "${DGN}Using $var_os Version: ${BGN}$var_version${CL}"
|
||||
echo -e "${OSVERSION}${BOLD}${DGN}Version: ${BGN}$var_version${CL}"
|
||||
fi
|
||||
else
|
||||
exit-script
|
||||
exit_script
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@ -201,20 +289,24 @@ advanced_settings() {
|
||||
if [ "$var_os" == "ubuntu" ]; then
|
||||
var_version=""
|
||||
while [ -z "$var_version" ]; do
|
||||
if var_version=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "UBUNTU VERSION" --radiolist "Choose Version" 10 58 3 \
|
||||
if var_version=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "UBUNTU VERSION" --radiolist "Choose Version" 10 58 4 \
|
||||
"20.04" "Focal" OFF \
|
||||
"22.04" "Jammy" OFF \
|
||||
"24.04" "Noble" OFF \
|
||||
3>&1 1>&2 2>&3); then
|
||||
"24.10" "Oracular" OFF \
|
||||
3>&1 1>&2 2>&3); then
|
||||
if [ -n "$var_version" ]; then
|
||||
echo -e "${DGN}Using $var_os Version: ${BGN}$var_version${CL}"
|
||||
echo -e "${OSVERSION}${BOLD}${DGN}Version: ${BGN}$var_version${CL}"
|
||||
fi
|
||||
else
|
||||
exit-script
|
||||
exit_script
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Setting Default Tag for Advanced Settings
|
||||
TAGS="community-script;"
|
||||
|
||||
CT_TYPE=""
|
||||
while [ -z "$CT_TYPE" ]; do
|
||||
if CT_TYPE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "CONTAINER TYPE" --radiolist "Choose Type" 10 58 2 \
|
||||
@ -222,10 +314,14 @@ advanced_settings() {
|
||||
"0" "Privileged" OFF \
|
||||
3>&1 1>&2 2>&3); then
|
||||
if [ -n "$CT_TYPE" ]; then
|
||||
echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
|
||||
CT_TYPE_DESC="Unprivileged"
|
||||
if [ "$CT_TYPE" -eq 0 ]; then
|
||||
CT_TYPE_DESC="Privileged"
|
||||
fi
|
||||
echo -e "${CONTAINERTYPE}${BOLD}${DGN}Container Type: ${BGN}$CT_TYPE_DESC${CL}"
|
||||
fi
|
||||
else
|
||||
exit-script
|
||||
exit_script
|
||||
fi
|
||||
done
|
||||
|
||||
@ -240,23 +336,23 @@ advanced_settings() {
|
||||
if PW2=$(whiptail --backtitle "Proxmox VE Helper Scripts" --passwordbox "\nVerify Root Password" 9 58 --title "PASSWORD VERIFICATION" 3>&1 1>&2 2>&3); then
|
||||
if [[ "$PW1" == "$PW2" ]]; then
|
||||
PW="-password $PW1"
|
||||
echo -e "${DGN}Using Root Password: ${BGN}********${CL}"
|
||||
echo -e "${VERIFYPW}${BOLD}${DGN}Root Password: ${BGN}********${CL}"
|
||||
break
|
||||
else
|
||||
whiptail --msgbox "Passwords do not match. Please try again." 8 58
|
||||
fi
|
||||
else
|
||||
exit-script
|
||||
exit_script
|
||||
fi
|
||||
fi
|
||||
else
|
||||
PW1="Automatic Login"
|
||||
PW=""
|
||||
echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
|
||||
echo -e "${VERIFYPW}${BOLD}${DGN}Root Password: ${BGN}$PW1${CL}"
|
||||
break
|
||||
fi
|
||||
else
|
||||
exit-script
|
||||
exit_script
|
||||
fi
|
||||
done
|
||||
|
||||
@ -264,9 +360,9 @@ advanced_settings() {
|
||||
if CT_ID=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3); then
|
||||
if [ -z "$CT_ID" ]; then
|
||||
CT_ID="$NEXTID"
|
||||
echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
|
||||
echo -e "${CONTAINERID}${BOLD}${DGN}Container ID: ${BGN}$CT_ID${CL}"
|
||||
else
|
||||
echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}"
|
||||
echo -e "${CONTAINERID}${BOLD}${DGN}Container ID: ${BGN}$CT_ID${CL}"
|
||||
fi
|
||||
else
|
||||
exit
|
||||
@ -278,57 +374,57 @@ advanced_settings() {
|
||||
else
|
||||
HN=$(echo ${CT_NAME,,} | tr -d ' ')
|
||||
fi
|
||||
echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
|
||||
echo -e "${HOSTNAME}${BOLD}${DGN}Hostname: ${BGN}$HN${CL}"
|
||||
else
|
||||
exit-script
|
||||
exit_script
|
||||
fi
|
||||
|
||||
if DISK_SIZE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3); then
|
||||
if [ -z "$DISK_SIZE" ]; then
|
||||
DISK_SIZE="$var_disk"
|
||||
echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DISKSIZE}${DGN}Disk Size: ${BGN}$DISK_SIZE${CL}"
|
||||
else
|
||||
if ! [[ $DISK_SIZE =~ $INTEGER ]]; then
|
||||
echo -e "${RD}⚠ DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
|
||||
echo -e "{INFO}${HOLD}${RD} DISK SIZE MUST BE AN INTEGER NUMBER!${CL}"
|
||||
advanced_settings
|
||||
fi
|
||||
echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
|
||||
echo -e "${DISKSIZE}${BOLD}${DGN}Disk Size: ${BGN}$DISK_SIZE${CL}"
|
||||
fi
|
||||
else
|
||||
exit-script
|
||||
exit_script
|
||||
fi
|
||||
|
||||
if CORE_COUNT=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3); then
|
||||
if [ -z "$CORE_COUNT" ]; then
|
||||
CORE_COUNT="$var_cpu"
|
||||
echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
|
||||
echo -e "${CPUCORE}${BOLD}${DGN}CPU Cores: ${BGN}$CORE_COUNT${CL}"
|
||||
else
|
||||
echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
|
||||
echo -e "${CPUCORE}${BOLD}${DGN}CPU Cores: ${BGN}$CORE_COUNT${CL}"
|
||||
fi
|
||||
else
|
||||
exit-script
|
||||
exit_script
|
||||
fi
|
||||
|
||||
if RAM_SIZE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3); then
|
||||
if [ -z "$RAM_SIZE" ]; then
|
||||
RAM_SIZE="$var_ram"
|
||||
echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
|
||||
echo -e "${RAMSIZE}${BOLD}${DGN}RAM Size: ${BGN}$RAM_SIZE${CL}"
|
||||
else
|
||||
echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
|
||||
echo -e "${RAMSIZE}${BOLD}${DGN}RAM Size: ${BGN}$RAM_SIZE${CL}"
|
||||
fi
|
||||
else
|
||||
exit-script
|
||||
exit_script
|
||||
fi
|
||||
|
||||
if BRG=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
|
||||
if [ -z "$BRG" ]; then
|
||||
BRG="vmbr0"
|
||||
echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
|
||||
echo -e "${BRIDGE}${BOLD}${DGN}Bridge: ${BGN}$BRG${CL}"
|
||||
else
|
||||
echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
|
||||
echo -e "${BRIDGE}${BOLD}${DGN}Bridge: ${BGN}$BRG${CL}"
|
||||
fi
|
||||
else
|
||||
exit-script
|
||||
exit_script
|
||||
fi
|
||||
|
||||
while true; do
|
||||
@ -336,18 +432,18 @@ advanced_settings() {
|
||||
exit_status=$?
|
||||
if [ $exit_status -eq 0 ]; then
|
||||
if [ "$NET" = "dhcp" ]; then
|
||||
echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
|
||||
echo -e "${NETWORK}${BOLD}${DGN}IP Address: ${BGN}$NET${CL}"
|
||||
break
|
||||
else
|
||||
if [[ "$NET" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}/([0-9]|[1-2][0-9]|3[0-2])$ ]]; then
|
||||
echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
|
||||
echo -e "${NETWORK}${BOLD}${DGN}IP Address: ${BGN}$NET${CL}"
|
||||
break
|
||||
else
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox "$NET is an invalid IPv4 CIDR address. Please enter a valid IPv4 CIDR address or 'dhcp'" 8 58
|
||||
fi
|
||||
fi
|
||||
else
|
||||
exit-script
|
||||
exit_script
|
||||
fi
|
||||
done
|
||||
|
||||
@ -360,13 +456,13 @@ advanced_settings() {
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox "Invalid IP address format" 8 58
|
||||
else
|
||||
GATE=",gw=$GATE1"
|
||||
echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
|
||||
echo -e "${GATEWAY}${BOLD}${DGN}Gateway IP Address: ${BGN}$GATE1${CL}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
else
|
||||
GATE=""
|
||||
echo -e "${DGN}Using Gateway IP Address: ${BGN}Default${CL}"
|
||||
echo -e "${GATEWAY}${BOLD}${DGN}Gateway IP Address: ${BGN}Default${CL}"
|
||||
fi
|
||||
|
||||
if [ "$var_os" == "alpine" ]; then
|
||||
@ -375,9 +471,9 @@ advanced_settings() {
|
||||
else
|
||||
if APT_CACHER_IP=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set APT-Cacher IP (leave blank for default)" 8 58 --title "APT-Cacher IP" 3>&1 1>&2 2>&3); then
|
||||
APT_CACHER="${APT_CACHER_IP:+yes}"
|
||||
echo -e "${DGN}Using APT-Cacher IP Address: ${BGN}${APT_CACHER_IP:-Default}${CL}"
|
||||
echo -e "${NETWORK}${BOLD}${DGN}APT-Cacher IP Address: ${BGN}${APT_CACHER_IP:-Default}${CL}"
|
||||
else
|
||||
exit-script
|
||||
exit_script
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -386,7 +482,7 @@ advanced_settings() {
|
||||
else
|
||||
DISABLEIP6="no"
|
||||
fi
|
||||
echo -e "${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
|
||||
echo -e "${DISABLEIPV6}${BOLD}${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
|
||||
|
||||
if MTU1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" 3>&1 1>&2 2>&3); then
|
||||
if [ -z $MTU1 ]; then
|
||||
@ -395,9 +491,9 @@ advanced_settings() {
|
||||
else
|
||||
MTU=",mtu=$MTU1"
|
||||
fi
|
||||
echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
|
||||
echo -e "${DEFAULT}${BOLD}${DGN}Interface MTU Size: ${BGN}$MTU1${CL}"
|
||||
else
|
||||
exit-script
|
||||
exit_script
|
||||
fi
|
||||
|
||||
if SD=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set a DNS Search Domain (leave blank for HOST)" 8 58 --title "DNS Search Domain" 3>&1 1>&2 2>&3); then
|
||||
@ -408,9 +504,9 @@ advanced_settings() {
|
||||
SX=$SD
|
||||
SD="-searchdomain=$SD"
|
||||
fi
|
||||
echo -e "${DGN}Using DNS Search Domain: ${BGN}$SX${CL}"
|
||||
echo -e "${SEARCH}${BOLD}${DGN}DNS Search Domain: ${BGN}$SX${CL}"
|
||||
else
|
||||
exit-script
|
||||
exit_script
|
||||
fi
|
||||
|
||||
if NX=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set a DNS Server IP (leave blank for HOST)" 8 58 --title "DNS SERVER IP" 3>&1 1>&2 2>&3); then
|
||||
@ -420,9 +516,9 @@ advanced_settings() {
|
||||
else
|
||||
NS="-nameserver=$NX"
|
||||
fi
|
||||
echo -e "${DGN}Using DNS Server IP Address: ${BGN}$NX${CL}"
|
||||
echo -e "${NETWORK}${BOLD}${DGN}DNS Server IP Address: ${BGN}$NX${CL}"
|
||||
else
|
||||
exit-script
|
||||
exit_script
|
||||
fi
|
||||
|
||||
if MAC1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set a MAC Address(leave blank for default)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
|
||||
@ -431,10 +527,10 @@ advanced_settings() {
|
||||
MAC=""
|
||||
else
|
||||
MAC=",hwaddr=$MAC1"
|
||||
echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
|
||||
echo -e "${MACADDRESS}${BOLD}${DGN}MAC Address: ${BGN}$MAC1${CL}"
|
||||
fi
|
||||
else
|
||||
exit-script
|
||||
exit_script
|
||||
fi
|
||||
|
||||
if VLAN1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3); then
|
||||
@ -444,9 +540,9 @@ advanced_settings() {
|
||||
else
|
||||
VLAN=",tag=$VLAN1"
|
||||
fi
|
||||
echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
|
||||
echo -e "${VLANTAG}${BOLD}${DGN}Vlan: ${BGN}$VLAN1${CL}"
|
||||
else
|
||||
exit-script
|
||||
exit_script
|
||||
fi
|
||||
|
||||
if [[ "$PW" == -password* ]]; then
|
||||
@ -455,10 +551,10 @@ advanced_settings() {
|
||||
else
|
||||
SSH="no"
|
||||
fi
|
||||
echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
|
||||
echo -e "${ROOTSSH}${BOLD}${DGN}Root SSH Access: ${BGN}$SSH${CL}"
|
||||
else
|
||||
SSH="no"
|
||||
echo -e "${DGN}Enable Root SSH Access: ${BGN}$SSH${CL}"
|
||||
echo -e "${ROOTSSH}${BOLD}${DGN}Root SSH Access: ${BGN}$SSH${CL}"
|
||||
fi
|
||||
|
||||
if (whiptail --backtitle "Proxmox VE Helper Scripts" --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
|
||||
@ -466,14 +562,14 @@ advanced_settings() {
|
||||
else
|
||||
VERB="no"
|
||||
fi
|
||||
echo -e "${DGN}Enable Verbose Mode: ${BGN}$VERB${CL}"
|
||||
echo -e "${SEARCH}${BOLD}${DGN}Verbose Mode: ${BGN}$VERB${CL}"
|
||||
|
||||
if (whiptail --backtitle "Proxmox VE Helper Scripts" --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
|
||||
echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
|
||||
echo -e "${CREATING}${BOLD}${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
|
||||
else
|
||||
clear
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${ADVANCED}${BOLD}${RD}Using Advanced Settings${CL}"
|
||||
advanced_settings
|
||||
fi
|
||||
}
|
||||
@ -493,25 +589,31 @@ install_script() {
|
||||
header_info
|
||||
if (whiptail --backtitle "Proxmox VE Helper Scripts" --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
|
||||
header_info
|
||||
echo -e "${BL}Using Default Settings${CL}"
|
||||
default_settings
|
||||
echo -e "${DEFAULT}${BOLD}${BL}Using Default Settings${CL}"
|
||||
base_settings
|
||||
echo_default
|
||||
else
|
||||
header_info
|
||||
echo -e "${RD}Using Advanced Settings${CL}"
|
||||
echo -e "${ADVANCED}${BOLD}${RD}Using Advanced Settings${CL}"
|
||||
advanced_settings
|
||||
fi
|
||||
}
|
||||
|
||||
check_container_resources() {
|
||||
# Check actual RAM & Cores
|
||||
current_ram=$(free -m | awk 'NR==2{print $2}')
|
||||
current_ram=$(free -m | awk '/^Mem:/{print $2}')
|
||||
current_cpu=$(nproc)
|
||||
|
||||
# Check whether the current RAM is less than the required RAM or the CPU cores are less than required
|
||||
if [[ "$current_ram" -lt "$var_ram" ]] || [[ "$current_cpu" -lt "$var_cpu" ]]; then
|
||||
echo -e "\n⚠️${HOLD} ${GN}Required: ${var_cpu} CPU, ${var_ram}MB RAM ${CL}| ${RD}Current: ${current_cpu} CPU, ${current_ram}MB RAM${CL}"
|
||||
echo -e "\n${INFO}${HOLD} ${GN}Required: ${var_cpu} CPU, ${var_ram}MB RAM ${CL}| ${RD}Current: ${current_cpu} CPU, ${current_ram}MB RAM${CL}"
|
||||
echo -e "${YWB}Please ensure that the ${APP} LXC is configured with at least ${var_cpu} vCPU and ${var_ram} MB RAM for the build process.${CL}\n"
|
||||
exit 1
|
||||
read -r -p "${INFO}${HOLD} May cause data loss! ${INFO} Continue update with under-provisioned LXC? <yes/No> " prompt
|
||||
# Check if the input is 'yes', otherwise exit with status 1
|
||||
if [[ ! ${prompt,,} =~ ^(yes)$ ]]; then
|
||||
echo -e "${CROSS}${HOLD} ${YWB}Exiting based on user input.${CL}"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo -e ""
|
||||
fi
|
||||
@ -524,11 +626,11 @@ check_container_storage() {
|
||||
usage=$(( 100 * used_size / total_size ))
|
||||
if (( usage > 80 )); then
|
||||
# Prompt the user for confirmation to continue
|
||||
echo -e "⚠️${HOLD} ${YWB}Warning: Storage is dangerously low (${usage}%).${CL}"
|
||||
echo -e "${INFO}${HOLD} ${YWB}Warning: Storage is dangerously low (${usage}%).${CL}"
|
||||
read -r -p "Continue anyway? <y/N> " prompt
|
||||
# Check if the input is 'y' or 'yes', otherwise exit with status 1
|
||||
if [[ ! ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||
echo -e "❌${HOLD} ${YWB}Exiting based on user input.${CL}"
|
||||
echo -e "${CROSS}${HOLD}${YWB}Exiting based on user input.${CL}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
@ -538,7 +640,7 @@ start() {
|
||||
if command -v pveversion >/dev/null 2>&1; then
|
||||
if ! (whiptail --backtitle "Proxmox VE Helper Scripts" --title "${APP} LXC" --yesno "This will create a New ${APP} LXC. Proceed?" 10 58); then
|
||||
clear
|
||||
echo -e "⚠ User exited script \n"
|
||||
exit_script
|
||||
exit
|
||||
fi
|
||||
SPINNER_PID=""
|
||||
@ -548,7 +650,7 @@ start() {
|
||||
if ! command -v pveversion >/dev/null 2>&1; then
|
||||
if ! (whiptail --backtitle "Proxmox VE Helper Scripts" --title "${APP} LXC UPDATE" --yesno "Support/Update functions for ${APP} LXC. Proceed?" 10 58); then
|
||||
clear
|
||||
echo -e "⚠ User exited script \n"
|
||||
exit_script
|
||||
exit
|
||||
fi
|
||||
SPINNER_PID=""
|
||||
@ -570,9 +672,9 @@ build_container() {
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
pushd $TEMP_DIR >/dev/null
|
||||
if [ "$var_os" == "alpine" ]; then
|
||||
export FUNCTIONS_FILE_PATH="$(curl -s https://git.thewrightserver.net/josh/ProxmoxVE/raw/branch/main/misc/alpine-install.func)"
|
||||
export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/alpine-install.func)"
|
||||
else
|
||||
export FUNCTIONS_FILE_PATH="$(curl -s https://git.thewrightserver.net/josh/ProxmoxVE/raw/branch/main/misc/install.func)"
|
||||
export FUNCTIONS_FILE_PATH="$(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/install.func)"
|
||||
fi
|
||||
export CACHER="$APT_CACHER"
|
||||
export CACHER_IP="$APT_CACHER_IP"
|
||||
@ -591,7 +693,7 @@ build_container() {
|
||||
export PCT_OPTIONS="
|
||||
-features $FEATURES
|
||||
-hostname $HN
|
||||
-tags thewrightserver-proxmox-scripts
|
||||
-tags $TAGS
|
||||
$SD
|
||||
$NS
|
||||
-net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU
|
||||
@ -602,7 +704,7 @@ build_container() {
|
||||
$PW
|
||||
"
|
||||
# This executes create_lxc.sh and creates the container and .conf file
|
||||
bash -c "$(wget -qLO - https://git.thewrightserver.net/josh/ProxmoxVE/raw/branch/main/ct/create_lxc.sh)" || exit
|
||||
bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/create_lxc.sh)" || exit
|
||||
|
||||
LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
|
||||
if [ "$CT_TYPE" == "0" ]; then
|
||||
@ -661,8 +763,6 @@ EOF
|
||||
pct exec "$CTID" -- /bin/sh -c 'cat <<EOF >/etc/apk/repositories
|
||||
http://dl-cdn.alpinelinux.org/alpine/latest-stable/main
|
||||
http://dl-cdn.alpinelinux.org/alpine/latest-stable/community
|
||||
#http://dl-cdn.alpinelinux.org/alpine/v3.19/main
|
||||
#http://dl-cdn.alpinelinux.org/alpine/v3.19/community
|
||||
EOF'
|
||||
pct exec "$CTID" -- ash -c "apk add bash >/dev/null"
|
||||
fi
|
||||
@ -677,12 +777,30 @@ description() {
|
||||
# Generate LXC Description
|
||||
DESCRIPTION=$(cat <<EOF
|
||||
<div align='center'>
|
||||
<a href='https://thewrightserver.net' target='_blank' rel='noopener noreferrer'>
|
||||
<img src='https://git.thewrightserver.net/josh/ProxmoxVE/raw/branch/main/misc/images/logo-114x114.png' alt='Logo' style='width:114px;height:114px;'/>
|
||||
<a href='https://Helper-Scripts.com' target='_blank' rel='noopener noreferrer'>
|
||||
<img src='https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/images/logo-81x112.png' alt='Logo' style='width:81px;height:112px;'/>
|
||||
</a>
|
||||
|
||||
<h2 style='font-size: 24px; margin: 20px 0;'>${APP} LXC</h2>
|
||||
<h2 style='font-size: 44px; margin: 20px 0;'>TheWrightServer</h2>
|
||||
|
||||
<p style='margin: 16px 0;'>
|
||||
<a href='https://ko-fi.com/community_scripts' target='_blank' rel='noopener noreferrer'>
|
||||
<img src='https://img.shields.io/badge/☕-Buy us a coffee-blue' alt='spend Coffee' />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<span style='margin: 0 10px;'>
|
||||
<i class="fa fa-github fa-fw" style="color: #f5f5f5;"></i>
|
||||
<a href='https://github.com/community-scripts/ProxmoxVE' target='_blank' rel='noopener noreferrer' style='text-decoration: none; color: #00617f;'>GitHub</a>
|
||||
</span>
|
||||
<span style='margin: 0 10px;'>
|
||||
<i class="fa fa-comments fa-fw" style="color: #f5f5f5;"></i>
|
||||
<a href='https://github.com/community-scripts/ProxmoxVE/discussions' target='_blank' rel='noopener noreferrer' style='text-decoration: none; color: #00617f;'>Discussions</a>
|
||||
</span>
|
||||
<span style='margin: 0 10px;'>
|
||||
<i class="fa fa-exclamation-circle fa-fw" style="color: #f5f5f5;"></i>
|
||||
<a href='https://github.com/community-scripts/ProxmoxVE/issues' target='_blank' rel='noopener noreferrer' style='text-decoration: none; color: #00617f;'>Issues</a>
|
||||
</span>
|
||||
</div>
|
||||
EOF
|
||||
)
|
||||
@ -693,4 +811,4 @@ EOF
|
||||
if [[ -f /etc/systemd/system/ping-instances.service ]]; then
|
||||
systemctl start ping-instances.service
|
||||
fi
|
||||
}
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 7.6 KiB |
BIN
misc/images/logo-81x112.png
Normal file
BIN
misc/images/logo-81x112.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 63 KiB |
@ -1,18 +1,38 @@
|
||||
# Copyright (c) 2021-2024 tteck
|
||||
# Author: tteck (tteckster)
|
||||
# Co-Author: MickLesk
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
# This function sets color variables for formatting output in the terminal
|
||||
color() {
|
||||
# Colors
|
||||
YW=$(echo "\033[33m")
|
||||
YWB=$(echo "\033[93m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BGN=$(echo "\033[4;92m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
DGN=$(echo "\033[32m")
|
||||
|
||||
# Formatting
|
||||
CL=$(echo "\033[m")
|
||||
BFR="\\r\\033[K"
|
||||
BOLD=$(echo "\033[1m")
|
||||
TAB=" "
|
||||
|
||||
# System
|
||||
RETRY_NUM=10
|
||||
RETRY_EVERY=3
|
||||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
BFR="\\r\\033[K"
|
||||
HOLD=" "
|
||||
|
||||
# Icons
|
||||
CM="${TAB}✔️${TAB}${CL}"
|
||||
CROSS="${TAB}✖️${TAB}${CL}"
|
||||
INFO="${TAB}💡${TAB}${CL}"
|
||||
NETWORK="${TAB}📡${TAB}${CL}"
|
||||
OS="${TAB}🖥️${TAB}${CL}"
|
||||
OSVERSION="${TAB}🌟${TAB}${CL}"
|
||||
HOSTNAME="${TAB}🏠${TAB}${CL}"
|
||||
GATEWAY="${TAB}🌐${TAB}${CL}"
|
||||
DEFAULT="${TAB}⚙️${TAB}${CL}"
|
||||
}
|
||||
|
||||
# This function enables IPv6 if it's not disabled and sets verbose mode if the global variable is set to "yes"
|
||||
@ -49,30 +69,34 @@ error_handler() {
|
||||
|
||||
# This function displays a spinner.
|
||||
spinner() {
|
||||
local chars="/-\|"
|
||||
local spin_i=0
|
||||
printf "\e[?25l"
|
||||
while true; do
|
||||
printf "\r \e[36m%s\e[0m" "${chars:spin_i++%${#chars}:1}"
|
||||
sleep 0.1
|
||||
done
|
||||
local frames=('⠋' '⠙' '⠹' '⠸' '⠼' '⠴' '⠦' '⠧' '⠇' '⠏')
|
||||
local spin_i=0
|
||||
local interval=0.1
|
||||
printf "\e[?25l"
|
||||
|
||||
local color="${YWB}"
|
||||
|
||||
while true; do
|
||||
printf "\r ${color}%s${CL}" "${frames[spin_i]}"
|
||||
spin_i=$(( (spin_i + 1) % ${#frames[@]} ))
|
||||
sleep "$interval"
|
||||
done
|
||||
}
|
||||
|
||||
# This function displays an informational message with a yellow color.
|
||||
msg_info() {
|
||||
local msg="$1"
|
||||
echo -ne " ${HOLD} ${YW}${msg} "
|
||||
echo -ne "${TAB}${YW}${msg}"
|
||||
spinner &
|
||||
SPINNER_PID=$!
|
||||
}
|
||||
|
||||
|
||||
# This function displays a success message with a green color.
|
||||
msg_ok() {
|
||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi
|
||||
printf "\e[?25h"
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
||||
echo -e "${BFR}${CM}${GN}${msg}${CL}"
|
||||
}
|
||||
|
||||
# This function displays a error message with a red color.
|
||||
@ -80,7 +104,7 @@ msg_error() {
|
||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi
|
||||
printf "\e[?25h"
|
||||
local msg="$1"
|
||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
echo -e "${BFR}${CROSS}${RD}${msg}${CL}"
|
||||
}
|
||||
|
||||
# This function sets up the Container OS by generating the locale, setting the timezone, and checking the network connection
|
||||
@ -102,7 +126,7 @@ setting_up_container() {
|
||||
done
|
||||
if [ "$(hostname -I)" = "" ]; then
|
||||
echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
|
||||
echo -e " 🖧 Check Network Settings"
|
||||
echo -e "${NETWORK}Check Network Settings"
|
||||
exit 1
|
||||
fi
|
||||
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
|
||||
@ -118,16 +142,16 @@ network_check() {
|
||||
ipv4_connected=false
|
||||
ipv6_connected=false
|
||||
sleep 1
|
||||
# Check IPv4 connectivity
|
||||
if ping -c 1 -W 1 1.1.1.1 &>/dev/null; then
|
||||
# Check IPv4 connectivity to Google, Cloudflare & Quad9 DNS servers.
|
||||
if ping -c 1 -W 1 1.1.1.1 &>/dev/null || ping -c 1 -W 1 8.8.8.8 &>/dev/null || ping -c 1 -W 1 9.9.9.9 &>/dev/null; then
|
||||
msg_ok "IPv4 Internet Connected";
|
||||
ipv4_connected=true
|
||||
else
|
||||
msg_error "IPv4 Internet Not Connected";
|
||||
fi
|
||||
|
||||
# Check IPv6 connectivity
|
||||
if ping6 -c 1 -W 1 2606:4700:4700::1111 &>/dev/null; then
|
||||
# Check IPv6 connectivity to Google, Cloudflare & Quad9 DNS servers.
|
||||
if ping6 -c 1 -W 1 2606:4700:4700::1111 &>/dev/null || ping6 -c 1 -W 1 2001:4860:4860::8888 &>/dev/null || ping6 -c 1 -W 1 2620:fe::fe &>/dev/null; then
|
||||
msg_ok "IPv6 Internet Connected";
|
||||
ipv6_connected=true
|
||||
else
|
||||
@ -138,9 +162,9 @@ network_check() {
|
||||
if [[ $ipv4_connected == false && $ipv6_connected == false ]]; then
|
||||
read -r -p "No Internet detected,would you like to continue anyway? <y/N> " prompt
|
||||
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
|
||||
echo -e "${INFO}${RD}Expect Issues Without Internet${CL}"
|
||||
else
|
||||
echo -e " 🖧 Check Network Settings"
|
||||
echo -e "${NETWORK}Check Network Settings"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
@ -174,13 +198,39 @@ EOF
|
||||
|
||||
# This function modifies the message of the day (motd) and SSH settings
|
||||
motd_ssh() {
|
||||
echo "export TERM='xterm-256color'" >>/root/.bashrc
|
||||
echo -e "$APPLICATION LXC provided by https://helper-scripts.com/\n" >/etc/motd
|
||||
chmod -x /etc/update-motd.d/*
|
||||
if [[ "${SSH_ROOT}" == "yes" ]]; then
|
||||
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
|
||||
systemctl restart sshd
|
||||
# Set terminal to 256-color mode
|
||||
grep -qxF "export TERM='xterm-256color'" /root/.bashrc || echo "export TERM='xterm-256color'" >> /root/.bashrc
|
||||
|
||||
# Get the current private IP address
|
||||
IP=$(hostname -I | awk '{print $1}') # Private IP
|
||||
|
||||
# Get OS information (Debian / Ubuntu)
|
||||
if [ -f "/etc/os-release" ]; then
|
||||
OS_NAME=$(grep ^NAME /etc/os-release | cut -d= -f2 | tr -d '"')
|
||||
OS_VERSION=$(grep ^VERSION_ID /etc/os-release | cut -d= -f2 | tr -d '"')
|
||||
elif [ -f "/etc/debian_version" ]; then
|
||||
OS_NAME="Debian"
|
||||
OS_VERSION=$(cat /etc/debian_version)
|
||||
fi
|
||||
|
||||
# Set MOTD with application info, system details
|
||||
MOTD_FILE="/etc/motd"
|
||||
if [ -f "$MOTD_FILE" ]; then
|
||||
# Start MOTD with application info and link
|
||||
echo -e "\n${BOLD}${APPLICATION} LXC Container${CL}" > "$MOTD_FILE"
|
||||
echo -e "${TAB}${GATEWAY}${YW} Provided by: ${GN}community-scripts ORG ${YW}| Project: ${GN}ProxmoxVE ${YW}| GitHub: ${GN}https://github.com/community-scripts/ProxmoxVE${CL}\n" >> "$MOTD_FILE"
|
||||
|
||||
# Add system information with icons
|
||||
echo -e "${TAB}${OS}${YW} OS: ${GN}${OS_NAME} ${OS_VERSION}${CL}" >> "$MOTD_FILE"
|
||||
echo -e "${TAB}${OSVERSION}${YW} Version: ${GN}${OS_VERSION}${CL}" >> "$MOTD_FILE"
|
||||
echo -e "${TAB}${HOSTNAME}${YW} Hostname: ${GN}$(hostname)${CL}" >> "$MOTD_FILE"
|
||||
echo -e "${TAB}${INFO}${YW} IP Address: ${GN}${IP}${CL}" >> "$MOTD_FILE"
|
||||
else
|
||||
echo "MotD file does not exist!" >&2
|
||||
fi
|
||||
|
||||
# Disable default MOTD scripts
|
||||
chmod -x /etc/update-motd.d/*
|
||||
}
|
||||
|
||||
# This function customizes the container by modifying the getty service and enabling auto-login for the root user
|
||||
|
Loading…
x
Reference in New Issue
Block a user