From a7b43d5b57e6fee3c160b92a6d0543c49d1b0d10 Mon Sep 17 00:00:00 2001 From: magicbelette Date: Tue, 2 Feb 2021 17:06:06 +0100 Subject: [PATCH] Add createtoken API --- models/users.js | 32 +++++++++++++ photorec.ses | Bin 0 -> 40960 bytes public/api/wekan.yml | 40 ++++++++++++++++ testdisk.log | 107 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 179 insertions(+) create mode 100644 photorec.ses create mode 100644 testdisk.log diff --git a/models/users.js b/models/users.js index 9bf588e5b..aebf41c25 100644 --- a/models/users.js +++ b/models/users.js @@ -1760,6 +1760,38 @@ if (Meteor.isServer) { }); } }); + + /** + * @operation create_user_token + * + * @summary Create a user token + * + * @description Only the admin user (the first user) can call the REST API. + * + * @param {string} userId the ID of the user to delete + * @return_type {_id: string} + */ + JsonRoutes.add('POST', '/api/createtoken/:userId', function(req, res) { + try { + Authentication.checkUserId(req.userId); + const id = req.params.userId; + const token = Accounts._generateStampedLoginToken(); + Accounts._insertLoginToken(id, token); + + JsonRoutes.sendResult(res, { + code: 200, + data: { + _id: id, + authToken: token.token, + }, + }); + } catch (error) { + JsonRoutes.sendResult(res, { + code: 200, + data: error, + }); + } + }); } export default Users; diff --git a/photorec.ses b/photorec.ses new file mode 100644 index 0000000000000000000000000000000000000000..ca5ea44f24f65b3d8acaaf654c430de8c51b16e2 GIT binary patch literal 40960 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM z7%*VKfB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM7%*VKfB^#r3>YwAz<>b* z1`HT5V8DO@0|pEjFkrxd0RsjM7%*VKfB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd t0RsjM7%*VKfB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0Rsm92L_-300961 literal 0 HcmV?d00001 diff --git a/public/api/wekan.yml b/public/api/wekan.yml index d5fea73c8..63be097b8 100644 --- a/public/api/wekan.yml +++ b/public/api/wekan.yml @@ -245,6 +245,46 @@ paths: type: string defaultSwimlaneId: type: string + /api/createtoken/{user}: + post: + operationId: createtoken + summary: CreateToken for a user with REST API + description: | + Only the admin user (the first user) can call the REST API. + consumes: + - application/x-www-form-urlencoded + - application/json + tags: + - Login + parameters: + - name: user + in: path + description: | + the user ID + type: string + required: true + responses: + 200: + description: |- + Successful + schema: + items: + properties: + id: + type: string + token: + type: string + 400: + description: | + Error + schema: + items: + properties: + error: + type: number + reason: + type: string + /api/boards/{board}: get: operationId: get_board diff --git a/testdisk.log b/testdisk.log new file mode 100644 index 000000000..883624613 --- /dev/null +++ b/testdisk.log @@ -0,0 +1,107 @@ + + +Tue Feb 2 15:32:43 2021 +Command line: TestDisk + +TestDisk 7.0, Data Recovery Utility, April 2015 +Christophe GRENIER +http://www.cgsecurity.org +OS: Linux, kernel 4.19.0-13-amd64 (#1 SMP Debian 4.19.160-2 (2020-11-28)) x86_64 +Compiler: GCC 8.2 +ext2fs lib: 1.44.5, ntfs lib: libntfs-3g, reiserfs lib: none, ewf lib: none, curses lib: ncurses 6.1 +/dev/sda: LBA, LBA48 support +/dev/sda: size 40960000 sectors +/dev/sda: user_max 40960000 sectors +/dev/sdb: LBA, LBA48 support +/dev/sdb: size 16777216 sectors +/dev/sdb: user_max 16777216 sectors +Warning: can't get size for Disk /dev/mapper/control - 0 B - 0 sectors, sector size=512 +/dev/sr0 is not an ATA disk +Hard disk list +Disk /dev/sda - 20 GB / 19 GiB - CHS 2549 255 63, sector size=512 - VBOX HARDDISK, S/N:VB0b6f207b-9457cb67, FW:1.0 +Disk /dev/sdb - 8589 MB / 8192 MiB - CHS 1044 255 63, sector size=512 - VBOX HARDDISK, S/N:VB58465fac-dc7acfae, FW:1.0 +Disk /dev/sr0 - 60 MB / 57 MiB - 29603 sectors (RO), sector size=2048 - VBOX CD-ROM, S/N:VB2-1a2b3c4d, FW:1.0 + +Partition table type (auto): Intel +Disk /dev/sda - 20 GB / 19 GiB - VBOX HARDDISK +Partition table type: Intel + +Analyse Disk /dev/sda - 20 GB / 19 GiB - CHS 2549 255 63 +Geometry from i386 MBR: head=255 sector=63 +Current partition structure: + 1 * Linux 0 32 33 2442 142 4 39237632 + 2 P Linux Swap 2442 142 5 2549 163 46 1720320 + +search_part() +Disk /dev/sda - 20 GB / 19 GiB - CHS 2549 255 63 + +recover_EXT2: s_block_group_nr=0/149, s_mnt_count=324/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192 +recover_EXT2: s_blocksize=4096 +recover_EXT2: s_blocks_count 4904704 +recover_EXT2: part_size 39237632 + Linux 0 32 33 2442 142 4 39237632 + ext4 blocksize=4096 Large_file Sparse_SB Recover, 20 GB / 18 GiB + Linux Swap 2442 142 5 2549 163 30 1720304 + SWAP2 version 1, pagesize=4096, 880 MB / 839 MiB + +Results + * Linux 0 32 33 2442 142 4 39237632 + ext4 blocksize=4096 Large_file Sparse_SB Recover, 20 GB / 18 GiB + P Linux Swap 2442 142 5 2549 163 46 1720320 + SWAP2 version 1, pagesize=4096, 880 MB / 840 MiB + +Hint for advanced users. dmsetup may be used if you prefer to avoid to rewrite the partition table for the moment: +echo "0 39237632 linear /dev/sda 2048" | dmsetup create test0 +echo "0 1720320 linear /dev/sda 39239680" | dmsetup create test1 + +interface_write() + 1 * Linux 0 32 33 2442 142 4 39237632 + 2 P Linux Swap 2442 142 5 2549 163 46 1720320 + +search_part() +Disk /dev/sda - 20 GB / 19 GiB - CHS 2549 255 63 + +recover_EXT2: s_block_group_nr=0/149, s_mnt_count=324/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192 +recover_EXT2: s_blocksize=4096 +recover_EXT2: s_blocks_count 4904704 +recover_EXT2: part_size 39237632 + Linux 0 32 33 2442 142 4 39237632 + ext4 blocksize=4096 Large_file Sparse_SB Recover, 20 GB / 18 GiB + +recover_EXT2: s_block_group_nr=0/149, s_mnt_count=324/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192 +recover_EXT2: s_blocksize=4096 +recover_EXT2: s_blocks_count 4904704 +recover_EXT2: part_size 39237632 + Linux 282 127 38 2724 237 9 39237632 + ext4 blocksize=4096 Large_file Sparse_SB Recover, 20 GB / 18 GiB +This partition ends after the disk limits. (start=4538368, size=39237632, end=43775999, disk end=40960000) + +recover_EXT2: s_block_group_nr=0/149, s_mnt_count=324/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192 +recover_EXT2: s_blocksize=4096 +recover_EXT2: s_blocks_count 4904704 +recover_EXT2: part_size 39237632 + Linux 282 225 8 2725 79 42 39237632 + ext4 blocksize=4096 Large_file Sparse_SB Recover, 20 GB / 18 GiB +This partition ends after the disk limits. (start=4544512, size=39237632, end=43782143, disk end=40960000) + Linux Swap 2442 142 5 2549 163 30 1720304 + SWAP2 version 1, pagesize=4096, 880 MB / 839 MiB +Search for partition aborted +Disk /dev/sda - 20 GB / 19 GiB - CHS 2549 255 63 +Check the harddisk size: HD jumpers settings, BIOS detection... +The harddisk (20 GB / 19 GiB) seems too small! (< 22 GB / 20 GiB) +The following partitions can't be recovered: + Linux 282 127 38 2724 237 9 39237632 + ext4 blocksize=4096 Large_file Sparse_SB Recover, 20 GB / 18 GiB + Linux 282 225 8 2725 79 42 39237632 + ext4 blocksize=4096 Large_file Sparse_SB Recover, 20 GB / 18 GiB + +Results + * Linux 0 32 33 2442 142 4 39237632 + ext4 blocksize=4096 Large_file Sparse_SB Recover, 20 GB / 18 GiB + P Linux Swap 2442 142 5 2549 163 46 1720320 + SWAP2 version 1, pagesize=4096, 880 MB / 840 MiB + +Hint for advanced users. dmsetup may be used if you prefer to avoid to rewrite the partition table for the moment: +echo "0 39237632 linear /dev/sda 2048" | dmsetup create test0 +echo "0 1720320 linear /dev/sda 39239680" | dmsetup create test1 +SIGINT detected! TestDisk has been killed.