Rebrand to picsur
143
LICENSE
@@ -1,5 +1,5 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
Version 3, 29 June 2007
|
Version 3, 19 November 2007
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
@@ -7,17 +7,15 @@
|
|||||||
|
|
||||||
Preamble
|
Preamble
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
The GNU Affero General Public License is a free, copyleft license for
|
||||||
software and other kinds of works.
|
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
|
The licenses for most software and other practical works are designed
|
||||||
to take away your freedom to share and change the works. By contrast,
|
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
|
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
|
software for all its users.
|
||||||
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.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
When we speak of free software, we are referring to freedom, not
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
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
|
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.
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
Developers that use our General Public Licenses protect your rights
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
with two steps: (1) assert copyright on the software, and (2) offer
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
you this License which gives you legal permission to copy, distribute
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
and/or modify the software.
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
A secondary benefit of defending all users' freedom is that
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
improvements made in alternate versions of the program, if they
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
receive widespread use, become available for other developers to
|
||||||
or can get the source code. And you must show them these terms so they
|
incorporate. Many developers of free software are heartened and
|
||||||
know their rights.
|
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:
|
The GNU Affero General Public License is designed specifically to
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
ensure that, in such cases, the modified source code becomes available
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
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
|
An older license, called the Affero General Public License and
|
||||||
that there is no warranty for this free software. For both users' and
|
published by Affero, was designed to accomplish similar goals. This is
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
a different license, not a version of the Affero GPL, but Affero has
|
||||||
changed, so that their problems will not be attributed erroneously to
|
released a new version of the Affero GPL which permits relicensing under
|
||||||
authors of previous versions.
|
this license.
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
The precise terms and conditions for copying, distribution and
|
||||||
modification follow.
|
modification follow.
|
||||||
@@ -72,7 +60,7 @@ modification follow.
|
|||||||
|
|
||||||
0. Definitions.
|
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
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
works, such as semiconductor masks.
|
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
|
the Program, the only way you could satisfy both those terms and this
|
||||||
License would be to refrain entirely from conveying the Program.
|
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
|
Notwithstanding any other provision of this License, you have
|
||||||
permission to link or combine any covered work with a work licensed
|
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
|
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,
|
License will continue to apply to the part which is the covered work,
|
||||||
but the special requirements of the GNU Affero General Public License,
|
but the work with which it is combined will remain governed by version
|
||||||
section 13, concerning interaction through a network will apply to the
|
3 of the GNU General Public License.
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
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
|
the GNU Affero General Public License from time to time. Such new versions
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
will be similar in spirit to the present version, but may differ in detail to
|
||||||
address new problems or concerns.
|
address new problems or concerns.
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
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
|
Public License "or any later version" applies to it, you have the
|
||||||
option of following the terms and conditions either of that numbered
|
option of following the terms and conditions either of that numbered
|
||||||
version or of any later version published by the Free Software
|
version or of any later version published by the Free Software
|
||||||
Foundation. If the Program does not specify a version number of the
|
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.
|
by the Free Software Foundation.
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
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
|
public statement of acceptance of a version permanently authorizes you
|
||||||
to choose that version for the Program.
|
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) <year> <name of author>
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Affero General Public License as published
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
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 <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
If your software can interact with users remotely through a computer
|
||||||
notice like this when it starts in an interactive mode:
|
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
|
||||||
<program> Copyright (C) <year> <name of author>
|
interface could display a "Source" link that leads users to an archive
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
of the code. There are many ways you could offer source, and different
|
||||||
This is free software, and you are welcome to redistribute it
|
solutions will be better for different programs; see section 13 for the
|
||||||
under certain conditions; type `show c' for details.
|
specific requirements.
|
||||||
|
|
||||||
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".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
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.
|
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
|
||||||
<https://www.gnu.org/licenses/>.
|
<https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
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
|
|
||||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
|
||||||
|
|||||||
76
README.md
@@ -1,6 +1,6 @@
|
|||||||
<img align="left" width="100" height="100" src="branding/logo/imagur.svg"/>
|
<img align="left" width="100" height="100" src="branding/logo/picsur.svg"/>
|
||||||
|
|
||||||
# Imagur
|
# Picsur
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
@@ -17,13 +17,13 @@ But it does function, so feel free to give it a try.
|
|||||||
|
|
||||||
## Demo
|
## Demo
|
||||||
|
|
||||||
You can view a live demo here: <https://imagur-demo.rubikscraft.nl/>
|
You can view a live demo here: <https://picsur.rubikscraft.nl/>
|
||||||
|
|
||||||
The images are deleted every five minutes, and the max filesize is 16MB. But it should give you an indication of how it works.
|
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
|
## 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
|
## Running
|
||||||
|
|
||||||
@@ -32,37 +32,37 @@ You easily run this service yourself via Docker. Here is an example docker-compo
|
|||||||
```yaml
|
```yaml
|
||||||
version: "3"
|
version: "3"
|
||||||
services:
|
services:
|
||||||
imagur:
|
picsur:
|
||||||
image: ghcr.io/rubikscraft/imagur:latest
|
image: ghcr.io/rubikscraft/picsur:latest
|
||||||
container_name: imagur
|
container_name: picsur
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
environment:
|
environment:
|
||||||
# IMAGUR_HOST: '0.0.0.0'
|
# PICSUR_HOST: '0.0.0.0'
|
||||||
# IMAGUR_PORT: 8080
|
# PICSUR_PORT: 8080
|
||||||
|
|
||||||
IMAGUR_DB_HOST: imagur_postgres
|
PICSUR_DB_HOST: picsur_postgres
|
||||||
# IMAGUR_DB_PORT: 5432
|
# PICSUR_DB_PORT: 5432
|
||||||
# IMAGUR_DB_USER: imagur
|
# PICSUR_DB_USER: picsur
|
||||||
# IMAGUR_DB_PASSWORD: imagur
|
# PICSUR_DB_PASSWORD: picsur
|
||||||
# IMAGUR_DB_NAME: imagur
|
# PICSUR_DB_NAME: picsur
|
||||||
|
|
||||||
# IMAGUR_ADMIN_USERNAME: imagur
|
# PICSUR_ADMIN_USERNAME: picsur
|
||||||
# IMAGUR_ADMIN_PASSWORD: imagur
|
# PICSUR_ADMIN_PASSWORD: picsur
|
||||||
|
|
||||||
# IMAGUR_JWT_SECRET: CHANGE_ME
|
# PICSUR_JWT_SECRET: CHANGE_ME
|
||||||
# IMAGUR_JWT_EXPIRY: 1d
|
# PICSUR_JWT_EXPIRY: 1d
|
||||||
|
|
||||||
# IMAGUR_MAX_FILE_SIZE: 128000000
|
# PICSUR_MAX_FILE_SIZE: 128000000
|
||||||
# IMAGUR_STATIC_FRONTEND_ROOT: "/imagur/frontend/dist"
|
# PICSUR_STATIC_FRONTEND_ROOT: "/picsur/frontend/dist"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
imagur_postgres:
|
picsur_postgres:
|
||||||
image: postgres:11-alpine
|
image: postgres:11-alpine
|
||||||
container_name: imagur_postgres
|
container_name: picsur_postgres
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: imagur
|
POSTGRES_DB: picsur
|
||||||
POSTGRES_PASSWORD: imagur
|
POSTGRES_PASSWORD: picsur
|
||||||
POSTGRES_USER: imagur
|
POSTGRES_USER: picsur
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- db-data:/var/lib/postgresql/data
|
- db-data:/var/lib/postgresql/data
|
||||||
@@ -70,32 +70,8 @@ volumes:
|
|||||||
db-data:
|
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
|
## Api
|
||||||
|
|
||||||
Here is a usually up to date documentation of the api:
|
Here is a usually up to date documentation of the api:
|
||||||
|
|
||||||
[](https://www.postman.com/rubikscraft/workspace/imagur/collection/1841871-78e559b6-4f39-4092-87c3-92fa29547d03)
|
[](https://www.postman.com/rubikscraft/workspace/picsur/collection/1841871-78e559b6-4f39-4092-87c3-92fa29547d03)
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "imagur-backend",
|
"name": "picsur-backend",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"description": "Backend for Imagur",
|
"description": "Backend for Picsur",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"repository": "https://github.com/rubikscraft/Imagur",
|
"repository": "https://github.com/rubikscraft/Picsur",
|
||||||
"author": "Rubikscraft <contact@rubikscraft.nl>",
|
"author": "Rubikscraft <contact@rubikscraft.nl>",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/main.js",
|
"main": "dist/main.js",
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"rxjs": "^7.5.4",
|
"rxjs": "^7.5.4",
|
||||||
"typeorm": "^0.2.44",
|
"typeorm": "^0.2.44",
|
||||||
"imagur-shared": "*"
|
"picsur-shared": "*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nestjs/cli": "^8.2.1",
|
"@nestjs/cli": "^8.2.1",
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import { ImageModule } from './routes/image/imageroute.module';
|
|||||||
import { ServeStaticModule } from '@nestjs/serve-static';
|
import { ServeStaticModule } from '@nestjs/serve-static';
|
||||||
import Config from './env';
|
import Config from './env';
|
||||||
import { DemoManagerModule } from './managers/demo/demomanager.module';
|
import { DemoManagerModule } from './managers/demo/demomanager.module';
|
||||||
import { EUser } from 'imagur-shared/dist/entities/user.entity';
|
import { EUser } from 'picsur-shared/dist/entities/user.entity';
|
||||||
import { EImage } from 'imagur-shared/dist/entities/image.entity';
|
import { EImage } from 'picsur-shared/dist/entities/image.entity';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Module } from '@nestjs/common';
|
|||||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||||
import { ImageDBService } from './imagedb.service';
|
import { ImageDBService } from './imagedb.service';
|
||||||
import { MimesService } from './mimes.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({
|
@Module({
|
||||||
imports: [TypeOrmModule.forFeature([EImage])],
|
imports: [TypeOrmModule.forFeature([EImage])],
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import {
|
|||||||
Fail,
|
Fail,
|
||||||
HasFailed,
|
HasFailed,
|
||||||
HasSuccess,
|
HasSuccess,
|
||||||
} from 'imagur-shared/dist/types';
|
} from 'picsur-shared/dist/types';
|
||||||
import { SupportedMime } from 'imagur-shared/dist/dto/mimes.dto';
|
import { SupportedMime } from 'picsur-shared/dist/dto/mimes.dto';
|
||||||
import { GetCols } from '../collectionutils';
|
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';
|
import { plainToClass } from 'class-transformer';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { Fail, Failable } from 'imagur-shared/dist/types';
|
import { Fail, Failable } from 'picsur-shared/dist/types';
|
||||||
import {
|
import {
|
||||||
FullMime,
|
FullMime,
|
||||||
SupportedAnimMimes,
|
SupportedAnimMimes,
|
||||||
SupportedImageMimes,
|
SupportedImageMimes,
|
||||||
SupportedMime,
|
SupportedMime,
|
||||||
} from 'imagur-shared/dist/dto/mimes.dto';
|
} from 'picsur-shared/dist/dto/mimes.dto';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class MimesService {
|
export class MimesService {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Module } from '@nestjs/common';
|
import { Module } from '@nestjs/common';
|
||||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
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';
|
import { UsersService } from './userdb.service';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ import { Injectable, Logger } from '@nestjs/common';
|
|||||||
import { InjectRepository } from '@nestjs/typeorm';
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
import { plainToClass } from 'class-transformer';
|
import { plainToClass } from 'class-transformer';
|
||||||
import { validate } from 'class-validator';
|
import { validate } from 'class-validator';
|
||||||
import { EUser } from 'imagur-shared/dist/entities/user.entity';
|
import { EUser } from 'picsur-shared/dist/entities/user.entity';
|
||||||
import {
|
import {
|
||||||
AsyncFailable,
|
AsyncFailable,
|
||||||
Fail,
|
Fail,
|
||||||
HasFailed,
|
HasFailed,
|
||||||
HasSuccess,
|
HasSuccess,
|
||||||
} from 'imagur-shared/dist/types';
|
} from 'picsur-shared/dist/types';
|
||||||
import { Repository } from 'typeorm';
|
import { Repository } from 'typeorm';
|
||||||
import { GetCols } from '../collectionutils';
|
import { GetCols } from '../collectionutils';
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
import { validate } from 'class-validator';
|
import { validate } from 'class-validator';
|
||||||
import { FastifyRequest } from 'fastify';
|
import { FastifyRequest } from 'fastify';
|
||||||
import { Multipart, MultipartFields, MultipartFile } from 'fastify-multipart';
|
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 Config from '../env';
|
||||||
import { MultiPartFieldDto, MultiPartFileDto } from '../backenddto/multipart.dto';
|
import { MultiPartFieldDto, MultiPartFileDto } from '../backenddto/multipart.dto';
|
||||||
|
|
||||||
|
|||||||
@@ -4,46 +4,46 @@ const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '../');
|
|||||||
|
|
||||||
const Config = {
|
const Config = {
|
||||||
main: {
|
main: {
|
||||||
host: process.env.IMAGUR_HOST || '0.0.0.0',
|
host: process.env.PICSUR_HOST || '0.0.0.0',
|
||||||
port: process.env.IMAGUR_PORT || 8080,
|
port: process.env.PICSUR_PORT || 8080,
|
||||||
},
|
},
|
||||||
database: {
|
database: {
|
||||||
host: process.env.IMAGUR_DB_HOST ?? 'localhost',
|
host: process.env.PICSUR_DB_HOST ?? 'localhost',
|
||||||
port: process.env.IMAGUR_DB_PORT
|
port: process.env.PICSUR_DB_PORT
|
||||||
? parseInt(process.env.IMAGUR_DB_PORT)
|
? parseInt(process.env.PICSUR_DB_PORT)
|
||||||
: 5432,
|
: 5432,
|
||||||
username: process.env.IMAGUR_DB_USERNAME ?? 'imagur',
|
username: process.env.PICSUR_DB_USERNAME ?? 'picsur',
|
||||||
password: process.env.IMAGUR_DB_PASSWORD ?? 'imagur',
|
password: process.env.PICSUR_DB_PASSWORD ?? 'picsur',
|
||||||
database: process.env.IMAGUR_DB_DATABASE ?? 'imagur',
|
database: process.env.PICSUR_DB_DATABASE ?? 'picsur',
|
||||||
},
|
},
|
||||||
defaultAdmin: {
|
defaultAdmin: {
|
||||||
username: process.env.IMAGUR_ADMIN_USERNAME ?? 'admin',
|
username: process.env.PICSUR_ADMIN_USERNAME ?? 'admin',
|
||||||
password: process.env.IMAGUR_ADMIN_PASSWORD ?? 'admin',
|
password: process.env.PICSUR_ADMIN_PASSWORD ?? 'admin',
|
||||||
},
|
},
|
||||||
jwt: {
|
jwt: {
|
||||||
secret: process.env.IMAGUR_JWT_SECRET ?? 'CHANGE_ME',
|
secret: process.env.PICSUR_JWT_SECRET ?? 'CHANGE_ME',
|
||||||
expiresIn: process.env.IMAGUR_JWT_EXPIRES_IN ?? '1d',
|
expiresIn: process.env.PICSUR_JWT_EXPIRES_IN ?? '1d',
|
||||||
},
|
},
|
||||||
uploadLimits: {
|
uploadLimits: {
|
||||||
fieldNameSize: 128,
|
fieldNameSize: 128,
|
||||||
fieldSize: 1024,
|
fieldSize: 1024,
|
||||||
fields: 16,
|
fields: 16,
|
||||||
files: 16,
|
files: 16,
|
||||||
fileSize: process.env.IMAGUR_MAX_FILE_SIZE
|
fileSize: process.env.PICSUR_MAX_FILE_SIZE
|
||||||
? parseInt(process.env.IMAGUR_MAX_FILE_SIZE)
|
? parseInt(process.env.PICSUR_MAX_FILE_SIZE)
|
||||||
: 128000000,
|
: 128000000,
|
||||||
},
|
},
|
||||||
static: {
|
static: {
|
||||||
packageRoot: packageRoot,
|
packageRoot: packageRoot,
|
||||||
frontendRoot:
|
frontendRoot:
|
||||||
process.env.IMAGUR_STATIC_FRONTEND_ROOT ??
|
process.env.PICSUR_STATIC_FRONTEND_ROOT ??
|
||||||
join(packageRoot, '../frontend/dist'),
|
join(packageRoot, '../frontend/dist'),
|
||||||
backendRoutes: ['i', 'api'],
|
backendRoutes: ['i', 'api'],
|
||||||
},
|
},
|
||||||
demo: {
|
demo: {
|
||||||
enabled: process.env.IMAGUR_DEMO?.toLowerCase() === 'true',
|
enabled: process.env.PICSUR_DEMO?.toLowerCase() === 'true',
|
||||||
interval: process.env.IMAGUR_DEMO_INTERVAL
|
interval: process.env.PICSUR_DEMO_INTERVAL
|
||||||
? parseInt(process.env.IMAGUR_DEMO_INTERVAL)
|
? parseInt(process.env.PICSUR_DEMO_INTERVAL)
|
||||||
: 1000 * 60 * 5,
|
: 1000 * 60 * 5,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { FastifyRequest } from 'fastify';
|
import { FastifyRequest } from 'fastify';
|
||||||
import { FastifyReply } 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)
|
@Catch(HttpException)
|
||||||
export class MainExceptionFilter implements ExceptionFilter {
|
export class MainExceptionFilter implements ExceptionFilter {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
ExecutionContext,
|
ExecutionContext,
|
||||||
CallHandler,
|
CallHandler,
|
||||||
} from '@nestjs/common';
|
} 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';
|
import { Observable, map } from 'rxjs';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { isHash } from 'class-validator';
|
import { isHash } from 'class-validator';
|
||||||
import { fileTypeFromBuffer, FileTypeResult } from 'file-type';
|
import { fileTypeFromBuffer, FileTypeResult } from 'file-type';
|
||||||
import { FullMime } from 'imagur-shared/dist/dto/mimes.dto';
|
import { FullMime } from 'picsur-shared/dist/dto/mimes.dto';
|
||||||
import { EImage } from 'imagur-shared/dist/entities/image.entity';
|
import { EImage } from 'picsur-shared/dist/entities/image.entity';
|
||||||
import { AsyncFailable, Fail, HasFailed } from 'imagur-shared/dist/types';
|
import { AsyncFailable, Fail, HasFailed } from 'picsur-shared/dist/types';
|
||||||
import { ImageDBService } from '../../collections/imagedb/imagedb.service';
|
import { ImageDBService } from '../../collections/imagedb/imagedb.service';
|
||||||
import { MimesService } from '../../collections/imagedb/mimes.service';
|
import { MimesService } from '../../collections/imagedb/mimes.service';
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { plainToClass } from 'class-transformer';
|
import { plainToClass } from 'class-transformer';
|
||||||
import { validate } from 'class-validator';
|
import { validate } from 'class-validator';
|
||||||
import { EUser } from 'imagur-shared/dist/entities/user.entity';
|
import { EUser } from 'picsur-shared/dist/entities/user.entity';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AdminGuard implements CanActivate {
|
export class AdminGuard implements CanActivate {
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ import { LocalAuthGuard } from './local-auth.guard';
|
|||||||
import { AuthService } from './auth.service';
|
import { AuthService } from './auth.service';
|
||||||
import { JwtAuthGuard } from './jwt.guard';
|
import { JwtAuthGuard } from './jwt.guard';
|
||||||
import { AdminGuard } from './admin.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 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')
|
@Controller('api/auth')
|
||||||
export class AuthController {
|
export class AuthController {
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ import { JwtService } from '@nestjs/jwt';
|
|||||||
import * as bcrypt from 'bcrypt';
|
import * as bcrypt from 'bcrypt';
|
||||||
import { plainToClass } from 'class-transformer';
|
import { plainToClass } from 'class-transformer';
|
||||||
import { validate } from 'class-validator';
|
import { validate } from 'class-validator';
|
||||||
import { JwtDataDto } from 'imagur-shared/dist/dto/auth.dto';
|
import { JwtDataDto } from 'picsur-shared/dist/dto/auth.dto';
|
||||||
import { EUser } from 'imagur-shared/dist/entities/user.entity';
|
import { EUser } from 'picsur-shared/dist/entities/user.entity';
|
||||||
import { AsyncFailable, HasFailed, Fail } from 'imagur-shared/dist/types';
|
import { AsyncFailable, HasFailed, Fail } from 'picsur-shared/dist/types';
|
||||||
import { UsersService } from '../../../collections/userdb/userdb.service';
|
import { UsersService } from '../../../collections/userdb/userdb.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { FastifyRequest } from 'fastify';
|
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 {
|
export default interface AuthFasityRequest extends FastifyRequest {
|
||||||
user: EUser;
|
user: EUser;
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import { Injectable, Logger, UnauthorizedException } from '@nestjs/common';
|
|||||||
import { validate } from 'class-validator';
|
import { validate } from 'class-validator';
|
||||||
import { plainToClass } from 'class-transformer';
|
import { plainToClass } from 'class-transformer';
|
||||||
import Config from '../../../env';
|
import Config from '../../../env';
|
||||||
import { JwtDataDto } from 'imagur-shared/dist/dto/auth.dto';
|
import { JwtDataDto } from 'picsur-shared/dist/dto/auth.dto';
|
||||||
import { EUser } from 'imagur-shared/dist/entities/user.entity';
|
import { EUser } from 'picsur-shared/dist/entities/user.entity';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class JwtStrategy extends PassportStrategy(Strategy, 'jwt') {
|
export class JwtStrategy extends PassportStrategy(Strategy, 'jwt') {
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import { Strategy } from 'passport-local';
|
|||||||
import { PassportStrategy } from '@nestjs/passport';
|
import { PassportStrategy } from '@nestjs/passport';
|
||||||
import { Injectable, UnauthorizedException } from '@nestjs/common';
|
import { Injectable, UnauthorizedException } from '@nestjs/common';
|
||||||
import { AuthService } from './auth.service';
|
import { AuthService } from './auth.service';
|
||||||
import { AsyncFailable, HasFailed } from 'imagur-shared/dist/types';
|
import { AsyncFailable, HasFailed } from 'picsur-shared/dist/types';
|
||||||
import { EUser } from 'imagur-shared/dist/entities/user.entity';
|
import { EUser } from 'picsur-shared/dist/entities/user.entity';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class LocalStrategy extends PassportStrategy(Strategy, 'local') {
|
export class LocalStrategy extends PassportStrategy(Strategy, 'local') {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
Res,
|
Res,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { FastifyReply, FastifyRequest } from 'fastify';
|
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 { MultiPart } from '../../decorators/multipart.decorator';
|
||||||
import { ImageManagerService } from '../../managers/imagemanager/imagemanager.service';
|
import { ImageManagerService } from '../../managers/imagemanager/imagemanager.service';
|
||||||
import { ImageUploadDto } from '../../backenddto/imageroute.dto';
|
import { ImageUploadDto } from '../../backenddto/imageroute.dto';
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -8,7 +8,7 @@
|
|||||||
version="1.1"
|
version="1.1"
|
||||||
id="svg5"
|
id="svg5"
|
||||||
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
|
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:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"private": false,
|
"private": false,
|
||||||
"name": "imagur-frontend",
|
"name": "picsur-frontend",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"description": "Frontend for Imagur",
|
"description": "Frontend for Picsur",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"repository": "https://github.com/rubikscraft/Imagur",
|
"repository": "https://github.com/rubikscraft/Picsur",
|
||||||
"author": "Rubikscraft <contact@rubikscraft.nl>",
|
"author": "Rubikscraft <contact@rubikscraft.nl>",
|
||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
"@mui/material": "^5.4.3",
|
"@mui/material": "^5.4.3",
|
||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
"class-validator": "^0.13.2",
|
"class-validator": "^0.13.2",
|
||||||
"imagur-shared": "*",
|
"picsur-shared": "*",
|
||||||
"notistack": "^2.0.3",
|
"notistack": "^2.0.3",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="icon" href="/image/logo/imagur.ico" />
|
<link rel="icon" href="/image/logo/picsur.ico" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
|
||||||
<link rel="stylesheet" href="/css/normalize.css" />
|
<link rel="stylesheet" href="/css/normalize.css" />
|
||||||
<!-- <link rel="stylesheet" href="/css/personal.css" /> -->
|
<!-- <link rel="stylesheet" href="/css/personal.css" /> -->
|
||||||
|
|
||||||
<title>Imagur</title>
|
<title>Picsur</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>Sorry, but you need javascript</noscript>
|
<noscript>Sorry, but you need javascript</noscript>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { AsyncFailable, Fail, HasFailed } from 'imagur-shared/dist/types';
|
import { AsyncFailable, Fail, HasFailed } from 'picsur-shared/dist/types';
|
||||||
import {
|
import {
|
||||||
ApiResponse,
|
ApiResponse,
|
||||||
ApiSuccessResponse,
|
ApiSuccessResponse,
|
||||||
} from 'imagur-shared/dist/dto/api.dto';
|
} from 'picsur-shared/dist/dto/api.dto';
|
||||||
import { validate } from 'class-validator';
|
import { validate } from 'class-validator';
|
||||||
import { ClassConstructor, plainToClass } from 'class-transformer';
|
import { ClassConstructor, plainToClass } from 'class-transformer';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { ImageUploadRequest } from '../frontenddto/imageroute.dto';
|
import { ImageUploadRequest } from '../frontenddto/imageroute.dto';
|
||||||
import ImagurApi from './api';
|
import ImagurApi from './api';
|
||||||
import { EImage } from 'imagur-shared/dist/entities/image.entity';
|
import { EImage } from 'picsur-shared/dist/entities/image.entity';
|
||||||
import { AsyncFailable, HasFailed } from 'imagur-shared/dist/types';
|
import { AsyncFailable, HasFailed } from 'picsur-shared/dist/types';
|
||||||
|
|
||||||
export interface ImageLinks {
|
export interface ImageLinks {
|
||||||
source: string;
|
source: string;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import Centered from '../../components/centered/centered';
|
|||||||
import CircularProgress from '@mui/material/CircularProgress';
|
import CircularProgress from '@mui/material/CircularProgress';
|
||||||
import { useLocation, useNavigate } from 'react-router-dom';
|
import { useLocation, useNavigate } from 'react-router-dom';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { HasFailed } from 'imagur-shared/dist/types';
|
import { HasFailed } from 'picsur-shared/dist/types';
|
||||||
import ImagesApi from '../../api/images';
|
import ImagesApi from '../../api/images';
|
||||||
import useError from '../../lib/useerror';
|
import useError from '../../lib/useerror';
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import Debounce from '../../lib/debounce';
|
|||||||
import Centered from '../../components/centered/centered';
|
import Centered from '../../components/centered/centered';
|
||||||
|
|
||||||
import './view.scoped.scss';
|
import './view.scoped.scss';
|
||||||
import { HasFailed } from 'imagur-shared/dist/types';
|
import { HasFailed } from 'picsur-shared/dist/types';
|
||||||
import useError from '../../lib/useerror';
|
import useError from '../../lib/useerror';
|
||||||
|
|
||||||
// Stupid names go brrr
|
// Stupid names go brrr
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"private": false,
|
"private": false,
|
||||||
"name": "imagur-shared",
|
"name": "picsur-shared",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"description": "Shared libraries for Imagur",
|
"description": "Shared libraries for Picsur",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"repository": "https://github.com/rubikscraft/Imagur",
|
"repository": "https://github.com/rubikscraft/Picsur",
|
||||||
"author": "Rubikscraft <contact@rubikscraft.nl>",
|
"author": "Rubikscraft <contact@rubikscraft.nl>",
|
||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ VERSION=$(cat ../package.json | grep version | head -1 | awk -F: '{ print $2 }'
|
|||||||
|
|
||||||
echo "Building version $VERSION"
|
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 "Done"
|
||||||
|
|
||||||
echo "Pushing to ghcr.io"
|
echo "Pushing to ghcr.io"
|
||||||
|
|
||||||
docker push "ghcr.io/rubikscraft/imagur:$VERSION"
|
docker push "ghcr.io/rubikscraft/picsur:$VERSION"
|
||||||
docker push "ghcr.io/rubikscraft/imagur:latest"
|
docker push "ghcr.io/rubikscraft/picsur:latest"
|
||||||
|
|
||||||
echo "Done"
|
echo "Done"
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ services:
|
|||||||
devdb:
|
devdb:
|
||||||
image: postgres:11-alpine
|
image: postgres:11-alpine
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: imagur
|
POSTGRES_DB: picsur
|
||||||
POSTGRES_PASSWORD: imagur
|
POSTGRES_PASSWORD: picsur
|
||||||
POSTGRES_USER: imagur
|
POSTGRES_USER: picsur
|
||||||
logging:
|
logging:
|
||||||
driver: "none"
|
driver: "none"
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
@@ -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:
|
|
||||||
@@ -3,18 +3,18 @@ FROM node:16-alpine
|
|||||||
# Sorry for the humongous docker container this generates
|
# Sorry for the humongous docker container this generates
|
||||||
# Maybe I'll trim it down some day
|
# Maybe I'll trim it down some day
|
||||||
|
|
||||||
ADD . /imagur
|
ADD . /picsur
|
||||||
WORKDIR /imagur
|
WORKDIR /picsur
|
||||||
|
|
||||||
RUN yarn install --frozen-lockfile
|
RUN yarn install --frozen-lockfile
|
||||||
|
|
||||||
WORKDIR /imagur/shared
|
WORKDIR /picsur/shared
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
WORKDIR /imagur/frontend
|
WORKDIR /picsur/frontend
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
WORKDIR /imagur/backend
|
WORKDIR /picsur/backend
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
CMD ["yarn", "start:prod"]
|
CMD ["yarn", "start:prod"]
|
||||||
38
support/picsur.docker-compose.yml
Normal file
@@ -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:
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
"path": "frontend"
|
"path": "frontend"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Imagur-Monorepo",
|
"name": "Picsur-Monorepo",
|
||||||
"path": "."
|
"path": "."
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||