Disable ghost write file storage on cloud app engine - javascript

I just try to install Ghost to Google Cloud App Engine. I follow the official instruction but I got error below:
2020-07-25 10:40:52 default[20200725t173735] Error: EROFS: read-only
file system, open
'/workspace/node_modules/ghost/content/logs/https___yaskurweb_appspot_com_production.error.log'
Then I change config.production.json from:
"logging": {
"level": "info",
"rotation": {
"enabled": true
},
"transports": ["file", "stdout"]
}
to
"logging": {
"transports": [
"stdout"
]
},
But I got another error below:
2020-07-25 10:58:47 default[20200725t175429] Error: EROFS: read-only
file system, copyfile
'/workspace/node_modules/ghost/core/frontend/services/settings/default-routes.yaml'
-> '/workspace/node_modules/ghost/content/settings/routes.yaml'
I think it's caused when Ghost tries to copy routes.yaml file to another directory. So I need to know how to disable writing any file in Ghost?
my full config.production.json is:
{
"url": "https://myproject.appspot.com",
"fileStorage": false,
"server": {
"port": 8080,
"host": "0.0.0.0"
},
"database": {
"client": "mysql",
"connection": {
"host": "*",
"port": "3306",
"user": "dev",
"password": "*",
"database": "test_db"
}
},
"mail": {
"transport": "Direct"
},
"logging": {
"transports": [
"stdout"
]
},
"process": "systemd",
"paths": {
"contentPath": "content/"
}
}

The problem is that config set content path to node_modules. it's should be installed root path.
so I changed from:
"paths": {
"contentPath": "content/"
}
to
"paths": {
"contentPath": "/workspace/content/"
}
And then work perfectly...

Related

Azure Blob Trigger in TypeScript doesn't trigger in deploy

I have tested my Azure function to run locally and it works normally but after I deployed, it doesn't trigger whenever I upload a file in the video-temp container.
{
"bindings": [
{
"name": "myBlob",
"type": "blobTrigger",
"direction": "in",
"path": "video-temp/{name}",
"connection": "NewContainer"
}
],
"scriptFile": "../dist/VideoConversionTrigger/index.js"
}
this is my local.settings.json
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "node",
"NewContainer": "DefaultEndpointsProtocol=https; ..."
}
}
local.settings.json is only used on local. You need to add settings here after deploy:
And for the error, Microsoft.WindowsAzure.Storage: Requested value 'GET,HEAD,DELETE,MERGE,OPTIONS,POST,PUT,PATCH' was not found., you can break up the values into separate CORS entries.

Expo React Native error: Unhandled JS Exception: manifest must specify logUrl

When publishing my app with expo using expo publish or pushing the app to App Store and Play Store, I get a crash on launch of the production app on both iOS and Android plateform with the error :
Unhandled JS Exception: manifest must specify logUrl
As this error doesn't happened on Development app, I don't know how to debug this. Does anyone encounter the same issue ? Do you have any idea on what's going on or do you have any idea on a method to find the error ?
Just for more context, I did publish my app to both stores months ago without any issue. I did not change anything in my manifest except changing the Expo SDK from version 38 to 40. Here is my current manifest :
{
"expo": {
"name": "My App",
"slug": "myApp",
"privacy": "public",
"platforms": ["ios", "android"],
"version": "1.0.2",
"orientation": "portrait",
"backgroundColor": "#ffffff",
"primaryColor": "#7198FF",
"icon": "./assets/android-icon.png",
"splash": {
"image": "./assets/Launch_Screen.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": false,
"bundleIdentifier": "com.company.app",
"buildNumber": "1"
},
"android": {
"package": "com.company.app",
"googleServicesFile": "./google-services.json",
"permissions": [
"CAMERA",
"MANAGE_DOCUMENTS",
"READ_CONTACTS",
"READ_CALENDAR",
"WRITE_CALENDAR",
"READ_EXTERNAL_STORAGE",
"READ_PHONE_STATE",
"RECORD_AUDIO",
"USE_FINGERPRINT",
"VIBRATE"
],
"versionCode": 21
},
"androidNavigationBar": {
"visible": "sticky-immersive",
"barStyle": "dark-content",
"backgroundColor": "#FFFFFF"
},
"androidStatusBar": {
"hidden": false,
"translucent": true,
"barStyle": "dark-content",
"backgroundColor": "#FFFFFF"
},
"extra": {
"firebase": {
"apiKey": "FIREBASE_KEY",
"authDomain": "app.firebaseapp.com",
"databaseURL": "https://app.firebaseio.com",
"projectId": "app",
"storageBucket": "app.appspot.com",
"messagingSenderId": "SENDER_ID",
"appId": "1:appID",
"measurementId": "G-ID"
}
},
"web": {
"config": {
"firebase": {
"apiKey": "FIREBASE_KEY",
"authDomain": "app.firebaseapp.com",
"databaseURL": "https://app.firebaseio.com",
"projectId": "app",
"storageBucket": "app.appspot.com",
"messagingSenderId": "MESSEGING_ID",
"appId": "1:APP_ID:web:WEB_ID",
"measurementId": "G-ID"
}
}
},
"hooks": {
"postPublish": [
{
"file": "sentry-expo/upload-sourcemaps",
"config": {
"organization": "app",
"project": "app",
"authToken": "SENTRY_TOKEN"
}
}
]
}
}
}
Seems like the issue was with expo trying to put logs to non-existent route on production.
According to expo docs,
the Expo SDK intercepts calls to console.log, console.warn, etc. and posts them to the logUrl specified in the manifest.
Check if you have Logs.enableExpoCliLogging(); enabled? Or if not, try manually importing logs at entry point
import { Logs } from 'expo';
and manually disabling them
Logs.disableExpoCliLogging();
According to the OP comment, the issue was as i mentioned. This stack helped me tho.
After reading #Oleksii comment about checking if the Expo CLI logging where enabled with Logs.enableExpoCliLogging();, it seems that this was causing the issue.
Just disable those by importing import { Logs } from 'expo'; and then calling Logs.disableExpoCliLogging(); in the app entry point file make it works again in production environment !
Thanks again #Oleksii !

TypeError: Cannot read property 'dbName' of null

I've tried to connect my Loopback application with MongoDb Atlas, but I'm having an error "TypeError: Cannot read property 'dbName' of null".
Below is what I've tried:
run lb data source
Fill all the required info
Generated this javascript object:
{
"db": {
"name": "db",
"connector": "mongodb"
},
"mongodb": {
"host": "",
"port": 0,
"url": "mongodb+srv://USER:PASSWORD#DATABASENAME-f4exx.mongodb.net/test?retryWrites=true&w=majority",
"database": "DATABASENAME",
"password": "PASSWORD",
"name": "mongodb",
"user": "dbAdmin",
"useNewUrlParser": true,
"connector": "mongodb"
}
}
On every attempt to run "node ." , getting TypeError: Cannot read property 'dbName' of null.
I've added my IP in the whitelisted IPs (MongoDB atlas)
Below is my model.config.json
{
"_meta": {
"sources": [
"loopback/common/models",
"loopback/server/models",
"../common/models",
"./models"
],
"mixins": [
"loopback/common/mixins",
"loopback/server/mixins",
"../common/mixins",
"./mixins"
]
},
"User": {
"dataSource": "mongodb"
},
"AccessToken": {
"dataSource": "mongodb",
"public": false
},
"ACL": {
"dataSource": "mongodb",
"public": false
},
"RoleMapping": {
"dataSource": "mongodb",
"public": false,
"options": {
"strictObjectIDCoercion": true
}
},
"Role": {
"dataSource": "mongodb",
"public": false
}
}
PS: I'm using loopback 3x
Figured out that setting the property "useNewUrlParser": true to false solved my issue. Still don't know why this was the root cause.
Don't put special character in your password, if you are using old mongodb

How to use ParseServerOptions

I am using Parse Server v2.8.2. I am trying to use src/Options/index.js to rebuild src/Options/Definitions.js using the following command
$ node resources/buildConfigDefinitions.js
But when I execute this command, nothing seems to happen. Besides when I run
parse-server --appId=def --masterKey=abc - databaseURI=mongodb://localhost/test
I can't get the configuration I'm setting in the
src/Options/index.js file.
Does anyone know how this works and how to actually get the configuration in the index.js file?
Thank you!
forget the rebuild. You can combine .env settings AND specify a config file both on the cmdLine, letting the default priorities establish themselves for actual , runtime config.properties...
since you are with node...
package.json
"scripts": {
...
"start": "node ./bin/parse-server -- lib/conf.json",
.env OR cli settings ...
VERBOSE=1
PORT=1337
PARSE_SERVER_APPLICATION_ID=06rc7
PARSE_SERVER_MASTER_KEY=wwTQ
PARSE_SERVER_URL=http://localhost:1337/parse
PARSE_PUBLIC_SERVER_URL=http://localhost:1337/parse
PARSE_SERVER_DATABASE_URI=mongodb://parse:adm#931.mb.com:13931/ntst
FIREBASE_SERVICE_ACCOUNT_KEY=../lib/fbidentity.json
FIREBASE_
AWS_ACCESS_KEY_ID=AKYA
AWS_SECRET_ACCESS_KEY=Marw9
S3_BUCKET=y
S3_REGION=
conf.json ...
{
"databaseURI": "",
"appId": "",
"masterKey": "",
"serverURL": "",
"verifyUserEmails": true,
"publicServerURL": "",
"appName": "Yayatv App",
"filesAdapter": {
"module": "#parse/s3-files-adapter",
"options": {
"bucket": "",
"region": ""
}
},
"emailAdapter": {
"module": "#parse/simple-mailgun-adapter",
"options": {
"fromAddress": "no-reply#mg.tv.tv",
"domain": "mg.yv.tv",
"apiKey": "key-478"
}
},
"auth" : {
"firebase" : {
"module" : "parse-server-firebase-auth-adapter"
}
}
}

Intern 4 tests fail to load the Dojo2 loader

I'm migrating from Intern 3/requirejs to Intern 4/dojo2. I'm trying to run a test and immediately after the capabilities checks it will fail before ever loading my tests with this error:
Listening on localhost:9000 (ws 9001)
Tunnel started
‣ Created remote session chrome 66.0.3359.139 on XP (bc531663-f9f7-4cba-9038-6ab15808e9a0)
Suite chrome 66.0.3359.139 on XP FAILED
Error: Unable to load /..\node_modules\intern/loaders/dojo2.js
at HTMLScriptElement.<anonymous> <node_modules\intern\browser\remote.js:667:23264>
TOTAL: tested 1 platforms, 0 passed, 0 failed; suite error occurred
It's 404ing on that file from http://localhost:9000/__intern/browser/remote.html because it's trying to get dojo2.js from the wrong path by the looks of it. If I replace dojo2 in my config script with __intern/loaders/dojo2.js it will then 404 on /node_modules/#dojo/loader/loader.js. It looks like it's just looking for the wrong paths, is there something I can do to fix this?
intern.json
{
"loader": {
"script": "dojo2",
"config": {
"waitSeconds": 60,
"packages": [ {
"name": "objects",
"location": "objects"
}, {
"name": "edits",
"location": "./",
"main": "edits"
}, {
"name": "prepare",
"location": "TESTS",
"main": "prepare"
}, {
"name": "common",
"location": "./",
"main": "common"
}, {
"name": "socket",
"location": "http://localhost:2020/socket.io",
"main": "socket.io"
}
]
}
},
"suites": [
"./functional/InitTests.js"
],
"environments": [ {
"browserName": "chrome"
}
],
"tunnelOptions": {
"drivers": [
"chrome"
],
"port": 4444,
"version": "3.4.0",
"maxConcurrency": 1,
"runnerClientReporter": {
"writeHtml": false
}
},
"tunnel": "null",
"leaveRemoteOpen": true,
"grep": ""
}
There are a few potential issues:
Have you installed #dojo/loader? The loader scripts require that the associated loader be installed as a peer of Intern.
When using an AMD loader, specify tests as module IDs rather than file names
Does ./functional/InitTests.js actually contain functional tests? If so, it should be specified under functionalSuites.

Categories