-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
[Bug]: Could not find resource files_external/js/public_key.js to load #42158
Comments
I'm also affected and it's causing a non-trivial number of "ERROR" level log messages to pile up. |
Im Using Docker Compose and get the same. Compose file: version: '3.8'
services:
nextcloud:
image: custom-nextcloud:latest
volumes:
- /home/docker-projects/nextcloud-fotos:/mnt/Fotos-Nextcloud
- /home/docker-projects/nextcloud:/var/www/html
restart: always
environment:
- POSTGRES_HOST=postgres
- POSTGRES_DB=nextcloud
- POSTGRES_USER=nextcloud
- POSTGRES_PASSWORD=securepassword
- REDIS_HOST=redis
- PHP_MEMORY_LIMIT=1024M
- NEXTCLOUD_TRUSTED_DOMAINS=localhost 192.168.178.36
- NEXTCLOUD_ADMIN_USER=myuser
- NEXTCLOUD_ADMIN_PASSWORD=myuser_password
- NEXTCLOUD_DEFAULT_PHONE_REGION=DE
ports:
- "8811:80"
hostname: nextcloud-server
container_name: nextcloud-server
depends_on:
- postgres
- redis
postgres:
image: postgres:latest
restart: always
environment:
- POSTGRES_DB=nextcloud
- POSTGRES_USER=nextcloud
- POSTGRES_PASSWORD=securepassword
hostname: nextcloud-db
container_name: nextcloud-db
volumes:
- /home/docker-projects/nextcloud/postgres:/var/lib/postgresql/data
redis:
image: redis:alpine
restart: always
hostname: nextcloud-redis
container_name: nextcloud-redis Dockerfile FROM nextcloud:latest
RUN apt-get update && \
apt-get install -y libbz2-dev nano ffmpeg && \
rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install bz2 Version Current install: Today, 05.01.2024 i check files: and i found the right codes <?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
* @author Morris Jobke <hey@morrisjobke.de>
* @author Robin McCorkell <robin@mccorkell.me.uk>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace OCA\Files_External\Lib\Auth\OAuth1;
use OCA\Files_External\Lib\Auth\AuthMechanism;
use OCA\Files_External\Lib\DefinitionParameter;
use OCP\IL10N;
/**
* OAuth1 authentication
*/
class OAuth1 extends AuthMechanism {
public function __construct(IL10N $l) {
$this
->setIdentifier('oauth1::oauth1')
->setScheme(self::SCHEME_OAUTH1)
->setText($l->t('OAuth1'))
->addParameters([
(new DefinitionParameter('configured', 'configured'))
->setType(DefinitionParameter::VALUE_HIDDEN),
new DefinitionParameter('app_key', $l->t('App key')),
(new DefinitionParameter('app_secret', $l->t('App secret')))
->setType(DefinitionParameter::VALUE_PASSWORD),
(new DefinitionParameter('token', 'token'))
->setType(DefinitionParameter::VALUE_HIDDEN),
(new DefinitionParameter('token_secret', 'token_secret'))
->setType(DefinitionParameter::VALUE_HIDDEN),
])
->addCustomJs('oauth1')
;
}
} $ cat apps/files_external/lib/Lib/Auth/OAuth2/OAuth2.php <?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
* @author Morris Jobke <hey@morrisjobke.de>
* @author Robin McCorkell <robin@mccorkell.me.uk>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace OCA\Files_External\Lib\Auth\OAuth2;
use OCA\Files_External\Lib\Auth\AuthMechanism;
use OCA\Files_External\Lib\DefinitionParameter;
use OCP\IL10N;
/**
* OAuth2 authentication
*/
class OAuth2 extends AuthMechanism {
public function __construct(IL10N $l) {
$this
->setIdentifier('oauth2::oauth2')
->setScheme(self::SCHEME_OAUTH2)
->setText($l->t('OAuth2'))
->addParameters([
(new DefinitionParameter('configured', 'configured'))
->setType(DefinitionParameter::VALUE_HIDDEN),
new DefinitionParameter('client_id', $l->t('Client ID')),
(new DefinitionParameter('client_secret', $l->t('Client secret')))
->setType(DefinitionParameter::VALUE_PASSWORD),
(new DefinitionParameter('token', 'token'))
->setType(DefinitionParameter::VALUE_HIDDEN),
])
->addCustomJs('oauth2')
;
}
} $ cat apps/files_external/lib/Lib/Auth/PublicKey/RSA.php <?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
* @author Morris Jobke <hey@morrisjobke.de>
* @author Robin McCorkell <robin@mccorkell.me.uk>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace OCA\Files_External\Lib\Auth\PublicKey;
use OCA\Files_External\Lib\Auth\AuthMechanism;
use OCA\Files_External\Lib\DefinitionParameter;
use OCA\Files_External\Lib\StorageConfig;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IUser;
use phpseclib\Crypt\RSA as RSACrypt;
/**
* RSA public key authentication
*/
class RSA extends AuthMechanism {
/** @var IConfig */
private $config;
public function __construct(IL10N $l, IConfig $config) {
$this->config = $config;
$this
->setIdentifier('publickey::rsa')
->setScheme(self::SCHEME_PUBLICKEY)
->setText($l->t('RSA public key'))
->addParameters([
new DefinitionParameter('user', $l->t('Username')),
new DefinitionParameter('public_key', $l->t('Public key')),
(new DefinitionParameter('private_key', 'private_key'))
->setType(DefinitionParameter::VALUE_HIDDEN),
])
->addCustomJs('public_key')
;
}
public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
$auth = new RSACrypt();
$auth->setPassword($this->config->getSystemValue('secret', ''));
if (!$auth->loadKey($storage->getBackendOption('private_key'))) {
// Add fallback routine for a time where secret was not enforced to be exists
$auth->setPassword('');
if (!$auth->loadKey($storage->getBackendOption('private_key'))) {
throw new \RuntimeException('unable to load private key');
}
}
$storage->setBackendOption('public_key_auth', $auth);
}
/**
* Generate a keypair
*
* @param int $keyLenth
* @return array ['privatekey' => $privateKey, 'publickey' => $publicKey]
*/
public function createKey($keyLength) {
$rsa = new RSACrypt();
$rsa->setPublicKeyFormat(RSACrypt::PUBLIC_FORMAT_OPENSSH);
$rsa->setPassword($this->config->getSystemValue('secret', ''));
if ($keyLength !== 1024 && $keyLength !== 2048 && $keyLength !== 4096) {
$keyLength = 1024;
}
return $rsa->createKey($keyLength);
}
} I mount external Sotrrage and if i want use it i get this error: RAW:
How i can fix it ? |
Reopening because backport to 28 is pending |
I had the same problem and it was caused by wrong permission set by the NC container on External Storage. |
This would also explain why the correct code is present. I'll test it later. Thanks for the tip! |
Same for me. Steps to reproduce:
|
It is fixed in 28.0.2 |
Starting update, thank you! |
I get the exact same three error messages as mentioned above.
Not sure if it is related. Thought I might as well ask before opening a separate issue if necessary. my php-local.ini
|
Yes, I have the same error as OP, but that seems to be fixed now with 28.0.2. Will check it out when released. |
@lukaszzyla v28.0.2 isn't out yet. It'll should be out next week. RC was pushed out today. |
Hello, I'm using Nextcloud AIO and updated minutes ago. Now I'm running v7.13. I still get the exact 3 error messages as mentioned above. However, Let's Encrypt is about to expire. It's not updating.
What's wrong with my setup? |
Bug description
Seeing the below errors under NC 28 RC4 looks similar to #41766
Could not find resource files_external/js/public_key.js to load
Could not find resource files_external/js/oauth2.js to load
Could not find resource files_external/js/oauth1.js to load
Steps to reproduce
Not sure
Expected behavior
No error
Installation method
Community Manual installation with Archive
Nextcloud Server version
28
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.2
Web server
Apache (supported)
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
Upgraded to a MAJOR version (ex. 22 to 23)
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
No response
List of activated Apps
No response
Nextcloud Signing status
No response
Nextcloud Logs
Additional info
No response
The text was updated successfully, but these errors were encountered: