Where is the app's folder ? Linux, Ubuntu

Tried package ostrio:meteor-root , which shows:

Meteor.absolutePath => /built_app/programs/server
Meteor.rootPath =>  /built_app/programs/server

Also __dirname is programs/server
Where is the folder ? I couldn’t find them at all.

I’m using this node package webtorrent.
And i can’t make it work in Meteor.

   client.add(url, {
                path: '/var/tmp',
            }, function(torrent) {
                torrent.on('download', function(bytes) {
                    let progress = getProgress(torrent.progress);

I wanted change the default download folder. But the downloading is so messed up, I can’t find the download folder in root path of Linux /var/tmp nor inside the meteor app.

How do i use the absolute folder of Linux system in Meteor (mup) ,Like : /var/tmp/ image

If you’re using MUP, the app is run in a container, which has it’s own temporary filesystem.

If you want the files to survive a container restart, you will want to map a directory from the host into the container using the volumes option in mup.js:

module.exports = {
  server: {
    // ...
  app: {
    volumes: {
      "/var/example/torrents": "/var/example/torrents",

I did this already
` app: {

    // TODO: change app name and path
    name: 'test',
    path: '../',
    volumes: {
        // passed as '-v /host/path:/container/path' to the docker run command
        '/files': '/files',
        '/files/tmp_download': '/files/tmp_download'
    servers: {
        // one: {},
        two: {
            // env: {
            //     PORT: 3000
            // }

But the files won’t get downloaded correctly.
Is there a latest way/link to deploy the code directly without docker ? --> I only need this one run on the server side without brower
Or how to test the new code faster without waiting for a long time for building bundles to deploy in Mup or Docker.

And you’ve told webtorrent to use those paths?

You can do a manual deploy using the custom deployment guide here:

Basically it’s:

  • build
  • copy bundle to server
  • extract bundle
  • rebuild binaries: (cd programs/server && npm install)
  • run node main.js

Also, you can copy the source and run meteor in dev mode as well, for debugging.
VSCode’s remote SSH explorer is very good for editing live on the server with rebuilds

Yes, I have given it an options :
` //

  const WebTorrent = require('webtorrent')
  const client = new WebTorrent();
 const fs = require('fs');

const defaultOpts = {
  path: absDownloadPath,
   maxWebConns: maxWebConns};

export async function readFilesFromTorrentUrl(url) {

  return new Promise((resolve, reject) => {
    try {
        client.add(url, defaultOpts, function(torrent) {
            torrent.on('download', function(bytes) {
                let progress = getProgress(torrent.progress);
                if (('' + progress).includes('.11')) console.log(`[${torrent.name} / ${torrent.path}] ==> ${progress} (${getFileSizeMega(torrent.downloaded)}b/${getFileSizeMega(torrent.length)}b) at ${getFileSizeMega(torrent.downloadSpeed)}b/s`);
            torrent.on('done', function() {
                console.log('torrent finished downloading', (torrent.path))
                resolve({ files: torrent.files, downloadDir: torrent.path })
    } catch (error) {
        resolve({ error })
        console.error('err during parse torrent')

but the files won’t get downloaded anywhere.image
Also I tried to deploy it directly but not working neither.
(Error -- segfault-handler.node: invalid ELF header)

This code snippet doesn’t actually show your path, so I can’t check.

Looking at the terminal screenshot, the find command has successfully found the folder you’re looking for.

Are you certain you have passed the path to webtorrent correctly and checked for files in the folder correctly?

The webtorrent source looks like it doesn’t do anything weird to the path:

1 Like

If it was using path.join then it won’t work. Because it need to be an absolute path. And i’m using this for the file dir + '/' + filename
The downloading log

The pathOption: { "path": "/files/tmp_download", "maxWebConns":6 }

Hmm, it looks like webtorrent also adds the filename to the path as well (that’s whats happening in the highlighted path.join, the absolute path joined to filename), so maybe that’s the issue?

Thank you for the important information and i have fixed the problem now!
I downloaded the webtorrent package and changed the file inside

        this.store = new ImmediateChunkStore(
            new this._store(this.pieceLength, {
                torrent: {
                    infoHash: this.infoHash
                files: this.files.map(file => {
                    // console.log('file', this.path, file.path)
                    let pathTmp = getAbsoluteFilePath(this.path, file.path);
                    // console.log('pathTmp', pathTmp)
                    return {
                        path: pathTmp,
                        length: file.length,
                        offset: file.offset
                length: this.length,
                name: this.infoHash
function getAbsoluteFilePath(dir, filename) {
    // console.log('getAbsoluteFilePath', dir, filename)
    if (dir && filename) {
        if (dir.endsWith('/') || filename.startsWith('/')) {
            return dir + filename
    return dir + '/' + filename

Also update my meteor to 1.10.2 latest from 1.8.3 along with node updated to v12
Tested and works.

1 Like