Skip to content

Commit 89d5307

Browse files
committed
feat: implement reuse action
Signed-off-by: David Lima <[email protected]>
1 parent 14be4e1 commit 89d5307

File tree

12 files changed

+141
-93
lines changed

12 files changed

+141
-93
lines changed

.github/workflows/reuse.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
6+
# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. <https://fsfe.org>
7+
#
8+
# SPDX-License-Identifier: CC0-1.0
9+
10+
name: REUSE Compliance Check
11+
12+
on: [pull_request]
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
reuse-compliance-check:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23+
with:
24+
persist-credentials: false
25+
26+
- name: REUSE Compliance Check
27+
uses: fsfe/reuse-action@bb774aa972c2a89ff34781233d275075cbddf542 # v5.0.0

CHANGELOG.md

Lines changed: 44 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,99 @@
1+
<!--
2+
- SPDX-FileCopyrightText: 2025 LibreCode coop and contributors
3+
- SPDX-License-Identifier: AGPL-3.0-or-later
4+
-->
15

26
## 1.3.6
37

4-
- NC27 support
8+
- NC27 support
9+
510
## 1.3.5
611

7-
- Fix issue on external storage
12+
- Fix issue on external storage
13+
814
## 1.3.4
915

10-
- NC24 support
16+
- NC24 support
17+
1118
## 1.3.3
1219

13-
- NC23 support
20+
- NC23 support
21+
1422
## 1.3.2
1523

16-
- NC22 support
24+
- NC22 support
25+
1726
## 1.3.1
1827

19-
- NC21 support
28+
- NC21 support
2029

2130
## 1.3.0
2231

23-
- Better handling of files
24-
- Improved performances
25-
- Support group folders
26-
- Support all external storage methods
32+
- Better handling of files
33+
- Improved performances
34+
- Support group folders
35+
- Support all external storage methods
2736

2837
## 1.2.5
2938

30-
- Update to NC 20
39+
- Update to NC 20
3140

3241
## 1.2.4
3342

34-
- Update to NC 19
35-
- Add debug infos
36-
- Remove accidently shipped phpunit
43+
- Update to NC 19
44+
- Add debug infos
45+
- Remove accidently shipped phpunit
3746

3847
## 1.2.3
3948

40-
- Update to NC 18
41-
- Fix security issues
49+
- Update to NC 18
50+
- Fix security issues
4251

4352
## 1.2.2
4453

45-
- Update to NC 17
46-
- Fix languages
47-
- Fix shared folders
48-
- Fix rar folder scan
54+
- Update to NC 17
55+
- Fix languages
56+
- Fix shared folders
57+
- Fix rar folder scan
4958

5059
## 1.2.1
5160

52-
- Add languages
61+
- Add languages
5362

5463
## 1.2.0
5564

56-
- Tar, Gzip, 7z, Deb and Bzip2 support
57-
- Add error messages
58-
- Fix security issue
59-
- Fix shared files issue
60-
- Others minor fixes
65+
- Tar, Gzip, 7z, Deb and Bzip2 support
66+
- Add error messages
67+
- Fix security issue
68+
- Fix shared files issue
69+
- Others minor fixes
6170

6271
## 1.1.1
6372

64-
- Improved external storage reliability
73+
- Improved external storage reliability
6574

6675
## 1.0.0
6776

68-
- Rar support
69-
- Loading icon
70-
- Fix icon issue
77+
- Rar support
78+
- Loading icon
79+
- Fix icon issue
7180

7281
## 1.1.0
7382

74-
- Bug fixes
83+
- Bug fixes
7584

7685
## 0.0.4
7786

78-
- Bug fixes on firefox
87+
- Bug fixes on firefox
7988

8089
## 0.0.3
8190

82-
- Bug fixes
91+
- Bug fixes
8392

8493
## 0.0.2
8594

86-
- Bug fixes
95+
- Bug fixes
8796

8897
## 0.0.1
8998

90-
- Zip support
99+
- Zip support

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
# This file is licensed under the Affero General Public License version 3 or
2-
# later. See the COPYING file.
3-
# @author Bernhard Posselt <[email protected]>
4-
# @copyright Bernhard Posselt 2016
1+
# SPDX-FileCopyrightText: 2016 Bernhard Posselt <[email protected]>
2+
# SPDX-License-Identifier: AGPL-3.0-or-later
53

64
# Generic Makefile for building and packaging a Nextcloud app which uses npm and
75
# Composer.

README.md

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,33 @@
1+
<!--
2+
- SPDX-FileCopyrightText: 2025 LibreCode coop and contributors
3+
- SPDX-License-Identifier: AGPL-3.0-or-later
4+
-->
5+
16
# Extract
7+
28
Place this app in **nextcloud/apps/**
39

410
This app does only support local external storage backend
511

612
## Supported
713

8-
* Zip
9-
* Rar
10-
* Tar
11-
* Gzip
12-
* 7z
13-
* Deb
14-
* Bzip2
14+
- Zip
15+
- Rar
16+
- Tar
17+
- Gzip
18+
- 7z
19+
- Deb
20+
- Bzip2
1521

1622
## Requirements
1723

18-
* Rar PHP extension
24+
- Rar PHP extension
25+
1926
```bash
2027
pecl -v install rar ## or ## sudo apt-get install unrar
2128
```
2229

23-
* p7zip and p7zip-full
30+
- p7zip and p7zip-full
2431

2532
## Steps to install p7zip on Linux &raquo; Ubuntu and Fedora or CentOS / RHEL
2633

@@ -37,7 +44,8 @@ sudo apt-get install p7zip p7zip-full
3744
```
3845

3946
#### CentOS 7.x or Fedora
40-
#### Download and install manually
47+
48+
#### Download and install manually
4149

4250
```bash
4351
wget https://www.mirrorservice.org/sites/dl.fedoraproject.org/pub/epel/7/x86_64/Packages/p/p7zip-16.02-10.el7.x86_64.rpm
@@ -48,7 +56,9 @@ sudo rpm -U --quiet p7zip-plugins-16.02-10.el7.x86_64.rpm
4856
```
4957

5058
#### CentOS 6.7
59+
5160
#### From EPEL
61+
5262
Download and install using Package manager
5363

5464
```bash
@@ -60,7 +70,8 @@ sudo yum repolist
6070
sudo yum install -y -q p7zip p7zip-plugins
6171
```
6272

63-
#### Download and install manually
73+
#### Download and install manually
74+
6475
In case of connectivity [or any other] issues, please follow these steps to download and install the following packages directly.
6576

6677
```bash
@@ -73,9 +84,9 @@ sudo rpm -U --quiet p7zip-plugins-16.02-10.el6.x86_64.rpm
7384

7485
## TODO
7586

76-
* Add password support
77-
* Add viewer for archives
78-
* Support nextcloud's encryption module
87+
- Add password support
88+
- Add viewer for archives
89+
- Support nextcloud's encryption module
7990

8091
## Preview
8192

css/style.css

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
.icon-extract{
2-
background-image: url('../img/extracticon.svg');
3-
}
1+
/* SPDX-FileCopyrightText: 2025 LibreCode coop and contributors */
2+
/* SPDX-License-Identifier: AGPL-3.0-or-later */
3+
4+
.icon-extract {
5+
background-image: url("../img/extracticon.svg");
6+
}
7+

lib/AppInfo/Application.php

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,8 @@
11
<?php
22

33
/**
4-
* @author Claus-Justus Heine
5-
* @copyright 2022 Claus-Justus Heine <[email protected]>
6-
* @license AGPL-3.0-or-later
7-
*
8-
* This program is free software: you can redistribute it and/or modify
9-
* it under the terms of the GNU Affero General Public License as
10-
* published by the Free Software Foundation, either version 3 of the
11-
* License, or (at your option) any later version.
12-
*
13-
* This program is distributed in the hope that it will be useful,
14-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16-
* GNU Affero General Public License for more details.
17-
*
18-
* You should have received a copy of the GNU Affero General Public License
19-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
4+
* SPDX-FileCopyrightText: 2022 Claus-Justus Heine <[email protected]>
5+
* SPDX-License-Identifier: AGPL-3.0-or-later
206
*/
217

228
namespace OCA\Extract\AppInfo;

lib/Controller/ExtractionController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
namespace OCA\Extract\Controller;
44

5+
/*
6+
* SPDX-FileCopyrightText: 2025 LibreCode coop and contributors
7+
* SPDX-License-Identifier: AGPL-3.0-or-later
8+
*/
9+
510
// Only in order to access Filesystem::isFileBlacklisted().
611
use OC\Files\Filesystem;
712
use OCA\Extract\ResponseDefinitions;

lib/Service/ExtractionService.php

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,8 @@
11
<?php
22

33
/**
4-
* @author Paul Lereverend
5-
* @copyright 2012-2022 Paul Lereverend <[email protected]>
6-
* @author Claus-Justus Heine
7-
* @copyright 2022 Claus-Justus Heine <[email protected]>
8-
* @license AGPL-3.0-or-later
9-
*
10-
* This program is free software: you can redistribute it and/or modify
11-
* it under the terms of the GNU Affero General Public License as
12-
* published by the Free Software Foundation, either version 3 of the
13-
* License, or (at your option) any later version.
14-
*
15-
* This program is distributed in the hope that it will be useful,
16-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18-
* GNU Affero General Public License for more details.
19-
*
20-
* You should have received a copy of the GNU Affero General Public License
21-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
4+
* SPDX-FileCopyrightText: 2022 Claus-Justus Heine <[email protected]>
5+
* SPDX-License-Identifier: AGPL-3.0-or-later
226
*/
237

248
namespace OCA\Extract\Service;

src/actions/extract-action.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* SPDX-FileCopyrightText: 2025 LibreCode coop and contributors
3+
* SPDX-License-Identifier: AGPL-3.0-or-later
4+
*/
5+
16
import type { Node, View } from '@nextcloud/files'
27

38
import ArchiveArrowUpSvg from '@mdi/svg/svg/archive-arrow-up.svg?raw'
@@ -40,12 +45,15 @@ export const extractAction = new FileAction({
4045
const data = {
4146
nameOfFile: node.attributes?.basename ?? '',
4247
directory: dir,
43-
external: node.attributes?.['mount-type']?.startsWith('external') ? 1 : 0,
48+
external: node.attributes?.['mount-type']?.startsWith('external')
49+
? 1
50+
: 0,
4451
mime: node.attributes?.mime,
4552
}
4653

4754
const url = generateOcsUrl('/apps/extract/api/v1/extraction/execute')
48-
axios.post(url, data)
55+
axios
56+
.post(url, data)
4957
.then(({ data }) => {
5058
const time = data.ocs.data.extracted.mtime * 1000
5159
const folder = new Folder({
@@ -58,7 +66,8 @@ export const extractAction = new FileAction({
5866
attributes: {
5967
'mount-type': data.ocs.data.extracted['mount-type'],
6068
'owner-id': data.ocs.data.extracted.owner,
61-
'owner-display-name': data.ocs.data.extracted['owner-display-name'],
69+
'owner-display-name':
70+
data.ocs.data.extracted['owner-display-name'],
6271
},
6372
})
6473

src/main.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* SPDX-FileCopyrightText: 2025 LibreCode coop and contributors
3+
* SPDX-License-Identifier: AGPL-3.0-or-later
4+
*/
5+
16
import { registerFileAction } from '@nextcloud/files'
27
import { extractAction } from './actions/extract-action.ts'
38

0 commit comments

Comments
 (0)