ソースを参照

Merge branch 'stretch' of https://github.com/bashrc/freedombone

Bob Mottram 7 年 前
コミット
f125123fb4
共有5 個のファイルを変更した22 個の追加16 個の削除を含む
  1. 2
    0
      src/freedombone-app-koel
  2. 1
    2
      src/freedombone-app-pleroma
  3. 10
    6
      src/freedombone-client
  4. 7
    6
      src/freedombone-image-customise
  5. 2
    2
      tests/output.sh

+ 2
- 0
src/freedombone-app-koel ファイルの表示

176
 }
176
 }
177
 
177
 
178
 function koel_import_from_directory {
178
 function koel_import_from_directory {
179
+    read_config_param MY_USERNAME
180
+
179
     data=$(mktemp 2>/dev/null)
181
     data=$(mktemp 2>/dev/null)
180
     dialog --title "Choose a directory containing music" --dselect "/home/$MY_USERNAME/" 30 60 2> "$data"
182
     dialog --title "Choose a directory containing music" --dselect "/home/$MY_USERNAME/" 30 60 2> "$data"
181
     selected_dir=$(cat "$data")
183
     selected_dir=$(cat "$data")

+ 1
- 2
src/freedombone-app-pleroma ファイルの表示

42
 PLEROMA_ADMIN_PASSWORD=
42
 PLEROMA_ADMIN_PASSWORD=
43
 PLEROMA_DIR=/etc/pleroma
43
 PLEROMA_DIR=/etc/pleroma
44
 PLEROMA_SECRET_KEY=""
44
 PLEROMA_SECRET_KEY=""
45
+pleroma_secret=$PLEROMA_DIR/config/dev.secret.exs
45
 
46
 
46
 PLEROMA_BACKGROUND_IMAGE_URL=
47
 PLEROMA_BACKGROUND_IMAGE_URL=
47
 
48
 
406
         echo $"Missing directory $PLEROMA_DIR/config"
407
         echo $"Missing directory $PLEROMA_DIR/config"
407
         exit 7835393
408
         exit 7835393
408
     fi
409
     fi
409
-    pleroma_secret=$PLEROMA_DIR/config/dev.secret.exs
410
     if [ ! -f $PLEROMA_DIR/config/dev.exs ]; then
410
     if [ ! -f $PLEROMA_DIR/config/dev.exs ]; then
411
         echo $"Did not find $PLEROMA_DIR/config/dev.exs"
411
         echo $"Did not find $PLEROMA_DIR/config/dev.exs"
412
         exit 78923528
412
         exit 78923528
1186
 
1186
 
1187
     # We need to set up the url option again because it somehow gets
1187
     # We need to set up the url option again because it somehow gets
1188
     # lost during mix compile
1188
     # lost during mix compile
1189
-    pleroma_secret=$PLEROMA_DIR/config/dev.secret.exs
1190
     if ! grep -q 'watchers: [],' $pleroma_secret; then
1189
     if ! grep -q 'watchers: [],' $pleroma_secret; then
1191
         sed -i 's|watchers: \[\]|watchers: \[\],|g' $pleroma_secret
1190
         sed -i 's|watchers: \[\]|watchers: \[\],|g' $pleroma_secret
1192
     fi
1191
     fi

+ 10
- 6
src/freedombone-client ファイルの表示

94
         fi
94
         fi
95
     fi
95
     fi
96
     sudo cp /etc/crontab ~/temp_crontab
96
     sudo cp /etc/crontab ~/temp_crontab
97
-    sudo chown "$CURR_USER":"$CURR_GROUP" ~/temp_crontab
98
-    if ! grep -q 'gpg --refresh-keys' ~/temp_crontab; then
99
-        echo "0            */$REFRESH_GPG_KEYS_HOURS *   *   *   $CURR_USER /usr/bin/gpg --refresh-keys > /dev/null" >> ~/temp_crontab
100
-        sudo cp ~/temp_crontab /etc/crontab
101
-        sudo chown root:root /etc/crontab
97
+    if [ -f ~/temp_crontab ]; then
98
+        sudo chown "$CURR_USER":"$CURR_GROUP" ~/temp_crontab
99
+        if grep -q 'test' ~/temp_crontab; then
100
+            if ! grep -q 'gpg --refresh-keys' ~/temp_crontab; then
101
+                echo "0            */$REFRESH_GPG_KEYS_HOURS *   *   *   $CURR_USER /usr/bin/gpg --refresh-keys > /dev/null" >> ~/temp_crontab
102
+                sudo cp ~/temp_crontab /etc/crontab
103
+                sudo chown root:root /etc/crontab
104
+            fi
105
+        fi
106
+        rm ~/temp_crontab
102
     fi
107
     fi
103
-    rm ~/temp_crontab
104
 }
108
 }
105
 
109
 
106
 # see https://stribika.github.io/2015/01/04/secure-secure-shell.html
110
 # see https://stribika.github.io/2015/01/04/secure-secure-shell.html

+ 7
- 6
src/freedombone-image-customise ファイルの表示

1708
       echo '[Install]';
1708
       echo '[Install]';
1709
       echo 'WantedBy=multi-user.target'; } > "$rootdir/etc/systemd/system/inadyn.service"
1709
       echo 'WantedBy=multi-user.target'; } > "$rootdir/etc/systemd/system/inadyn.service"
1710
     chroot "$rootdir" systemctl enable inadyn
1710
     chroot "$rootdir" systemctl enable inadyn
1711
-    echo "inadyn commit:$INADYN_COMMIT" >> "$rootdir/root/freedombone-completed.txt"
1711
+    echo "inadyn commit:$INADYN_COMMIT" >> "$rootdir/root/${PROJECT_NAME}-completed.txt"
1712
 }
1712
 }
1713
 
1713
 
1714
 image_setup_utils() {
1714
 image_setup_utils() {
1829
     echo "export PATH=\$PATH:\$GOPATH" >> "${rootdir}/home/go/.bashrc"
1829
     echo "export PATH=\$PATH:\$GOPATH" >> "${rootdir}/home/go/.bashrc"
1830
     chroot "$rootdir" chown -R go:go /home/go
1830
     chroot "$rootdir" chown -R go:go /home/go
1831
     cp "${rootdir}/home/go/go${GO_VERSION}/bin/"* "${rootdir}/usr/bin"
1831
     cp "${rootdir}/home/go/go${GO_VERSION}/bin/"* "${rootdir}/usr/bin"
1832
+    echo "upgrade_golang:$GO_VERSION" >> "${rootdir}/root/${PROJECT_NAME}-completed.txt"
1832
 
1833
 
1833
     # Tomb
1834
     # Tomb
1834
     chroot "$rootdir" apt-get -yq install zsh pinentry-curses
1835
     chroot "$rootdir" apt-get -yq install zsh pinentry-curses
1836
     cd "$rootdir/root/build/tomb" || exit 468368345425
1837
     cd "$rootdir/root/build/tomb" || exit 468368345425
1837
     git checkout "$TOMB_COMMIT" -b "$TOMB_COMMIT"
1838
     git checkout "$TOMB_COMMIT" -b "$TOMB_COMMIT"
1838
     chroot "$rootdir" cd /root/build/tomb && make install
1839
     chroot "$rootdir" cd /root/build/tomb && make install
1839
-    echo "tomb commit:$TOMB_COMMIT" >> "$rootdir/root/freedombone-completed.txt"
1840
+    echo "tomb commit:$TOMB_COMMIT" >> "$rootdir/root/${PROJECT_NAME}-completed.txt"
1840
 
1841
 
1841
     if ! grep -q '\* hard maxsyslogins' "$rootdir/etc/security/limits.conf"; then
1842
     if ! grep -q '\* hard maxsyslogins' "$rootdir/etc/security/limits.conf"; then
1842
         echo '* hard maxsyslogins 10' >> "$rootdir/etc/security/limits.conf"
1843
         echo '* hard maxsyslogins 10' >> "$rootdir/etc/security/limits.conf"
1869
     cd "$rootdir/root/build/gpgit" || exit 62484624682
1870
     cd "$rootdir/root/build/gpgit" || exit 62484624682
1870
     git checkout "$GPGIT_COMMIT" -b "$GPGIT_COMMIT"
1871
     git checkout "$GPGIT_COMMIT" -b "$GPGIT_COMMIT"
1871
     cp "$rootdir/root/build/gpgit/gpgit.pl" "$rootdir/usr/bin"
1872
     cp "$rootdir/root/build/gpgit/gpgit.pl" "$rootdir/usr/bin"
1872
-    echo "gpgit commit:$GPGIT_COMMIT" >> "$rootdir/root/freedombone-completed.txt"
1873
+    echo "gpgit commit:$GPGIT_COMMIT" >> "$rootdir/root/${PROJECT_NAME}-completed.txt"
1873
 
1874
 
1874
     # email client
1875
     # email client
1875
     chroot "$rootdir" apt-get -yq install lynx abook urlview mutt
1876
     chroot "$rootdir" apt-get -yq install lynx abook urlview mutt
1878
     cd "$rootdir/root/build/cleanup-maildir" || exit 246872646847264
1879
     cd "$rootdir/root/build/cleanup-maildir" || exit 246872646847264
1879
     git checkout "$CLEANUP_MAILDIR_COMMIT" -b "$CLEANUP_MAILDIR_COMMIT"
1880
     git checkout "$CLEANUP_MAILDIR_COMMIT" -b "$CLEANUP_MAILDIR_COMMIT"
1880
     cp "$rootdir/root/build/cleanup-maildir/cleanup-maildir" "$rootdir/usr/bin"
1881
     cp "$rootdir/root/build/cleanup-maildir/cleanup-maildir" "$rootdir/usr/bin"
1881
-    echo "cleanup-maildir commit:$CLEANUP_MAILDIR_COMMIT" >> "$rootdir/root/freedombone-completed.txt"
1882
+    echo "cleanup-maildir commit:$CLEANUP_MAILDIR_COMMIT" >> "$rootdir/root/${PROJECT_NAME}-completed.txt"
1882
 
1883
 
1883
     # web server
1884
     # web server
1884
     chroot "$rootdir" apt-get -yq remove --purge apache2
1885
     chroot "$rootdir" apt-get -yq remove --purge apache2
1886
     git clone "$NGINX_ENSITE_REPO" "$rootdir/root/build/nginx_ensite"
1887
     git clone "$NGINX_ENSITE_REPO" "$rootdir/root/build/nginx_ensite"
1887
     cd "$rootdir/root/build/nginx_ensite" || exit 462746826482
1888
     cd "$rootdir/root/build/nginx_ensite" || exit 462746826482
1888
     git checkout "$NGINX_ENSITE_COMMIT" -b "$NGINX_ENSITE_COMMIT"
1889
     git checkout "$NGINX_ENSITE_COMMIT" -b "$NGINX_ENSITE_COMMIT"
1889
-    echo "nginx-ensite commit:$NGINX_ENSITE_COMMIT" >> "$rootdir/root/freedombone-completed.txt"
1890
+    echo "nginx-ensite commit:$NGINX_ENSITE_COMMIT" >> "$rootdir/root/${PROJECT_NAME}-completed.txt"
1890
     chroot "$rootdir" cd /root/build/nginx_ensite && make install
1891
     chroot "$rootdir" cd /root/build/nginx_ensite && make install
1891
     if [ ! -f "$rootdir/etc/pam.d/nginx" ]; then
1892
     if [ ! -f "$rootdir/etc/pam.d/nginx" ]; then
1892
         { echo '#%PAM-1.0';
1893
         { echo '#%PAM-1.0';
1902
 
1903
 
1903
 image_install_nodejs() {
1904
 image_install_nodejs() {
1904
     mesh_install_nodejs
1905
     mesh_install_nodejs
1905
-    #echo 'install_nodejs' >> ${rootdir}/root/${PROJECT_NAME}-completed.txt
1906
+    echo 'install_nodejs' >> "${rootdir}/root/${PROJECT_NAME}-completed.txt"
1906
 }
1907
 }
1907
 
1908
 
1908
 image_preinstall_repos() {
1909
 image_preinstall_repos() {

+ 2
- 2
tests/output.sh ファイルの表示

259
               fi
259
               fi
260
               ;;
260
               ;;
261
     V-51391)  if [ "$3" = "en" ]; then
261
     V-51391)  if [ "$3" = "en" ]; then
262
-                  log_msg $2 'A file integrity baseline must be created. Reset the tripwire from the administrator control panel.'
262
+                  log_msg $2 'A file integrity baseline must be created. Reset the tripwire from the administrator control panel under security settings.'
263
               else
263
               else
264
                   log_msg $2 '必须创建文件完整性基线。'
264
                   log_msg $2 '必须创建文件完整性基线。'
265
               fi
265
               fi
266
               if [ $2 -ne 0 ];then
266
               if [ $2 -ne 0 ];then
267
-                  printf '\n######################\n\nSTIG-ID:RHEL-06-000018\n\nVulnerability Discussion: For tripwire to be effective, an initial database of "known-good" information about files must be captured and it should be able to be verified against the installed files.\n\nFix text: Run "reset tripwire" from the administrator control panel.\n\n######################\n\n' >> $LOG
267
+                  printf '\n######################\n\nSTIG-ID:RHEL-06-000018\n\nVulnerability Discussion: For tripwire to be effective, an initial database of "known-good" information about files must be captured and it should be able to be verified against the installed files.\n\nFix text: Run "reset tripwire" from security settings on the administrator control panel.\n\n######################\n\n' >> $LOG
268
               fi
268
               fi
269
               ;;
269
               ;;
270
     V-38491)  if [ "$3" = "en" ]; then
270
     V-38491)  if [ "$3" = "en" ]; then