mirror of
https://github.com/bpatrik/pigallery2.git
synced 2024-12-25 02:04:15 +02:00
package update
This commit is contained in:
parent
2036db563d
commit
f68fdafb0e
@ -9,7 +9,6 @@
|
||||
"outDir": "dist",
|
||||
"assets": [
|
||||
"assets",
|
||||
"favicon.ico",
|
||||
"config_inject.ejs"
|
||||
],
|
||||
"index": "index.html",
|
||||
|
5
COMPARE.md
Normal file
5
COMPARE.md
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
| |PiGallery |PiGallery2 |
|
||||
|-----------------|------------|-------------|
|
||||
|Idle memory usage| 8-10Mb | 6-8MB |
|
||||
|Load memory usage| 60-100Mb | 6-8MB |
|
@ -59,12 +59,19 @@ npm start
|
||||
To configure it. Run `PiGallery2` first to create `config.json` file, then edit it and restart.
|
||||
Default user: `admin` pass: `admin`
|
||||
|
||||
|
||||
### Using nginx
|
||||
https://stackoverflow.com/questions/5009324/node-js-nginx-what-now
|
||||
|
||||
### making https
|
||||
https://certbot.eff.org/
|
||||
|
||||
### node install error:
|
||||
If you get error during module installation, make sure you have everything to build node modules from source
|
||||
```bash
|
||||
apt-get install build-essential libkrb5-dev gcc g++
|
||||
```
|
||||
|
||||
|
||||
## Feature list
|
||||
|
||||
* **Rendering directories as it is**
|
||||
|
@ -5,7 +5,7 @@ import * as fs from "fs";
|
||||
import {DirectoryEntity} from "./enitites/DirectoryEntity";
|
||||
import {SQLConnection} from "./SQLConnection";
|
||||
import {DiskManager} from "../DiskManger";
|
||||
import {PhotoEntity, PhotoMetadataEntity} from "./enitites/PhotoEntity";
|
||||
import {PhotoEntity} from "./enitites/PhotoEntity";
|
||||
import {Utils} from "../../../common/Utils";
|
||||
import {ProjectPath} from "../../ProjectPath";
|
||||
import {Config} from "../../../common/config/private/Config";
|
||||
@ -37,7 +37,7 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager {
|
||||
|
||||
|
||||
if (dir && dir.scanned == true) {
|
||||
//iF it seems that the content did not changed, do not work on it
|
||||
//If it seems that the content did not changed, do not work on it
|
||||
if (knownLastModified && knownLastScanned
|
||||
&& lastModified == knownLastModified &&
|
||||
dir.lastScanned == knownLastScanned) {
|
||||
@ -53,7 +53,7 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager {
|
||||
if (dir.photos) {
|
||||
for (let i = 0; i < dir.photos.length; i++) {
|
||||
dir.photos[i].directory = dir;
|
||||
PhotoMetadataEntity.open(dir.photos[i].metadata);
|
||||
//PhotoMetadataEntity.open(dir.photos[i].metadata);
|
||||
dir.photos[i].readyThumbnails = [];
|
||||
dir.photos[i].readyIcon = false;
|
||||
}
|
||||
@ -67,13 +67,13 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager {
|
||||
dir: dir.directories[i].id
|
||||
})
|
||||
.orderBy("photo.metadata.creationDate", "ASC")
|
||||
.setLimit(Config.Server.indexing.folderPreviewSize)
|
||||
.limit(Config.Server.indexing.folderPreviewSize)
|
||||
.getMany();
|
||||
dir.directories[i].isPartial = true;
|
||||
|
||||
for (let j = 0; j < dir.directories[i].photos.length; j++) {
|
||||
dir.directories[i].photos[j].directory = dir.directories[i];
|
||||
PhotoMetadataEntity.open(dir.directories[i].photos[j].metadata);
|
||||
// PhotoMetadataEntity.open(dir.directories[i].photos[j].metadata);
|
||||
dir.directories[i].photos[j].readyThumbnails = [];
|
||||
dir.directories[i].photos[j].readyIcon = false;
|
||||
}
|
||||
@ -123,14 +123,14 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager {
|
||||
path: scannedDirectory.path
|
||||
}).getOne();
|
||||
|
||||
if (!!parentDir) {
|
||||
if (!!parentDir) {//Updated parent dir (if it was in the DB previously)
|
||||
parentDir.scanned = true;
|
||||
parentDir.lastModified = scannedDirectory.lastModified;
|
||||
parentDir.lastScanned = scannedDirectory.lastScanned;
|
||||
parentDir = await directoryRepository.persist(parentDir);
|
||||
parentDir = await directoryRepository.save(parentDir);
|
||||
} else {
|
||||
(<DirectoryEntity>scannedDirectory).scanned = true;
|
||||
parentDir = await directoryRepository.persist(<DirectoryEntity>scannedDirectory);
|
||||
parentDir = await directoryRepository.save(<DirectoryEntity>scannedDirectory);
|
||||
}
|
||||
|
||||
let indexedDirectories = await directoryRepository.createQueryBuilder("directory")
|
||||
@ -140,6 +140,7 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager {
|
||||
|
||||
for (let i = 0; i < scannedDirectory.directories.length; i++) {
|
||||
|
||||
//Was this child Dir already indexed before?
|
||||
let directory: DirectoryEntity = null;
|
||||
for (let j = 0; j < indexedDirectories.length; j++) {
|
||||
if (indexedDirectories[j].name == scannedDirectory.directories[i].name) {
|
||||
@ -149,25 +150,26 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager {
|
||||
}
|
||||
}
|
||||
|
||||
if (directory) { //update existing directory
|
||||
if (directory != null) { //update existing directory
|
||||
if (!directory.parent && !directory.parent.id) {
|
||||
directory.parent = parentDir;
|
||||
delete directory.photos;
|
||||
await directoryRepository.persist(directory);
|
||||
await directoryRepository.save(directory);
|
||||
}
|
||||
} else {
|
||||
scannedDirectory.directories[i].parent = parentDir;
|
||||
(<DirectoryEntity>scannedDirectory.directories[i]).scanned = false;
|
||||
const d = await directoryRepository.persist(<DirectoryEntity>scannedDirectory.directories[i]);
|
||||
const d = await directoryRepository.save(<DirectoryEntity>scannedDirectory.directories[i]);
|
||||
for (let j = 0; j < scannedDirectory.directories[i].photos.length; j++) {
|
||||
PhotoMetadataEntity.close(scannedDirectory.directories[i].photos[j].metadata);
|
||||
// PhotoMetadataEntity.close(scannedDirectory.directories[i].photos[j].metadata);
|
||||
scannedDirectory.directories[i].photos[j].directory = d;
|
||||
|
||||
}
|
||||
await photosRepository.persist(scannedDirectory.directories[i].photos);
|
||||
|
||||
await photosRepository.save(scannedDirectory.directories[i].photos);
|
||||
}
|
||||
}
|
||||
|
||||
//Remove child Dirs that are not anymore in the parent dir
|
||||
await directoryRepository.remove(indexedDirectories);
|
||||
|
||||
|
||||
@ -195,7 +197,7 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager {
|
||||
}
|
||||
|
||||
//typeorm not supports recursive embended: TODO:fix it
|
||||
PhotoMetadataEntity.close(scannedDirectory.photos[i].metadata);
|
||||
// PhotoMetadataEntity.close(scannedDirectory.photos[i].metadata);
|
||||
|
||||
if (photo.metadata.keywords != scannedDirectory.photos[i].metadata.keywords ||
|
||||
photo.metadata.cameraData != scannedDirectory.photos[i].metadata.cameraData ||
|
||||
@ -209,7 +211,7 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager {
|
||||
photosToSave.push(photo);
|
||||
}
|
||||
}
|
||||
await photosRepository.persist(photosToSave);
|
||||
await photosRepository.save(photosToSave);
|
||||
await photosRepository.remove(indexedPhotos);
|
||||
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import "reflect-metadata";
|
||||
import {Connection, createConnection, DriverOptions, getConnection} from "typeorm";
|
||||
import {Connection, ConnectionOptions, createConnection, getConnection} from "typeorm";
|
||||
import {UserEntity} from "./enitites/UserEntity";
|
||||
import {UserRoles} from "../../../common/entities/UserDTO";
|
||||
import {PhotoEntity, PhotoMetadataEntity} from "./enitites/PhotoEntity";
|
||||
import {PhotoEntity} from "./enitites/PhotoEntity";
|
||||
import {DirectoryEntity} from "./enitites/DirectoryEntity";
|
||||
import {Config} from "../../../common/config/private/Config";
|
||||
import {SharingEntity} from "./enitites/SharingEntity";
|
||||
@ -24,24 +24,20 @@ export class SQLConnection {
|
||||
|
||||
if (this.connection == null) {
|
||||
|
||||
this.connection = await createConnection({
|
||||
name: "main",
|
||||
driver: this.getDriver(Config.Server.database),
|
||||
entities: [
|
||||
UserEntity,
|
||||
DirectoryEntity,
|
||||
PhotoMetadataEntity,
|
||||
PhotoEntity,
|
||||
SharingEntity
|
||||
],
|
||||
autoSchemaSync: true,
|
||||
/* logging: {
|
||||
logQueries: true,
|
||||
logOnlyFailedQueries: true,
|
||||
logFailedQueryError: true,
|
||||
logSchemaCreation: true
|
||||
}*/
|
||||
});
|
||||
let options: any = this.getDriver(Config.Server.database);
|
||||
options.name = "main";
|
||||
options.entities = [
|
||||
UserEntity,
|
||||
DirectoryEntity,
|
||||
PhotoEntity,
|
||||
SharingEntity
|
||||
];
|
||||
options.synchronize = true;
|
||||
|
||||
//options.logging = "all" ;
|
||||
|
||||
|
||||
this.connection = await createConnection(options);
|
||||
}
|
||||
return this.connection;
|
||||
|
||||
@ -52,16 +48,29 @@ export class SQLConnection {
|
||||
await getConnection("test").close();
|
||||
} catch (err) {
|
||||
}
|
||||
const conn = await createConnection({
|
||||
name: "test",
|
||||
driver: this.getDriver(config)
|
||||
});
|
||||
let options: any = this.getDriver(config);
|
||||
options.name = "test";
|
||||
const conn = await createConnection(options);
|
||||
await conn.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
private static getDriver(config: DataBaseConfig): DriverOptions {
|
||||
let driver: DriverOptions = null;
|
||||
public static async init(): Promise<void> {
|
||||
const connection = await this.getConnection();
|
||||
let userRepository = connection.getRepository(UserEntity);
|
||||
let admins = await userRepository.find({role: UserRoles.Admin});
|
||||
if (admins.length == 0) {
|
||||
let a = new UserEntity();
|
||||
a.name = "admin";
|
||||
a.password = PasswordHelper.cryptPassword("admin");
|
||||
a.role = UserRoles.Admin;
|
||||
await userRepository.save(a);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static getDriver(config: DataBaseConfig): ConnectionOptions {
|
||||
let driver: ConnectionOptions = null;
|
||||
if (config.type == DatabaseType.mysql) {
|
||||
driver = {
|
||||
type: "mysql",
|
||||
@ -74,26 +83,12 @@ export class SQLConnection {
|
||||
} else if (config.type == DatabaseType.sqlite) {
|
||||
driver = {
|
||||
type: "sqlite",
|
||||
storage: ProjectPath.getAbsolutePath(config.sqlite.storage)
|
||||
database: ProjectPath.getAbsolutePath(config.sqlite.storage)
|
||||
};
|
||||
}
|
||||
return driver;
|
||||
}
|
||||
|
||||
public static async init(): Promise<void> {
|
||||
const connection = await this.getConnection();
|
||||
let userRepository = connection.getRepository(UserEntity);
|
||||
let admins = await userRepository.find({role: UserRoles.Admin});
|
||||
if (admins.length == 0) {
|
||||
let a = new UserEntity();
|
||||
a.name = "admin";
|
||||
a.password = PasswordHelper.cryptPassword("admin");
|
||||
a.role = UserRoles.Admin;
|
||||
await userRepository.persist(a);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static async close() {
|
||||
try {
|
||||
await getConnection().close();
|
||||
|
@ -21,7 +21,7 @@ export class SearchManager implements ISearchManager {
|
||||
.createQueryBuilder('photo')
|
||||
.select('DISTINCT(photo.metadataKeywords)')
|
||||
.where('photo.metadata.keywords LIKE :text COLLATE utf8_general_ci', {text: "%" + text + "%"})
|
||||
.setLimit(5)
|
||||
.limit(5)
|
||||
.getRawMany())
|
||||
.map(r => <Array<string>>JSON.parse(r.metadataKeywords))
|
||||
.forEach(keywords => {
|
||||
@ -33,7 +33,7 @@ export class SearchManager implements ISearchManager {
|
||||
.createQueryBuilder('photo')
|
||||
.select('DISTINCT(photo.metadataPositionData)')
|
||||
.where('photo.metadata.positionData LIKE :text COLLATE utf8_general_ci', {text: "%" + text + "%"})
|
||||
.setLimit(5)
|
||||
.limit(5)
|
||||
.getRawMany())
|
||||
.map(r => <PositionMetaData>JSON.parse(r.metadataPositionData))
|
||||
.filter(pm => !!pm)
|
||||
@ -47,7 +47,7 @@ export class SearchManager implements ISearchManager {
|
||||
.createQueryBuilder('photo')
|
||||
.select('DISTINCT(photo.name)')
|
||||
.where('photo.name LIKE :text COLLATE utf8_general_ci', {text: "%" + text + "%"})
|
||||
.setLimit(5)
|
||||
.limit(5)
|
||||
.getRawMany())
|
||||
.map(r => r.name), SearchTypes.image));
|
||||
|
||||
@ -55,7 +55,7 @@ export class SearchManager implements ISearchManager {
|
||||
.createQueryBuilder('dir')
|
||||
.select('DISTINCT(dir.name)')
|
||||
.where('dir.name LIKE :text COLLATE utf8_general_ci', {text: "%" + text + "%"})
|
||||
.setLimit(5)
|
||||
.limit(5)
|
||||
.getRawMany())
|
||||
.map(r => r.name), SearchTypes.directory));
|
||||
|
||||
@ -96,7 +96,7 @@ export class SearchManager implements ISearchManager {
|
||||
query.orWhere('photo.metadata.keywords LIKE :text COLLATE utf8_general_ci', {text: "%" + text + "%"});
|
||||
}
|
||||
let photos = await query
|
||||
.setLimit(2001)
|
||||
.limit(2001)
|
||||
.getMany();
|
||||
|
||||
|
||||
@ -117,7 +117,7 @@ export class SearchManager implements ISearchManager {
|
||||
.getRepository(DirectoryEntity)
|
||||
.createQueryBuilder("dir")
|
||||
.where('dir.name LIKE :text COLLATE utf8_general_ci', {text: "%" + text + "%"})
|
||||
.setLimit(201)
|
||||
.limit(201)
|
||||
.getMany();
|
||||
|
||||
if (result.directories.length > 200) {
|
||||
@ -145,7 +145,7 @@ export class SearchManager implements ISearchManager {
|
||||
.orWhere('photo.metadata.positionData LIKE :text COLLATE utf8_general_ci', {text: "%" + text + "%"})
|
||||
.orWhere('photo.name LIKE :text COLLATE utf8_general_ci', {text: "%" + text + "%"})
|
||||
.innerJoinAndSelect("photo.directory", "directory")
|
||||
.setLimit(10)
|
||||
.limit(10)
|
||||
.getMany();
|
||||
|
||||
|
||||
@ -163,7 +163,7 @@ export class SearchManager implements ISearchManager {
|
||||
.getRepository(DirectoryEntity)
|
||||
.createQueryBuilder("dir")
|
||||
.where('dir.name LIKE :text COLLATE utf8_general_ci', {text: "%" + text + "%"})
|
||||
.setLimit(10)
|
||||
.limit(10)
|
||||
.getMany();
|
||||
|
||||
result.directories = directories;
|
||||
|
@ -19,7 +19,7 @@ export class SharingManager implements ISharingManager {
|
||||
if (sharing.password) {
|
||||
sharing.password = PasswordHelper.cryptPassword(sharing.password);
|
||||
}
|
||||
return await connection.getRepository(SharingEntity).persist(sharing);
|
||||
return await connection.getRepository(SharingEntity).save(sharing);
|
||||
|
||||
|
||||
}
|
||||
@ -29,7 +29,7 @@ export class SharingManager implements ISharingManager {
|
||||
|
||||
let sharing = await connection.getRepository(SharingEntity).findOne({
|
||||
id: inSharing.id,
|
||||
creator: inSharing.creator.id,
|
||||
creator: inSharing.creator,
|
||||
path: inSharing.path
|
||||
});
|
||||
|
||||
@ -41,7 +41,7 @@ export class SharingManager implements ISharingManager {
|
||||
sharing.includeSubfolders = inSharing.includeSubfolders;
|
||||
sharing.expires = inSharing.expires;
|
||||
|
||||
return await connection.getRepository(SharingEntity).persist(sharing);
|
||||
return await connection.getRepository(SharingEntity).save(sharing);
|
||||
}
|
||||
|
||||
private async removeExpiredLink() {
|
||||
|
@ -44,7 +44,7 @@ export class UserManager implements IUserManager {
|
||||
user.permissions = <any>JSON.stringify(<any>user.permissions);
|
||||
}
|
||||
user.password = PasswordHelper.cryptPassword(user.password);
|
||||
return await connection.getRepository(UserEntity).persist(user);
|
||||
return await connection.getRepository(UserEntity).save(user);
|
||||
}
|
||||
|
||||
public async deleteUser(id: number) {
|
||||
@ -59,7 +59,7 @@ export class UserManager implements IUserManager {
|
||||
let userRepository = connection.getRepository(UserEntity);
|
||||
const user = await userRepository.findOne({id: id});
|
||||
user.role = newRole;
|
||||
return await userRepository.persist(user);
|
||||
return await userRepository.save(user);
|
||||
|
||||
}
|
||||
|
||||
|
@ -14,9 +14,9 @@ export class DirectoryEntity implements DirectoryDTO {
|
||||
@Column()
|
||||
path: string;
|
||||
|
||||
@Column()
|
||||
@Column('bigint')
|
||||
public lastModified: number;
|
||||
@Column()
|
||||
@Column('bigint')
|
||||
public lastScanned: number;
|
||||
|
||||
@Column()
|
||||
|
@ -1,7 +1,8 @@
|
||||
import {Column, EmbeddableEntity, Embedded, Entity, ManyToOne, PrimaryGeneratedColumn} from "typeorm";
|
||||
import {Column, Entity, ManyToOne, PrimaryGeneratedColumn} from "typeorm";
|
||||
import {DirectoryDTO} from "../../../../common/entities/DirectoryDTO";
|
||||
import {
|
||||
CameraMetadata,
|
||||
GPSMetadata,
|
||||
ImageSize,
|
||||
PhotoDTO,
|
||||
PhotoMetadata,
|
||||
@ -9,58 +10,19 @@ import {
|
||||
} from "../../../../common/entities/PhotoDTO";
|
||||
import {DirectoryEntity} from "./DirectoryEntity";
|
||||
|
||||
|
||||
@EmbeddableEntity()
|
||||
export class PhotoMetadataEntity implements PhotoMetadata {
|
||||
|
||||
@Column("string")
|
||||
keywords: Array<string>;
|
||||
|
||||
@Column("string")
|
||||
cameraData: CameraMetadata;
|
||||
|
||||
@Column("string")
|
||||
positionData: PositionMetaData;
|
||||
|
||||
@Column("string")
|
||||
size: ImageSize;
|
||||
|
||||
@Column("number")
|
||||
creationDate: number;
|
||||
|
||||
@Column("number")
|
||||
fileSize: number;
|
||||
|
||||
//TODO: fixit after typeorm update
|
||||
public static open(m: PhotoMetadataEntity) {
|
||||
m.keywords = <any>JSON.parse(<any>m.keywords);
|
||||
m.cameraData = <any>JSON.parse(<any>m.cameraData);
|
||||
m.positionData = <any>JSON.parse(<any>m.positionData);
|
||||
m.size = <any>JSON.parse(<any>m.size);
|
||||
}
|
||||
|
||||
//TODO: fixit after typeorm update
|
||||
public static close(m: PhotoMetadataEntity) {
|
||||
m.keywords = <any>JSON.stringify(<any>m.keywords);
|
||||
m.cameraData = <any>JSON.stringify(<any>m.cameraData);
|
||||
m.positionData = <any>JSON.stringify(<any>m.positionData);
|
||||
m.size = <any>JSON.stringify(<any>m.size);
|
||||
}
|
||||
}
|
||||
|
||||
@Entity()
|
||||
export class PhotoEntity implements PhotoDTO {
|
||||
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column("string")
|
||||
@Column("text")
|
||||
name: string;
|
||||
|
||||
@ManyToOne(type => DirectoryEntity, directory => directory.photos, {onDelete: "CASCADE"})
|
||||
directory: DirectoryDTO;
|
||||
|
||||
@Embedded(type => PhotoMetadataEntity)
|
||||
@Column(type => PhotoMetadataEntity)
|
||||
metadata: PhotoMetadataEntity;
|
||||
|
||||
readyThumbnails: Array<number> = [];
|
||||
@ -70,67 +32,105 @@ export class PhotoEntity implements PhotoDTO {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@EmbeddableTable()
|
||||
export class CameraMetadataEntity implements CameraMetadata {
|
||||
@Entity()
|
||||
export class PhotoMetadataEntity implements PhotoMetadata {
|
||||
|
||||
@Column("string")
|
||||
ISO: number;
|
||||
@Column("simple-array")
|
||||
keywords: Array<string>;
|
||||
|
||||
@Column("string")
|
||||
model: string;
|
||||
@Column(type => CameraMetadataEntity)
|
||||
cameraData: CameraMetadataEntity;
|
||||
|
||||
@Column("string")
|
||||
maker: string;
|
||||
@Column(type => PositionMetaDataEntity)
|
||||
positionData: PositionMetaDataEntity;
|
||||
|
||||
@Column("int")
|
||||
fStop: number;
|
||||
@Column(type => ImageSizeEntity)
|
||||
size: ImageSizeEntity;
|
||||
|
||||
@Column("int")
|
||||
exposure: number;
|
||||
@Column("bigint")
|
||||
creationDate: number;
|
||||
|
||||
@Column("int")
|
||||
focalLength: number;
|
||||
@Column("int")
|
||||
fileSize: number;
|
||||
/*
|
||||
//TODO: fixit after typeorm update
|
||||
public static open(m: PhotoMetadataEntity) {
|
||||
m.keywords = <any>JSON.parse(<any>m.keywords);
|
||||
m.cameraData = <any>JSON.parse(<any>m.cameraData);
|
||||
m.positionData = <any>JSON.parse(<any>m.positionData);
|
||||
m.size = <any>JSON.parse(<any>m.size);
|
||||
}
|
||||
|
||||
@Column("string")
|
||||
lens: string;
|
||||
}
|
||||
/*
|
||||
|
||||
@EmbeddableTable()
|
||||
export class PositionMetaDataEntity implements PositionMetaData {
|
||||
|
||||
@Embedded(type => GPSMetadataEntity)
|
||||
GPSData: GPSMetadataEntity;
|
||||
|
||||
@Column("string")
|
||||
country: string;
|
||||
|
||||
@Column("string")
|
||||
state: string;
|
||||
|
||||
@Column("string")
|
||||
city: string;
|
||||
}
|
||||
//TODO: fixit after typeorm update
|
||||
public static close(m: PhotoMetadataEntity) {
|
||||
m.keywords = <any>JSON.stringify(<any>m.keywords);
|
||||
m.cameraData = <any>JSON.stringify(<any>m.cameraData);
|
||||
m.positionData = <any>JSON.stringify(<any>m.positionData);
|
||||
m.size = <any>JSON.stringify(<any>m.size);
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
@EmbeddableTable()
|
||||
export class GPSMetadataEntity implements GPSMetadata {
|
||||
@Entity()
|
||||
export class CameraMetadataEntity implements CameraMetadata {
|
||||
|
||||
@Column("string")
|
||||
latitude: string;
|
||||
@Column("string")
|
||||
longitude: string;
|
||||
@Column("string")
|
||||
altitude: string;
|
||||
}
|
||||
@Column("text", {nullable: true})
|
||||
ISO: number;
|
||||
|
||||
@EmbeddableTable()
|
||||
export class ImageSizeEntity implements ImageSize {
|
||||
@Column("text", {nullable: true})
|
||||
model: string;
|
||||
|
||||
@Column("int")
|
||||
width: number;
|
||||
@Column("text", {nullable: true})
|
||||
maker: string;
|
||||
|
||||
@Column("int")
|
||||
height: number;
|
||||
}*/
|
||||
@Column("int", {nullable: true})
|
||||
fStop: number;
|
||||
|
||||
@Column("int", {nullable: true})
|
||||
exposure: number;
|
||||
|
||||
@Column("int", {nullable: true})
|
||||
focalLength: number;
|
||||
|
||||
@Column("text", {nullable: true})
|
||||
lens: string;
|
||||
}
|
||||
|
||||
|
||||
@Entity()
|
||||
export class PositionMetaDataEntity implements PositionMetaData {
|
||||
|
||||
@Column(type => GPSMetadataEntity)
|
||||
GPSData: GPSMetadataEntity;
|
||||
|
||||
@Column("text", {nullable: true})
|
||||
country: string;
|
||||
|
||||
@Column("text", {nullable: true})
|
||||
state: string;
|
||||
|
||||
@Column("text", {nullable: true})
|
||||
city: string;
|
||||
}
|
||||
|
||||
|
||||
@Entity()
|
||||
export class GPSMetadataEntity implements GPSMetadata {
|
||||
|
||||
@Column("int", {nullable: true})
|
||||
latitude: number;
|
||||
@Column("int", {nullable: true})
|
||||
longitude: number;
|
||||
@Column("int", {nullable: true})
|
||||
altitude: number;
|
||||
}
|
||||
|
||||
@Entity()
|
||||
export class ImageSizeEntity implements ImageSize {
|
||||
|
||||
@Column("int")
|
||||
width: number;
|
||||
|
||||
@Column("int")
|
||||
height: number;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Column, EmbeddableEntity, Embedded, Entity, ManyToOne, PrimaryGeneratedColumn} from "typeorm";
|
||||
import {Column, Entity, ManyToOne, PrimaryGeneratedColumn} from "typeorm";
|
||||
import {SharingDTO} from "../../../../common/entities/SharingDTO";
|
||||
import {UserEntity} from "./UserEntity";
|
||||
import {UserDTO} from "../../../../common/entities/UserDTO";
|
||||
@ -8,22 +8,22 @@ export class SharingEntity implements SharingDTO {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column("string")
|
||||
@Column()
|
||||
sharingKey: string;
|
||||
|
||||
@Column("string")
|
||||
@Column()
|
||||
path: string;
|
||||
|
||||
@Column("string", {nullable: true})
|
||||
@Column({type: "text", nullable: true})
|
||||
password: string;
|
||||
|
||||
@Column("number")
|
||||
@Column()
|
||||
expires: number;
|
||||
|
||||
@Column("number")
|
||||
@Column()
|
||||
timeStamp: number;
|
||||
|
||||
@Column("boolean")
|
||||
@Column()
|
||||
includeSubfolders: boolean;
|
||||
|
||||
@ManyToOne(type => UserEntity)
|
||||
|
@ -16,7 +16,7 @@ export class UserEntity implements UserDTO {
|
||||
@Column("smallint")
|
||||
role: UserRoles;
|
||||
|
||||
@Column("string", {nullable: true})
|
||||
@Column("text", {nullable: true})
|
||||
permissions: string[];
|
||||
|
||||
}
|
||||
|
@ -60,6 +60,12 @@ export class Server {
|
||||
keys: ["key1" + s4() + s4() + s4() + s4(), "key2" + s4() + s4() + s4() + s4(), "key3" + s4() + s4() + s4() + s4()]
|
||||
}));
|
||||
|
||||
/* this.app.use((req: Request, res: Response, next: NextFunction) => {
|
||||
res.setHeader('Accept-Ranges', 'none');
|
||||
res.setHeader('Connection', 'close');
|
||||
next();
|
||||
});*/
|
||||
|
||||
/**
|
||||
* Parse parameters in POST
|
||||
*/
|
||||
|
@ -5,12 +5,12 @@ var runSequence = require('run-sequence');
|
||||
var jsonModify = require('gulp-json-modify');
|
||||
var exec = require('child_process').exec;
|
||||
|
||||
var tsProject = ts.createProject('tsconfig.json');
|
||||
var tsBackendProject = ts.createProject('backend/tsconfig.json');
|
||||
gulp.task('build-backend', function () {
|
||||
return gulp.src([
|
||||
"common/**/*.ts",
|
||||
"backend/**/*.ts"], {base: "."})
|
||||
.pipe(tsProject())
|
||||
.pipe(tsBackendProject())
|
||||
.js
|
||||
.pipe(gulp.dest("./release"))
|
||||
|
||||
|
101
package.json
101
package.json
@ -26,58 +26,59 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"bcryptjs": "2.4.3",
|
||||
"body-parser": "1.17.2",
|
||||
"cookie-session": "^2.0.0-beta.2",
|
||||
"body-parser": "1.18.2",
|
||||
"cookie-session": "^2.0.0-beta.3",
|
||||
"ejs": "2.5.7",
|
||||
"express": "4.15.3",
|
||||
"express": "4.16.2",
|
||||
"jimp": "0.2.28",
|
||||
"mysql": "^2.15.0",
|
||||
"reflect-metadata": "0.1.10",
|
||||
"sqlite3": "^3.1.8",
|
||||
"sqlite3": "^3.1.13",
|
||||
"ts-exif-parser": "^0.1.23",
|
||||
"ts-node-iptc": "^1.0.9",
|
||||
"typeconfig": "1.0.4",
|
||||
"typeorm": "0.0.11",
|
||||
"winston": "2.3.1"
|
||||
"typeorm": "0.1.1",
|
||||
"winston": "2.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@agm/core": "^1.0.0-beta.0",
|
||||
"@angular/animations": "^4.3.2",
|
||||
"@angular/cli": "1.2.6",
|
||||
"@angular/common": "~4.3.2",
|
||||
"@angular/compiler": "~4.3.2",
|
||||
"@angular/compiler-cli": "^4.3.2",
|
||||
"@angular/core": "~4.3.2",
|
||||
"@angular/forms": "~4.3.2",
|
||||
"@angular/http": "~4.3.2",
|
||||
"@angular/language-service": "^4.3.2",
|
||||
"@angular/platform-browser": "~4.3.2",
|
||||
"@angular/platform-browser-dynamic": "~4.3.2",
|
||||
"@angular/router": "~4.3.2",
|
||||
"@types/bcryptjs": "^2.4.0",
|
||||
"@types/chai": "^4.0.1",
|
||||
"@types/cookie-session": "^2.0.32",
|
||||
"@types/express": "^4.0.36",
|
||||
"@types/gm": "^1.17.31",
|
||||
"@types/jasmine": "^2.5.53",
|
||||
"@agm/core": "^1.0.0-beta.1",
|
||||
"@angular/animations": "^4.4.6",
|
||||
"@angular/cli": "1.4.8",
|
||||
"@angular/common": "~4.4.6",
|
||||
"@angular/compiler": "~4.4.6",
|
||||
"@angular/compiler-cli": "^4.4.6",
|
||||
"@angular/core": "~4.4.6",
|
||||
"@angular/forms": "~4.4.6",
|
||||
"@angular/http": "~4.4.6",
|
||||
"@angular/language-service": "^4.4.6",
|
||||
"@angular/platform-browser": "~4.4.6",
|
||||
"@angular/platform-browser-dynamic": "~4.4.6",
|
||||
"@angular/router": "~4.4.6",
|
||||
"@types/bcryptjs": "^2.4.1",
|
||||
"@types/chai": "^4.0.4",
|
||||
"@types/cookie-session": "^2.0.33",
|
||||
"@types/express": "^4.0.37",
|
||||
"@types/gm": "^1.17.33",
|
||||
"@types/jasmine": "^2.6.0",
|
||||
"@types/jimp": "^0.2.1",
|
||||
"@types/node": "^8.0.17",
|
||||
"@types/sharp": "^0.17.2",
|
||||
"@types/winston": "^2.3.4",
|
||||
"@types/node": "^8.0.45",
|
||||
"@types/sharp": "^0.17.4",
|
||||
"@types/winston": "^2.3.6",
|
||||
"bootstrap": "^3.3.7",
|
||||
"chai": "^4.1.0",
|
||||
"codelyzer": "~3.1.2",
|
||||
"core-js": "^2.4.1",
|
||||
"chai": "^4.1.2",
|
||||
"codelyzer": "~3.2.1",
|
||||
"core-js": "^2.5.1",
|
||||
"ejs-loader": "^0.3.0",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-json-modify": "^1.0.2",
|
||||
"gulp-typescript": "^3.2.1",
|
||||
"gulp-typescript": "^3.2.2",
|
||||
"gulp-zip": "^4.0.0",
|
||||
"hammerjs": "^2.0.8",
|
||||
"intl": "^1.2.5",
|
||||
"jasmine-core": "^2.7.0",
|
||||
"jasmine-spec-reporter": "~4.1.1",
|
||||
"jw-bootstrap-switch-ng2": "^1.0.4",
|
||||
"karma": "^1.7.0",
|
||||
"jasmine-core": "^2.8.0",
|
||||
"jasmine-spec-reporter": "~4.2.1",
|
||||
"jw-bootstrap-switch-ng2": "^1.0.6",
|
||||
"karma": "^1.7.1",
|
||||
"karma-cli": "^1.0.1",
|
||||
"karma-coverage-istanbul-reporter": "^1.3.0",
|
||||
"karma-jasmine": "^1.1.0",
|
||||
@ -85,29 +86,29 @@
|
||||
"karma-phantomjs-launcher": "^1.0.4",
|
||||
"karma-remap-istanbul": "^0.6.0",
|
||||
"karma-systemjs": "^0.16.0",
|
||||
"merge2": "^1.1.0",
|
||||
"mocha": "^3.4.2",
|
||||
"merge2": "^1.2.0",
|
||||
"mocha": "^4.0.1",
|
||||
"ng2-cookies": "^1.0.12",
|
||||
"ng2-slim-loading-bar": "^4.0.0",
|
||||
"ng2-toastr": "^4.1.2",
|
||||
"ngx-bootstrap": "^1.8.1",
|
||||
"ngx-clipboard": "^8.0.3",
|
||||
"phantomjs-prebuilt": "^2.1.14",
|
||||
"protractor": "^5.1.2",
|
||||
"ngx-bootstrap": "^1.9.3",
|
||||
"ngx-clipboard": "^8.1.1",
|
||||
"phantomjs-prebuilt": "^2.1.15",
|
||||
"protractor": "^5.2.0",
|
||||
"remap-istanbul": "^0.9.5",
|
||||
"rimraf": "^2.6.1",
|
||||
"run-sequence": "^2.1.0",
|
||||
"rxjs": "^5.4.2",
|
||||
"rimraf": "^2.6.2",
|
||||
"run-sequence": "^2.2.0",
|
||||
"rxjs": "^5.5.0",
|
||||
"ts-helpers": "^1.1.2",
|
||||
"ts-node": "~3.3.0",
|
||||
"tslint": "^5.5.0",
|
||||
"typescript": "^2.4.2",
|
||||
"zone.js": "^0.8.16"
|
||||
"tslint": "^5.7.0",
|
||||
"typescript": "^2.5.3",
|
||||
"zone.js": "^0.8.18"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"bcrypt": "^1.0.2",
|
||||
"bcrypt": "^1.0.3",
|
||||
"gm": "^1.23.0",
|
||||
"sharp": "^0.18.2"
|
||||
"sharp": "^0.18.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.9"
|
||||
|
Loading…
Reference in New Issue
Block a user