From 748348f4075e15af190910d1db37091ff6d5c2a6 Mon Sep 17 00:00:00 2001 From: glaszig Date: Thu, 1 Aug 2019 15:07:26 +0200 Subject: [PATCH 1/3] during installation copy files from the git working tree to their destinations instead of moving them and making git think they got deleted --- installers/common.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index fb2c9bfa..bf3a8400 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -131,9 +131,9 @@ function create_hostapd_scripts() { sudo mkdir $raspap_dir/hostapd || install_error "Unable to create directory '$raspap_dir/hostapd'" # Move logging shell scripts - sudo mv "$webroot_dir/installers/"*log.sh "$raspap_dir/hostapd" || install_error "Unable to move logging scripts" + sudo cp "$webroot_dir/installers/"*log.sh "$raspap_dir/hostapd" || install_error "Unable to move logging scripts" # Move service control shell scripts - sudo mv "$webroot_dir/installers/"service*.sh "$raspap_dir/hostapd" || install_error "Unable to move service control scripts" + sudo cp "$webroot_dir/installers/"service*.sh "$raspap_dir/hostapd" || install_error "Unable to move service control scripts" # Make enablelog.sh and disablelog.sh not writable by www-data group. sudo chown -c root:"$raspap_user" "$raspap_dir/hostapd/"*.sh || install_error "Unable change owner and/or group." sudo chmod 750 "$raspap_dir/hostapd/"*.sh || install_error "Unable to change file permissions." @@ -152,7 +152,7 @@ function download_latest_files() { # Move icons to webroot echo -n "Installing high-res favicons" - sudo mv $webroot_dir/dist/icons/* $webroot_dir || install_error "Unable to move icons to web root" + sudo cp $webroot_dir/dist/icons/* $webroot_dir || install_error "Unable to move icons to web root" } # Sets files ownership in web root directory @@ -200,7 +200,7 @@ function move_config_file() { fi install_log "Moving configuration file to '$raspap_dir'" - sudo mv "$webroot_dir"/raspap.php "$raspap_dir" || install_error "Unable to move files to '$raspap_dir'" + sudo cp "$webroot_dir"/raspap.php "$raspap_dir" || install_error "Unable to move files to '$raspap_dir'" sudo chown -R $raspap_user:$raspap_user "$raspap_dir" || install_error "Unable to change file ownership for '$raspap_dir'" } @@ -210,10 +210,10 @@ function default_configuration() { if [ -f /etc/default/hostapd ]; then sudo mv /etc/default/hostapd /tmp/default_hostapd.old || install_error "Unable to remove old /etc/default/hostapd file" fi - sudo mv $webroot_dir/config/default_hostapd /etc/default/hostapd || install_error "Unable to move hostapd defaults file" - sudo mv $webroot_dir/config/hostapd.conf /etc/hostapd/hostapd.conf || install_error "Unable to move hostapd configuration file" - sudo mv $webroot_dir/config/dnsmasq.conf /etc/dnsmasq.conf || install_error "Unable to move dnsmasq configuration file" - sudo mv $webroot_dir/config/dhcpcd.conf /etc/dhcpcd.conf || install_error "Unable to move dhcpcd configuration file" + sudo cp $webroot_dir/config/default_hostapd /etc/default/hostapd || install_error "Unable to move hostapd defaults file" + sudo cp $webroot_dir/config/hostapd.conf /etc/hostapd/hostapd.conf || install_error "Unable to move hostapd configuration file" + sudo cp $webroot_dir/config/dnsmasq.conf /etc/dnsmasq.conf || install_error "Unable to move dnsmasq configuration file" + sudo cp $webroot_dir/config/dhcpcd.conf /etc/dhcpcd.conf || install_error "Unable to move dhcpcd configuration file" # Generate required lines for Rasp AP to place into rc.local file. # #RASPAP is for removal script @@ -241,7 +241,7 @@ function default_configuration() { read answer if [ "$answer" != 'n' ] && [ "$answer" != 'N' ]; then echo -n "Enabling RaspAP daemon. Disable with: sudo systemctl disable raspap.service" - sudo mv $webroot_dir/installers/raspap.service /lib/systemd/system/ || install_error "Unable to move raspap.service file" + sudo cp $webroot_dir/installers/raspap.service /lib/systemd/system/ || install_error "Unable to move raspap.service file" sudo systemctl enable raspap.service || install_error "Failed to enable raspap.service" fi } From 2104ccb91a4b5c944f4dbca81cab7d47e9ff2709 Mon Sep 17 00:00:00 2001 From: glaszig Date: Thu, 1 Aug 2019 15:31:34 +0200 Subject: [PATCH 2/3] favicons and sorts can stay in subdirectories and be pointed to by proper meta tags. do not copy these around during installation and poison the git tree. --- dist/icons/browserconfig.xml => browserconfig.xml | 2 +- index.php | 4 ++-- installers/common.sh | 4 ---- 3 files changed, 3 insertions(+), 7 deletions(-) rename dist/icons/browserconfig.xml => browserconfig.xml (72%) diff --git a/dist/icons/browserconfig.xml b/browserconfig.xml similarity index 72% rename from dist/icons/browserconfig.xml rename to browserconfig.xml index e8b57e57..087d949b 100644 --- a/dist/icons/browserconfig.xml +++ b/browserconfig.xml @@ -2,7 +2,7 @@ - + #b91d47 diff --git a/index.php b/index.php index 8189e175..fd74dc60 100755 --- a/index.php +++ b/index.php @@ -95,8 +95,8 @@ $theme_url = 'dist/css/'.htmlspecialchars($theme, ENT_QUOTES); - - + + diff --git a/installers/common.sh b/installers/common.sh index bf3a8400..fa4d1591 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -149,10 +149,6 @@ function download_latest_files() { install_log "Cloning latest files from github" git clone --depth 1 https://github.com/billz/raspap-webgui /tmp/raspap-webgui || install_error "Unable to download files from github" sudo mv /tmp/raspap-webgui $webroot_dir || install_error "Unable to move raspap-webgui to web root" - - # Move icons to webroot - echo -n "Installing high-res favicons" - sudo cp $webroot_dir/dist/icons/* $webroot_dir || install_error "Unable to move icons to web root" } # Sets files ownership in web root directory From c70433585a18d8a382bf70998a084b415430eac9 Mon Sep 17 00:00:00 2001 From: glaszig Date: Thu, 1 Aug 2019 15:37:27 +0200 Subject: [PATCH 3/3] move all other favicon-types into dist/icons folder, point to icons via link and meta tags, leave favicon.ico in root old browsers, added custom jekyll layout file to use the icons for the project website as well. https://help.github.com/en/articles/customizing-css-and-html-in-your-jekyll-theme https://github.com/pages-themes/minimal/blob/master/_layouts/default.html https://stackoverflow.com/a/48969053 --- _layouts/default.html | 74 ++++++++++++++++++ .../icons/android-chrome-192x192.png | Bin .../icons/apple-touch-icon.png | Bin .../icons/browserconfig.xml | 0 .../icons/favicon-16x16.png | Bin .../icons/favicon-32x32.png | Bin favicon.png => dist/icons/favicon.png | Bin dist/icons/site.webmanifest | 2 +- index.php | 12 +-- 9 files changed, 82 insertions(+), 6 deletions(-) create mode 100644 _layouts/default.html rename android-chrome-192x192.png => dist/icons/android-chrome-192x192.png (100%) rename apple-touch-icon.png => dist/icons/apple-touch-icon.png (100%) rename browserconfig.xml => dist/icons/browserconfig.xml (100%) rename favicon-16x16.png => dist/icons/favicon-16x16.png (100%) rename favicon-32x32.png => dist/icons/favicon-32x32.png (100%) rename favicon.png => dist/icons/favicon.png (100%) diff --git a/_layouts/default.html b/_layouts/default.html new file mode 100644 index 00000000..14d02718 --- /dev/null +++ b/_layouts/default.html @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + +{% seo %} + + + + +
+
+

{{ site.title | default: site.github.repository_name }}

+ + {% if site.logo %} + Logo + {% endif %} + +

{{ site.description | default: site.github.project_tagline }}

+ + {% if site.github.is_project_page %} +

View the Project on GitHub {{ site.github.repository_nwo }}

+ {% endif %} + + {% if site.github.is_user_page %} +

View My GitHub Profile

+ {% endif %} + + {% if site.show_downloads %} + + {% endif %} +
+
+ + {{ content }} + +
+ +
+ + {% if site.google_analytics %} + + {% endif %} + + diff --git a/android-chrome-192x192.png b/dist/icons/android-chrome-192x192.png similarity index 100% rename from android-chrome-192x192.png rename to dist/icons/android-chrome-192x192.png diff --git a/apple-touch-icon.png b/dist/icons/apple-touch-icon.png similarity index 100% rename from apple-touch-icon.png rename to dist/icons/apple-touch-icon.png diff --git a/browserconfig.xml b/dist/icons/browserconfig.xml similarity index 100% rename from browserconfig.xml rename to dist/icons/browserconfig.xml diff --git a/favicon-16x16.png b/dist/icons/favicon-16x16.png similarity index 100% rename from favicon-16x16.png rename to dist/icons/favicon-16x16.png diff --git a/favicon-32x32.png b/dist/icons/favicon-32x32.png similarity index 100% rename from favicon-32x32.png rename to dist/icons/favicon-32x32.png diff --git a/favicon.png b/dist/icons/favicon.png similarity index 100% rename from favicon.png rename to dist/icons/favicon.png diff --git a/dist/icons/site.webmanifest b/dist/icons/site.webmanifest index 8242651f..321ab7db 100644 --- a/dist/icons/site.webmanifest +++ b/dist/icons/site.webmanifest @@ -3,7 +3,7 @@ "short_name": "RaspAP", "icons": [ { - "src": "/android-chrome-192x192.png", + "src": "/dist/icons/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" } diff --git a/index.php b/index.php index fd74dc60..df096b93 100755 --- a/index.php +++ b/index.php @@ -91,12 +91,14 @@ $theme_url = 'dist/css/'.htmlspecialchars($theme, ENT_QUOTES); - - - - + + + + + - + +