Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 7 additions & 16 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MINIO_MC = "minio/mc:RELEASE.2020-12-18T10-53-53Z"
OC_CI_ALPINE = "owncloudci/alpine:latest"
OC_CI_BAZEL_BUILDIFIER = "owncloudci/bazel-buildifier"
OC_CI_CEPH = "owncloudci/ceph:tag-build-master-jewel-ubuntu-16.04"
OC_CI_CORE = "owncloudci/core"
OC_CI_CORE = "owncloudci/core:php83"
OC_CI_DRONE_SKIP_PIPELINE = "owncloudci/drone-skip-pipeline"
OC_CI_NODEJS = "owncloudci/nodejs:%s"
OC_CI_ORACLE_XE = "owncloudci/oracle-xe:latest"
Expand All @@ -25,7 +25,7 @@ SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli"
DEEPDIVER_ICAP_CLAMAV_SERVICE = "deepdiver/icap-clamav-service"
OC_CI_CLAMAVD = "owncloudci/clamavd"

DEFAULT_PHP_VERSION = "7.4"
DEFAULT_PHP_VERSION = "8.3"
DEFAULT_NODEJS_VERSION = "14"

# minio mc environment variables
Expand Down Expand Up @@ -58,15 +58,8 @@ config = {
"master",
],
"appInstallCommandPhp": "make",
"codestyle": True,
"phan": {
"multipleVersions": {
"phpVersions": [
DEFAULT_PHP_VERSION,
"7.3",
],
},
},
"codestyle": False,
"phan": False,
"phpunit": {
"allDatabases": {
"phpVersions": [
Expand Down Expand Up @@ -167,7 +160,6 @@ config = {
},
"servers": [
"daily-master-qa",
"latest",
],
"databases": [
"mariadb:10.2",
Expand Down Expand Up @@ -199,7 +191,6 @@ config = {
},
"servers": [
"daily-master-qa",
"latest",
],
"databases": [
"mariadb:10.2",
Expand Down Expand Up @@ -892,7 +883,7 @@ def phpTests(ctx, testType, withCoverage):
"mysql:8.0",
"postgres:9.4",
],
"coverage": True,
"coverage": False,
"includeKeyInMatrixName": False,
"logLevel": "2",
"cephS3": False,
Expand All @@ -918,7 +909,7 @@ def phpTests(ctx, testType, withCoverage):
"postgres:9.4",
"oracle",
],
"coverage": True,
"coverage": False,
"includeKeyInMatrixName": False,
"logLevel": "2",
"cephS3": False,
Expand Down Expand Up @@ -1119,7 +1110,7 @@ def acceptance(ctx):
errorFound = False

default = {
"servers": ["daily-master-qa", "latest"],
"servers": ["daily-master-qa"],
"browsers": ["chrome"],
"phpVersions": [DEFAULT_PHP_VERSION],
"databases": ["mariadb:10.2"],
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
push:
branches:
- master
pull_request:
types:
- opened
- synchronize
- reopened

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

env:
APP_NAME: files_antivirus
PHP_VERSIONS: '["8.3"]'

jobs:
get-vars:
runs-on: ubuntu-latest
outputs:
app-name: ${{ env.APP_NAME }}
php-versions: ${{ env.PHP_VERSIONS }}
steps:
- name: Set variables
run: |
echo "App name $APP_NAME"
echo "PHP versions string: $PHP_VERSIONS"

semantic-git-messages:
name: Commits
uses: owncloud/reusable-workflows/.github/workflows/semantic-git-message.yml@main

php-code-style:
name: PHP Code Style
needs:
- get-vars
uses: owncloud/reusable-workflows/.github/workflows/php-codestyle.yml@main
with:
app-name: ${{ needs.get-vars.outputs.app-name }}
php-versions: ${{ needs.get-vars.outputs.php-versions }}
12 changes: 6 additions & 6 deletions appinfo/Migrations/Version20170808221437.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
namespace OCA\Files_Antivirus\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\BigIntType;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use OCP\Migration\ISchemaMigration;

/**
Expand All @@ -26,7 +28,7 @@ class Version20170808221437 implements ISchemaMigration {
* @param array $options
*
* @return void
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
* @throws \Doctrine\DBAL\Schema\SchemaException
*/
public function changeSchema(Schema $schema, array $options) {
Expand All @@ -36,12 +38,10 @@ public function changeSchema(Schema $schema, array $options) {
$table = $schema->getTable("{$prefix}files_antivirus");

$fileIdColumn = $table->getColumn('fileid');
if ($fileIdColumn
/** @phan-suppress-next-line PhanDeprecatedClassConstant */
&& $fileIdColumn->getType()->getName() !== Type::BIGINT
if ($fileIdColumn // @phpstan-ignore-line
&& $fileIdColumn->getType() instanceof BigIntType
) {
/** @phan-suppress-next-line PhanDeprecatedClassConstant */
$fileIdColumn->setType(Type::getType(Type::BIGINT));
$fileIdColumn->setType(Type::getType(Types::BIGINT));
$fileIdColumn->setOptions(['length' => 20]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion appinfo/Migrations/Version20180116141548.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Version20180116141548 implements ISqlMigration {
* @param IDBConnection $connection
* @return void
*/
public function sql(IDBConnection $connection) {
public function sql(IDBConnection $connection) { // @phpstan-ignore-line
$sql = $connection->getDatabasePlatform()->getTruncateTableSQL(
"`*PREFIX*files_antivirus`"
);
Expand Down
4 changes: 2 additions & 2 deletions appinfo/Migrations/Version20180116142011.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace OCA\Files_Antivirus\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use OCP\Migration\ISchemaMigration;

/**
Expand All @@ -32,7 +32,7 @@ public function changeSchema(Schema $schema, array $options) {
$table->addColumn(
'etag',
/** @phan-suppress-next-line PhanDeprecatedClassConstant */
Type::STRING,
Types::STRING,
[
'default' => null,
'length' => 40,
Expand Down
4 changes: 2 additions & 2 deletions appinfo/Migrations/Version20210212160142.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Version20210212160142 implements ISchemaMigration {
* @param array $options
*
* @return void
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Exception
* @throws \Doctrine\DBAL\Schema\SchemaException
*/
public function changeSchema(Schema $schema, array $options) {
Expand All @@ -40,7 +40,7 @@ public function changeSchema(Schema $schema, array $options) {
$alterQuery = $dbConn->prepare(
'ALTER TABLE `*PREFIX*files_antivirus_status` RENAME TO `*PREFIX*files_avir_status`'
);
$alterQuery->execute();
$alterQuery->executeStatement();
}
}
}
18 changes: 6 additions & 12 deletions appinfo/Migrations/Version20210413110050.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,23 @@
* Cleans table before adding etag field
*/
class Version20210413110050 implements ISqlMigration {
/**
* @param IDBConnection $connection
* @return void
*/
public function sql(IDBConnection $conn) {
$conf = \OC::$server->getConfig();
$query = 'SELECT `configkey`, `configvalue` FROM `*PREFIX*appconfig` WHERE `appid` = \'files_antivirus\' AND (`configkey` = \'av_path\' OR `configkey` = \'av_cmd_options\')';
$result = $conn->executeQuery($query);
/** @phan-suppress-next-line PhanDeprecatedFunction */
while ($row = $result->fetch()) {
while ($row = $result->fetchAssociative()) {
try {
$conf->setSystemValue('files_antivirus.' . $row['configkey'], $row['configvalue']);
} catch (\Exception $e) {
echo 'Migration failed: ', $e->getMessage(), '\n';
return;
return [];
}
}
/** @phan-suppress-next-line PhanDeprecatedFunction */
$result->closeCursor();
$result->free();

$query = 'DELETE FROM `*PREFIX*appconfig` WHERE `appid` = \'files_antivirus\' AND (`configkey` = \'av_path\' OR `configkey` = \'av_cmd_options\')';
$result = $conn->executeQuery($query);
/** @phan-suppress-next-line PhanDeprecatedFunction */
$result->closeCursor();
$conn->executeStatement($query);

return [];
}
}
5 changes: 3 additions & 2 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Please note that enabling this application can impact system performance as addi
<category>security</category>
<licence>AGPL</licence>
<author>Manuel Delgado, Bart Visscher, thinksilicon.de, Viktar Dubiniuk</author>
<version>1.2.3</version>
<version>1.3.0</version>
<documentation>
<admin>https://doc.owncloud.com/server/latest/admin_manual/configuration/server/antivirus_configuration.html</admin>
</documentation>
Expand All @@ -34,7 +34,8 @@ Please note that enabling this application can impact system performance as addi
<use-migrations>true</use-migrations>
<namespace>Files_Antivirus</namespace>
<dependencies>
<owncloud min-version="10.6" max-version="10" />
<owncloud min-version="11" max-version="11" />
<php min-version="8.3" />
</dependencies>
<settings>
<admin>OCA\Files_Antivirus\AdminPanel</admin>
Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
"description": "files_antivirus is an antivirus app for ownCloud based on ClamAV",
"config": {
"platform": {
"php": "7.3"
"php": "8.3"
},
"allow-plugins": {
"bamarni/composer-bin-plugin": true
}
},
"require": {
"php": ">=8.3"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8"
"bamarni/composer-bin-plugin": "^1.8",
"roave/security-advisories": "dev-latest"
},
"extra": {
"bamarni-bin": {
Expand Down
Loading