#!/bin/sh # ===================================================================== # Projet : DARKMAKE # Fichier : initProjectFromGitHub # Auteur : Nicolas "DarkHack" Chapuis (c) 2026 # ================== DARKHACK ================== # [ darkweb.fr - system online ] # Powered by Perplexity, your AI assistant # [https://www.perplexity.ai](https://www.perplexity.ai) # ============================================== # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ===================================================================== rootDarkMake="${rootDarkMake:-/etc/darkmake}" #./bin/initProjectFromGitHubToSvn pcre2 svn://vcs.exim.org/pcre2/code/trunk #git svn clone svn://vcs.exim.org/pcre2/code/trunk pcre2.git . /etc/darksh/lib/shTools shLog="$0($$):" shDebugEnable="1" shDebug "$*" #$(shInclude $rootDarkMake/firewall/lib-sh/firewall) projectName="$1" projectUrl="$2" # initProjectFromGitHub miniupnp https://github.com/miniupnp/miniupnp.git if [ -z "$projectName" ] || [ -z "$projectUrl" ];then shDebug " init from github project, [name:$projectName] [url source:$projectUrl]" exit 1 fi chrootDir="/srv/httpd" pkgSourceDirectory="/var/www/darkweb.fr/https/pkg" pkgProjectDir="$pkgSourceDirectory/git" if [ -d "$pkgProjectDir/$projectName.git" ];then echo "clean project?" read answer if [ "$answer" = "y" ];then rm -R "$pkgProjectDir/$projectName.git";fi fi if [ ! -d "$pkgProjectDir/$projectName.git" ];then shDebug " clone git repository :$pkgProjectDir/$projectName.git" mkdir "$pkgProjectDir/$projectName.git" cd "$pkgProjectDir/$projectName.git" echo git clone "$projectUrl" . git -c http.sslVerify=false clone --recursive "$projectUrl" . # cp hooks/post-update.sample hooks/post-update git update-server-info git config --bool core.bare true git config --bool core.sharedRepository true # git init --bare --shared # cp hooks/post-update.sample hooks/post-update # git update-server-info # echo git remote add origin "$projectUrl" # git remote add origin "$projectUrl" git fetch if [ -d "$chrootDir" ];then $rootDarkMake/chroot/bin/execute "$chrootDir" "$(which chown)" -R www-data:www-data "$pkgProjectDir/$projectName.git" $rootDarkMake/chroot/bin/execute "$chrootDir" "$(which chmod)" -R a+rw "$pkgProjectDir/$projectName.git" else chown -R www-data:www-data "$pkgProjectDir/$projectName.git" chmod -R a+rw "$pkgProjectDir/$projectName.git" fi fi