You are not logged in.
Bonjour à tous·tes!
Je cherche à faire fonctionner le serveur de synchronisation de podcast oPodSync sur mon serveur Debian 12.
Documentation: https://fossil.kd2.org/opodsync/doc/main/README.md
J'ai pu installer le côté serveur, je peux y accéder via un navigateur web et j'ai pu créer un utilisateur, mais je rencontre des problèmes pour connecter mes clients. Je pense qu'il s'agit d'un problème de configuration Apache ou PHP et j'atteins mes limites d'autodidacte...
OS: Debian 12
Apache: 2.4.62
PHP: 8.2.28
SQLite3: 3.40.1
AntennaPod: 3.8.0
Configuration du VirtualHost Apache (j'ai volontairement masqué mon domaine):
<VirtualHost *:80 *:8083> Servername ops.mon.domaine DocumentRoot /var/www/opodsync/server ErrorLog ${APACHE_LOG_DIR}/oPodSync_error.log CustomLog ${APACHE_LOG_DIR}/oPodSync_access.log combined </VirtualHost>
Fichier de configuration oPodSync (j'ai volontairement masqué mon domaine):
<?php namespace OPodSync; /** * ENABLE_SUBSCRIPTIONS * true = Open subscriptions to anyone * false = Subscriptions are closed after the first account is created * * Default: false * @var bool */ const ENABLE_SUBSCRIPTIONS = false; /** * TITLE * This is used for the instance name * * Default: My oPodSync server * @var string */ const TITLE = 'My oPodSync server'; /** * BASE_URL * Set to the URL where the server is hosted * * Default: detected automatically if not set (can fail in some cases) * @var string */ //const BASE_URL = 'https://gpodder.mydomain.tld/me/'; const BASE_URL = 'http://ops.mon.domaine/'; /** * DISABLE_USER_METADATA_UPDATE * Set this to TRUE to forbid users from updating feed metadata, * as this may add some load on your server * (default is FALSE) * * @var bool */ const DISABLE_USER_METADATA_UPDATE = false; /** * DATA_ROOT * Path of directory where data will be stored. * ROOT is the root of oPodSync code. * * @var string */ const DATA_ROOT = ROOT . '/data'; /** * CACHE_ROOT * Path of directory where cache will be stored. * ROOT is the root of oPodSync code. * * @var string */ const CACHE_ROOT = DATA_ROOT . '/cache'; /** * DB_FILE * SQLite3 database file * This is where the users, app sessions and stuff will be stored */ const DB_FILE = DATA_ROOT . '/data.sqlite'; /** * SQLITE_JOURNAL_MODE * SQLite3 journaling mode * Default: TRUNCATE (slower) * Recommended: WAL (faster, but read below) * * If your database file is on a local disk, you will get better performance by using * 'WAL' journaling instead. But it is not enabled by default as it may * lead to database corruption on some network storage (eg. old NFS). * * @see https://www.sqlite.org/pragma.html#pragma_journal_mode * @see https://www.sqlite.org/wal.html * @see https://stackoverflow.com/questions/52378361/which-nfs-implementation-is-safe-for-sqlite-database-accessed-by-multiple-proces * * Default: 'TRUNCATE' * @var string */ const SQLITE_JOURNAL_MODE = 'TRUNCATE'; /** * ERRORS_SHOW * Show PHP errors details to users? * If set to TRUE, full error messages and source code will be displayed to visitors. * If set to FALSE, just a generic "an error happened" message will be displayed. * * It is recommended to set this to FALSE in production. * Default: TRUE * * @var bool */ const ERRORS_SHOW = true; /** * ERRORS_EMAIL * Send PHP errors to this email address * The email will contain * Default: NULL (errors are not sent by email) * * @var string|null */ const ERRORS_EMAIL = null; /** * ERRORS_LOG * Log PHP errors in this file. * Default: ROOT/data/error.log * * @var string */ const ERRORS_LOG = DATA_ROOT . '/error.log'; /** * ERRORS_REPORT_URL * Send errors reports to this errbit/airbrake compatible API endpoint * Default: NULL * Example: 'https://user:password@domain.tld/errors' * * @var string|null * @see https://errbit.com/images/error_summary.png * @see https://airbrake.io/docs/api/#create-notice-v3 */ const ERRORS_REPORT_URL = null; /** * DEBUG_LOG * Log API calls to this file. * Useful for development. * * Default: null (= disabled) * @var string|null */
Le dossier /var/www/opodsync/server/ ainsi que l'entier son contenu appartient à www-data:
drwxr-xr-x 6 www-data www-data 4.0K 26 avr 17:39 . drwxr-xr-x 3 www-data www-data 4.0K 26 avr 17:19 .. drwxr-xr-x 3 www-data www-data 4.0K 26 avr 17:40 data -rw-r--r-- 1 www-data www-data 406 26 avr 17:19 feed.php -rw-r--r-- 1 www-data www-data 240 26 avr 17:19 .htaccess -rw-r--r-- 1 www-data www-data 2.2K 26 avr 17:19 icon.svg -rw-r--r-- 1 www-data www-data 2.6K 26 avr 17:19 _inc.php -rw-r--r-- 1 www-data www-data 1.1K 26 avr 17:19 index.php drwxr-xr-x 4 www-data www-data 4.0K 26 avr 17:19 lib -rw-r--r-- 1 www-data www-data 419 26 avr 17:19 login.php -rw-r--r-- 1 www-data www-data 606 26 avr 17:19 register.php drwxr-xr-x 2 www-data www-data 4.0K 26 avr 17:19 sql -rw-r--r-- 1 www-data www-data 3.3K 26 avr 17:19 style.css -rw-r--r-- 1 www-data www-data 263 26 avr 17:19 subscriptions.php drwxr-xr-x 2 www-data www-data 4.0K 26 avr 17:19 templates -rw-r--r-- 1 www-data www-data 330 26 avr 17:19 update.php
Ce serveur n'est pas accessible depuis le WAN, tout reste en local.
Avec AntennaPod sur Android, on peut utiliser les deux possibilités pour configurer la synchronisation (selon la documentation: AntennaPod 2.6.1: both GPodder API and NextCloud API):
1. Gpodder API
Adresse du serveur: http://ops.mon.domaine
Identifiant: mon user
Mot de passe: mon mot de passe
Erreur: Unable to connect to ops.mon.domaine (code 404: Not found)
Rien dans /var/log/apache2/opodsync_access.log
Rien dans /var/log/apache2/opodsync_error.log
Rien dans /var/www/opodsync/server/data/error.log
Je vois passer les requêtes sur mon routeur OPNsens et elle ne sont pas bloquées par celui-ci.
2. NextCloud API
Adresse du serveur: http://ops.mon.domaine
Cela ouvre un navigateur sur la page http://ops.mon.domaine/login?token=dec1e5... avec l'erreur (j'ai volontairement masqué mon domaine):
404 Not Found The requested URL was not found on this server. Apache/2.4.62 (Debian) Server at ops.mon.domaine Port 80
Rien dans /var/log/apache2/opodsync_access.log
Rien dans /var/log/apache2/opodsync_error.log
Par contre, dans /var/www/opodsync/server/data/error.log je trouve (j'ai volontairement masqué mon domaine):
[27-Apr-2025 10:28:49 UTC] =========== Error ref. 17afsbc =========== ErrorException: Warning: session_id(): Session ID cannot be changed when a session is active in /var/www/opodsync/server/lib/OPodSync/API.php:287 Stack trace: #0 [internal function]: KD2\ErrorManager::errorHandler(2, '...', '...', 287) #1 /var/www/opodsync/server/lib/OPodSync/API.php(287): session_id('...') #2 /var/www/opodsync/server/lib/OPodSync/API.php(361): OPodSync\API->handleNextCloud() #3 /var/www/opodsync/server/index.php(22): OPodSync\API->handleRequest() #4 {main} <errorReport> { "errors": [ { "message": "Warning: session_id(): Session ID cannot be changed when a session is active", "errorCode": 0, "type": "PHP error", "backtrace": [ { "file": "...\/lib\/OPodSync\/API.php", "line": 287, "code": { "283": "\t\t\tif (empty($_POST['token']) || !ctype_alnum($_POST['token'])) {", "284": "\t\t\t\t$this->error(400, 'Invalid token');", "285": "\t\t\t}", "286": "", "287": "\t\t\tsession_id($_POST['token']);", "288": "\t\t\tsession_start();", "289": "", "290": "\t\t\tif (empty($_SESSION['user']) || empty($_SESSION['app_password'])) {", "291": "\t\t\t\t$this->error(404, 'Not logged in yet, using token: ' . $_POST['token']);" } }, { "function": "session_id", "file": "...\/lib\/OPodSync\/API.php", "line": 287, "args": { "$id": "string(40) \"dec1e5aefc9a39acbcef72886a0a268192b02caf\"" }, "code": { "283": "\t\t\tif (empty($_POST['token']) || !ctype_alnum($_POST['token'])) {", "284": "\t\t\t\t$this->error(400, 'Invalid token');", "285": "\t\t\t}", "286": "", "287": "\t\t\tsession_id($_POST['token']);", "288": "\t\t\tsession_start();", "289": "", "290": "\t\t\tif (empty($_SESSION['user']) || empty($_SESSION['app_password'])) {", "291": "\t\t\t\t$this->error(404, 'Not logged in yet, using token: ' . $_POST['token']);" } }, { "function": "OPodSync\\API->handleNextCloud", "file": "...\/lib\/OPodSync\/API.php", "line": 361, "code": { "357": "\t\t$this->url = strtok($url, '?');", "358": "", "359": "\t\t$this->debug('Got a %s request on %s', $this->method, $this->url);", "360": "", "361": "\t\t$return = $this->handleNextCloud();", "362": "", "363": "\t\tif ($return) {", "364": "\t\t\techo json_encode($return, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT);", "365": "\t\t\texit;" } }, { "function": "OPodSync\\API->handleRequest", "file": "...\/index.php", "line": 22, "code": { "18": "\/\/ Try to handle API requests first", "19": "$api = new API;", "20": "", "21": "try {", "22": "\tif ($api->handleRequest()) {", "23": "\t\treturn;", "24": "\t}", "25": "} catch (JsonException $e) {", "26": "\treturn;" } } ] } ], "context": { "date": "2025-04-27T10:28:49+00:00", "duration": 7.879018783569336, "environment": "development", "hostname": "ops.mon.domaine", "http_files": "array(0) {\n }", "http_method": "POST", "http_post": "array(1) {\n [\"token\"]=> string(40) \"***HIDDEN***\"\n }", "http_user_agent": "AntennaPod\/3.8.0", "id": "17afsbc", "language": "PHP 8.2.28", "memory_peak": 2097152, "memory_used": 2097152, "os": "Linux", "php_sapi": "apache2handler", "remote_ip": "10.10.20.2", "root_directory": "\/var\/www\/opodsync\/server", "server_addr": "10.10.10.10", "user_addr": "10.10.20.2", "url": "http:\/\/ops.mon.domaine\/index.php\/login\/v2\/poll" } } </errorReport>
J'ai essayé de modifier manuellement ce lien directement dans le navigateur en ajoutant .php après /login, soit http://ops.mon.domaine/login.php?token=dec1e5... Cela permet d'accéder à la page de login d'oPodSync où je peux me connecter avec succès avec le message "You are logged in, you can close this and go back to the app". Mais en retournant sur AntennaPod, la connexion ne s'est pas faite. J'ai toujours la roue qui tourne avec le message "Autoriser l'accès à l'aide du navigateur qui a été ouvert puis revenez sur AntennaPod".
Voilà, je sèche... Je suis preneur de toute aide, tout conseil, toute piste.
Au plaisir de vous lire et bons messages à tous·tes!
P.S.
J'ai plusieurs autres services qui fonctionnent correctement et qui sont accessibles via leurs interfaces web:
- APT Cacher NG
- Jellyfin
- Radicale
- Syncthing
- Unbound
- ...
Offline
OK, j'ai trouvé.
Dans les clients, il suffit de préciser le port. Donc:
Gpodder API
Adresse du serveur: http://ops.mon.domaine:8083
Identifiant: user
Mot de passe: mot de passe
Et ça roule!
Offline