environnement complet autonome, révision complete de la méthode, ajout de configuration
Some checks failed
Cadoles/hydra-sql/pipeline/head There was a failure building this commit
Cadoles/hydra-sql/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
2022-12-09 17:31:07 +01:00
parent b451566452
commit 6fc004a549
110 changed files with 1829 additions and 372 deletions

View File

@ -0,0 +1,18 @@
{
"client_id": "oidc-test",
"client_name": "OIDC Test",
"client_secret": "oidc-test-123456",
"grant_types": [
"authorization_code",
"refresh_token"
],
"jwks": {},
"metadata": {},
"token_endpoint_auth_method": "client_secret_basic",
"post_logout_redirect_uris": ["http://localhost:8000"],
"redirect_uris": ["http://localhost:8000/oauth2/callback"],
"response_types": [
"code"
],
"scope": "openid email"
}

View File

@ -0,0 +1 @@
postgres:5432:lasql:lasql:lasql

View File

@ -0,0 +1,14 @@
{
"Servers": {
"1": {
"Name": "postgres",
"Group": "Servers",
"Host": "postgres",
"Port": 5432,
"MaintenanceDB": "postgres",
"Username": "lasql",
"PassFile": "/pgpass",
"SSLMode": "prefer"
}
}
}

View File

@ -0,0 +1,7 @@
-- IF NOT EXISTS (SELECT * FROM pg_user WHERE usename = 'lasql')then
-- CREATE USER lasql WITH PASSWORD 'lasql';
-- END IF;
-- GRANT ALL PRIVILEGES ON DATABASE lasql TO lasql;
-- ALTER USER lasql WITH SUPERUSER;

View File

@ -0,0 +1,2 @@
SELECT 'CREATE DATABASE hydra' WHERE NOT EXISTS (SELECT * FROM pg_database WHERE datname = 'hydra')\gexec
GRANT ALL PRIVILEGES ON DATABASE hydra TO lasql

View File

@ -0,0 +1,12 @@
CREATE TABLE IF NOT EXISTS usager (
email VARCHAR ( 100 ) UNIQUE NOT NULL,
password VARCHAR ( 255 ) NOT NULL,
lastname VARCHAR ( 255 ) NOT NULL,
firstname VARCHAR ( 255 ) NOT NULL
);
INSERT INTO usager (email, password, lastname, firstname) VALUES
('test1@test.com', '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', 'Locke', 'John'),
('test2@test.com', '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', 'Dubois', 'Angela'),
('test3@test.com', '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', 'Dupont', 'Henri'),
('test4@test.com', '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', 'Durand', 'Isabelle');
GRANT ALL PRIVILEGES ON DATABASE usager TO lasql

View File

@ -20,8 +20,8 @@
# regular expression must be changed accordingly:
# ProxyPassMatch ^/path-to-app/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/project/public/$1
DocumentRoot /loginappsql/public
<Directory /loginappsql/public>
DocumentRoot /var/www/public
<Directory /var/www/public>
# enable the .htaccess rewrites
AllowOverride All
Require all granted

View File

@ -23,8 +23,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
php${PHP_VERSION}-xml php${PHP_VERSION}-bcmath \
php${PHP_VERSION}-zip php${PHP_VERSION}-fpm \
php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-mysql \
php${PHP_VERSION}-pdo-mysql \
php${PHP_VERSION}-pgsql \
php${PHP_VERSION}-pdo-pgsql \
php${PHP_VERSION}-ssh2 libxml2-utils \
locales \
apache2 \
@ -48,15 +48,15 @@ RUN wget -q -O /usr/local/bin/waitforit https://github.com/maxcnunes/waitforit/r
# Install superfsmon to restart supervisor programs on file changes
RUN pip3 install wheel superfsmon
VOLUME /loginappsql
VOLUME /loginappsql/var/logs
VOLUME /loginappsql/var/cache
VOLUME /var/www
VOLUME /var/www/var/logs
VOLUME /var/www/var/cache
# Install composer
COPY install-composer.sh /loginappsql/install-composer.sh
RUN chmod +x /loginappsql/install-composer.sh &&\
/loginappsql/install-composer.sh &&\
rm -f /loginappsql/install-composer.sh
COPY install-composer.sh /var/www/install-composer.sh
RUN chmod +x /var/www/install-composer.sh &&\
/var/www/install-composer.sh &&\
rm -f /var/www/install-composer.sh
# On active les mods d'apache nécessaires
RUN a2enmod rewrite
@ -73,7 +73,7 @@ COPY www.conf /etc/php/8.1/fpm/pool.d/www.conf
EXPOSE 5000
EXPOSE 80
WORKDIR /loginappsql
WORKDIR /var/www
# On démarre php-fpm une fois pour créer les sockets
RUN service php8.1-fpm start
@ -90,7 +90,7 @@ RUN chmod +x /root/first-run.sh
RUN sed -i 's/^\$\(PrivDropTo.*\)$/#\1/' /etc/rsyslog.conf
RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf
COPY rsyslog.conf /etc/rsyslog.d/loginappsql.conf
COPY rsyslog.conf /etc/rsyslog.d/var/www.conf
COPY supervisor.ini /etc/supervisor/supervisor.ini
COPY php.ini /etc/php/8.1/fpm/php.ini

View File

@ -8,8 +8,8 @@ set -xeo pipefail
[ ! -d /var/www/.cache ] && sudo mkdir -p /var/www/.cache
[ -d /var/www/.cache ] && sudo chown -R www-data: /var/www/.cache
sudo chown -R www-data: /loginappsql
sudo chown -R www-data: /var/www
cp /bin/composer.phar /loginappsql/composer.phar
cd /loginappsql
cp /bin/composer.phar /var/www/composer.phar
cd /var/www
php composer.phar install

View File

@ -1,7 +1,6 @@
user: www-data
group: www-data
paths:
- /loginappsql/node_modules
- /loginappsql/vendor
- /loginappsql
- /var/www
- /var/www/node_modules
- /var/www/vendor
- /var/www

View File

@ -16,7 +16,7 @@ stderr_logfile_maxbytes=0
[program:apache2]
environment=HOSTNAME="%(ENV_HOSTNAME)s"
command = apachectl -D "FOREGROUND"
directory = /loginappsql
directory = /var/www
user = root
autostart = true
stdout_logfile=/dev/stdout
@ -29,7 +29,7 @@ environment=HOSTNAME="%(ENV_HOSTNAME)s"
command = /usr/sbin/php-fpm8.1 -F
autostart = true
autorestart = true
directory = /loginappsql
directory = /var/www
user = root
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0