Selaa lähdekoodia

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

Bob Mottram 7 vuotta sitten
vanhempi
commit
f125123fb4

+ 2
- 0
src/freedombone-app-koel Näytä tiedosto

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

+ 1
- 2
src/freedombone-app-pleroma Näytä tiedosto

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

+ 10
- 6
src/freedombone-client Näytä tiedosto

@@ -94,13 +94,17 @@ function refresh_gpg_keys {
94 94
         fi
95 95
     fi
96 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 107
     fi
103
-    rm ~/temp_crontab
104 108
 }
105 109
 
106 110
 # see https://stribika.github.io/2015/01/04/secure-secure-shell.html

+ 7
- 6
src/freedombone-image-customise Näytä tiedosto

@@ -1708,7 +1708,7 @@ image_install_inadyn() {
1708 1708
       echo '[Install]';
1709 1709
       echo 'WantedBy=multi-user.target'; } > "$rootdir/etc/systemd/system/inadyn.service"
1710 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 1714
 image_setup_utils() {
@@ -1829,6 +1829,7 @@ image_setup_utils() {
1829 1829
     echo "export PATH=\$PATH:\$GOPATH" >> "${rootdir}/home/go/.bashrc"
1830 1830
     chroot "$rootdir" chown -R go:go /home/go
1831 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 1834
     # Tomb
1834 1835
     chroot "$rootdir" apt-get -yq install zsh pinentry-curses
@@ -1836,7 +1837,7 @@ image_setup_utils() {
1836 1837
     cd "$rootdir/root/build/tomb" || exit 468368345425
1837 1838
     git checkout "$TOMB_COMMIT" -b "$TOMB_COMMIT"
1838 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 1842
     if ! grep -q '\* hard maxsyslogins' "$rootdir/etc/security/limits.conf"; then
1842 1843
         echo '* hard maxsyslogins 10' >> "$rootdir/etc/security/limits.conf"
@@ -1869,7 +1870,7 @@ image_setup_utils() {
1869 1870
     cd "$rootdir/root/build/gpgit" || exit 62484624682
1870 1871
     git checkout "$GPGIT_COMMIT" -b "$GPGIT_COMMIT"
1871 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 1875
     # email client
1875 1876
     chroot "$rootdir" apt-get -yq install lynx abook urlview mutt
@@ -1878,7 +1879,7 @@ image_setup_utils() {
1878 1879
     cd "$rootdir/root/build/cleanup-maildir" || exit 246872646847264
1879 1880
     git checkout "$CLEANUP_MAILDIR_COMMIT" -b "$CLEANUP_MAILDIR_COMMIT"
1880 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 1884
     # web server
1884 1885
     chroot "$rootdir" apt-get -yq remove --purge apache2
@@ -1886,7 +1887,7 @@ image_setup_utils() {
1886 1887
     git clone "$NGINX_ENSITE_REPO" "$rootdir/root/build/nginx_ensite"
1887 1888
     cd "$rootdir/root/build/nginx_ensite" || exit 462746826482
1888 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 1891
     chroot "$rootdir" cd /root/build/nginx_ensite && make install
1891 1892
     if [ ! -f "$rootdir/etc/pam.d/nginx" ]; then
1892 1893
         { echo '#%PAM-1.0';
@@ -1902,7 +1903,7 @@ image_setup_utils() {
1902 1903
 
1903 1904
 image_install_nodejs() {
1904 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 1909
 image_preinstall_repos() {

+ 2
- 2
tests/output.sh Näytä tiedosto

@@ -259,12 +259,12 @@ an administrator.\n\n######################\n\n' >> $LOG
259 259
               fi
260 260
               ;;
261 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 263
               else
264 264
                   log_msg $2 '必须创建文件完整性基线。'
265 265
               fi
266 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 268
               fi
269 269
               ;;
270 270
     V-38491)  if [ "$3" = "en" ]; then