From fb37fb50b6601a132d4aa9d6af5da7fbf0195b2f Mon Sep 17 00:00:00 2001 From: rubikscraft Date: Sun, 27 Feb 2022 20:27:22 +0100 Subject: [PATCH] Rebrand to picsur --- LICENSE | 143 ++++++++---------- README.md | 76 ++++------ backend/package.json | 8 +- backend/src/app.module.ts | 4 +- .../src/collections/imagedb/imagedb.module.ts | 2 +- .../collections/imagedb/imagedb.service.ts | 6 +- .../src/collections/imagedb/mimes.service.ts | 4 +- .../src/collections/userdb/userdb.module.ts | 2 +- .../src/collections/userdb/userdb.service.ts | 4 +- backend/src/decorators/multipart.decorator.ts | 2 +- backend/src/env.ts | 36 ++--- .../http-exception/http-exception.filter.ts | 2 +- .../src/layers/success/success.interceptor.ts | 2 +- .../imagemanager/imagemanager.service.ts | 6 +- backend/src/routes/api/auth/admin.guard.ts | 2 +- .../src/routes/api/auth/auth.controller.ts | 4 +- backend/src/routes/api/auth/auth.service.ts | 6 +- backend/src/routes/api/auth/authrequest.ts | 2 +- backend/src/routes/api/auth/jwt.strategy.ts | 4 +- backend/src/routes/api/auth/local.strategy.ts | 4 +- .../src/routes/image/imageroute.controller.ts | 2 +- .../logo/{imagur-128.png => picsur-128.png} | Bin .../logo/{imagur-512.png => picsur-512.png} | Bin branding/logo/{imagur.ico => picsur.ico} | Bin branding/logo/{imagur.svg => picsur.svg} | 2 +- frontend/package.json | 8 +- frontend/public/index.html | 4 +- frontend/src/api/api.ts | 4 +- frontend/src/api/images.ts | 4 +- frontend/src/routes/processing/processing.tsx | 2 +- frontend/src/routes/view/view.tsx | 2 +- shared/package.json | 6 +- support/build.sh | 6 +- support/dev.docker-compose.yml | 6 +- support/imagur.docker-compose.yml | 38 ----- .../{imagur.Dockerfile => picsur.Dockerfile} | 10 +- support/picsur.docker-compose.yml | 38 +++++ workspace.code-workspace | 2 +- 38 files changed, 208 insertions(+), 245 deletions(-) rename branding/logo/{imagur-128.png => picsur-128.png} (100%) rename branding/logo/{imagur-512.png => picsur-512.png} (100%) rename branding/logo/{imagur.ico => picsur.ico} (100%) rename branding/logo/{imagur.svg => picsur.svg} (98%) delete mode 100644 support/imagur.docker-compose.yml rename support/{imagur.Dockerfile => picsur.Dockerfile} (69%) create mode 100644 support/picsur.docker-compose.yml diff --git a/LICENSE b/LICENSE index f288702..0ad25db 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies @@ -7,17 +7,15 @@ Preamble - The GNU General Public License is a free, copyleft license for -software and other kinds of works. + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to +our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. +software for all its users. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you @@ -26,44 +24,34 @@ them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. The precise terms and conditions for copying, distribution and modification follow. @@ -72,7 +60,7 @@ modification follow. 0. Definitions. - "This License" refers to version 3 of the GNU General Public License. + "This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. @@ -549,35 +537,45 @@ to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. - 13. Use with the GNU Affero General Public License. + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single +under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General +Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published +GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's +versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. @@ -635,40 +633,29 @@ the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 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 General Public License for more details. + GNU Affero General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see +For more information on this, and how to apply and follow the GNU AGPL, see . - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/README.md b/README.md index ce66225..567f125 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ - + -# Imagur +# Picsur
@@ -17,13 +17,13 @@ But it does function, so feel free to give it a try. ## Demo -You can view a live demo here: +You can view a live demo here: The images are deleted every five minutes, and the max filesize is 16MB. But it should give you an indication of how it works. ## Bugs -If you encounter any bugs or oddities, please open an issue [here](https://github.com/rubikscraft/Imagur/issues). Cause without feedback I'll never know they exists. +If you encounter any bugs or oddities, please open an issue [here](https://github.com/rubikscraft/Picsur/issues). Cause without feedback I'll never know they exists. ## Running @@ -32,37 +32,37 @@ You easily run this service yourself via Docker. Here is an example docker-compo ```yaml version: "3" services: - imagur: - image: ghcr.io/rubikscraft/imagur:latest - container_name: imagur + picsur: + image: ghcr.io/rubikscraft/picsur:latest + container_name: picsur ports: - "8080:8080" environment: - # IMAGUR_HOST: '0.0.0.0' - # IMAGUR_PORT: 8080 + # PICSUR_HOST: '0.0.0.0' + # PICSUR_PORT: 8080 - IMAGUR_DB_HOST: imagur_postgres - # IMAGUR_DB_PORT: 5432 - # IMAGUR_DB_USER: imagur - # IMAGUR_DB_PASSWORD: imagur - # IMAGUR_DB_NAME: imagur + PICSUR_DB_HOST: picsur_postgres + # PICSUR_DB_PORT: 5432 + # PICSUR_DB_USER: picsur + # PICSUR_DB_PASSWORD: picsur + # PICSUR_DB_NAME: picsur - # IMAGUR_ADMIN_USERNAME: imagur - # IMAGUR_ADMIN_PASSWORD: imagur + # PICSUR_ADMIN_USERNAME: picsur + # PICSUR_ADMIN_PASSWORD: picsur - # IMAGUR_JWT_SECRET: CHANGE_ME - # IMAGUR_JWT_EXPIRY: 1d + # PICSUR_JWT_SECRET: CHANGE_ME + # PICSUR_JWT_EXPIRY: 1d - # IMAGUR_MAX_FILE_SIZE: 128000000 - # IMAGUR_STATIC_FRONTEND_ROOT: "/imagur/frontend/dist" + # PICSUR_MAX_FILE_SIZE: 128000000 + # PICSUR_STATIC_FRONTEND_ROOT: "/picsur/frontend/dist" restart: unless-stopped - imagur_postgres: + picsur_postgres: image: postgres:11-alpine - container_name: imagur_postgres + container_name: picsur_postgres environment: - POSTGRES_DB: imagur - POSTGRES_PASSWORD: imagur - POSTGRES_USER: imagur + POSTGRES_DB: picsur + POSTGRES_PASSWORD: picsur + POSTGRES_USER: picsur restart: unless-stopped volumes: - db-data:/var/lib/postgresql/data @@ -70,32 +70,8 @@ volumes: db-data: ``` -## Configuration - -You can configure a couple different things using environment variables. Here is the current list with their default values: - -```txt -IMAGUR_HOST: '0.0.0.0' -IMAGUR_PORT: 8080 - -IMAGUR_DB_HOST: imagur_postgres -IMAGUR_DB_PORT: 5432 -IMAGUR_DB_USER: imagur -IMAGUR_DB_PASSWORD: imagur -IMAGUR_DB_NAME: imagur - -IMAGUR_ADMIN_USERNAME: imagur -IMAGUR_ADMIN_PASSWORD: imagur - -IMAGUR_JWT_SECRET: CHANGE_ME -IMAGUR_JWT_EXPIRY: 1d - -IMAGUR_MAX_FILE_SIZE: 128000000 -IMAGUR_STATIC_FRONTEND_ROOT: "/imagur/frontend/dist" -``` - ## Api Here is a usually up to date documentation of the api: -[![Run in Postman](https://run.pstmn.io/button.svg)](https://www.postman.com/rubikscraft/workspace/imagur/collection/1841871-78e559b6-4f39-4092-87c3-92fa29547d03) +[![Run in Postman](https://run.pstmn.io/button.svg)](https://www.postman.com/rubikscraft/workspace/picsur/collection/1841871-78e559b6-4f39-4092-87c3-92fa29547d03) diff --git a/backend/package.json b/backend/package.json index 328f9d9..c9be93b 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,10 +1,10 @@ { - "name": "imagur-backend", + "name": "picsur-backend", "private": false, "version": "0.0.0", - "description": "Backend for Imagur", + "description": "Backend for Picsur", "license": "GPL-3.0", - "repository": "https://github.com/rubikscraft/Imagur", + "repository": "https://github.com/rubikscraft/Picsur", "author": "Rubikscraft ", "type": "module", "main": "dist/main.js", @@ -41,7 +41,7 @@ "rimraf": "^3.0.2", "rxjs": "^7.5.4", "typeorm": "^0.2.44", - "imagur-shared": "*" + "picsur-shared": "*" }, "devDependencies": { "@nestjs/cli": "^8.2.1", diff --git a/backend/src/app.module.ts b/backend/src/app.module.ts index 5f761f0..003ff56 100644 --- a/backend/src/app.module.ts +++ b/backend/src/app.module.ts @@ -5,8 +5,8 @@ import { ImageModule } from './routes/image/imageroute.module'; import { ServeStaticModule } from '@nestjs/serve-static'; import Config from './env'; import { DemoManagerModule } from './managers/demo/demomanager.module'; -import { EUser } from 'imagur-shared/dist/entities/user.entity'; -import { EImage } from 'imagur-shared/dist/entities/image.entity'; +import { EUser } from 'picsur-shared/dist/entities/user.entity'; +import { EImage } from 'picsur-shared/dist/entities/image.entity'; @Module({ imports: [ diff --git a/backend/src/collections/imagedb/imagedb.module.ts b/backend/src/collections/imagedb/imagedb.module.ts index 2f722d8..dc948c9 100644 --- a/backend/src/collections/imagedb/imagedb.module.ts +++ b/backend/src/collections/imagedb/imagedb.module.ts @@ -2,7 +2,7 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; import { ImageDBService } from './imagedb.service'; import { MimesService } from './mimes.service'; -import { EImage } from 'imagur-shared/dist/entities/image.entity'; +import { EImage } from 'picsur-shared/dist/entities/image.entity'; @Module({ imports: [TypeOrmModule.forFeature([EImage])], diff --git a/backend/src/collections/imagedb/imagedb.service.ts b/backend/src/collections/imagedb/imagedb.service.ts index 953057f..021e7f3 100644 --- a/backend/src/collections/imagedb/imagedb.service.ts +++ b/backend/src/collections/imagedb/imagedb.service.ts @@ -7,10 +7,10 @@ import { Fail, HasFailed, HasSuccess, -} from 'imagur-shared/dist/types'; -import { SupportedMime } from 'imagur-shared/dist/dto/mimes.dto'; +} from 'picsur-shared/dist/types'; +import { SupportedMime } from 'picsur-shared/dist/dto/mimes.dto'; import { GetCols } from '../collectionutils'; -import { EImage } from 'imagur-shared/dist/entities/image.entity'; +import { EImage } from 'picsur-shared/dist/entities/image.entity'; import { plainToClass } from 'class-transformer'; @Injectable() diff --git a/backend/src/collections/imagedb/mimes.service.ts b/backend/src/collections/imagedb/mimes.service.ts index de45730..d548ce8 100644 --- a/backend/src/collections/imagedb/mimes.service.ts +++ b/backend/src/collections/imagedb/mimes.service.ts @@ -1,11 +1,11 @@ import { Injectable } from '@nestjs/common'; -import { Fail, Failable } from 'imagur-shared/dist/types'; +import { Fail, Failable } from 'picsur-shared/dist/types'; import { FullMime, SupportedAnimMimes, SupportedImageMimes, SupportedMime, -} from 'imagur-shared/dist/dto/mimes.dto'; +} from 'picsur-shared/dist/dto/mimes.dto'; @Injectable() export class MimesService { diff --git a/backend/src/collections/userdb/userdb.module.ts b/backend/src/collections/userdb/userdb.module.ts index 38204a5..b5164b1 100644 --- a/backend/src/collections/userdb/userdb.module.ts +++ b/backend/src/collections/userdb/userdb.module.ts @@ -1,6 +1,6 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { EUser } from 'imagur-shared/dist/entities/user.entity'; +import { EUser } from 'picsur-shared/dist/entities/user.entity'; import { UsersService } from './userdb.service'; @Module({ diff --git a/backend/src/collections/userdb/userdb.service.ts b/backend/src/collections/userdb/userdb.service.ts index 895bee4..f485c7d 100644 --- a/backend/src/collections/userdb/userdb.service.ts +++ b/backend/src/collections/userdb/userdb.service.ts @@ -2,13 +2,13 @@ import { Injectable, Logger } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { plainToClass } from 'class-transformer'; import { validate } from 'class-validator'; -import { EUser } from 'imagur-shared/dist/entities/user.entity'; +import { EUser } from 'picsur-shared/dist/entities/user.entity'; import { AsyncFailable, Fail, HasFailed, HasSuccess, -} from 'imagur-shared/dist/types'; +} from 'picsur-shared/dist/types'; import { Repository } from 'typeorm'; import { GetCols } from '../collectionutils'; diff --git a/backend/src/decorators/multipart.decorator.ts b/backend/src/decorators/multipart.decorator.ts index 9feb7d4..52eb821 100644 --- a/backend/src/decorators/multipart.decorator.ts +++ b/backend/src/decorators/multipart.decorator.ts @@ -8,7 +8,7 @@ import { import { validate } from 'class-validator'; import { FastifyRequest } from 'fastify'; import { Multipart, MultipartFields, MultipartFile } from 'fastify-multipart'; -import { Newable } from 'imagur-shared/dist/types'; +import { Newable } from 'picsur-shared/dist/types'; import Config from '../env'; import { MultiPartFieldDto, MultiPartFileDto } from '../backenddto/multipart.dto'; diff --git a/backend/src/env.ts b/backend/src/env.ts index abc5597..2cff883 100644 --- a/backend/src/env.ts +++ b/backend/src/env.ts @@ -4,46 +4,46 @@ const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '../'); const Config = { main: { - host: process.env.IMAGUR_HOST || '0.0.0.0', - port: process.env.IMAGUR_PORT || 8080, + host: process.env.PICSUR_HOST || '0.0.0.0', + port: process.env.PICSUR_PORT || 8080, }, database: { - host: process.env.IMAGUR_DB_HOST ?? 'localhost', - port: process.env.IMAGUR_DB_PORT - ? parseInt(process.env.IMAGUR_DB_PORT) + host: process.env.PICSUR_DB_HOST ?? 'localhost', + port: process.env.PICSUR_DB_PORT + ? parseInt(process.env.PICSUR_DB_PORT) : 5432, - username: process.env.IMAGUR_DB_USERNAME ?? 'imagur', - password: process.env.IMAGUR_DB_PASSWORD ?? 'imagur', - database: process.env.IMAGUR_DB_DATABASE ?? 'imagur', + username: process.env.PICSUR_DB_USERNAME ?? 'picsur', + password: process.env.PICSUR_DB_PASSWORD ?? 'picsur', + database: process.env.PICSUR_DB_DATABASE ?? 'picsur', }, defaultAdmin: { - username: process.env.IMAGUR_ADMIN_USERNAME ?? 'admin', - password: process.env.IMAGUR_ADMIN_PASSWORD ?? 'admin', + username: process.env.PICSUR_ADMIN_USERNAME ?? 'admin', + password: process.env.PICSUR_ADMIN_PASSWORD ?? 'admin', }, jwt: { - secret: process.env.IMAGUR_JWT_SECRET ?? 'CHANGE_ME', - expiresIn: process.env.IMAGUR_JWT_EXPIRES_IN ?? '1d', + secret: process.env.PICSUR_JWT_SECRET ?? 'CHANGE_ME', + expiresIn: process.env.PICSUR_JWT_EXPIRES_IN ?? '1d', }, uploadLimits: { fieldNameSize: 128, fieldSize: 1024, fields: 16, files: 16, - fileSize: process.env.IMAGUR_MAX_FILE_SIZE - ? parseInt(process.env.IMAGUR_MAX_FILE_SIZE) + fileSize: process.env.PICSUR_MAX_FILE_SIZE + ? parseInt(process.env.PICSUR_MAX_FILE_SIZE) : 128000000, }, static: { packageRoot: packageRoot, frontendRoot: - process.env.IMAGUR_STATIC_FRONTEND_ROOT ?? + process.env.PICSUR_STATIC_FRONTEND_ROOT ?? join(packageRoot, '../frontend/dist'), backendRoutes: ['i', 'api'], }, demo: { - enabled: process.env.IMAGUR_DEMO?.toLowerCase() === 'true', - interval: process.env.IMAGUR_DEMO_INTERVAL - ? parseInt(process.env.IMAGUR_DEMO_INTERVAL) + enabled: process.env.PICSUR_DEMO?.toLowerCase() === 'true', + interval: process.env.PICSUR_DEMO_INTERVAL + ? parseInt(process.env.PICSUR_DEMO_INTERVAL) : 1000 * 60 * 5, }, }; diff --git a/backend/src/layers/http-exception/http-exception.filter.ts b/backend/src/layers/http-exception/http-exception.filter.ts index a5e09c1..d54067e 100644 --- a/backend/src/layers/http-exception/http-exception.filter.ts +++ b/backend/src/layers/http-exception/http-exception.filter.ts @@ -6,7 +6,7 @@ import { } from '@nestjs/common'; import { FastifyRequest } from 'fastify'; import { FastifyReply } from 'fastify'; -import { ApiErrorResponse, ApiResponse } from 'imagur-shared/dist/dto/api.dto'; +import { ApiErrorResponse } from 'picsur-shared/dist/dto/api.dto'; @Catch(HttpException) export class MainExceptionFilter implements ExceptionFilter { diff --git a/backend/src/layers/success/success.interceptor.ts b/backend/src/layers/success/success.interceptor.ts index f1061c1..edeb5ae 100644 --- a/backend/src/layers/success/success.interceptor.ts +++ b/backend/src/layers/success/success.interceptor.ts @@ -4,7 +4,7 @@ import { ExecutionContext, CallHandler, } from '@nestjs/common'; -import { ApiResponse } from 'imagur-shared/dist/dto/api.dto'; +import { ApiResponse } from 'picsur-shared/dist/dto/api.dto'; import { Observable, map } from 'rxjs'; @Injectable() diff --git a/backend/src/managers/imagemanager/imagemanager.service.ts b/backend/src/managers/imagemanager/imagemanager.service.ts index 4c58243..b495828 100644 --- a/backend/src/managers/imagemanager/imagemanager.service.ts +++ b/backend/src/managers/imagemanager/imagemanager.service.ts @@ -1,9 +1,9 @@ import { Injectable } from '@nestjs/common'; import { isHash } from 'class-validator'; import { fileTypeFromBuffer, FileTypeResult } from 'file-type'; -import { FullMime } from 'imagur-shared/dist/dto/mimes.dto'; -import { EImage } from 'imagur-shared/dist/entities/image.entity'; -import { AsyncFailable, Fail, HasFailed } from 'imagur-shared/dist/types'; +import { FullMime } from 'picsur-shared/dist/dto/mimes.dto'; +import { EImage } from 'picsur-shared/dist/entities/image.entity'; +import { AsyncFailable, Fail, HasFailed } from 'picsur-shared/dist/types'; import { ImageDBService } from '../../collections/imagedb/imagedb.service'; import { MimesService } from '../../collections/imagedb/mimes.service'; diff --git a/backend/src/routes/api/auth/admin.guard.ts b/backend/src/routes/api/auth/admin.guard.ts index 9067c50..9a0fc79 100644 --- a/backend/src/routes/api/auth/admin.guard.ts +++ b/backend/src/routes/api/auth/admin.guard.ts @@ -6,7 +6,7 @@ import { } from '@nestjs/common'; import { plainToClass } from 'class-transformer'; import { validate } from 'class-validator'; -import { EUser } from 'imagur-shared/dist/entities/user.entity'; +import { EUser } from 'picsur-shared/dist/entities/user.entity'; @Injectable() export class AdminGuard implements CanActivate { diff --git a/backend/src/routes/api/auth/auth.controller.ts b/backend/src/routes/api/auth/auth.controller.ts index a709101..6d479c7 100644 --- a/backend/src/routes/api/auth/auth.controller.ts +++ b/backend/src/routes/api/auth/auth.controller.ts @@ -13,9 +13,9 @@ import { LocalAuthGuard } from './local-auth.guard'; import { AuthService } from './auth.service'; import { JwtAuthGuard } from './jwt.guard'; import { AdminGuard } from './admin.guard'; -import { HasFailed } from 'imagur-shared/dist/types'; +import { HasFailed } from 'picsur-shared/dist/types'; import AuthFasityRequest from './authrequest'; -import { AuthDeleteRequest, AuthLoginResponse, AuthRegisterRequest } from 'imagur-shared/dist/dto/auth.dto'; +import { AuthDeleteRequest, AuthLoginResponse, AuthRegisterRequest } from 'picsur-shared/dist/dto/auth.dto'; @Controller('api/auth') export class AuthController { diff --git a/backend/src/routes/api/auth/auth.service.ts b/backend/src/routes/api/auth/auth.service.ts index ce735ee..5dfbfc6 100644 --- a/backend/src/routes/api/auth/auth.service.ts +++ b/backend/src/routes/api/auth/auth.service.ts @@ -3,9 +3,9 @@ import { JwtService } from '@nestjs/jwt'; import * as bcrypt from 'bcrypt'; import { plainToClass } from 'class-transformer'; import { validate } from 'class-validator'; -import { JwtDataDto } from 'imagur-shared/dist/dto/auth.dto'; -import { EUser } from 'imagur-shared/dist/entities/user.entity'; -import { AsyncFailable, HasFailed, Fail } from 'imagur-shared/dist/types'; +import { JwtDataDto } from 'picsur-shared/dist/dto/auth.dto'; +import { EUser } from 'picsur-shared/dist/entities/user.entity'; +import { AsyncFailable, HasFailed, Fail } from 'picsur-shared/dist/types'; import { UsersService } from '../../../collections/userdb/userdb.service'; @Injectable() diff --git a/backend/src/routes/api/auth/authrequest.ts b/backend/src/routes/api/auth/authrequest.ts index 78e0718..edae40b 100644 --- a/backend/src/routes/api/auth/authrequest.ts +++ b/backend/src/routes/api/auth/authrequest.ts @@ -1,5 +1,5 @@ import { FastifyRequest } from 'fastify'; -import { EUser } from 'imagur-shared/dist/entities/user.entity'; +import { EUser } from 'picsur-shared/dist/entities/user.entity'; export default interface AuthFasityRequest extends FastifyRequest { user: EUser; diff --git a/backend/src/routes/api/auth/jwt.strategy.ts b/backend/src/routes/api/auth/jwt.strategy.ts index b5c2434..bb992af 100644 --- a/backend/src/routes/api/auth/jwt.strategy.ts +++ b/backend/src/routes/api/auth/jwt.strategy.ts @@ -4,8 +4,8 @@ import { Injectable, Logger, UnauthorizedException } from '@nestjs/common'; import { validate } from 'class-validator'; import { plainToClass } from 'class-transformer'; import Config from '../../../env'; -import { JwtDataDto } from 'imagur-shared/dist/dto/auth.dto'; -import { EUser } from 'imagur-shared/dist/entities/user.entity'; +import { JwtDataDto } from 'picsur-shared/dist/dto/auth.dto'; +import { EUser } from 'picsur-shared/dist/entities/user.entity'; @Injectable() export class JwtStrategy extends PassportStrategy(Strategy, 'jwt') { diff --git a/backend/src/routes/api/auth/local.strategy.ts b/backend/src/routes/api/auth/local.strategy.ts index 882d532..a4d6ed6 100644 --- a/backend/src/routes/api/auth/local.strategy.ts +++ b/backend/src/routes/api/auth/local.strategy.ts @@ -2,8 +2,8 @@ import { Strategy } from 'passport-local'; import { PassportStrategy } from '@nestjs/passport'; import { Injectable, UnauthorizedException } from '@nestjs/common'; import { AuthService } from './auth.service'; -import { AsyncFailable, HasFailed } from 'imagur-shared/dist/types'; -import { EUser } from 'imagur-shared/dist/entities/user.entity'; +import { AsyncFailable, HasFailed } from 'picsur-shared/dist/types'; +import { EUser } from 'picsur-shared/dist/entities/user.entity'; @Injectable() export class LocalStrategy extends PassportStrategy(Strategy, 'local') { diff --git a/backend/src/routes/image/imageroute.controller.ts b/backend/src/routes/image/imageroute.controller.ts index 19e7513..27dcd18 100644 --- a/backend/src/routes/image/imageroute.controller.ts +++ b/backend/src/routes/image/imageroute.controller.ts @@ -10,7 +10,7 @@ import { Res, } from '@nestjs/common'; import { FastifyReply, FastifyRequest } from 'fastify'; -import { HasFailed } from 'imagur-shared/dist/types'; +import { HasFailed } from 'picsur-shared/dist/types'; import { MultiPart } from '../../decorators/multipart.decorator'; import { ImageManagerService } from '../../managers/imagemanager/imagemanager.service'; import { ImageUploadDto } from '../../backenddto/imageroute.dto'; diff --git a/branding/logo/imagur-128.png b/branding/logo/picsur-128.png similarity index 100% rename from branding/logo/imagur-128.png rename to branding/logo/picsur-128.png diff --git a/branding/logo/imagur-512.png b/branding/logo/picsur-512.png similarity index 100% rename from branding/logo/imagur-512.png rename to branding/logo/picsur-512.png diff --git a/branding/logo/imagur.ico b/branding/logo/picsur.ico similarity index 100% rename from branding/logo/imagur.ico rename to branding/logo/picsur.ico diff --git a/branding/logo/imagur.svg b/branding/logo/picsur.svg similarity index 98% rename from branding/logo/imagur.svg rename to branding/logo/picsur.svg index d0258aa..ba331b4 100644 --- a/branding/logo/imagur.svg +++ b/branding/logo/picsur.svg @@ -8,7 +8,7 @@ version="1.1" id="svg5" inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)" - sodipodi:docname="imagur.svg" + sodipodi:docname="picsur.svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" diff --git a/frontend/package.json b/frontend/package.json index 49a745d..1e7b2db 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,10 +1,10 @@ { "private": false, - "name": "imagur-frontend", + "name": "picsur-frontend", "version": "0.0.0", - "description": "Frontend for Imagur", + "description": "Frontend for Picsur", "license": "GPL-3.0", - "repository": "https://github.com/rubikscraft/Imagur", + "repository": "https://github.com/rubikscraft/Picsur", "author": "Rubikscraft ", "type": "commonjs", "main": "dist/index.js", @@ -15,7 +15,7 @@ "@mui/material": "^5.4.3", "class-transformer": "^0.5.1", "class-validator": "^0.13.2", - "imagur-shared": "*", + "picsur-shared": "*", "notistack": "^2.0.3", "react": "^17.0.2", "react-dom": "^17.0.2", diff --git a/frontend/public/index.html b/frontend/public/index.html index b8d9c36..104eb98 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -2,13 +2,13 @@ - + - Imagur + Picsur diff --git a/frontend/src/api/api.ts b/frontend/src/api/api.ts index 14861fb..c5e41c2 100644 --- a/frontend/src/api/api.ts +++ b/frontend/src/api/api.ts @@ -1,8 +1,8 @@ -import { AsyncFailable, Fail, HasFailed } from 'imagur-shared/dist/types'; +import { AsyncFailable, Fail, HasFailed } from 'picsur-shared/dist/types'; import { ApiResponse, ApiSuccessResponse, -} from 'imagur-shared/dist/dto/api.dto'; +} from 'picsur-shared/dist/dto/api.dto'; import { validate } from 'class-validator'; import { ClassConstructor, plainToClass } from 'class-transformer'; diff --git a/frontend/src/api/images.ts b/frontend/src/api/images.ts index 6626087..3e7c3bb 100644 --- a/frontend/src/api/images.ts +++ b/frontend/src/api/images.ts @@ -1,7 +1,7 @@ import { ImageUploadRequest } from '../frontenddto/imageroute.dto'; import ImagurApi from './api'; -import { EImage } from 'imagur-shared/dist/entities/image.entity'; -import { AsyncFailable, HasFailed } from 'imagur-shared/dist/types'; +import { EImage } from 'picsur-shared/dist/entities/image.entity'; +import { AsyncFailable, HasFailed } from 'picsur-shared/dist/types'; export interface ImageLinks { source: string; diff --git a/frontend/src/routes/processing/processing.tsx b/frontend/src/routes/processing/processing.tsx index 3c8e656..6a7b313 100644 --- a/frontend/src/routes/processing/processing.tsx +++ b/frontend/src/routes/processing/processing.tsx @@ -2,7 +2,7 @@ import Centered from '../../components/centered/centered'; import CircularProgress from '@mui/material/CircularProgress'; import { useLocation, useNavigate } from 'react-router-dom'; import { useEffect } from 'react'; -import { HasFailed } from 'imagur-shared/dist/types'; +import { HasFailed } from 'picsur-shared/dist/types'; import ImagesApi from '../../api/images'; import useError from '../../lib/useerror'; diff --git a/frontend/src/routes/view/view.tsx b/frontend/src/routes/view/view.tsx index 1c0a301..3efe56f 100644 --- a/frontend/src/routes/view/view.tsx +++ b/frontend/src/routes/view/view.tsx @@ -9,7 +9,7 @@ import Debounce from '../../lib/debounce'; import Centered from '../../components/centered/centered'; import './view.scoped.scss'; -import { HasFailed } from 'imagur-shared/dist/types'; +import { HasFailed } from 'picsur-shared/dist/types'; import useError from '../../lib/useerror'; // Stupid names go brrr diff --git a/shared/package.json b/shared/package.json index c7fdc0d..58b1b66 100644 --- a/shared/package.json +++ b/shared/package.json @@ -1,10 +1,10 @@ { "private": false, - "name": "imagur-shared", + "name": "picsur-shared", "version": "0.0.0", - "description": "Shared libraries for Imagur", + "description": "Shared libraries for Picsur", "license": "GPL-3.0", - "repository": "https://github.com/rubikscraft/Imagur", + "repository": "https://github.com/rubikscraft/Picsur", "author": "Rubikscraft ", "type": "commonjs", "main": "./dist/index.js", diff --git a/support/build.sh b/support/build.sh index 66ce77a..c5bd092 100755 --- a/support/build.sh +++ b/support/build.sh @@ -8,13 +8,13 @@ VERSION=$(cat ../package.json | grep version | head -1 | awk -F: '{ print $2 }' echo "Building version $VERSION" -docker build -t "ghcr.io/rubikscraft/imagur:$VERSION" -t "ghcr.io/rubikscraft/imagur:latest" -f ./imagur.Dockerfile .. +docker build -t "ghcr.io/rubikscraft/picsur:$VERSION" -t "ghcr.io/rubikscraft/picsur:latest" -f ./picsur.Dockerfile .. echo "Done" echo "Pushing to ghcr.io" -docker push "ghcr.io/rubikscraft/imagur:$VERSION" -docker push "ghcr.io/rubikscraft/imagur:latest" +docker push "ghcr.io/rubikscraft/picsur:$VERSION" +docker push "ghcr.io/rubikscraft/picsur:latest" echo "Done" diff --git a/support/dev.docker-compose.yml b/support/dev.docker-compose.yml index 911e6be..826c0e0 100644 --- a/support/dev.docker-compose.yml +++ b/support/dev.docker-compose.yml @@ -3,9 +3,9 @@ services: devdb: image: postgres:11-alpine environment: - POSTGRES_DB: imagur - POSTGRES_PASSWORD: imagur - POSTGRES_USER: imagur + POSTGRES_DB: picsur + POSTGRES_PASSWORD: picsur + POSTGRES_USER: picsur logging: driver: "none" ports: diff --git a/support/imagur.docker-compose.yml b/support/imagur.docker-compose.yml deleted file mode 100644 index cb176af..0000000 --- a/support/imagur.docker-compose.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: "3" -services: - imagur: - image: ghcr.io/rubikscraft/imagur:latest - container_name: imagur - ports: - - "8080:8080" - environment: - # IMAGUR_HOST: '0.0.0.0' - # IMAGUR_PORT: 8080 - - IMAGUR_DB_HOST: imagur_postgres - # IMAGUR_DB_PORT: 5432 - # IMAGUR_DB_USER: imagur - # IMAGUR_DB_PASSWORD: imagur - # IMAGUR_DB_NAME: imagur - - # IMAGUR_ADMIN_USERNAME: imagur - # IMAGUR_ADMIN_PASSWORD: imagur - - # IMAGUR_JWT_SECRET: CHANGE_ME - # IMAGUR_JWT_EXPIRY: 1d - - # IMAGUR_MAX_FILE_SIZE: 128000000 - # IMAGUR_STATIC_FRONTEND_ROOT: "/imagur/frontend/dist" - restart: unless-stopped - imagur_postgres: - image: postgres:11-alpine - container_name: imagur_postgres - environment: - POSTGRES_DB: imagur - POSTGRES_PASSWORD: imagur - POSTGRES_USER: imagur - restart: unless-stopped - volumes: - - db-data:/var/lib/postgresql/data -volumes: - db-data: diff --git a/support/imagur.Dockerfile b/support/picsur.Dockerfile similarity index 69% rename from support/imagur.Dockerfile rename to support/picsur.Dockerfile index 8336b7c..7ccb79d 100644 --- a/support/imagur.Dockerfile +++ b/support/picsur.Dockerfile @@ -3,18 +3,18 @@ FROM node:16-alpine # Sorry for the humongous docker container this generates # Maybe I'll trim it down some day -ADD . /imagur -WORKDIR /imagur +ADD . /picsur +WORKDIR /picsur RUN yarn install --frozen-lockfile -WORKDIR /imagur/shared +WORKDIR /picsur/shared RUN yarn build -WORKDIR /imagur/frontend +WORKDIR /picsur/frontend RUN yarn build -WORKDIR /imagur/backend +WORKDIR /picsur/backend RUN yarn build CMD ["yarn", "start:prod"] diff --git a/support/picsur.docker-compose.yml b/support/picsur.docker-compose.yml new file mode 100644 index 0000000..a207484 --- /dev/null +++ b/support/picsur.docker-compose.yml @@ -0,0 +1,38 @@ +version: "3" +services: + picsur: + image: ghcr.io/rubikscraft/picsur:latest + container_name: picsur + ports: + - "8080:8080" + environment: + # PICSUR_HOST: '0.0.0.0' + # PICSUR_PORT: 8080 + + PICSUR_DB_HOST: picsur_postgres + # PICSUR_DB_PORT: 5432 + # PICSUR_DB_USER: picsur + # PICSUR_DB_PASSWORD: picsur + # PICSUR_DB_NAME: picsur + + # PICSUR_ADMIN_USERNAME: picsur + # PICSUR_ADMIN_PASSWORD: picsur + + # PICSUR_JWT_SECRET: CHANGE_ME + # PICSUR_JWT_EXPIRY: 1d + + # PICSUR_MAX_FILE_SIZE: 128000000 + # PICSUR_STATIC_FRONTEND_ROOT: "/picsur/frontend/dist" + restart: unless-stopped + picsur_postgres: + image: postgres:11-alpine + container_name: picsur_postgres + environment: + POSTGRES_DB: picsur + POSTGRES_PASSWORD: picsur + POSTGRES_USER: picsur + restart: unless-stopped + volumes: + - picsur-data:/var/lib/postgresql/data +volumes: + picsur-data: diff --git a/workspace.code-workspace b/workspace.code-workspace index 7ed508f..6fcefea 100644 --- a/workspace.code-workspace +++ b/workspace.code-workspace @@ -13,7 +13,7 @@ "path": "frontend" }, { - "name": "Imagur-Monorepo", + "name": "Picsur-Monorepo", "path": "." } ],