Initial commit

This commit is contained in:
Kristo Copani 2024-11-30 14:04:29 +02:00
parent 4bc9e5deb6
commit 743ea1897b
3 changed files with 68 additions and 43 deletions

View File

@ -9,21 +9,20 @@ source <(curl -s https://raw.githubusercontent.com/quantumryuu/ProxmoxVE/build/m
function header_info {
clear
cat <<"EOF"
____ ________ ______ __
/ _/___ _________ / _/ __ \/ ____/___/ /
/ // __ \/ ___/ __ \ / // /_/ / / / __ /
_/ // / / (__ ) /_/ // // _, _/ /___/ /_/ /
/___/_/ /_/____/ .___/___/_/ |_|\____/\__,_/
/_/
____ ____
/ __ \____ ___ / __ \___ _ __
/ / / / __ \/ _ \/ / / / _ \ | / /
/ /_/ / / / / __/ /_/ / __/ |/ /
\____/_/ /_/\___/_____/\___/|___/
EOF
}
header_info
echo -e "Loading..."
APP="InspIRCd"
var_disk="2"
var_cpu="1"
var_ram="512"
APP="OneDev"
var_disk="4"
var_cpu="2"
var_ram="2048"
var_os="debian"
var_version="12"
variables
@ -58,29 +57,32 @@ header_info
check_container_storage
check_container_resources
if [[ ! -f /lib/systemd/system/inspircd.service ]]; then
if [[ ! -f /etc/systemd/system/onedev.service ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -s https://api.github.com/repos/inspircd/inspircd/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
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 inspircd
systemctl stop onedev
msg_ok "Stopped Service"
msg_info "Updating ${APP} to v${RELEASE}"
cd /opt
wget -q https://github.com/inspircd/inspircd/releases/download/v${RELEASE}/inspircd_${RELEASE}.deb12u1_amd64.deb
apt-get install "./inspircd_${RELEASE}.deb12u1_amd64.deb" -y &>/dev/nul
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
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 inspircd
systemctl start onedev
msg_ok "Started Service"
msg_info "Cleaning up"
rm -rf /opt/inspircd_${RELEASE}.deb12u1_amd64.deb
rm -rf /opt/onedev-latest
rm -rf /opt/onedev-latest.tar.gz
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else

View File

@ -17,38 +17,27 @@ msg_info "Installing Dependencies"
$STD apt-get install -y \
curl \
mc \
sudo
sudo \
openjdk-21-jdk \
git
msg_ok "Installed Dependencies"
msg_info "Installing InspIRCd"
RELEASE=$(curl -s https://api.github.com/repos/REPO/REPO/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
msg_info "Installing OneDev"
cd /opt
wget -q https://github.com/REPO/REPO/releases/download/v${RELEASE}/inspircd_${RELEASE}.deb12u1_amd64.deb
$STD apt-get install "./inspircd_${RELEASE}.deb12u1_amd64.deb" -y &>/dev/null
cat <<EOF >/etc/inspircd/inspircd.conf
<define name="networkDomain" value="helper-scripts.com">
<define name="networkName" value="Proxmox VE Helper-Scripts">
<server
name="irc.&networkDomain;"
description="&networkName; IRC server"
network="&networkName;">
<admin
name="Admin"
description="Supreme Overlord"
email="irc@&networkDomain;">
<bind address="" port="6667" type="clients">
EOF
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
RELEASE=$(cat /opt/onedev/release.properties | grep "version" | cut -d'=' -f2)
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
msg_ok "Installed InspIRCd"
msg_ok "Installed OneDev"
motd_ssh
customize
msg_info "Cleaning up"
rm -rf /opt/inspircd_${RELEASE}.deb12u1_amd64.deb
rm -rf /opt/onedev-latest.tar.gz
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"

34
json/onedev.json Normal file
View File

@ -0,0 +1,34 @@
{
"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": []
}