diff --git a/.env.development b/.env.development index a35f0fe3..c9ff8c0c 100755 --- a/.env.development +++ b/.env.development @@ -1,7 +1,7 @@ -APP_VERSION="0.1.2" +APP_VERSION="0.1.3" SERVICE_WORKER_FILE="service-worker.js" APP_ID="1" -DIRECTORY_LOCAL="freeplanet" +DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_SERVER="freeplanet_serverside" SERVERDIR_WEBSITE="" SERVERPW_WEBSITE="" @@ -11,7 +11,7 @@ PROVA_PAOLO="PROVA ENV FUNZIONA!" LANG_DEFAULT="it" PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF" MASTER_KEY="KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T" -MONGODB_HOST="http://localhost:3000" +MONGODB_HOST="http://192.168.1.6:3000" LOGO_REG="freeplanet-logo-full.svg" TEST_NAME="Paolo" TEST_SURNAME="Arena" @@ -25,4 +25,4 @@ DEBUG="1" TELEGRAM_SUPPORT="" PROJECT_ID_MAIN="5cc0a13fe5c9d156728f400a" TEST_CELL="" -ISTEST=true +ISTEST=1 diff --git a/.env.prod.bak b/.env.prod.bak new file mode 100755 index 00000000..47597800 --- /dev/null +++ b/.env.prod.bak @@ -0,0 +1,28 @@ +APP_VERSION="0.1.3" +SERVICE_WORKER_FILE="service-worker.js" +APP_ID="1" +DIRECTORY_LOCAL=newfreeplanet +DIRECTORY_SERVER=freeplanet_serverside +SERVERDIR_WEBSITE=www.freeplanet.app +SERVERPW_WEBSITE=pwdadmin@1AOK +APP_URL="https://www.freeplanet.app" +URL_FACEBOOK="https://www.facebook.com/freeplanetapp" +PROVA_PAOLO="PROVA ENV FUNZIONA!" +LANG_DEFAULT="it" +PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF" +MASTER_KEY="KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T" +MONGODB_HOST="https://www.freeplanet.app:3000" +LOGO_REG='freeplanet-logo-full.svg' +TEST_NAME="" +TEST_SURNAME="" +TEST_EMAIL="" +TEST_USERNAME="" +TEST_PASSWORD="" +TEST_APORTADOR="------" +PUBLICKEY_PUSH="BNM-cEpTbPVc_ujXf3QOC8ggf7b-X44P44esfJUWqNOFq1XhWCoZJpOi71_cbXC5SnfO9HassQ6OouAYgtBA9Pw" +IN_CONSTRUCTION="1" +DEBUG="1" +TELEGRAM_SUPPORT="https://t.me/freeplanet_supporto" +PROJECT_ID_MAIN="5cc0a13fe5c9d156728f400a" +TEST_CELL="" +ISTEST=0 diff --git a/.env.production b/.env.production index 5d91f481..47597800 100755 --- a/.env.production +++ b/.env.production @@ -1,7 +1,7 @@ -APP_VERSION="0.1.1" +APP_VERSION="0.1.3" SERVICE_WORKER_FILE="service-worker.js" APP_ID="1" -DIRECTORY_LOCAL=freeplanet +DIRECTORY_LOCAL=newfreeplanet DIRECTORY_SERVER=freeplanet_serverside SERVERDIR_WEBSITE=www.freeplanet.app SERVERPW_WEBSITE=pwdadmin@1AOK @@ -25,4 +25,4 @@ DEBUG="1" TELEGRAM_SUPPORT="https://t.me/freeplanet_supporto" PROJECT_ID_MAIN="5cc0a13fe5c9d156728f400a" TEST_CELL="" -ISTEST=false +ISTEST=0 diff --git a/.env.test b/.env.test new file mode 100755 index 00000000..1aeb2fcd --- /dev/null +++ b/.env.test @@ -0,0 +1,28 @@ +APP_VERSION="0.1.3" +SERVICE_WORKER_FILE="service-worker.js" +APP_ID="1" +DIRECTORY_LOCAL=newfreeplanet +DIRECTORY_SERVER=test.freeplanet_serverside +SERVERDIR_WEBSITE="test.freeplanet.app" +SERVERPW_WEBSITE="pwdadmin@1AOK" +APP_URL="https://test.freeplanet.app" +URL_FACEBOOK="https://www.facebook.com/freeplanetapp" +PROVA_PAOLO="PROVA ENV FUNZIONA!" +LANG_DEFAULT="it" +PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF" +MASTER_KEY="KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T" +MONGODB_HOST="https://test.freeplanet.app:3001" +LOGO_REG="freeplanet-logo-full.svg" +TEST_NAME="Paolo" +TEST_SURNAME="Arena" +TEST_EMAIL="paolo@freeplanet.app" +TEST_USERNAME="paoloar77" +TEST_PASSWORD="passpao1fr@1A" +TEST_APORTADOR="" +PUBLICKEY_PUSH="BNM-cEpTbPVc_ujXf3QOC8ggf7b-X44P44esfJUWqNOFq1XhWCoZJpOi71_cbXC5SnfO9HassQ6OouAYgtBA9Pw" +IN_CONSTRUCTION="0" +DEBUG="1" +TELEGRAM_SUPPORT="" +PROJECT_ID_MAIN="5cc0a13fe5c9d156728f400a" +TEST_CELL="" +ISTEST=1 diff --git a/deploy_frontend.sh b/deploy_frontend.sh new file mode 100755 index 00000000..11c8a46a --- /dev/null +++ b/deploy_frontend.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +source ./.env.production + +msg="*** TUTTI I SERVER FRONTEND !!! **** SEI SICURO DI INVIARE GLI AGGIORNAMENTI FRONTEND - SU TUTTI SERVER ??? $DIRECTORY_LOCAL (Y/N) ? " + +if [ "$1" = "" ]; then + read -p "$msg" risposta +else + risposta=$1 +fi + +if [[ $risposta == "Y" || $risposta == "y" ]]; then + cd /home/paolo/myproject/$DIRECTORY_LOCAL/ + ./deploy_on_production.sh $risposta + ./deploy_on_test_server.sh $risposta +fi diff --git a/deploy_on_test_server.sh b/deploy_on_test_server.sh new file mode 100755 index 00000000..e1fe20f3 --- /dev/null +++ b/deploy_on_test_server.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +source ./.env.test + +msg="*** Sincronizzazione ??? $DIRECTORY_LOCAL e $DIRECTORY_SERVER (Y/N) ? " + +if [ "$1" = "" ]; then + read -p "$msg" risposta +else + risposta=$1 +fi + +cd /home/paolo/myproject/$DIRECTORY_LOCAL/ +cp .env.production .env.prod.bak +cp .env.test .env.production + +sleep 1 + +npm run buildpwa + +echo "Sincronizzazione $SERVERDIR_WEBSITE in remoto..." +sshpass -p $SERVERPW_WEBSITE rsync -e 'ssh -p 8822' -a dist/pwa/ ftpadmin@servereng:/var/www/$SERVERDIR_WEBSITE/ + +cp .env.prod.bak .env.production + +sleep 1 + +echo "Finito $SERVERDIR_WEBSITE" diff --git a/package.json b/package.json index b38eb38e..7c45771c 100755 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "freeplanet", "version": "0.0.6", "description": "FreePlanet", - "productName": "First Proj", + "productName": "FreePlanet", "author": "Paolo Arena", "private": true, "keywords": [ diff --git a/public/favicon.ico b/public/favicon.ico index ae7bbdb7..fd1950b5 100755 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/icons/.directory b/public/icons/.directory deleted file mode 100755 index e5d50763..00000000 --- a/public/icons/.directory +++ /dev/null @@ -1,4 +0,0 @@ -[Dolphin] -PreviewsShown=true -Timestamp=2018,11,1,10,45,49 -Version=4 diff --git a/public/icons/favicon.ico b/public/icons/favicon.ico deleted file mode 100755 index fd1950b5..00000000 Binary files a/public/icons/favicon.ico and /dev/null differ diff --git a/public/icons/android-chrome-192x192.png b/public/images/android-chrome-192x192.png similarity index 100% rename from public/icons/android-chrome-192x192.png rename to public/images/android-chrome-192x192.png diff --git a/public/icons/android-chrome-512x512.png b/public/images/android-chrome-512x512.png similarity index 100% rename from public/icons/android-chrome-512x512.png rename to public/images/android-chrome-512x512.png diff --git a/public/icons/apple-touch-icon.png b/public/images/apple-touch-icon.png similarity index 100% rename from public/icons/apple-touch-icon.png rename to public/images/apple-touch-icon.png diff --git a/public/icons/favicon-16x16.png b/public/images/favicon-16x16.png similarity index 100% rename from public/icons/favicon-16x16.png rename to public/images/favicon-16x16.png diff --git a/public/icons/favicon-32x32.png b/public/images/favicon-32x32.png similarity index 100% rename from public/icons/favicon-32x32.png rename to public/images/favicon-32x32.png diff --git a/public/images/opz1-icon-96x96.jpg b/public/images/opz1-icon-96x96.jpg new file mode 100755 index 00000000..32d09c99 Binary files /dev/null and b/public/images/opz1-icon-96x96.jpg differ diff --git a/public/images/opz2-icon-96x96.jpg b/public/images/opz2-icon-96x96.jpg new file mode 100755 index 00000000..32d09c99 Binary files /dev/null and b/public/images/opz2-icon-96x96.jpg differ diff --git a/public/icons/flag_de.svg b/public/svg/flag_de.svg similarity index 100% rename from public/icons/flag_de.svg rename to public/svg/flag_de.svg diff --git a/public/icons/flag_es.svg b/public/svg/flag_es.svg similarity index 100% rename from public/icons/flag_es.svg rename to public/svg/flag_es.svg diff --git a/public/icons/flag_gb.svg b/public/svg/flag_gb.svg similarity index 100% rename from public/icons/flag_gb.svg rename to public/svg/flag_gb.svg diff --git a/public/icons/flag_it.svg b/public/svg/flag_it.svg similarity index 100% rename from public/icons/flag_it.svg rename to public/svg/flag_it.svg diff --git a/public/icons/flag_us.svg b/public/svg/flag_us.svg similarity index 100% rename from public/icons/flag_us.svg rename to public/svg/flag_us.svg diff --git a/quasar.conf.js b/quasar.conf.js index 2e6a8bab..fd4837df 100755 --- a/quasar.conf.js +++ b/quasar.conf.js @@ -17,7 +17,7 @@ const webpack = require('webpack') const helpers = require('./helpers') const envparser = require('./config/envparser') -// const ESLintPlugin = require('eslint-webpack-plugin') +const ESLintPlugin = require('eslint-webpack-plugin') module.exports = configure((ctx) => ({ // https://v2.quasar.dev/quasar-cli/supporting-ts @@ -276,24 +276,26 @@ module.exports = configure((ctx) => ({ // for the custom service worker ONLY (/src-pwa/custom-service-worker.[js|ts]) // if using workbox in InjectManifest mode chainWebpackCustomSW(chain) { + chain.plugin('eslint-webpack-plugin') + .use(ESLintPlugin, [{ extensions: ['js'] }]) }, manifest: { - name: 'First Proj', - short_name: 'First Proj', - description: 'A Quasar Framework app', + name: 'FreePlanet', + short_name: 'FreePlanet', + description: 'New Free Social', display: 'standalone', orientation: 'portrait', background_color: '#ffffff', theme_color: '#027be3', icons: [ { - src: 'icons/android-chrome-192x192.png', + src: 'images/android-chrome-192x192.png', sizes: '384x384', type: 'image/png', }, { - src: 'icons/android-chrome-512x512.png', + src: 'images/android-chrome-512x512.png', sizes: '512x512', type: 'image/png', }, diff --git a/send_to_test.sh b/send_to_test.sh index 41cdb7db..22a0257a 100755 --- a/send_to_test.sh +++ b/send_to_test.sh @@ -2,6 +2,10 @@ source ./.env.test +cp .env.test .env.production + echo "Sincronizzazione in remoto $SERVERDIR_WEBSITE ..." -sshpass -p $SERVERPW_WEBSITE rsync -a dist/pwa/ ftpadmin@servereng:/var/www/$SERVERDIR_WEBSITE/ +sshpass -p $SERVERPW_WEBSITE rsync -e 'ssh -p 8822' -a dist/pwa/ ftpadmin@servereng:/var/www/$SERVERDIR_WEBSITE/ echo "Finito $SERVERDIR_WEBSITE" + +cp .env.prod.bak .env.production diff --git a/src-pwa/custom-service-worker.js b/src-pwa/custom-service-worker.js index 63de293f..f2b0850c 100755 --- a/src-pwa/custom-service-worker.js +++ b/src-pwa/custom-service-worker.js @@ -16,7 +16,7 @@ import { CacheableResponsePlugin } from 'workbox-cacheable-response' import { ExpirationPlugin } from 'workbox-expiration' console.log( - ' [ VER-0.0.65 ] _---------________------ PAO: this is my custom service worker') + ' [ VER-0.1.2b ] _---------________------ PAO: this is my custom service worker') importScripts('js/idb.js') importScripts('js/storage.js') @@ -92,7 +92,7 @@ if (workbox) { // cleanupOutdatedCaches() registerRoute( - new RegExp(/\.(?:png|gif|jpg|jpeg|svg)$/), + new RegExp(/\.(?:png|gif|jpg|jpeg)$/), new CacheFirst({ cacheName: 'images', plugins: [ @@ -107,6 +107,22 @@ if (workbox) { ], }), ) + registerRoute( + new RegExp(/\.(?:svg)$/), + new CacheFirst({ + cacheName: 'svg', + plugins: [ + // Ensure that only requests that result in a 200 status are cached + new CacheableResponsePlugin({ + statuses: [200], + }), + new ExpirationPlugin({ + maxEntries: 60, + maxAgeSeconds: 30 * 24 * 60 * 60, // 30 Days + }), + ], + }), + ) // Per Articoli.... const articleHandler = new NetworkFirst({ @@ -250,9 +266,9 @@ if (workbox) { ) registerRoute( - new RegExp(/.*\/(?:statics\/icons).*$/), + new RegExp(/.*\/(?:icons).*$/), new CacheFirst({ - cacheName: 'image-cache', + cacheName: 'icon-cache', plugins: [ // Ensure that only requests that result in a 200 status are cached new CacheableResponsePlugin({ @@ -558,8 +574,8 @@ self.addEventListener('push', (event) => { const options = { body: data.content, - icon: '/public/icons/android-chrome-192x192.png', - badge: '/public/icons/android-chrome-192x192.png', + icon: '/images/android-chrome-192x192.png', + badge: '/images/android-chrome-192x192.png', data: { url: data.url, }, diff --git a/src/App.ts b/src/App.ts index ae2618fe..e124186b 100755 --- a/src/App.ts +++ b/src/App.ts @@ -7,6 +7,7 @@ import { useUserStore } from '@store/UserStore' import { Header } from '@/components/Header' import { computed } from 'vue' import { CProvaPao } from '@/components/CProvaPao' +import { tools } from '@store/Modules/tools' export default { components: { @@ -38,50 +39,59 @@ export default { } function created() { - if (process.env.DEV) { - console.info('SESSIONE IN SVILUPPO ! (DEV)') - // console.info(process.env) - } - if (process.env.PROD) { - console.info('SESSIONE IN PRODUZIONE!') - // console.info(process.env) - } - - // Make autologin only if some routing - - // console.log('window.location.href', window.location.href) - - let chiamaautologin = true - listaRoutingNoLogin.forEach((mystr) => { - if (window.location.href.includes(mystr)) { - chiamaautologin = false + try { + if (process.env.DEV) { + console.info('SESSIONE IN SVILUPPO ! (DEV)') + // console.info(process.env) + } + if (tools.isTest()) { + console.info('SESSIONE IN TEST ! (TEST)') + } else { + if (process.env.PROD) { + console.info('SESSIONE IN PRODUZIONE!') + // console.info(process.env) + } } - }) - - if (chiamaautologin) { - // console.log('CHIAMA autologin_FromLocalStorage') - userStore.autologin_FromLocalStorage($router) - .then((loadstorage: any) => { - if (loadstorage) { - /*if (toolsext.getLocale() !== '') { - // console.log('SETLOCALE :', this.$i18n.locale) - $i18n.locale = toolsext.getLocale() // Set Lang - } else { - userStore.setlang($router, this.$i18n.locale) - }*/ + // Make autologin only if some routing + + // console.log('window.location.href', window.location.href) + + let chiamaautologin = true + listaRoutingNoLogin.forEach((mystr) => { + if (window.location.href.includes(mystr)) { + chiamaautologin = false + } + }) + + if (chiamaautologin) { + // console.log('CHIAMA autologin_FromLocalStorage') + userStore.autologin_FromLocalStorage($router) + .then((loadstorage: any) => { + if (loadstorage) { - // console.log('lang CARICATO:', this.$i18n.locale) + /*if (toolsext.getLocale() !== '') { + // console.log('SETLOCALE :', this.$i18n.locale) + $i18n.locale = toolsext.getLocale() // Set Lang + } else { + userStore.setlang($router, this.$i18n.locale) + }*/ - //++Todo PWA: globalroutines('loadapp', '') - // Create Subscription to Push Notification - globalStore.createPushSubscription() - } - }) - } else { + // console.log('lang CARICATO:', this.$i18n.locale) + + //++Todo PWA: globalroutines('loadapp', '') + + // Create Subscription to Push Notification + globalStore.createPushSubscription() + } + }) + } else { + globalStore.finishLoading = true + } + } catch (e) { globalStore.finishLoading = true } diff --git a/src/components/CCardCarousel/CCardCarousel.vue b/src/components/CCardCarousel/CCardCarousel.vue index 00974c48..3a4c7375 100755 --- a/src/components/CCardCarousel/CCardCarousel.vue +++ b/src/components/CCardCarousel/CCardCarousel.vue @@ -71,7 +71,7 @@ dark color="white" v-model="globalStore.autoplaydisc" label="Auto Play" class="s
diff --git a/src/components/CMySingleEvent/CMySingleEvent.vue.off2 b/src/components/CMySingleEvent/CMySingleEvent.vue.off2 index 2b5f0db2..f29aa735 100644 --- a/src/components/CMySingleEvent/CMySingleEvent.vue.off2 +++ b/src/components/CMySingleEvent/CMySingleEvent.vue.off2 @@ -69,7 +69,7 @@ v-if="myevent.news" class="cltexth4 chipnews shadow-5 glossy text-right" color=" @@ -152,7 +152,7 @@ v-if="myevent.price && isShowPrice(myevent)" class="glossy" color="orange"
diff --git a/src/components/COpenStreetMap/COpenStreetMap.vue b/src/components/COpenStreetMap/COpenStreetMap.vue index a3307cf3..fc4875c2 100755 --- a/src/components/COpenStreetMap/COpenStreetMap.vue +++ b/src/components/COpenStreetMap/COpenStreetMap.vue @@ -20,7 +20,7 @@ - Apri Mappa

- + diff --git a/src/components/CProductCard/CProductCard.vue b/src/components/CProductCard/CProductCard.vue index ea1f5982..51123a75 100755 --- a/src/components/CProductCard/CProductCard.vue +++ b/src/components/CProductCard/CProductCard.vue @@ -1,6 +1,6 @@