Browse Source

Deprecate backup of github projects

Since gogs can do that
Bob Mottram 9 years ago
parent
commit
6fd4d2b084
1 changed files with 0 additions and 53 deletions
  1. 0
    53
      src/freedombone

+ 0
- 53
src/freedombone View File

@@ -321,12 +321,6 @@ CREATE_GIT_PROJECT_COMMAND='create-project'
321 321
 # File which keeps track of what has already been installed
322 322
 COMPLETION_FILE=$HOME/freedombone-completed.txt
323 323
 
324
-# Your github username
325
-GITHUB_USERNAME=
326
-
327
-# Directory where github projects will be backed up
328
-GITHUB_BACKUP_DIRECTORY=/var/backups/github
329
-
330 324
 # Used to indicate whether the backup contains MariaDB databases or not
331 325
 BACKUP_INCLUDES_DATABASES="no"
332 326
 
@@ -1076,12 +1070,6 @@ function read_configuration {
1076 1070
       if grep -q "ROUTER_IP_ADDRESS" $CONFIGURATION_FILE; then
1077 1071
           ROUTER_IP_ADDRESS=$(grep "ROUTER_IP_ADDRESS" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
1078 1072
       fi
1079
-      if grep -q "GITHUB_USERNAME" $CONFIGURATION_FILE; then
1080
-          GITHUB_USERNAME=$(grep "GITHUB_USERNAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
1081
-      fi
1082
-      if grep -q "GITHUB_BACKUP_DIRECTORY" $CONFIGURATION_FILE; then
1083
-          GITHUB_BACKUP_DIRECTORY=$(grep "GITHUB_BACKUP_DIRECTORY" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
1084
-      fi
1085 1073
       if grep -q "CPU_CORES" $CONFIGURATION_FILE; then
1086 1074
           CPU_CORES=$(grep "CPU_CORES" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
1087 1075
       fi
@@ -11339,46 +11327,6 @@ function create_git_project {
11339 11327
   echo 'create_git_project' >> $COMPLETION_FILE
11340 11328
 }
11341 11329
 
11342
-# Create daily backups of any projects on Github
11343
-# Then if Github goes away, turns evil, is censored or has
11344
-# outages then you still have access to your projects
11345
-function backup_github_projects {
11346
-  if grep -Fxq "backup_github_projects" $COMPLETION_FILE; then
11347
-      return
11348
-  fi
11349
-  if [ ! $GITHUB_USERNAME ]; then
11350
-      return 731
11351
-  fi
11352
-  if [ ! $GITHUB_BACKUP_DIRECTORY ]; then
11353
-      return 732
11354
-  fi
11355
-  apt-get -y install git
11356
-
11357
-  # create a github backups directory if needed
11358
-  if [ ! -d $GITHUB_BACKUP_DIRECTORY ]; then
11359
-      mkdir -p $GITHUB_BACKUP_DIRECTORY
11360
-  fi
11361
-
11362
-  # get the backup utility
11363
-  cd $INSTALL_DIR
11364
-  git clone https://github.com/josegonzalez/python-github-backup
11365
-
11366
-  # install it
11367
-  cd $INSTALL_DIR/python-github-backup
11368
-  python setup.py install
11369
-
11370
-  # add a daily cron entry
11371
-  echo '#!/bin/bash' > /etc/cron.daily/github
11372
-  echo "github-backup $GITHUB_USERNAME -o $GITHUB_BACKUP_DIRECTORY --repositories" >> /etc/cron.daily/github
11373
-  echo 'exit 0' >> /etc/cron.daily/github
11374
-  chmod +x /etc/cron.daily/github
11375
-
11376
-  # do an initial backup
11377
-  /etc/cron.daily/github
11378
-
11379
-  echo 'backup_github_projects' >> $COMPLETION_FILE
11380
-}
11381
-
11382 11330
 function check_date {
11383 11331
   curr_date=$(date)
11384 11332
   if [[ $curr_date == *"1970"* ]]; then
@@ -11876,7 +11824,6 @@ set_your_domain_name
11876 11824
 time_synchronisation
11877 11825
 configure_internet_protocol
11878 11826
 create_git_project
11879
-backup_github_projects
11880 11827
 configure_ssh
11881 11828
 remove_instructions_from_motd
11882 11829
 check_hwrng