Help with PydioBooster & CODE

IMPORTANT NOTIFICATION - FORUM MOVES TO HTTPS://FORUM.PYDIO.COM

Dear Pydio Community,
This forum will be soon made readonly, as we are transitioning to Discourse. To start on a fresh basis, we decided NOT TO MIGRATE the current threads to the new platform.
As a result, please be kind enough to register there and post your messages at the new location, and if you have an open thread, please do re-open it on Discourse!

Thank you and sorry for the inconvenience
Pydio Team

Home Forums Troubleshooting Install & Upgrade Help with PydioBooster & CODE

This topic contains 3 replies, has 2 voices, and was last updated by Profile photo of Scott Duensing sduensin 2 months, 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #115426
    Profile photo of Scott Duensing
    sduensin
    Participant

    I’ve been trying to get help with downloading for a couple weeks now. I’m an avid Pydio fan. I’m familiar with it. I know (kinda) what I’m doing. I can’t for the life of me fix this.

    Again, Booster and CODE are installed. Booster works for WSS and uploading. Downloading, not so much. Nothing in the logs. Nobody ever helped me increase logging levels.

    So. Because I have very little diagnostic information at this time, I’m going to attach my complete build! This is exactly how my server is currently set up. What did I do wrong?

    HELP!

    #!/bin/bash
    
    # ::NOTE::
    # Although this is a bash script, you cannot simply run it to install Pydio!
    # Reboots need to be performed and database configuration must be handled
    # manually.  Consider it codified documentation.  DO NOT EXECUTE IT.
    
    # First, anually install Ubuntu LTS with SSH Server role.  Name the machine
    # whatever you select for the PYDIO variable below.
    
    # Next, everything below is done as root:
    
    export PYDIO=pydio.yourdomain.com
    export CODE=code.yourdomain.com
    
    # Update system
    
    apt-get update
    apt-get -y install joe mc byobu
    apt-get -y upgrade
    apt-get -y dist-upgrade
    apt-get -y autoremove
    reboot
    
    # Add repositories
    
    echo "deb https://download.pydio.com/pub/linux/debian/ xenial main" > /etc/apt/sources.list.d/pydio.list
    wget -qO - https://download.pydio.com/pub/linux/debian/key/pubkey | apt-key add -
    apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0C54D189F4BA284D
    echo 'deb https://www.collaboraoffice.com/repos/CollaboraOnline/CODE ./' >> /etc/apt/sources.list.d/collaboraoffice.list
    add-apt-repository -y ppa:certbot/certbot
    apt-get update
    
    # Install Pydio
    
    apt-get -y install pydio
    apt-get -y install pydio-all
    sed -i 's/\t\/pydio/\t\//' /etc/pydio/apache2*.conf
    sed -i 's/RewriteBase \/pydio/RewriteBase \//' /etc/pydio/htaccess
    sed -i 's/en_EN\.UTF-8/en_US\.UTF-8/' /etc/pydio/bootstrap_conf.php
    sed -i 's/^output_buffering = 4096/output_buffering = Off/' /etc/php/7.0/apache2/php.ini
    a2dissite 000-default
    a2disconf pydio
    
    cat > /etc/apache2/sites-available/pydio.conf <<PYDIO
    <VirtualHost *:443>
    
        ServerName ${PYDIO}:443
        ServerAlias ${PYDIO}
    
        SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
        SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
        Include /etc/letsencrypt/options-ssl-apache.conf
    
        ErrorLog \${APACHE_LOG_DIR}/${PYDIO}.error.log
        CustomLog \${APACHE_LOG_DIR}${PYDIO}.access.log combined
    
        DocumentRoot /usr/share/pydio
        <Directory /usr/share/pydio>
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
            Require all granted
            Satisfy Any
        </Directory>
    
        SSLProxyEngine On
        ProxyRequests Off
    
        ProxyPass /ws wss://${PYDIO}:8090/ws
    
        ProxyPass /io https://${PYDIO}:8090/io retry=0
        ProxyPassReverse /io https://${PYDIO}:8090/io
    
        #ProxyPass /admin https://${PYDIO}:8090/admin retry=0
        #ProxyPassReverse /admin https://${PYDIO}:8090/admin
    
    </VirtualHost>
    PYDIO
    
    a2ensite pydio.conf
    service apache2 restart
    
    # Visit https://${PYDIO}/ and complete setup.
    
    # Install CollaboraOffice CODE
    apt-get -y install loolwsd code-brand
    
    cat > /etc/apache2/sites-available/code.conf <<CODE
    <VirtualHost *:443>
    
        ServerName ${CODE}:443
        ServerAlias ${CODE}
    
        SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
        SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
        Include /etc/letsencrypt/options-ssl-apache.conf
    
        ErrorLog \${APACHE_LOG_DIR}/${CODE}.error.log
        CustomLog \${APACHE_LOG_DIR}/${CODE}.access.log combined
    
        # Encoded slashes need to be allowed
        AllowEncodedSlashes NoDecode
    
        # Container uses a unique non-signed certificate
        SSLProxyEngine On
        SSLProxyVerify None
        SSLProxyCheckPeerCN Off
        SSLProxyCheckPeerName Off
    
        # keep the host
        ProxyPreserveHost On
    
        # static html, js, images, etc. served from loolwsd
        # loleaflet is the client part of LibreOffice Online
        ProxyPass           /loleaflet https://${CODE}:9980/loleaflet retry=0
        ProxyPassReverse    /loleaflet https://${CODE}:9980/loleaflet
    
        # WOPI discovery URL
        ProxyPass           /hosting/discovery https://${CODE}:9980/hosting/discovery retry=0
        ProxyPassReverse    /hosting/discovery https://${CODE}:9980/hosting/discovery
    
        # Main websocket
        ProxyPassMatch "/lool/(.*)/ws$" wss://${CODE}:9980/lool/$1/ws nocanon
    
        # Admin Console websocket
        ProxyPass   /lool/adminws wss://${CODE}:9980/lool/adminws
    
        # Download as, Fullscreen presentation and Image upload operations
        ProxyPass           /lool https://${CODE}:9980/lool
        ProxyPassReverse    /lool https://${CODE}:9980/lool
    
        # For debugging CertBot
        #DocumentRoot /var/www/html
        #<Directory /var/www/html>
        #    Options FollowSymLinks
        #    AllowOverride All
        #    Order allow,deny
        #    Allow from all
        #    Require all granted
        #    Satisfy Any
        #</Directory>
    
    </VirtualHost>
    CODE
    
    a2ensite code.conf
    a2enmod ssl
    a2enmod proxy
    a2enmod proxy_wstunnel
    a2enmod proxy_http
    service apache2 restart
    
    # Install Certbot
    apt-get -y install python-certbot-apache
    apt-get -y upgrade
    
    # Get SSL going
    certbot --apache
    sed -i 's/\/\/define("AJXP_FORCE_SSL/define("AJXP_FORCE_SSL/' /etc/pydio/bootstrap_conf.php
    echo \<html\>\<head\>\<meta http-equiv=\"refresh\" content=\"0\;URL=\'https://${PYDIO}/\'\" /\>\</head\>\</html\> > /var/www/html/index.html
    mkdir /opt/scripts
    
    cat > /opt/scripts/update-certs.sh <<CERTS
    #!/bin/bash
    
    /usr/bin/certbot renew --quiet
    
    # This is hacky but works for now.
    cp -f /etc/letsencrypt/live/${PYDIO}/chain.pem /etc/loolwsd/ca-chain.cert.pem
    cp -f /etc/letsencrypt/live/${PYDIO}/privkey.pem /etc/loolwsd/key.pem
    cp -f /etc/letsencrypt/live/${PYDIO}/cert.pem /etc/loolwsd/cert.pem
    chown lool:lool /etc/loolwsd/*.pem
    chmod 600 /etc/loolwsd/*.pem
    CERTS
    
    chmod 700 /opt/scripts/update-certs.sh
    (crontab -l 2>/dev/null; echo "0 1 * * * /opt/scripts/update-certs.sh") | crontab -
    /opt/scripts/update-certs.sh
    
    # Get CODE going
    service loolwsd start
    
    # In Pydio, the Settings panel, go to All Plugins > Features Plugins > Editors and enable the Collabora Online plugin.
    # Edit its parameters as follow:
    #   Url to the Libre Office Editor iFrame: https://${CODE}/loleaflet/dist/loleaflet.html
    #   WebSocket use TLS: true
    #   Web Socket Connector Host: ${CODE}
    #   Web Socket Connector Port: 443 (see virtual host configuration above)
    # Next go to Pydio Booster, scroll down, and click Generate API Key
    
    # Download Pydio Booster
    mkdir -p /opt/booster/ocsp
    chown www-data:www-data /opt/booster/ocsp
    wget -O /opt/booster/pydio https://download.pydio.com/pub/booster/release/0.8.6/linux_amd64/pydio
    chmod +x /opt/booster/pydio
    
    cat > /opt/booster/start.sh <<START
    #!/bin/bash
    cd /opt/booster
    ulimit -n 8192
    sudo -u www-data CADDYPATH=/opt/booster /opt/booster/pydio -conf /opt/booster/pydioconf -pidfile /opt/booster/pydio.pid &> /opt/booster/pydio.log &
    START
    
    chmod +x /opt/booster/start.sh
    
    cat > /opt/booster/stop.sh <<STOP
    #!/bin/bash
    cd /opt/booster
    if [[ -e pydio.pid ]]; then
        kill \$(cat pydio.pid)
    fi
    STOP
    
    chmod +x /opt/booster/stop.sh
    
    export TOKENP=$(cat /var/lib/pydio/data/plugins/core.mq/apikey | cut -d : -f 1)
    export TOKENS=$(cat /var/lib/pydio/data/plugins/core.mq/apikey | cut -d : -f 2)
    
    cat > /opt/booster/pydioconf <<CONF
    {
        "scheduler": {
            "host": "https:\/\/${PYDIO}\/pydio",
            "tokenP": "${TOKENP}",
            "tokenS": "${TOKENS}",
            "minutes": 2
        },
        "nsq": {
            "host": "0.0.0.0",
            "port": 4150
        },
        "caddyFilePath": "/opt/booster/pydiocaddy"
    }
    CONF
    cat > /opt/booster/pydiocaddy <<CADDY
    https://${PYDIO}:8090 {
        #errors /opt/booster/errors.log
        #log /opt/booster/access.log
        tls fullchain2.pem key.pem
        pydiows /ws     {
            pre {
                if {>Cookie} has "AjaXplorer"
                type request
                url https://${PYDIO}?get_action=keystore_generate_auth_token&device=websocket
                cookie AjaXplorer
                out token
            }
            pre {
                type request
                url https://${PYDIO}/api/pydio/ws_authenticate?key=${TOKENP}:${TOKENS}
                query auth_hash
                query auth_token
                out user
            }
        }
        header /io {
        Access-Control-Allow-Origin https://${PYDIO}
            Access-Control-Request-Headers *
            Access-Control-Allow-Methods POST
            Access-Control-Allow-Headers Range
            Access-Control-Allow-Credentials true
        }
        pydioupload /io     {
            pre {
                type node
                out node
            }
            pre {
                if {query} has "minisite_session"
                type request
                url https://${PYDIO}?get_action=keystore_generate_auth_token&device=upload
                query minisite_session
                cookie AjaXplorer_Shared
                out token
            }
            pre {
                if {query} not_has "minisite_session"
                if {>Cookie} has "AjaXplorer="
                type request
                url https://${PYDIO}?get_action=keystore_generate_auth_token&device=upload
                cookie AjaXplorer
                out token
            }
            pre {
                type request
                url https://${PYDIO}/api/{repo}/upload/put/{nodedir}?xhr_uploader=true
                header X-File-Direct-Upload request-options
                header X-Pydio-Admin-Auth ${TOKENP}:${TOKENS}
                header X-File-Name {nodename}
                query *
                out options
            }
            post {
                type request
                url https://${PYDIO}/api/{repo}/upload/put/{nodedir}?xhr_uploader=true
                header X-File-Direct-Upload upload-finished
                header X-Pydio-Admin-Auth ${TOKENP}:${TOKENS}
                header X-File-Name {nodename}
                query auth_hash
                query auth_token
                out body
            }
        }
    
    #    pydiodownload /io {
    #        pre {
    #            type node
    #            out node
    #        }
    #        pre {
    #            if {query} not_has "minisite_session"
    #            if {>Cookie} has "AjaXplorer="
    #            type request
    #            url https://${PYDIO}/?get_action=download
    #            header X-Pydio-Admin-Auth ${TOKENP}:${TOKENS}
    #            header X-Pydio-Download-Supported true
    #            cookie AjaXplorer
    #            query *
    #            out options X-Pydio-Download-Redirect
    #        }
    #    }
    
        pydioadmin /admin
        basicauth /admin ${TOKENP} ${TOKENS}
    }
    CADDY
    
    sed -i 's/exit 0/\/opt\/booster\/start.sh/' /etc/rc.local
    echo exit 0 >> /etc/rc.local
    

    • This topic was modified 2 months ago by Profile photo of Charles Charles.
    #115429
    Profile photo of Scott Duensing
    sduensin
    Participant

    FFS! The docs are wrong! Issue filed.

    https://github.com/pydio/pydio-doc-admin-guide/issues/2


    #115516
    Profile photo of Charles
    Charles
    Keymaster

    scott, is it ok once you have the correct build?


    Charles, Pydio author - doing my best to help !
    If you like the software or want to say thanks, pay by a tweet, mention #pydio or follow us

    #115521
    Profile photo of Scott Duensing
    sduensin
    Participant

    Yep! We’re rocking! Looking to install and configure it at work for a demo with CODE integrated this week. :-)


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.