Skip to content

Commit

Permalink
Merge production. Bump to 3.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscant committed Aug 4, 2023
2 parents 32c802d + e14d198 commit 3c71ef4
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 38 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM node:18-alpine

WORKDIR /app

ENV IZNIK_API_V1=http://apiv1/api \
IZNIK_API_V2=http://apiv2:8192/api
ENV IZNIK_API_V1=http://apiv1.localhost/api \
IZNIK_API_V2=http://apiv2.localhost:8192/api

RUN apk update && apk add git \
&& git clone https://github.com/Freegle/iznik-nuxt3.git
Expand All @@ -12,4 +12,4 @@ CMD cd iznik-nuxt3 \
&& git pull \
&& yes | npm install -y --legacy-peer-deps \
&& export NODE_OPTIONS=--max-old-space-size=8192;npm run build \
&& npm run start
&& export HOST=0; npm run start
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "org.ilovefreegle.direct"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1212
versionName "3.0.10"
versionCode 1213
versionName "3.0.11"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down
6 changes: 6 additions & 0 deletions api/BaseAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ export default class BaseAPI {
'Iznik ' + JSON.stringify(authStore.auth.persistent)
}

headers['Cache-Control'] =
'max-age=0, must-revalidate, no-cache, no-store, private'

if (method === 'GET' && config?.params) {
// Remove falsey values from the params.
config.params = Object.fromEntries(
Expand Down Expand Up @@ -311,6 +314,9 @@ export default class BaseAPI {
headers.Authorization2 = JSON.stringify(authStore.auth.persistent)
}

headers['Cache-Control'] =
'max-age=0, must-revalidate, no-cache, no-store, private'

if (method === 'GET' && config?.params) {
// Remove falsey values from the params.
config.params = Object.fromEntries(
Expand Down
3 changes: 1 addition & 2 deletions components/PostMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
ref="filepond"
imgtype="Message"
imgflag="message"
:identify="true"
:browse="pondBrowse"
:multiple="true"
@photo-processed="photoProcessed"
Expand Down Expand Up @@ -161,7 +160,7 @@ export default {
// init callback below.
this.uploading = true
},
photoProcessed(imageid, imagethumb, image, ocr, suggestions) {
photoProcessed(imageid, imagethumb, image) {
// We have uploaded a photo. Remove the filepond instance.
const att = {
id: imageid,
Expand Down
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ export default {
'https://[email protected]/4504083802226688',

ISAPP: process.env.IZNIK_NUXT3_IS_APP === 'true',
MOBILE_VERSION: '3.0.10',
MOBILE_VERSION: '3.0.11',
}
8 changes: 4 additions & 4 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1206;
CURRENT_PROJECT_VERSION = 1207;
DEVELOPMENT_TEAM = GMYU3K9D84;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 3.0.10;
MARKETING_VERSION = 3.0.11;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = org.ilovefreegle.iphone;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -379,12 +379,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1206;
CURRENT_PROJECT_VERSION = 1207;
DEVELOPMENT_TEAM = GMYU3K9D84;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 3.0.10;
MARKETING_VERSION = 3.0.11;
PRODUCT_BUNDLE_IDENTIFIER = org.ilovefreegle.iphone;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
Expand Down
1 change: 1 addition & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export default defineNuxtConfig({
MOBILE_VERSION: config.MOBILE_VERSION,
NETLIFY_DEPLOY_ID: process.env.DEPLOY_ID,
NETLIFY_SITE_NAME: process.env.SITE_NAME,
MATOMO_HOST: process.env.MATOMO_HOST,
},
},

Expand Down
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
"vue-highlight-words": "^3.0.0",
"vue-inner-image-zoom": "^2.0.0",
"vue-json-pretty": "^2.2.4",
"vue-matomo": "^4.2.0",
"vue-plugin-load-script": "^2.1.1",
"vue-read-more3": "^1.2.2",
"vue-simple-context-menu": "^4.0.4",
Expand Down
28 changes: 9 additions & 19 deletions pages/privacy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@
out.
</p>
<ul>
<li>
We store a session cookie. That's strictly necessary for the site to
function, and does not require consent.
</li>
<li>
We store some information in your browser's local storage, because
of the way the site works. There's not much in it except if you're
Expand All @@ -70,6 +66,13 @@
<!-- eslint-disable-next-line -->
<nuxt-link no-prefetch to="/donate">donate</nuxt-link>).
</li>
<li>
We use
<ExternalLink href="https://matomo.org">Matomo</ExternalLink> to
collect information about how people use the site. This is similar
to Google Analytics, but more privacy-safe. We have configured this
not to use any cookies.
</li>
</ul>
<p>Once you log in, you're giving us consent to do the following.</p>
<ul>
Expand Down Expand Up @@ -101,21 +104,6 @@
<!-- eslint-disable-next-line -->
<ExternalLink href="https://sentry.io/privacy/">here</ExternalLink>.
</p>
<h2>Inspectlet</h2>
<p>
On a small random fraction of sessions, we use
<ExternalLink href="https://www.inspectlet.com/"
>Inspectlet</ExternalLink
>. This helps us work out which bits of the website are working well
for freeglers, and which aren't. You can read their privacy policy
<ExternalLink
href="https://docs.inspectlet.com/hc/en-us/articles/360002994432-Privacy-Impact-Assessment-under-GDPR"
>here</ExternalLink
>, and opt out of this
<ExternalLink href="https://www.inspectlet.com/optout"
>here</ExternalLink
>.
</p>
<h2>Deleting your data</h2>
<p>
If you want to leave Freegle, please go
Expand All @@ -132,6 +120,8 @@
<h3>Change History</h3>
<p>Here are the changes to this page.</p>
<ul class>
<li>03/08/2023: Remove session cookie, which is no longer used.</li>
<li>31/07/2023: Remove Inspectlet, which we no longer use.</li>
<li>
04/02/2023: Removed Google Analytics, which we no longer use. Add
mention of cookies.
Expand Down
16 changes: 16 additions & 0 deletions plugins/matomo.client.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import VueMatomo from 'vue-matomo'
import { useRuntimeConfig, defineNuxtPlugin } from '#imports'

export default defineNuxtPlugin((nuxtApp) => {
const config = useRuntimeConfig()

const host = config.public.MATOMO_HOST

if (host) {
nuxtApp.vueApp.use(VueMatomo, {
router: nuxtApp.$router,
host,
siteId: 1,
})
}
})
2 changes: 1 addition & 1 deletion public/_headers
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Headers for Netlify. csp.js seems to kick in during dev but not when deployed.
/*
Content-Security-Policy: worker-src blob:; object-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval' *.facebook.net *.google.com *.gstatic.com cdn.jsdelivr.net *.paypalobjects.com; report-uri https://fdapilive.ilovefreegle.org/csp.php
Content-Security-Policy: worker-src blob:; object-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval' *.facebook.net ilovefreegle.matomo.cloud *.google.com *.gstatic.com cdn.jsdelivr.net *.paypalobjects.com; report-uri https://fdapilive.ilovefreegle.org/csp.php
2 changes: 1 addition & 1 deletion server/middleware/csp.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
export default defineEventHandler((event) => {
event.node.res.setHeader(
'Content-Security-Policy',
"object-src 'none'; worker-src blob:; script-src 'self' 'unsafe-inline' 'unsafe-eval' *.facebook.net *.google.com *.gstatic.com cdn.jsdelivr.net *.paypalobjects.com; report-uri https://fdapilive.ilovefreegle.org/csp.php"
"object-src 'none'; worker-src blob:; script-src 'self' 'unsafe-inline' 'unsafe-eval' *.facebook.net ilovefreegle.matomo.cloud *.google.com *.gstatic.com cdn.jsdelivr.net *.paypalobjects.com; report-uri https://fdapilive.ilovefreegle.org/csp.php"
)
})
14 changes: 9 additions & 5 deletions stores/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,15 @@ export const useAuthStore = defineStore({

if (process.client) {
// Store the values in cookies. This means they are accessible during SSR.
const j = useCookie('jwt')
const p = useCookie('persistent')
j.value = jwt
p.value = JSON.stringify(persistent)
console.log('Saved jwt and persistent cookies')
if (jwt) {
const j = useCookie('jwt')
j.value = jwt
}

if (persistent) {
const p = useCookie('persistent')
p.value = JSON.stringify(persistent)
}
}
},
setUser(value) {
Expand Down

0 comments on commit 3c71ef4

Please sign in to comment.