Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix remote set-up, i.e. deploy server remotly [5] #95

Closed
JonasHelming opened this issue Mar 9, 2022 · 1 comment · Fixed by #109
Closed

Fix remote set-up, i.e. deploy server remotly [5] #95

JonasHelming opened this issue Mar 9, 2022 · 1 comment · Fixed by #109

Comments

@JonasHelming
Copy link
Member

JonasHelming commented Mar 9, 2022

Test and log issues, only ix super small isues right away

@JonasHelming JonasHelming created this issue from a note in CDT.cloud deployment server (Estimation) Mar 9, 2022
@theZasa theZasa changed the title Test in remote set-up, i.e. deploy server remotly Test in remote set-up, i.e. deploy server remotly [5] Mar 9, 2022
@Gozzim Gozzim self-assigned this Mar 29, 2022
@Gozzim Gozzim moved this from Estimation to In progress in CDT.cloud deployment server Mar 29, 2022
@Gozzim
Copy link
Contributor

Gozzim commented Mar 29, 2022

Setup

Current setup for remote deployment

Deployment Server

Currently running a remote setup of the deployment-server on https://deployment.sanctum-dev.com

  • Dashboard is available under the described URL
  • There is currently one mock device in the database

Nginx Setup

Using a reverse-proxy with Nginx to manage the connection to the deployment-server API and the dashboard
Requires a small addition to the default nginx-reverse-proxy-configuration to support the WebSockets
The connection is routed over Cloudflare (without an enabled Origin-Certificate), which is why there is only a port 80 configuration but the connection is encrypted.
Nginx Config:

server {
        listen 80;
        listen [::]:80;
        server_name domain.tld;

        access_log /var/log/nginx/reverse-access.log;
        error_log /var/log/nginx/reverse-error.log;

        location / {
                    proxy_pass http://127.0.0.1:3001;
                    proxy_http_version  1.1;
                    proxy_cache_bypass  $http_upgrade;

                    proxy_set_header Host              $host;
                    proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
                    proxy_set_header X-Real-IP         $remote_addr;
                    proxy_set_header X-Forwarded-Host  $host;
                    proxy_set_header X-Forwarded-Proto https;
                    proxy_set_header X-Forwarded-Port  $server_port;

                    # Websocket Support
                    proxy_set_header Upgrade $http_upgrade;
                    proxy_set_header Connection "upgrade";
  }
}

Device Connector

The Device Connector was run remotely from another machine for testing purposes. Thanks to @theZasa for the help.
A general connector is currently not running remotely as we do not have access to a public machine we can attach hardware to.

  • Change the following lines in the .env file (device-connector folder or .docker folder depending on how it's executed):
    • DEPLOY_IP='deployment.sanctum-dev.com'
    • DEPLOY_PORT=443
    • DEPLOY_SECURE=true

Theia

Current workaround until settings exist:

  • Change the lines in cdtcloud/src/node/config-service.ts to the correct domain
    • host: deployment.sanctum-dev.com
    • port: 443
    • secure: true

Arduino-Cli

Run as per usual

Tests

Deployment Server

  • The Deployment Server is running flawlessly
  • The API shows no issues and is working fine

Admin Dashboard

  • The main Dashboard works fine
  • The Deployments page shows correct data
  • The Deployments artifact download links are broken due to a violation of the content security policy - This is caused by the artifactUrl being stored as insecure URL (http) with the server running a secure connection in our test case
    Refused to connect to 'http://deployment.sanctum-dev.com/api/deployment-artifacts/77ccff26-6f71-4894-922e-e4658ca06d82.bin' because it violates the document's Content Security Policy. 0717616
  • [Bug]: deployment-server-ui Devices shows a white screen #105
  • The Device Types page shows correct data
  • The Device Types images are broken due to a 'wrong origin'
    GET https://raw.githubusercontent.com/fritzing/fritzing-parts/main/svg/core/breadboard/arduino_uno(rev3)-icsp_breadboard.svg net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 200 3401b85
  • Websockets issue when using proxies with TLS only on one side remotely 1925259

Device Connector

  • Starts and connects fine to the cli and the deployment server
  • Currently running into issues during deployment. Failing at board reset
    INFO[0034] Performing 1200-bps touch reset on serial port COM3 phase="board reset" 0717616aa285986cfe63ad4faaddc8a76c1ccf31 | ERROR: rpc error: code = Internal desc = Failed uploading: uploading error: exit status 3221225620

Theia

  • Starting and connecting to the deployment server and arduino-cli without issues
  • Compiling code works
  • Deployment request sent fine
  • Failing deployment due to the board reset error in the device connector - could therefore not be tested completely yet 0717616

@theZasa theZasa moved this from In progress to Reviewer approved in CDT.cloud deployment server Mar 30, 2022
@theZasa theZasa changed the title Test in remote set-up, i.e. deploy server remotly [5] Fix remote set-up, i.e. deploy server remotly [5] Mar 30, 2022
@theZasa theZasa moved this from Reviewer approved to Review in progress in CDT.cloud deployment server Mar 30, 2022
@theZasa theZasa moved this from Review in progress to Estimation in CDT.cloud deployment server Mar 30, 2022
@Gozzim Gozzim removed their assignment Apr 1, 2022
CDT.cloud deployment server automation moved this from Estimation to Done May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants