Merge branch 'develop'

This commit is contained in:
Babibubebon 2020-09-01 03:29:58 +09:00
commit 03ba5758b3
No known key found for this signature in database
GPG key ID: 575C0B67FDDAF4AE
12 changed files with 94 additions and 11 deletions

8
.dockerignore Normal file
View file

@ -0,0 +1,8 @@
.env
.git
.idea
vendor
storage/app/*
storage/framework/cache/*
storage/framework/views/*
storage/logs/*

View file

@ -11,5 +11,5 @@ trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.{yml,yaml}]
[*.{yml,yaml,conf}]
indent_size = 2

View file

@ -1,19 +1,12 @@
APP_NAME=lodfe
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_DEBUG=false
APP_URL=http://localhost
APP_TIMEZONE=UTC
LOG_CHANNEL=stack
LOG_SLACK_WEBHOOK_URL=
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
CACHE_DRIVER=file
QUEUE_CONNECTION=sync

View file

@ -4,7 +4,8 @@ SPARQLエンドポイントを用いたLinked Open Dataフロントエンド([Pu
## Installation
```
$ git clone https://github.com/Babibubebon/lodfe.git
$ cd lodfe
$ composer install
$ cp .env{.example,}
$ cp config/datasets.php{.example,}
```

View file

@ -29,6 +29,10 @@ class ResourceController extends Controller
*/
protected function querySparql($request)
{
if (!empty($request->datasetConfig['http'])) {
$httpClient = new \EasyRdf\Http\Client(null, $request->datasetConfig['http']);
\EasyRdf\Http::setDefaultHttpClient($httpClient);
}
$client = new \EasyRdf\Sparql\Client($request->datasetConfig['endpoint']);
$query = <<<EOT
CONSTRUCT {

View file

@ -2,7 +2,7 @@
return [
'version' => '1.2.4',
'version' => '1.2.5',
/*
|--------------------------------------------------------------------------

View file

@ -8,6 +8,9 @@ return [
'html_uri' => 'https://example.com/page/{id}',
'data_uri' => 'https://example.com/data/{id}',
'endpoint' => 'https://example.com/query', // SPARQL endpoint URI
'http' => [
'timeout' => 30,
]
],
*/
];

22
docker-compose.dev.yml Normal file
View file

@ -0,0 +1,22 @@
version: "3"
services:
php:
image: babibubebon/lodfe:latest-php
build:
context: .
dockerfile: ./docker/php/Dockerfile
volumes:
- ./:/var/www/lodfe
nginx:
image: babibubebon/lodfe:latest-nginx
build:
context: .
dockerfile: ./docker/nginx/Dockerfile
ports:
- 80:80
depends_on:
- php
volumes:
- ./:/var/www/lodfe
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro

13
docker-compose.yml Normal file
View file

@ -0,0 +1,13 @@
version: "3"
services:
php:
image: babibubebon/lodfe:latest-php
volumes:
- ./config/datasets.php:/var/www/lodfe/config/datasets.php:ro
nginx:
image: babibubebon/lodfe:latest-nginx
ports:
- 80:80
depends_on:
- php

4
docker/nginx/Dockerfile Normal file
View file

@ -0,0 +1,4 @@
FROM nginx:1.19-alpine
ADD ./docker/nginx/default.conf /etc/nginx/conf.d/default.conf
ADD ./public /var/www/lodfe/public

27
docker/nginx/default.conf Normal file
View file

@ -0,0 +1,27 @@
server {
listen 80 default_server;
server_name _;
root /var/www/lodfe/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass php:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}

8
docker/php/Dockerfile Normal file
View file

@ -0,0 +1,8 @@
FROM php:7.4-fpm-alpine
ARG WORKDIR=/var/www/lodfe
WORKDIR ${WORKDIR}
COPY --from=composer /usr/bin/composer /usr/bin/composer
ADD --chown=www-data:www-data . /var/www/lodfe
RUN composer install