Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Android App Error "Unknown Error" when attempting login to self hosted StandardNotes server #5

@e1025735

Description

@e1025735

As requested two days ago in the ticket "Unknown Error when attempting login to self hosted StandardNotes server" I create a new issue for this project.

Setup

I have taken the following steps to set up the selfhosted standardnotes application:

LOG_LEVEL=info
NODE_ENV=production

JWT_SECRET=32 bit Key
LEGACY_JWT_SECRET=32 bit Key
AUTH_JWT_SECRET=32 bit Key

EXPOSED_PORT=5001

DB_HOST=db
DB_REPLICA_HOST=db
DB_PORT=3306
DB_USERNAME=std_notes_user
DB_PASSWORD=32 bit Key
DB_DATABASE=standard_notes_db
DB_DEBUG_LEVEL=all
DB_MIGRATIONS_PATH=dist/migrations/*.js

REDIS_URL=redis://cache

DISABLE_USER_REGISTRATION=false

ACCESS_TOKEN_AGE=5184000
REFRESH_TOKEN_AGE=31556926

EPHEMERAL_SESSION_AGE=259200

MAX_LOGIN_ATTEMPTS=6
FAILED_LOGIN_LOCKOUT=3600

PSEUDO_KEY_PARAMS_KEY=32 bit Key

SNS_TOPIC_ARN=
SNS_AWS_REGION=
SQS_QUEUE_URL=
SQS_AWS_REGION=
S3_AWS_REGION=
S3_BACKUP_BUCKET_NAME=

USER_SERVER_REGISTRATION_URL=
USER_SERVER_AUTH_KEY=

REDIS_EVENTS_CHANNEL=events

INTERNAL_DNS_REROUTE_ENABLED=false
EXTENSIONS_SERVER_URL=http://extensions-server:3004
AUTH_SERVER_URL=http://auth:3000

EMAIL_ATTACHMENT_MAX_BYTE_SIZE=10485760

REVISIONS_FREQUENCY=300

NEW_RELIC_ENABLED=false
NEW_RELIC_APP_NAME="Syncing Server JS"
NEW_RELIC_LICENSE_KEY=
NEW_RELIC_NO_CONFIG_FILE=true
NEW_RELIC_DISTRIBUTED_TRACING_ENABLED=false
NEW_RELIC_LOG_ENABLED=false
NEW_RELIC_LOG_LEVEL=info
  • Create a ngnix config for a reverse proxy
        listen 5000 ssl;

        ssl_certificate /etc/letsencrypt/certs/standardnotes.crt;
        ssl_certificate_key /etc/letsencrypt/certs/standardnotes.key;
        ssl_protocols TLSv1.2 TLSv1.3;

        location / {
                proxy_pass "http://127.0.0.1:5001";
        }
}

docker run -d -p 5003:3001 --env-file=/path/to/file/.env standardnotes/web:stable

with the following .env file

PORT=3001
WEB_CONCURRENCY=0
RAILS_LOG_TO_STDOUT=true
RAILS_SERVE_STATIC_FILES=true
SECRET_KEY_BASE=32 bit Key
APP_HOST=http://localhost:3001

EXTENSIONS_MANAGER_LOCATION=extensions/extensions-manager/dist/index.html
BATCH_MANAGER_LOCATION=extensions/batch-manager/dist/index.min.html
SF_DEFAULT_SERVER=https://STATIC_IP:5000

DEV_DEFAULT_SYNC_SERVER=https://STATIC_IP:5000
DEV_EXTENSIONS_MANAGER_LOCATION=public/extensions/extensions-manager/dist/index.html
DEV_BATCH_MANAGER_LOCATION=public/extensions/batch-manager/dist/index.min.html

NEW_RELIC_ENABLED=false
NEW_RELIC_THREAD_PROFILER_ENABLED=false
NEW_RELIC_LICENSE_KEY=
NEW_RELIC_APP_NAME=Web
NEW_RELIC_BROWSER_MONITORING_AUTO_INSTRUMENT=false
  • creating another ngnix reverse proxy for the web app
        listen 5002 ssl;

        ssl_certificate /etc/letsencrypt/certs/standardnotes.crt;
        ssl_certificate_key /etc/letsencrypt/certs/standardnotes.key;
        ssl_protocols TLSv1.2 TLSv1.3;

        location / {
                proxy_pass "http://127.0.0.1:5003";
        }
}
  • restarting ngnix

sudo systemctl reload nginx.service

Problem

So far so good. The web app works as intended and lets me create notes with the freshly created user.
BUT if I want to use the android app to connect to the URL https://STATIC_IP:5000 with the same user and password the following error is thrown in the mobile app: "Unknown Error".
Therefore I ask the same question as in the mobile issue:

Is there a quick and easy way to show the user a better help text for the problem without having to debug the app? For example, the possibility to see an abbreviated StackTrace or to show the most common error sources: no HTTPS usage, a self-made certificate, which therefore will not be accepted or no internet access. The message "Unknown Error" is certainly true but hardly helps for the user.

However the following path might me help as well:
Is there any documentation that describes what configuration must be done for the android app to work with a self-applied standalone StandardNotes? Or have I committed some other oversight that is obviously already apparent?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions