Merge branch 'main' of https://github.com/community-scripts/ProxmoxVED
This commit is contained in:
		
						commit
						d02a86b58c
					
				
							
								
								
									
										88
									
								
								.github/workflows/delete_new_script.yaml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										88
									
								
								.github/workflows/delete_new_script.yaml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,88 @@ | |||||||
|  | name: Delete Files on Issue Close | ||||||
|  | 
 | ||||||
|  | on: | ||||||
|  |   issues: | ||||||
|  |     types: [closed] | ||||||
|  | 
 | ||||||
|  | jobs: | ||||||
|  |   delete-files: | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     if: contains(github.event.issue.labels.*.name, 'Migration To ProxmoxVE') | ||||||
|  |     steps: | ||||||
|  |       - name: Checkout repository | ||||||
|  |         uses: actions/checkout@v4 | ||||||
|  |         with: | ||||||
|  |           token: ${{ secrets.GITHUB_TOKEN }} | ||||||
|  | 
 | ||||||
|  |       - name: Extract Issue Title (Lowercase & Underscores) | ||||||
|  |         id: extract_title | ||||||
|  |         run: echo "TITLE=$(echo '${{ github.event.issue.title }}' | tr '[:upper:]' '[:lower:]' | sed 's/ /_/g')" >> $GITHUB_ENV | ||||||
|  | 
 | ||||||
|  |       - name: Check if Files Exist in community-scripts/ProxmoxVE | ||||||
|  |         id: check_files | ||||||
|  |         env: | ||||||
|  |           GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
|  |         run: | | ||||||
|  |           REPO="community-scripts/ProxmoxVE" | ||||||
|  |           API_URL="https://api.github.com/repos/$REPO/contents" | ||||||
|  | 
 | ||||||
|  |           FILES=( | ||||||
|  |             "ct/${TITLE}.sh" | ||||||
|  |             "install/${TITLE}-install.sh" | ||||||
|  |             "json/${TITLE}.json" | ||||||
|  |           ) | ||||||
|  | 
 | ||||||
|  |           EXISTS=false | ||||||
|  |           for FILE in "${FILES[@]}"; do | ||||||
|  |             STATUS=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: token $GH_TOKEN" "$API_URL/$FILE") | ||||||
|  |             if [ "$STATUS" -eq 200 ]; then | ||||||
|  |               EXISTS=true | ||||||
|  |               echo "$FILE exists in $REPO" | ||||||
|  |             else | ||||||
|  |               echo "$FILE does NOT exist in $REPO" | ||||||
|  |             fi | ||||||
|  |           done | ||||||
|  | 
 | ||||||
|  |           if [ "$EXISTS" = false ]; then | ||||||
|  |             echo "No matching files found in $REPO. Exiting..." | ||||||
|  |             exit 0 | ||||||
|  |           fi | ||||||
|  | 
 | ||||||
|  |       - name: Commit and Push Changes | ||||||
|  |         env: | ||||||
|  |           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
|  |         run: | | ||||||
|  |           branch=$(echo "delete-files_${{ github.event.issue.number }}_${TITLE}" | tr '[:upper:]' '[:lower:]' | sed 's/ /_/g') | ||||||
|  |           git config --global user.name "github-actions[bot]" | ||||||
|  |           git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||||||
|  |           git checkout -b $branch | ||||||
|  |           rm -f ct/${TITLE}.sh | ||||||
|  |           rm -f install/${TITLE}-install.sh | ||||||
|  |           rm -f json/${TITLE}.json | ||||||
|  |           git add . | ||||||
|  |           if git diff --staged --quiet; then | ||||||
|  |             echo "No files to delete. Exiting..." | ||||||
|  |             exit 0 | ||||||
|  |           fi | ||||||
|  |           git commit -m "Deleted files for issue: ${{ github.event.issue.title }}" | ||||||
|  |           git push origin $branch | ||||||
|  |           gh pr create --title "Delete Files for ${{ github.event.issue.title }} after Merge to Main" --body "Delete files after merge in main repo." --base main --head $branch | ||||||
|  | 
 | ||||||
|  |           pr_number=$(gh pr list | grep -m 1 $branch | awk '{print $1}') | ||||||
|  |           #gh pr merge $pr_number --squash | ||||||
|  |           echo pr_number=$pr_number >> $GITHUB_ENV | ||||||
|  | 
 | ||||||
|  |       - name: Comment on Issue | ||||||
|  |         uses: actions/github-script@v7 | ||||||
|  |         with: | ||||||
|  |           github-token: ${{ secrets.GITHUB_TOKEN }} | ||||||
|  |           script: | | ||||||
|  |             const issue_number = context.payload.issue.number; | ||||||
|  | 
 | ||||||
|  |             const message = `Files deleted with PR #${process.env.pr_number}`; | ||||||
|  |             github.rest.issues.createComment({ | ||||||
|  |               owner: context.repo.owner, | ||||||
|  |               repo: context.repo.repo, | ||||||
|  |               issue_number: issue_number, | ||||||
|  |               body: message | ||||||
|  |             }); | ||||||
| @ -1,78 +0,0 @@ | |||||||
| #!/usr/bin/env bash |  | ||||||
| source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) |  | ||||||
| # Copyright (c) 2021-2025 community-scripts ORG |  | ||||||
| # Author: vhsdream |  | ||||||
| # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE |  | ||||||
| # Source: https://fluidcalendar.com |  | ||||||
| 
 |  | ||||||
| APP="fluid-calendar" |  | ||||||
| var_tags="calendar,tasks" |  | ||||||
| var_cpu="3" |  | ||||||
| var_ram="4096" |  | ||||||
| var_disk="7" |  | ||||||
| var_os="debian" |  | ||||||
| var_version="12" |  | ||||||
| var_unprivileged="1" |  | ||||||
| 
 |  | ||||||
| header_info "$APP" |  | ||||||
| variables |  | ||||||
| color |  | ||||||
| catch_errors |  | ||||||
| 
 |  | ||||||
| function update_script() { |  | ||||||
|     header_info |  | ||||||
|     check_container_storage |  | ||||||
|     check_container_resources |  | ||||||
| 
 |  | ||||||
|     if [[ ! -d /opt/fluid-calendar ]]; then |  | ||||||
|         msg_error "No ${APP} Installation Found!" |  | ||||||
|         exit |  | ||||||
|     fi |  | ||||||
| 
 |  | ||||||
|     RELEASE=$(curl -s https://api.github.com/repos/dotnetfactory/fluid-calendar/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') |  | ||||||
|     if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then |  | ||||||
|         msg_info "Stopping $APP" |  | ||||||
|         systemctl stop fluid-calendar.service |  | ||||||
|         msg_ok "Stopped $APP" |  | ||||||
| 
 |  | ||||||
|         msg_info "Creating Backup" |  | ||||||
|         $STD tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /opt/fluid-calendar |  | ||||||
|         msg_ok "Backup Created" |  | ||||||
| 
 |  | ||||||
|         msg_info "Updating $APP to v${RELEASE}" |  | ||||||
|         tmp_file=$(mktemp) |  | ||||||
|         wget -q "https://github.com/dotnetfactory/fluid-calendar/archive/refs/tags/v${RELEASE}.zip" -O $tmp_file |  | ||||||
|         unzip -q $tmp_file |  | ||||||
|         cp -rf ${APP}-${RELEASE}/* /opt/fluid-calendar |  | ||||||
|         cd /opt/fluid-calendar |  | ||||||
|         export NEXT_TELEMETRY_DISABLED=1 |  | ||||||
|         $STD npm run setup |  | ||||||
|         $STD npm run build |  | ||||||
|         msg_ok "Updated $APP to v${RELEASE}" |  | ||||||
| 
 |  | ||||||
|         msg_info "Starting $APP" |  | ||||||
|         systemctl start fluid-calendar.service |  | ||||||
|         msg_ok "Started $APP" |  | ||||||
| 
 |  | ||||||
|         msg_info "Cleaning Up" |  | ||||||
|         rm -rf $tmp_file |  | ||||||
|         rm -rf "/opt/${APP}_backup_$(date +%F).tar.gz" |  | ||||||
|         rm -rf /tmp/${APP}-${RELEASE} |  | ||||||
|         msg_ok "Cleanup Completed" |  | ||||||
| 
 |  | ||||||
|         echo "${RELEASE}" >/opt/${APP}_version.txt |  | ||||||
|         msg_ok "Update Successful" |  | ||||||
|     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 "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" |  | ||||||
| echo -e "${INFO}${YW} Access it using the following URL:${CL}" |  | ||||||
| echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" |  | ||||||
| @ -1,43 +0,0 @@ | |||||||
| #!/usr/bin/env bash |  | ||||||
| source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) |  | ||||||
| # Copyright (c) 2021-2025 tteck |  | ||||||
| # Author: dave-yap (dave-yap) |  | ||||||
| # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE |  | ||||||
| # Source: https://seafile.com/ |  | ||||||
| 
 |  | ||||||
| APP="Seafile" |  | ||||||
| var_tags="documents" |  | ||||||
| var_cpu="2" |  | ||||||
| var_ram="2048" |  | ||||||
| var_disk="20" |  | ||||||
| var_os="debian" |  | ||||||
| var_version="12" |  | ||||||
| var_unprivileged="1" |  | ||||||
| 
 |  | ||||||
| header_info "$APP" |  | ||||||
| base_settings |  | ||||||
| 
 |  | ||||||
| variables |  | ||||||
| color |  | ||||||
| catch_errors |  | ||||||
| 
 |  | ||||||
| function update_script() { |  | ||||||
|     header_info |  | ||||||
|     check_container_storage |  | ||||||
|     check_container_resources |  | ||||||
|     if [[ ! -f /etc/systemd/system/seafile.service ]]; then |  | ||||||
|         msg_error "No ${APP} Installation Found!" |  | ||||||
|         exit |  | ||||||
|     fi |  | ||||||
|     msg_ok "No upgrade path available now." |  | ||||||
|     exit |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| start |  | ||||||
| build_container |  | ||||||
| description |  | ||||||
| 
 |  | ||||||
| msg_ok "Completed Successfully!\n" |  | ||||||
| echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" |  | ||||||
| echo -e "${INFO}${YW} Access it using the following URL:${CL}" |  | ||||||
| echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8000${CL}" |  | ||||||
							
								
								
									
										1
									
								
								ct/snipeit.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								ct/snipeit.sh
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | |||||||
|  | 
 | ||||||
| @ -1,112 +0,0 @@ | |||||||
| #!/usr/bin/env bash |  | ||||||
| 
 |  | ||||||
| # Copyright (c) 2021-2025 community-scripts ORG |  | ||||||
| # Author: vhsdream |  | ||||||
| # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE |  | ||||||
| # Source: https://github.com/dotnetfactory/fluid-calendar |  | ||||||
| 
 |  | ||||||
| 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 \ |  | ||||||
|   sudo \ |  | ||||||
|   mc \ |  | ||||||
|   zip \ |  | ||||||
|   gnupg \ |  | ||||||
|   postgresql-common |  | ||||||
| msg_ok "Installed Dependencies" |  | ||||||
| 
 |  | ||||||
| msg_info "Installing Additional Dependencies" |  | ||||||
| curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg |  | ||||||
| echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list |  | ||||||
| echo "YES" | /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh &>/dev/null |  | ||||||
| $STD apt-get install -y postgresql-17 nodejs |  | ||||||
| msg_ok "Installed Additional Dependencies" |  | ||||||
| 
 |  | ||||||
| msg_info "Setting up Postgresql Database" |  | ||||||
| DB_NAME="fluiddb" |  | ||||||
| DB_USER="fluiduser" |  | ||||||
| DB_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)" |  | ||||||
| NEXTAUTH_SECRET="$(openssl rand -base64 44 | tr -dc 'a-zA-Z0-9' | cut -c1-32)" |  | ||||||
| $STD sudo -u postgres psql -c "CREATE USER $DB_USER WITH ENCRYPTED PASSWORD '$DB_PASS';" |  | ||||||
| $STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;" |  | ||||||
| $STD sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE $DB_NAME to $DB_USER;" |  | ||||||
| $STD sudo -u postgres psql -c "ALTER USER $DB_USER WITH SUPERUSER;" |  | ||||||
| { |  | ||||||
|     echo "${APPLICATION} Credentials" |  | ||||||
|     echo "Database User: $DB_USER" |  | ||||||
|     echo "Database Password: $DB_PASS" |  | ||||||
|     echo "Database Name: $DB_NAME" |  | ||||||
|     echo "NextAuth Secret: $NEXTAUTH_SECRET" |  | ||||||
| } >> ~/$APPLICATION.creds |  | ||||||
| msg_ok "Set up Postgresql Database" |  | ||||||
| 
 |  | ||||||
| msg_info "Setup ${APPLICATION}" |  | ||||||
| tmp_file=$(mktemp) |  | ||||||
| RELEASE=$(curl -s https://api.github.com/repos/dotnetfactory/fluid-calendar/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') |  | ||||||
| wget -q "https://github.com/dotnetfactory/fluid-calendar/archive/refs/tags/v${RELEASE}.zip" -O $tmp_file |  | ||||||
| unzip -q $tmp_file |  | ||||||
| mv ${APPLICATION}-${RELEASE}/ /opt/${APPLICATION} |  | ||||||
| echo "${RELEASE}" >/opt/${APPLICATION}_version.txt |  | ||||||
| 
 |  | ||||||
| cat <<EOF >/opt/fluid-calendar/.env |  | ||||||
| DATABASE_URL="postgresql://${DB_USER}:${DB_PASS}@localhost:5432/${DB_NAME}" |  | ||||||
| 
 |  | ||||||
| # For OAuth integration with Google Calendar |  | ||||||
| # See https://console.cloud.google.com |  | ||||||
| GOOGLE_CLIENT_ID="" |  | ||||||
| GOOGLE_CLIENT_SECRET="" |  | ||||||
| 
 |  | ||||||
| # Change the URL below to your external URL |  | ||||||
| NEXTAUTH_URL="http://localhost:3000" |  | ||||||
| NEXTAUTH_SECRET="${NEXTAUTH_SECRET}" |  | ||||||
| 
 |  | ||||||
| # For optional Outlook Calendar Integration |  | ||||||
| # Create at https://portal.azure.com |  | ||||||
| AZURE_AD_CLIENT_ID="" |  | ||||||
| AZURE_AD_CLIENT_SECRET="" |  | ||||||
| AZURE_AD_TENANT_ID="" |  | ||||||
| 
 |  | ||||||
| # Logging configuration |  | ||||||
| # Options: debug, none (check logger.js for more details) |  | ||||||
| LOG_LEVEL="none" |  | ||||||
| DEBUG_ENABLED=0 |  | ||||||
| EOF |  | ||||||
| export NEXT_TELEMETRY_DISABLED=1 |  | ||||||
| cd /opt/fluid-calendar |  | ||||||
| $STD npm run setup |  | ||||||
| $STD npm run build |  | ||||||
| msg_ok "Setup ${APPLICATION}" |  | ||||||
| 
 |  | ||||||
| msg_info "Creating Service" |  | ||||||
| cat <<EOF >/etc/systemd/system/fluid-calendar.service |  | ||||||
| [Unit] |  | ||||||
| Description=Fluid Calendar Application |  | ||||||
| After=network.target postgresql.service |  | ||||||
| 
 |  | ||||||
| [Service] |  | ||||||
| Restart=always |  | ||||||
| WorkingDirectory=/opt/fluid-calendar |  | ||||||
| ExecStart=/usr/bin/npm run start |  | ||||||
| 
 |  | ||||||
| [Install] |  | ||||||
| WantedBy=multi-user.target |  | ||||||
| EOF |  | ||||||
| systemctl enable -q --now fluid-calendar.service |  | ||||||
| msg_ok "Created Service" |  | ||||||
| 
 |  | ||||||
| motd_ssh |  | ||||||
| customize |  | ||||||
| 
 |  | ||||||
| msg_info "Cleaning up" |  | ||||||
| rm -f $tmp_file |  | ||||||
| $STD apt-get -y autoremove |  | ||||||
| $STD apt-get -y autoclean |  | ||||||
| msg_ok "Cleaned" |  | ||||||
| @ -1,298 +0,0 @@ | |||||||
| #!/usr/bin/env bash |  | ||||||
| 
 |  | ||||||
| # Copyright (c) 2021-2025 community-scripts ORG |  | ||||||
| # Author: dave-yap |  | ||||||
| # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE |  | ||||||
| # Source: https://seafile.com/ |  | ||||||
| 
 |  | ||||||
| source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" |  | ||||||
| color |  | ||||||
| verb_ip6 |  | ||||||
| catch_errors |  | ||||||
| setting_up_container |  | ||||||
| network_check |  | ||||||
| update_os |  | ||||||
| 
 |  | ||||||
| msg_info "Installing Dependencies (Patience)" |  | ||||||
| $STD apt-get install -y \ |  | ||||||
|     sudo \ |  | ||||||
|     mc \ |  | ||||||
|     wget \ |  | ||||||
|     curl \ |  | ||||||
|     xmlstarlet \ |  | ||||||
|     expect |  | ||||||
| msg_ok "Installed Dependencies" |  | ||||||
| 
 |  | ||||||
| msg_info "Installing MariaDB" |  | ||||||
| $STD apt-get install -y mariadb-server |  | ||||||
| systemctl start mariadb |  | ||||||
| msg_ok "Installed MariaDB" |  | ||||||
| 
 |  | ||||||
| msg_info "Setup MariaDB for Seafile" |  | ||||||
| CCNET_DB="ccnet_db" |  | ||||||
| SEAFILE_DB="seafile_db" |  | ||||||
| SEAHUB_DB="seahub_db" |  | ||||||
| DB_USER="seafile" |  | ||||||
| DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13) |  | ||||||
| ADMIN_EMAIL="admin@localhost.local" |  | ||||||
| ADMIN_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13) |  | ||||||
| sudo -u mysql mysql -s -e "CREATE DATABASE $CCNET_DB CHARACTER SET utf8;" |  | ||||||
| sudo -u mysql mysql -s -e "CREATE DATABASE $SEAFILE_DB CHARACTER SET utf8;" |  | ||||||
| sudo -u mysql mysql -s -e "CREATE DATABASE $SEAHUB_DB CHARACTER SET utf8;" |  | ||||||
| sudo -u mysql mysql -s -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';" |  | ||||||
| sudo -u mysql mysql -s -e "GRANT ALL PRIVILEGES ON $CCNET_DB.* TO '$DB_USER'@localhost;" |  | ||||||
| sudo -u mysql mysql -s -e "GRANT ALL PRIVILEGES ON $SEAFILE_DB.* TO '$DB_USER'@localhost;" |  | ||||||
| sudo -u mysql mysql -s -e "GRANT ALL PRIVILEGES ON $SEAHUB_DB.* TO '$DB_USER'@localhost;" |  | ||||||
| { |  | ||||||
|     echo "Application Credentials" |  | ||||||
|     echo "CCNET_DB: $CCNET_DB" |  | ||||||
|     echo "SEAFILE_DB: $SEAFILE_DB" |  | ||||||
|     echo "SEAHUB_DB: $SEAHUB_DB" |  | ||||||
|     echo "DB_USER: $DB_USER" |  | ||||||
|     echo "DB_PASS: $DB_PASS" |  | ||||||
|     echo "ADMIN_EMAIL: $ADMIN_EMAIL" |  | ||||||
|     echo "ADMIN_PASS: $ADMIN_PASS" |  | ||||||
| } >> ~/seafile.creds |  | ||||||
| msg_ok "MariaDB setup for Seafile" |  | ||||||
| 
 |  | ||||||
| msg_info "Installing Seafile Python Dependencies" |  | ||||||
| $STD apt-get install -y \ |  | ||||||
|     python3 \ |  | ||||||
|     python3-dev \ |  | ||||||
|     python3-setuptools \ |  | ||||||
|     python3-pip \ |  | ||||||
|     libmariadb-dev \ |  | ||||||
|     ldap-utils \ |  | ||||||
|     libldap2-dev \ |  | ||||||
|     libsasl2-dev \ |  | ||||||
|     pkg-config |  | ||||||
| $STD pip3 install \ |  | ||||||
|     django \ |  | ||||||
|     future \ |  | ||||||
|     mysqlclient \ |  | ||||||
|     pymysql \ |  | ||||||
|     pillow \ |  | ||||||
|     pylibmc \ |  | ||||||
|     captcha \ |  | ||||||
|     markupsafe \ |  | ||||||
|     jinja2 \ |  | ||||||
|     sqlalchemy \ |  | ||||||
|     psd-tools \ |  | ||||||
|     django-pylibmc \ |  | ||||||
|     django_simple_captcha \ |  | ||||||
|     djangosaml2 \ |  | ||||||
|     pysaml2 \ |  | ||||||
|     pycryptodome \ |  | ||||||
|     cffi \ |  | ||||||
|     lxml \ |  | ||||||
|     python-ldap |  | ||||||
| msg_ok "Installed Seafile Python Dependecies" |  | ||||||
| 
 |  | ||||||
| msg_info "Installing Seafile" |  | ||||||
| IP=$(ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1) |  | ||||||
| mkdir -p /opt/seafile |  | ||||||
| useradd seafile |  | ||||||
| mkdir -p /home/seafile |  | ||||||
| chown seafile: /home/seafile |  | ||||||
| chown seafile: /opt/seafile |  | ||||||
| mkdir -p /opt/conf |  | ||||||
| chown seafile:seafile /opt/conf |  | ||||||
| chmod 755 /opt/conf |  | ||||||
| mkdir -p /opt/ccnet |  | ||||||
| chown seafile:seafile /opt/ccnet |  | ||||||
| chmod 755 /opt/ccnet |  | ||||||
| chown -R seafile:seafile /opt/conf |  | ||||||
| chmod -R 755 /opt/conf |  | ||||||
| LATEST_FILE=$(curl -s "https://download.seadrive.org/" | \ |  | ||||||
|   xmlstarlet sel -N s3="http://s3.amazonaws.com/doc/2006-03-01/" \ |  | ||||||
|   -t -m "//s3:Contents[s3:Key[starts-with(text(),'seafile-server')]]" \ |  | ||||||
|   -v "s3:LastModified" -o " " -v "s3:Key" -n | \ |  | ||||||
|   sort -r | head -n1 | awk '{print $2}') |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| $STD su - seafile -c "wget -qc https://s3.eu-central-1.amazonaws.com/download.seadrive.org/$LATEST_FILE" |  | ||||||
| $STD su - seafile -c "tar -xzf $LATEST_FILE --strip-components=1 -C /opt/seafile/" |  | ||||||
| $STD su - seafile -c "expect <<EOF |  | ||||||
| spawn bash /opt/seafile/setup-seafile-mysql.sh |  | ||||||
| expect { |  | ||||||
|     \"Press ENTER to continue\" { |  | ||||||
|         send \"\r\" |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| expect { |  | ||||||
|     \"What is the name of the server\" { |  | ||||||
|         send \"Seafile\r\" |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| expect { |  | ||||||
|     \"What is the ip or domain of the server\" { |  | ||||||
|         send \"$IP\r\" |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| expect { |  | ||||||
|     \"Which port do you want to use for the seafile fileserver\" { |  | ||||||
|         send \"8082\r\" |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| expect { |  | ||||||
|     \"1 or 2\" { |  | ||||||
|         send \"2\r\" |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| expect { |  | ||||||
|     \"What is the host of mysql server\" { |  | ||||||
|         send \"localhost\r\" |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| expect { |  | ||||||
|     \"What is the port of mysql server\" { |  | ||||||
|         send \"3306\r\" |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| expect { |  | ||||||
|     \"Which mysql user to use for seafile\" { |  | ||||||
|         send \"seafile\r\" |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| expect { |  | ||||||
|     \"What is the password for mysql user\" { |  | ||||||
|         send \"$DB_PASS\r\" |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| expect { |  | ||||||
|     \"Enter the existing database name for ccnet\" { |  | ||||||
|         send \"$CCNET_DB\r\" |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| expect { |  | ||||||
|     \"Enter the existing database name for seafile\" { |  | ||||||
|         send \"$SEAFILE_DB\r\" |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| expect { |  | ||||||
|     \"Enter the existing database name for seahub\" { |  | ||||||
|         send \"$SEAHUB_DB\r\" |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| expect { |  | ||||||
|     \"Press ENTER to continue, or Ctrl-C to abort\" { |  | ||||||
|         send \"\r\" |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| expect eof |  | ||||||
| EOF" |  | ||||||
| msg_ok "Installed Seafile" |  | ||||||
| 
 |  | ||||||
| msg_info "Setting up Memcached" |  | ||||||
| $STD apt-get install -y \ |  | ||||||
|     memcached \ |  | ||||||
|     libmemcached-dev |  | ||||||
| $STD pip3 install \ |  | ||||||
|     pylibmc \ |  | ||||||
|     django-pylibmc |  | ||||||
| systemctl enable --now -q memcached |  | ||||||
| cat <<EOF >>/opt/seafile/conf/seahub_settings.py |  | ||||||
| CACHES = { |  | ||||||
|     'default': { |  | ||||||
|         'BACKEND': 'django_pylibmc.memcached.PyLibMCCache', |  | ||||||
|         'LOCATION': '127.0.0.1:11211', |  | ||||||
|     }, |  | ||||||
| } |  | ||||||
| EOF |  | ||||||
| msg_ok "Memcached Started" |  | ||||||
| 
 |  | ||||||
| msg_info "Adjusting Conf files" |  | ||||||
| sed -i "0,/127.0.0.1/s/127.0.0.1/0.0.0.0/" /opt/seafile/conf/gunicorn.conf.py |  | ||||||
| sed -i "0,/SERVICE_URL = \"http:\/\/$IP\"/s/SERVICE_URL = \"http:\/\/$IP\"/SERVICE_URL = \"http:\/\/$IP:8000\"/" /opt/seafile/conf/seahub_settings.py |  | ||||||
| echo -e "\nFILE_SERVER_ROOT = \"http://$IP:8082\"" >> /opt/seafile/conf/seahub_settings.py |  | ||||||
| echo -e "CSRF_TRUSTED_ORIGINS = ['http://$IP/']" >> /opt/seafile/conf/seahub_settings.py |  | ||||||
| msg_ok "Conf files adjusted" |  | ||||||
| 
 |  | ||||||
| msg_info "Setting up Seafile" |  | ||||||
| $STD su - seafile -c "bash /opt/seafile/seafile-server-latest/seafile.sh start" |  | ||||||
| $STD su - seafile -c "expect <<EOF |  | ||||||
| spawn bash /opt/seafile/seafile-server-latest/seahub.sh start |  | ||||||
| expect { |  | ||||||
|     \"email\" { |  | ||||||
|         send \"$ADMIN_EMAIL\r\" |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| expect { |  | ||||||
|     \"password\" { |  | ||||||
|         send \"$ADMIN_PASS\r\" |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| expect { |  | ||||||
|     \"password again\" { |  | ||||||
|         send \"$ADMIN_PASS\r\" |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| expect eof |  | ||||||
| EOF" |  | ||||||
| $STD su - seafile -c "bash /opt/seafile/seafile-server-latest/seahub.sh stop" || true |  | ||||||
| $STD su - seafile -c "bash /opt/seafile/seafile-server-latest/seafile.sh stop" || true |  | ||||||
| msg_ok "Seafile setup" |  | ||||||
| 
 |  | ||||||
| msg_info "Creating Services" |  | ||||||
| cat <<EOF >/etc/systemd/system/seafile.service |  | ||||||
| [Unit] |  | ||||||
| Description=Seafile File-hosting |  | ||||||
| After=network.target mysql.service memcached.service |  | ||||||
| Wants=mysql.service memcached.service |  | ||||||
| 
 |  | ||||||
| [Service] |  | ||||||
| Type=forking |  | ||||||
| User=seafile |  | ||||||
| Group=seafile |  | ||||||
| WorkingDirectory=/opt/seafile |  | ||||||
| 
 |  | ||||||
| ExecStart=/opt/seafile/seafile-server-latest/seafile.sh start |  | ||||||
| ExecStartPost=/opt/seafile/seafile-server-latest/seahub.sh start |  | ||||||
| ExecStop=/opt/seafile/seafile-server-latest/seahub.sh stop |  | ||||||
| ExecStop=/opt/seafile/seafile-server-latest/seafile.sh stop |  | ||||||
| 
 |  | ||||||
| Restart=on-failure |  | ||||||
| RestartSec=5s |  | ||||||
| 
 |  | ||||||
| [Install] |  | ||||||
| WantedBy=multi-user.target |  | ||||||
| EOF |  | ||||||
| systemctl enable --now -q seafile.service |  | ||||||
| msg_ok "Created Services" |  | ||||||
| 
 |  | ||||||
| msg_info "Creating External Storage script" |  | ||||||
| cat <<'EOF' >~/external-storage.sh |  | ||||||
| #!/bin/bash |  | ||||||
| STORAGE_DIR="/path/to/your/external/storage" |  | ||||||
| 
 |  | ||||||
| # Move the seafile-data folder to external storage |  | ||||||
| mv /opt/seafile/seafile-data $STORAGE_DIR/seafile-data |  | ||||||
| 
 |  | ||||||
| # Create a symlink for access |  | ||||||
| ln -s $STORAGE_DIR/seafile-data /opt/seafile/seafile-data |  | ||||||
| EOF |  | ||||||
| chmod +x ~/external-storage.sh |  | ||||||
| msg_ok "Bash Script for External Storage created" |  | ||||||
| 
 |  | ||||||
| msg_info "Creating Domain access script" |  | ||||||
| cat <<'EOF' >~/domain.sh |  | ||||||
| #!/bin/bash |  | ||||||
| DOMAIN=$1 |  | ||||||
| IP=$(ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1) |  | ||||||
| DOMAIN_NOSCHEME=$(echo $DOMAIN | sed 's|^https://||') |  | ||||||
| 
 |  | ||||||
| #Change the CORS to provided domain |  | ||||||
| sed -i "s|CSRF_TRUSTED_ORIGINS = ['http://$IP:8000/']|CSRF_TRUSTED_ORIGINS = ['$DOMAIN']|g" /opt/seafile/conf/seahub_settings.py |  | ||||||
| sed -i "s|FILE_SERVER_ROOT = \"http://$IP:8082\"|FILE_SERVER_ROOT = \"$DOMAIN/seafhttp\"|g" /opt/seafile/conf/seahub_settings.py |  | ||||||
| EOF |  | ||||||
| chmod +x ~/domain.sh |  | ||||||
| msg_ok "Bash Script for Domain access created" |  | ||||||
| 
 |  | ||||||
| motd_ssh |  | ||||||
| customize |  | ||||||
| 
 |  | ||||||
| msg_info "Cleaning up" |  | ||||||
| rm -rf /home/seafile/seafile*.tar.gz |  | ||||||
| $STD apt-get -y autoremove |  | ||||||
| $STD apt-get -y autoclean |  | ||||||
| msg_ok "Cleaned" |  | ||||||
							
								
								
									
										1
									
								
								install/snipeit-install.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								install/snipeit-install.sh
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | |||||||
|  | 
 | ||||||
| @ -1,40 +0,0 @@ | |||||||
| { |  | ||||||
|   "name": "Fluid-Calendar", |  | ||||||
|   "slug": "fluid-calendar", |  | ||||||
|   "categories": [ |  | ||||||
|     19, |  | ||||||
|     0 |  | ||||||
|   ], |  | ||||||
|   "date_created": "2025-03-04", |  | ||||||
|   "type": "ct", |  | ||||||
|   "updateable": true, |  | ||||||
|   "privileged": false, |  | ||||||
|   "interface_port": 3000, |  | ||||||
|   "documentation": "https://github.com/dotnetfactory/fluid-calendar/tree/main/docs", |  | ||||||
|   "website": "https://github.com/dotnetfactory/fluid-calendar", |  | ||||||
|   "logo": "https://raw.githubusercontent.com/dotnetfactory/fluid-calendar/refs/heads/main/src/app/favicon.ico", |  | ||||||
|   "description": "The open-source intelligent calendar that adapts to your workflow. Experience seamless task scheduling powered by AI, designed to make your time management effortless.", |  | ||||||
|   "install_methods": [ |  | ||||||
|     { |  | ||||||
|       "type": "default", |  | ||||||
|       "script": "ct/fluid-calendar.sh", |  | ||||||
|       "resources": { |  | ||||||
|         "cpu": 3, |  | ||||||
|         "ram": 4096, |  | ||||||
|         "hdd": 7, |  | ||||||
|         "os": "Debian", |  | ||||||
|         "version": "12" |  | ||||||
|       } |  | ||||||
|     } |  | ||||||
|   ], |  | ||||||
|   "default_credentials": { |  | ||||||
|     "username": null, |  | ||||||
|     "password": null |  | ||||||
|   }, |  | ||||||
|   "notes": [ |  | ||||||
|     { |  | ||||||
|       "text": "Creds: cat ~/fluid-calendar.creds", |  | ||||||
|       "type": "info" |  | ||||||
|     } |  | ||||||
|   ] |  | ||||||
| } |  | ||||||
							
								
								
									
										0
									
								
								json/snipeit.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								json/snipeit.json
									
									
									
									
									
										Normal file
									
								
							
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 tremor021
						tremor021