cloudron 7.0.4 → 7.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudron",
3
- "version": "7.0.4",
3
+ "version": "7.0.6",
4
4
  "license": "MIT",
5
5
  "description": "Cloudron Commandline Tool",
6
6
  "type": "module",
package/src/actions.js CHANGED
@@ -106,10 +106,14 @@ async function stopActiveTask(app, options) {
106
106
  function saveCwdAppId(appId, manifestFilePath) {
107
107
  if (!manifestFilePath) return;
108
108
 
109
- const sourceDir = path.dirname(manifestFilePath);
110
- const cwdConfig = config.getCwdConfig(sourceDir);
111
- cwdConfig.appId = appId;
112
- config.setCwdConfig(sourceDir, cwdConfig);
109
+ try {
110
+ const sourceDir = path.dirname(manifestFilePath);
111
+ const cwdConfig = config.getCwdConfig(sourceDir);
112
+ cwdConfig.appId = appId;
113
+ config.setCwdConfig(sourceDir, cwdConfig);
114
+ } catch (e) { // will happen when run on EROFS (set HOME to avoid)
115
+ console.log(`Warning: Could not save app id to config: ${e.message} . Try setting $HOME`);
116
+ }
113
117
  }
114
118
 
115
119
  // appId may be the appId or the location
@@ -542,6 +546,7 @@ async function install(localOptions, cmd) {
542
546
 
543
547
  manifest = response.body.manifest;
544
548
  versionsUrl = response.body.versionsUrl;
549
+ console.log(`Using image ${manifest.dockerImage} (from versions url)`);
545
550
  } else {
546
551
  const result = await getManifest(options.appstoreId || '');
547
552
  manifest = result.manifest;
@@ -563,14 +568,19 @@ async function install(localOptions, cmd) {
563
568
  }
564
569
  });
565
570
 
566
- sourceArchiveFilePath = path.join(os.tmpdir(), `cloudron-source-${Date.now()}.tar`);
571
+ sourceArchiveFilePath = path.join(os.tmpdir(), `cloudron-source-${Date.now()}.tar.gz`);
567
572
  const sourceArchiveStream = fs.createWriteStream(sourceArchiveFilePath);
568
573
 
569
- const [tarError] = await safe(stream.pipeline(tarStream, sourceArchiveStream));
574
+ const [tarError] = await safe(stream.pipeline(tarStream, zlib.createGzip(), sourceArchiveStream));
570
575
  if (tarError) return exit(`Could not create source archive: ${tarError.message}`);
571
576
  } else {
572
577
  manifest.dockerImage = image;
578
+ const buildServiceConfig = config.getBuildServiceConfig();
579
+ const buildInfo = buildServiceConfig.type === 'remote' ? `remote - ${buildServiceConfig.url}` : 'local';
580
+ console.log(`Using image ${image} (built ${buildInfo})`);
573
581
  }
582
+ } else {
583
+ console.log(`Using image ${manifest.dockerImage} (from app store)`);
574
584
  }
575
585
  }
576
586
 
@@ -840,7 +850,7 @@ async function update(localOptions, cmd) {
840
850
  const image = options.image || config.getCwdConfig(sourceDir).dockerImage;
841
851
 
842
852
  if (!image) {
843
- console.log('No docker image detected. Creating source archive from this folder.');
853
+ console.log('No build detected. This package will be built on the server.');
844
854
 
845
855
  const dockerignoreFilePath = path.join(sourceDir, '.dockerignore');
846
856
  const ignoreMatcher = dockerignoreMatcher(dockerignoreFilePath);
@@ -851,13 +861,16 @@ async function update(localOptions, cmd) {
851
861
  }
852
862
  });
853
863
 
854
- sourceArchiveFilePath = path.join(os.tmpdir(), `cloudron-source-${Date.now()}.tar`);
864
+ sourceArchiveFilePath = path.join(os.tmpdir(), `cloudron-source-${Date.now()}.tar.gz`);
855
865
  const sourceArchiveStream = fs.createWriteStream(sourceArchiveFilePath);
856
866
 
857
- const [tarError] = await safe(stream.pipeline(tarStream, sourceArchiveStream));
867
+ const [tarError] = await safe(stream.pipeline(tarStream, zlib.createGzip(), sourceArchiveStream));
858
868
  if (tarError) return exit(`Could not create source archive: ${tarError.message}`);
859
869
  } else {
860
870
  manifest.dockerImage = image;
871
+ const buildServiceConfig = config.getBuildServiceConfig();
872
+ const buildInfo = buildServiceConfig.type === 'remote' ? `remote - ${buildServiceConfig.url}` : 'local';
873
+ console.log(`Using image ${image} (built ${buildInfo})`);
861
874
  }
862
875
 
863
876
  if (manifest.icon) {
@@ -866,6 +879,8 @@ async function update(localOptions, cmd) {
866
879
  data.icon = safe.fs.readFileSync(iconFilename, { encoding: 'base64' });
867
880
  if (!data.icon) return exit(`Could not read icon: ${iconFilename} message: ${safe.error.message}`);
868
881
  }
882
+ } else {
883
+ console.log(`Using image ${manifest.dockerImage} (from app store)`);
869
884
  }
870
885
 
871
886
  data = Object.assign(data, {
@@ -295,11 +295,6 @@ async function build(localOptions, cmd) {
295
295
 
296
296
  const appConfig = config.getCwdConfig(sourceDir);
297
297
  const buildServiceConfig = getEffectiveBuildServiceConfig(options);
298
- if (buildServiceConfig.type === 'remote' && buildServiceConfig.url) {
299
- console.log('Building using remote build service at %s', buildServiceConfig.url);
300
- } else {
301
- console.log('Building locally with Docker.');
302
- }
303
298
 
304
299
  let repository = appConfig.repository;
305
300
  if (!repository || options.repository) {