# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
openssl ecparam -genkey -name secp384r1 -out server.key
from flask import Flask | |
from flask import request | |
from flask import jsonify | |
from flask import send_from_directory | |
app = Flask(__name__) | |
@app.route('/', defaults=dict(filename=None)) |
from django.views.decorators.csrf import csrf_exempt | |
@csrf_exempt | |
def reverse_proxy(request): | |
""" | |
Reverse proxy for a remote service. | |
""" | |
path = request.get_full_path() | |
#Optionally, rewrite the path to fit whatever service we're proxying to. | |
from starlette.applications import Starlette | |
from starlette.responses import StreamingResponse | |
from starlette.requests import Request | |
from starlette.routing import Route | |
from pathlib import Path | |
from typing import IO, Generator | |
""" | |
Stream a file, in this case an mp4 video, supporting range-requests using starlette |
// By overriding a subset of the interfaces from the `@types/react` package, | |
// we're able to strictly type check what our JSX must look like and avoid inheriting from HTML elements (since they're not valid in our environment for instance). | |
import * as React from 'react'; | |
declare module 'react' { | |
namespace JSX { | |
interface ElementChildrenAttribute { | |
children: {}; | |
} |
If we have the following structure in our application:
- 📁 application_folder_name
- 📄 index.php
- 📄 handle_form.php
- 📄 main.js
And we fill our index.php
with the following content just to get a basic website with a form working. You should be able to run this through a php-server of your choice.
const exec = require('child_process').exec; | |
const fs = require('fs'); | |
const path = require('path'); | |
var pathPrefix = process.argv.slice(2)[0]; | |
// find the styles css file | |
const files = getAllFiles(`./${pathPrefix}/`, '.css'); | |
let data = []; |
generator client { | |
provider = "prisma-client-js" | |
previewFeatures = ["transactionApi"] | |
} | |
datasource db { | |
provider = "postgresql" | |
url = env("DATABASE_URL") | |
} |
The connection failed because by default psql
connects over UNIX sockets using peer
authentication, that requires the current UNIX user to have the same user name as psql
. So you will have to create the UNIX user postgres
and then login as postgres
or use sudo -u postgres psql database-name
for accessing the database (and psql
should not ask for a password).
If you cannot or do not want to create the UNIX user, like if you just want to connect to your database for ad hoc queries, forcing a socket connection using psql --host=localhost --dbname=database-name --username=postgres
(as pointed out by @meyerson answer) will solve your immediate problem.
But if you intend to force password authentication over Unix sockets instead of the peer method, try changing the following pg_hba.conf
* line:
from
input, textarea { | |
outline: none; | |
border:1px solid #ccc !important; | |
box-shadow:none !important; | |
} |