From 3a8576a28033fdaad6ee69bfee098d5004f5f602 Mon Sep 17 00:00:00 2001 From: lesion Date: Fri, 22 Mar 2019 00:16:12 +0100 Subject: [PATCH] fix dockerization --- .env | 18 +- .gitignore | 9 +- README.md | 5 +- app/config/config.json | 17 +- app/emails/register/html.pug | 4 +- app/mail.js | 13 +- docker-compose.yml | 13 +- init.sql | 1088 +++++++++++++++++++--------------- locales/en.json | 4 +- locales/es.json | 4 +- locales/zh.json | 4 +- 11 files changed, 645 insertions(+), 534 deletions(-) diff --git a/.env b/.env index 10d554a7..e4958174 100644 --- a/.env +++ b/.env @@ -1,13 +1,21 @@ NODE_ENV=production + +# complete url (use https here!) BASE_URL=http://localhost:12300 +# node server will listen here +PORT=12300 + +# your instance's name and description TITLE=Gancio -DESCRIPTION=diocane -ADMIN_EMAIL=admin@example.com +DESCRIPTION="description" -SMTP_HOST=mail.example.com -SMTP_USER=admin@example.com -SMTP_PASS=secret +# where emails comes from +ADMIN_EMAIL=admin@example.org +SMTP_HOST=mail.example.org +SMTP_USER=admin@example.org +SMTP_PASS=password +# please put a random string here SECRET=secret diff --git a/.gitignore b/.gitignore index e52596d5..687e0f08 100644 --- a/.gitignore +++ b/.gitignore @@ -2,12 +2,11 @@ node_modules client/dist -# local env files -.env.local -.env.*.local -config.development.js -config.production.js +uploads + +# local env files +.env.production # Log files npm-debug.log* diff --git a/README.md b/README.md index be22cd47..f5d43357 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ We provide a docker way to run **gancio**. ``` git clone https://git.lattuga.net/lesion/gancio.git cd gancio + +# copy .env into .env.production and edit it docker-compose up -d ``` @@ -31,5 +33,4 @@ cd client yarn # run front-end in development mode yarn dev -``` - +``` \ No newline at end of file diff --git a/app/config/config.json b/app/config/config.json index 5a68a3e1..72743a29 100644 --- a/app/config/config.json +++ b/app/config/config.json @@ -4,18 +4,11 @@ "dialect": "sqlite", "logging": false }, - "test": { - "username": "root", - "password": null, - "database": "database_test", - "host": "127.0.0.1", - "dialect": "mysql" - }, "production": { - "username": "root", - "password": null, - "database": "database_production", - "host": "127.0.0.1", - "dialect": "mysql" + "username": "docker", + "password": "docker", + "database": "gancio", + "host": "db", + "dialect": "postgres" } } diff --git a/app/emails/register/html.pug b/app/emails/register/html.pug index de38b8ed..8cdb9def 100644 --- a/app/emails/register/html.pug +++ b/app/emails/register/html.pug @@ -1,6 +1,6 @@ p= t('registration_email') ---- -small #{config.title} +hr +small #{config.title} / #{config.description} br small #{config.baseurl} \ No newline at end of file diff --git a/app/mail.js b/app/mail.js index 911eba02..4f38ee11 100644 --- a/app/mail.js +++ b/app/mail.js @@ -6,7 +6,6 @@ moment.locale('it') const mail = { send (addresses, template, locals) { - locals.locale = config.locale const email = new Email({ views: { root: path.join(__dirname, 'emails') }, juice: true, @@ -20,7 +19,10 @@ const mail = { from: `${config.title} <${config.smtp.auth.user}>` }, send: true, - i18n: {}, + i18n: { + locales: ['en', 'es', 'it'], + defaultLocale: config.locale + }, transport: config.smtp }) return email.send({ @@ -29,7 +31,12 @@ const mail = { to: addresses, bcc: config.admin }, - locals: { ...locals, config, datetime: datetime => moment(datetime).format('ddd, D MMMM HH:mm') } + locals: { + ...locals, + locale: config.locale, + config, + datetime: datetime => moment(datetime).format('ddd, D MMMM HH:mm') + } }) } } diff --git a/docker-compose.yml b/docker-compose.yml index 8838caa8..1ae0558a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,28 +5,21 @@ services: db: image: 'postgres:latest' environment: - POSTGRES_PASSWORD: 12345 - POSTGRES_USER: postgres + POSTGRES_PASSWORD: docker + POSTGRES_USER: docker POSTGRES_DB: gancio volumes: - ./init.sql:/docker-entrypoint-initdb.d/init.sql - ./postgres:/var/lib/postgresql/data app: - env_file: .env + env_file: .env.production build: . ports: - '12300:12300' volumes: - ./app/uploads:/usr/src/app/app/uploads - environment: - PORT: 12300 - DB_HOST: db - DB_PASS: 12345 - DB_USER: postgres - DB_NAME: gancio - links: - db diff --git a/init.sql b/init.sql index bd3f7c60..81e8d7f1 100644 --- a/init.sql +++ b/init.sql @@ -1,492 +1,596 @@ --- --- PostgreSQL database dump --- - --- Dumped from database version 11.2 (Debian 11.2-1.pgdg90+1) --- Dumped by pg_dump version 11.2 (Debian 11.2-1.pgdg90+1) - -SET statement_timeout = 0; -SET lock_timeout = 0; -SET idle_in_transaction_session_timeout = 0; -SET client_encoding = 'UTF8'; -SET standard_conforming_strings = on; -SELECT pg_catalog.set_config('search_path', '', false); -SET check_function_bodies = false; -SET client_min_messages = warning; -SET row_security = off; - -SET default_tablespace = ''; - -SET default_with_oids = false; - --- --- Name: comments; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.comments ( - id integer NOT NULL, - activitypub_id integer, - author character varying(255), - text character varying(255), - "createdAt" timestamp with time zone NOT NULL, - "updatedAt" timestamp with time zone NOT NULL, - "eventId" integer -); - - -ALTER TABLE public.comments OWNER TO postgres; - --- --- Name: comments_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public.comments_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public.comments_id_seq OWNER TO postgres; - --- --- Name: comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public.comments_id_seq OWNED BY public.comments.id; - - --- --- Name: events; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.events ( - id integer NOT NULL, - title character varying(255), - description character varying(255), - multidate boolean, - start_datetime timestamp with time zone, - end_datetime timestamp with time zone, - image_path character varying(255), - activitypub_id integer, - "createdAt" timestamp with time zone NOT NULL, - "updatedAt" timestamp with time zone NOT NULL, - "userId" integer, - "placeId" integer -); - - -ALTER TABLE public.events OWNER TO postgres; - --- --- Name: events_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public.events_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public.events_id_seq OWNER TO postgres; - --- --- Name: events_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public.events_id_seq OWNED BY public.events.id; - - --- --- Name: places; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.places ( - id integer NOT NULL, - name character varying(255), - address character varying(255), - "createdAt" timestamp with time zone NOT NULL, - "updatedAt" timestamp with time zone NOT NULL -); - - -ALTER TABLE public.places OWNER TO postgres; - --- --- Name: places_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public.places_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public.places_id_seq OWNER TO postgres; - --- --- Name: places_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public.places_id_seq OWNED BY public.places.id; - - --- --- Name: subscriptions; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.subscriptions ( - id integer NOT NULL, - filters json, - mail text, - send_on_add boolean, - send_reminder integer, - "createdAt" timestamp with time zone NOT NULL, - "updatedAt" timestamp with time zone NOT NULL -); - - -ALTER TABLE public.subscriptions OWNER TO postgres; - --- --- Name: subscriptions_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public.subscriptions_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public.subscriptions_id_seq OWNER TO postgres; - --- --- Name: subscriptions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public.subscriptions_id_seq OWNED BY public.subscriptions.id; - - --- --- Name: tagEvent; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public."tagEvent" ( - "createdAt" timestamp with time zone NOT NULL, - "updatedAt" timestamp with time zone NOT NULL, - "eventId" integer NOT NULL, - "tagTag" character varying(255) NOT NULL -); - - -ALTER TABLE public."tagEvent" OWNER TO postgres; - --- --- Name: tags; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.tags ( - tag character varying(255) NOT NULL, - color character varying(255), - "createdAt" timestamp with time zone NOT NULL, - "updatedAt" timestamp with time zone NOT NULL -); - - -ALTER TABLE public.tags OWNER TO postgres; - --- --- Name: users; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.users ( - id integer NOT NULL, - email character varying(255) NOT NULL, - description text, - password character varying(255), - is_admin boolean, - is_active boolean, - mastodon_instance character varying(255), - mastodon_auth json, - "createdAt" timestamp with time zone NOT NULL, - "updatedAt" timestamp with time zone NOT NULL -); - - -ALTER TABLE public.users OWNER TO postgres; - --- --- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public.users_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public.users_id_seq OWNER TO postgres; - --- --- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id; - - --- --- Name: comments id; Type: DEFAULT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.comments ALTER COLUMN id SET DEFAULT nextval('public.comments_id_seq'::regclass); - - --- --- Name: events id; Type: DEFAULT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.events ALTER COLUMN id SET DEFAULT nextval('public.events_id_seq'::regclass); - - --- --- Name: places id; Type: DEFAULT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.places ALTER COLUMN id SET DEFAULT nextval('public.places_id_seq'::regclass); - - --- --- Name: subscriptions id; Type: DEFAULT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.subscriptions ALTER COLUMN id SET DEFAULT nextval('public.subscriptions_id_seq'::regclass); - - --- --- Name: users id; Type: DEFAULT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass); - - --- --- Data for Name: comments; Type: TABLE DATA; Schema: public; Owner: postgres --- - -COPY public.comments (id, activitypub_id, author, text, "createdAt", "updatedAt", "eventId") FROM stdin; -\. - - --- --- Data for Name: events; Type: TABLE DATA; Schema: public; Owner: postgres --- - -COPY public.events (id, title, description, multidate, start_datetime, end_datetime, image_path, activitypub_id, "createdAt", "updatedAt", "userId", "placeId") FROM stdin; -\. - - --- --- Data for Name: places; Type: TABLE DATA; Schema: public; Owner: postgres --- - -COPY public.places (id, name, address, "createdAt", "updatedAt") FROM stdin; -\. - - --- --- Data for Name: subscriptions; Type: TABLE DATA; Schema: public; Owner: postgres --- - -COPY public.subscriptions (id, filters, mail, send_on_add, send_reminder, "createdAt", "updatedAt") FROM stdin; -\. - - --- --- Data for Name: tagEvent; Type: TABLE DATA; Schema: public; Owner: postgres --- - -COPY public."tagEvent" ("createdAt", "updatedAt", "eventId", "tagTag") FROM stdin; -\. - - --- --- Data for Name: tags; Type: TABLE DATA; Schema: public; Owner: postgres --- - -COPY public.tags (tag, color, "createdAt", "updatedAt") FROM stdin; -\. - - --- --- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: postgres --- - -COPY public.users (id, email, description, password, is_admin, is_active, mastodon_instance, mastodon_auth, "createdAt", "updatedAt") FROM stdin; -\. - - --- --- Name: comments_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres --- - -SELECT pg_catalog.setval('public.comments_id_seq', 1, false); - - --- --- Name: events_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres --- - -SELECT pg_catalog.setval('public.events_id_seq', 1, false); - - --- --- Name: places_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres --- - -SELECT pg_catalog.setval('public.places_id_seq', 1, false); - - --- --- Name: subscriptions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres --- - -SELECT pg_catalog.setval('public.subscriptions_id_seq', 1, false); - - --- --- Name: users_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres --- - -SELECT pg_catalog.setval('public.users_id_seq', 1, false); - - --- --- Name: comments comments_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.comments - ADD CONSTRAINT comments_pkey PRIMARY KEY (id); - - --- --- Name: events events_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.events - ADD CONSTRAINT events_pkey PRIMARY KEY (id); - - --- --- Name: places places_name_key; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.places - ADD CONSTRAINT places_name_key UNIQUE (name); - - --- --- Name: places places_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.places - ADD CONSTRAINT places_pkey PRIMARY KEY (id); - - --- --- Name: subscriptions subscriptions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.subscriptions - ADD CONSTRAINT subscriptions_pkey PRIMARY KEY (id); - - --- --- Name: tagEvent tagEvent_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."tagEvent" - ADD CONSTRAINT "tagEvent_pkey" PRIMARY KEY ("eventId", "tagTag"); - - --- --- Name: tags tags_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.tags - ADD CONSTRAINT tags_pkey PRIMARY KEY (tag); - - --- --- Name: users users_email_key; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.users - ADD CONSTRAINT users_email_key UNIQUE (email); - - --- --- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.users - ADD CONSTRAINT users_pkey PRIMARY KEY (id); - - --- --- Name: comments comments_eventId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.comments - ADD CONSTRAINT "comments_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES public.events(id) ON UPDATE CASCADE ON DELETE SET NULL; - - --- --- Name: events events_placeId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.events - ADD CONSTRAINT "events_placeId_fkey" FOREIGN KEY ("placeId") REFERENCES public.places(id) ON UPDATE CASCADE ON DELETE SET NULL; - - --- --- Name: events events_userId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.events - ADD CONSTRAINT "events_userId_fkey" FOREIGN KEY ("userId") REFERENCES public.users(id) ON UPDATE CASCADE ON DELETE SET NULL; - - --- --- Name: tagEvent tagEvent_eventId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."tagEvent" - ADD CONSTRAINT "tagEvent_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES public.events(id) ON UPDATE CASCADE ON DELETE CASCADE; - - --- --- Name: tagEvent tagEvent_tagTag_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public."tagEvent" - ADD CONSTRAINT "tagEvent_tagTag_fkey" FOREIGN KEY ("tagTag") REFERENCES public.tags(tag) ON UPDATE CASCADE ON DELETE CASCADE; - - --- --- PostgreSQL database dump complete --- - +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 11.2 (Debian 11.2-1.pgdg90+1) +-- Dumped by pg_dump version 11.2 (Debian 11.2-1.pgdg90+1) + +SET statement_timeout = 0; +SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET client_min_messages = warning; +SET row_security = off; + +-- +-- Name: enum_EventNotifications_status; Type: TYPE; Schema: public; Owner: docker +-- + +CREATE TYPE public."enum_EventNotifications_status" AS ENUM ( + 'new', + 'sent', + 'error' +); + + +ALTER TYPE public."enum_EventNotifications_status" OWNER TO docker; + +-- +-- Name: enum_notifications_type; Type: TYPE; Schema: public; Owner: docker +-- + +CREATE TYPE public.enum_notifications_type AS ENUM ( + 'mail', + 'admin_email', + 'mastodon' +); + + +ALTER TYPE public.enum_notifications_type OWNER TO docker; + +SET default_tablespace = ''; + +SET default_with_oids = false; + +-- +-- Name: EventNotifications; Type: TABLE; Schema: public; Owner: docker +-- + +CREATE TABLE public."EventNotifications" ( + status public."enum_EventNotifications_status" DEFAULT 'new'::public."enum_EventNotifications_status", + "createdAt" timestamp with time zone NOT NULL, + "updatedAt" timestamp with time zone NOT NULL, + "eventId" integer NOT NULL, + "notificationId" integer NOT NULL +); + + +ALTER TABLE public."EventNotifications" OWNER TO docker; + +-- +-- Name: comments; Type: TABLE; Schema: public; Owner: docker +-- + +CREATE TABLE public.comments ( + id integer NOT NULL, + activitypub_id integer, + author character varying(255), + text character varying(255), + "createdAt" timestamp with time zone NOT NULL, + "updatedAt" timestamp with time zone NOT NULL, + "eventId" integer +); + + +ALTER TABLE public.comments OWNER TO docker; + +-- +-- Name: comments_id_seq; Type: SEQUENCE; Schema: public; Owner: docker +-- + +CREATE SEQUENCE public.comments_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +ALTER TABLE public.comments_id_seq OWNER TO docker; + +-- +-- Name: comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: docker +-- + +ALTER SEQUENCE public.comments_id_seq OWNED BY public.comments.id; + + +-- +-- Name: events; Type: TABLE; Schema: public; Owner: docker +-- + +CREATE TABLE public.events ( + id integer NOT NULL, + title character varying(255), + description text, + multidate boolean, + start_datetime timestamp with time zone, + end_datetime timestamp with time zone, + image_path character varying(255), + activitypub_id integer, + is_visible boolean, + "createdAt" timestamp with time zone NOT NULL, + "updatedAt" timestamp with time zone NOT NULL, + "userId" integer, + "placeId" integer +); + + +ALTER TABLE public.events OWNER TO docker; + +-- +-- Name: events_id_seq; Type: SEQUENCE; Schema: public; Owner: docker +-- + +CREATE SEQUENCE public.events_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +ALTER TABLE public.events_id_seq OWNER TO docker; + +-- +-- Name: events_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: docker +-- + +ALTER SEQUENCE public.events_id_seq OWNED BY public.events.id; + + +-- +-- Name: notifications; Type: TABLE; Schema: public; Owner: docker +-- + +CREATE TABLE public.notifications ( + id integer NOT NULL, + filters json, + email character varying(255), + remove_code character varying(255), + type public.enum_notifications_type, + "createdAt" timestamp with time zone NOT NULL, + "updatedAt" timestamp with time zone NOT NULL +); + + +ALTER TABLE public.notifications OWNER TO docker; + +-- +-- Name: notifications_id_seq; Type: SEQUENCE; Schema: public; Owner: docker +-- + +CREATE SEQUENCE public.notifications_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +ALTER TABLE public.notifications_id_seq OWNER TO docker; + +-- +-- Name: notifications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: docker +-- + +ALTER SEQUENCE public.notifications_id_seq OWNED BY public.notifications.id; + + +-- +-- Name: places; Type: TABLE; Schema: public; Owner: docker +-- + +CREATE TABLE public.places ( + id integer NOT NULL, + name character varying(255), + address character varying(255), + "createdAt" timestamp with time zone NOT NULL, + "updatedAt" timestamp with time zone NOT NULL +); + + +ALTER TABLE public.places OWNER TO docker; + +-- +-- Name: places_id_seq; Type: SEQUENCE; Schema: public; Owner: docker +-- + +CREATE SEQUENCE public.places_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +ALTER TABLE public.places_id_seq OWNER TO docker; + +-- +-- Name: places_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: docker +-- + +ALTER SEQUENCE public.places_id_seq OWNED BY public.places.id; + + +-- +-- Name: settings; Type: TABLE; Schema: public; Owner: docker +-- + +CREATE TABLE public.settings ( + key character varying(255) NOT NULL, + value json, + "createdAt" timestamp with time zone NOT NULL, + "updatedAt" timestamp with time zone NOT NULL +); + + +ALTER TABLE public.settings OWNER TO docker; + +-- +-- Name: tagEvent; Type: TABLE; Schema: public; Owner: docker +-- + +CREATE TABLE public."tagEvent" ( + "createdAt" timestamp with time zone NOT NULL, + "updatedAt" timestamp with time zone NOT NULL, + "eventId" integer NOT NULL, + "tagTag" character varying(255) NOT NULL +); + + +ALTER TABLE public."tagEvent" OWNER TO docker; + +-- +-- Name: tags; Type: TABLE; Schema: public; Owner: docker +-- + +CREATE TABLE public.tags ( + tag character varying(255) NOT NULL, + color character varying(255), + "createdAt" timestamp with time zone NOT NULL, + "updatedAt" timestamp with time zone NOT NULL +); + + +ALTER TABLE public.tags OWNER TO docker; + +-- +-- Name: users; Type: TABLE; Schema: public; Owner: docker +-- + +CREATE TABLE public.users ( + id integer NOT NULL, + email character varying(255) NOT NULL, + description text, + password character varying(255), + recover_code character varying(255), + is_admin boolean, + is_active boolean, + mastodon_auth json, + "createdAt" timestamp with time zone NOT NULL, + "updatedAt" timestamp with time zone NOT NULL +); + + +ALTER TABLE public.users OWNER TO docker; + +-- +-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: docker +-- + +CREATE SEQUENCE public.users_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +ALTER TABLE public.users_id_seq OWNER TO docker; + +-- +-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: docker +-- + +ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id; + + +-- +-- Name: comments id; Type: DEFAULT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public.comments ALTER COLUMN id SET DEFAULT nextval('public.comments_id_seq'::regclass); + + +-- +-- Name: events id; Type: DEFAULT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public.events ALTER COLUMN id SET DEFAULT nextval('public.events_id_seq'::regclass); + + +-- +-- Name: notifications id; Type: DEFAULT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public.notifications ALTER COLUMN id SET DEFAULT nextval('public.notifications_id_seq'::regclass); + + +-- +-- Name: places id; Type: DEFAULT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public.places ALTER COLUMN id SET DEFAULT nextval('public.places_id_seq'::regclass); + + +-- +-- Name: users id; Type: DEFAULT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass); + + +-- +-- Data for Name: EventNotifications; Type: TABLE DATA; Schema: public; Owner: docker +-- + +COPY public."EventNotifications" (status, "createdAt", "updatedAt", "eventId", "notificationId") FROM stdin; +\. + + +-- +-- Data for Name: comments; Type: TABLE DATA; Schema: public; Owner: docker +-- + +COPY public.comments (id, activitypub_id, author, text, "createdAt", "updatedAt", "eventId") FROM stdin; +\. + + +-- +-- Data for Name: events; Type: TABLE DATA; Schema: public; Owner: docker +-- + +COPY public.events (id, title, description, multidate, start_datetime, end_datetime, image_path, activitypub_id, is_visible, "createdAt", "updatedAt", "userId", "placeId") FROM stdin; +\. + + +-- +-- Data for Name: notifications; Type: TABLE DATA; Schema: public; Owner: docker +-- + +COPY public.notifications (id, filters, email, remove_code, type, "createdAt", "updatedAt") FROM stdin; +\. + + +-- +-- Data for Name: places; Type: TABLE DATA; Schema: public; Owner: docker +-- + +COPY public.places (id, name, address, "createdAt", "updatedAt") FROM stdin; +\. + + +-- +-- Data for Name: settings; Type: TABLE DATA; Schema: public; Owner: docker +-- + +COPY public.settings (key, value, "createdAt", "updatedAt") FROM stdin; +\. + + +-- +-- Data for Name: tagEvent; Type: TABLE DATA; Schema: public; Owner: docker +-- + +COPY public."tagEvent" ("createdAt", "updatedAt", "eventId", "tagTag") FROM stdin; +\. + + +-- +-- Data for Name: tags; Type: TABLE DATA; Schema: public; Owner: docker +-- + +COPY public.tags (tag, color, "createdAt", "updatedAt") FROM stdin; +\. + + +-- +-- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: docker +-- + +COPY public.users (id, email, description, password, recover_code, is_admin, is_active, mastodon_auth, "createdAt", "updatedAt") FROM stdin; +\. + + +-- +-- Name: comments_id_seq; Type: SEQUENCE SET; Schema: public; Owner: docker +-- + +SELECT pg_catalog.setval('public.comments_id_seq', 1, false); + + +-- +-- Name: events_id_seq; Type: SEQUENCE SET; Schema: public; Owner: docker +-- + +SELECT pg_catalog.setval('public.events_id_seq', 1, false); + + +-- +-- Name: notifications_id_seq; Type: SEQUENCE SET; Schema: public; Owner: docker +-- + +SELECT pg_catalog.setval('public.notifications_id_seq', 1, false); + + +-- +-- Name: places_id_seq; Type: SEQUENCE SET; Schema: public; Owner: docker +-- + +SELECT pg_catalog.setval('public.places_id_seq', 1, false); + + +-- +-- Name: users_id_seq; Type: SEQUENCE SET; Schema: public; Owner: docker +-- + +SELECT pg_catalog.setval('public.users_id_seq', 1, false); + + +-- +-- Name: EventNotifications EventNotifications_pkey; Type: CONSTRAINT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public."EventNotifications" + ADD CONSTRAINT "EventNotifications_pkey" PRIMARY KEY ("eventId", "notificationId"); + + +-- +-- Name: comments comments_pkey; Type: CONSTRAINT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public.comments + ADD CONSTRAINT comments_pkey PRIMARY KEY (id); + + +-- +-- Name: events events_pkey; Type: CONSTRAINT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public.events + ADD CONSTRAINT events_pkey PRIMARY KEY (id); + + +-- +-- Name: notifications notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public.notifications + ADD CONSTRAINT notifications_pkey PRIMARY KEY (id); + + +-- +-- Name: places places_name_key; Type: CONSTRAINT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public.places + ADD CONSTRAINT places_name_key UNIQUE (name); + + +-- +-- Name: places places_pkey; Type: CONSTRAINT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public.places + ADD CONSTRAINT places_pkey PRIMARY KEY (id); + + +-- +-- Name: settings settings_pkey; Type: CONSTRAINT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public.settings + ADD CONSTRAINT settings_pkey PRIMARY KEY (key); + + +-- +-- Name: tagEvent tagEvent_pkey; Type: CONSTRAINT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public."tagEvent" + ADD CONSTRAINT "tagEvent_pkey" PRIMARY KEY ("eventId", "tagTag"); + + +-- +-- Name: tags tags_pkey; Type: CONSTRAINT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public.tags + ADD CONSTRAINT tags_pkey PRIMARY KEY (tag); + + +-- +-- Name: users users_email_key; Type: CONSTRAINT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public.users + ADD CONSTRAINT users_email_key UNIQUE (email); + + +-- +-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public.users + ADD CONSTRAINT users_pkey PRIMARY KEY (id); + + +-- +-- Name: EventNotifications EventNotifications_eventId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public."EventNotifications" + ADD CONSTRAINT "EventNotifications_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES public.events(id) ON UPDATE CASCADE ON DELETE CASCADE; + + +-- +-- Name: EventNotifications EventNotifications_notificationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public."EventNotifications" + ADD CONSTRAINT "EventNotifications_notificationId_fkey" FOREIGN KEY ("notificationId") REFERENCES public.notifications(id) ON UPDATE CASCADE ON DELETE CASCADE; + + +-- +-- Name: comments comments_eventId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public.comments + ADD CONSTRAINT "comments_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES public.events(id) ON UPDATE CASCADE ON DELETE SET NULL; + + +-- +-- Name: events events_placeId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public.events + ADD CONSTRAINT "events_placeId_fkey" FOREIGN KEY ("placeId") REFERENCES public.places(id) ON UPDATE CASCADE ON DELETE SET NULL; + + +-- +-- Name: events events_userId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public.events + ADD CONSTRAINT "events_userId_fkey" FOREIGN KEY ("userId") REFERENCES public.users(id) ON UPDATE CASCADE ON DELETE SET NULL; + + +-- +-- Name: tagEvent tagEvent_eventId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public."tagEvent" + ADD CONSTRAINT "tagEvent_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES public.events(id) ON UPDATE CASCADE ON DELETE CASCADE; + + +-- +-- Name: tagEvent tagEvent_tagTag_fkey; Type: FK CONSTRAINT; Schema: public; Owner: docker +-- + +ALTER TABLE ONLY public."tagEvent" + ADD CONSTRAINT "tagEvent_tagTag_fkey" FOREIGN KEY ("tagTag") REFERENCES public.tags(tag) ON UPDATE CASCADE ON DELETE CASCADE; + + +-- +-- PostgreSQL database dump complete +-- + diff --git a/locales/en.json b/locales/en.json index 466ecd18..9ecdb844 100644 --- a/locales/en.json +++ b/locales/en.json @@ -1,4 +1,6 @@ { "registration_email": "Ciao, la tua registrazione sarĂ  confermata nei prossimi giorni. Riceverai una conferma non temere.", - "confirm_email": "confirm_email" + "confirm_email": "confirm_email", + "recover_email": "recover_email", + "press here": "press here" } \ No newline at end of file diff --git a/locales/es.json b/locales/es.json index 4be32491..b6bb56df 100644 --- a/locales/es.json +++ b/locales/es.json @@ -1,4 +1,6 @@ { "registration_email": "registration_email", - "confirm_email": "confirm_email" + "confirm_email": "confirm_email", + "recover_email": "recover_email", + "press here": "press here" } \ No newline at end of file diff --git a/locales/zh.json b/locales/zh.json index 4be32491..b6bb56df 100644 --- a/locales/zh.json +++ b/locales/zh.json @@ -1,4 +1,6 @@ { "registration_email": "registration_email", - "confirm_email": "confirm_email" + "confirm_email": "confirm_email", + "recover_email": "recover_email", + "press here": "press here" } \ No newline at end of file