abraunegg / onedrive

OneDrive Client for Linux
https://abraunegg.github.io
GNU General Public License v3.0
10.16k stars 864 forks source link

Bug: Client and systemd use different home directory for users with unusual $HOME #2555

Closed marmeladapk closed 11 months ago

marmeladapk commented 11 months ago

Describe the bug

Onedrive client when run from terminal searches for config in $HOME or $XDG_CONFIG_HOME folders. Systemd unit has hardcoded --confdir=/home/%i/.config/onedrive. This yields different behaviour when running from terminal vs enabling systemd service.

This means that for users with unusual home directory, when you first need to authenticate, files are created in another place, that systemd won't be searching. You'll need to either modify systemd file or copy configuration and token.

Example situation:

Operating System Details

Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:    22.04
Codename:   jammy

Client Installation Method

From 3rd Party Source (PPA, OpenSuSE Build Service etc)

OneDrive Account Type

Personal

What is your OneDrive Application Version

onedrive v2.4.25-1+np1

What is your OneDrive Application Configuration

Irrelevant

What is your 'curl' version

curl 7.81.0 (aarch64-unknown-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.16
Release-Date: 2022-01-05
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets zstd

Where is your 'sync_dir' located

Local

What are all your system 'mount points'

Irrelevant

What are all your local file system partition types

Irrelevant

How do you use 'onedrive'

Using systemd for synchronization service.

Steps to reproduce the behaviour

Try to use onedrive for www-data user on ubuntu from terminal and as systemd service.

Complete Verbose Log Output

sudo -u www-data onedrive -vv
[sudo] password for : 
[DEBUG] homePath: HOME environment variable set
[DEBUG] homePath: /var/www
[DEBUG] configDirBase: WARNING - no XDG_CONFIG_HOME environment variable set
[DEBUG] configDirBase: /var/www/.config
[DEBUG] configDirName: Configuring application to use default config path
Using 'user' Config Dir: /var/www/.config/onedrive
Using 'system' Config Dir: /etc/onedrive

Screenshots

No response

Other Log Information or Details

No response

Additional context

No response

abraunegg commented 11 months ago

@marmeladapk This is not a bug - sorry.

You are placing the home directory in a non standard place, thus you need to modify your systemd files to suit your environment.

abraunegg commented 11 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.