...
 
Commits (2)
......@@ -45,3 +45,8 @@ PP_STORE_TIME='7 days'
###< APISERVER ###
###> snc/redis-bundle ###
# passwords that contain special characters (@, %, :, +) must be urlencoded
REDIS_URL=redis://localhost
###< snc/redis-bundle ###
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_APP_ENV=panther
......@@ -24,3 +24,10 @@ yarn-error.log
bin/
###> symfony/webpack-encore-bundle ###
/node_modules/
/public/build/
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-bundle ###
......@@ -5,26 +5,22 @@ ogame-apiserver allows people without an apikey using OGames API in a friendly m
The operator of an ogame-apiserver needs to have his __own__ APIKEY from OGame which can be requested [here](https://board.origin.ogame.gameforge.com/index.php/Thread/10659-New-API-Key-requests/).
## Requirements ##
* php7.1.3 or later
* php7.3.11 or later
* redis-server
* webserver of your choice, simple nginx+php7.2 config supplied in /nginx/
* webserver of your choice, simple nginx+php7.3 config supplied in /nginx/
* git
* composer
## Setup on debian stretch ##
* add surys php repo
## Setup on debian buster ##
* install php, nginx, redis-server, composer, git, nodejs, ...
```
echo "deb https://packages.sury.org/php/ stretch main" | tee /etc/apt/sources.list.d/php.list
wget -q -O- https://packages.sury.org/php/apt.gpg | apt-key add -
apt update
```
* install php, nginx, redis-server, composer, git
```
apt install php7.2 php7.2-cli php7.2-common php7.2-curl php7.2-fpm php7.2-gd php7.2-json php7.2-mbstring php7.2-mysql \
php7.2-opcache php7.2-readline php7.2-xml php7.2-zip nginx-full composer redis-server git
apt install -y php7.3 php7.3-cli php7.3-common php7.3-curl php7.3-fpm php7.3-gd php7.3-json php7.3-mbstring php7.3-mysql \
php7.3-opcache php7.3-readline php7.3-xml php7.3-zip nginx-full composer redis-server git curl dirmngr apt-transport-https \
lsb-release ca-certificates
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get install -y nodejs
npm i -g yarn
```
* set redis-server password
......@@ -43,6 +39,8 @@ cd apiserver
cp .env.dist .env
editor .env
composer install
yarn install
yarn encore dev
```
* add nginx site, edit config to meet your FQDN
......
body {
background-color: lightgray;
}
/*
* Welcome to your app's main JavaScript file!
*
* We recommend including the built version of this JavaScript file
* (and its CSS file) in your base layout (base.html.twig).
*/
// any CSS you import will output into a single css file (app.css in this case)
import '../css/app.css';
// Need jQuery? Install it with "yarn add jquery", then uncomment to import it.
// import $ from 'jquery';
console.log('Hello Webpack Encore! Edit me in assets/js/app.js');
......@@ -2,8 +2,9 @@
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"php": "^7.3.11",
"ext-iconv": "*",
"doctrine/doctrine-cache-bundle": "^1.4",
"nelmio/api-doc-bundle": "^3.2",
"noxlogic/ratelimit-bundle": "1.x",
"php-http/guzzle6-adapter": "^1.1",
......@@ -11,34 +12,34 @@
"predis/predis": "^1.0",
"sensio/framework-extra-bundle": "^5.1",
"snc/redis-bundle": "3.x-dev",
"symfony/asset": "^4.4",
"symfony/cache": "^4.4",
"symfony/console": "^4.4",
"symfony/debug-bundle": "^4.4",
"symfony/expression-language": "^4.4",
"symfony/asset": "4.4.*",
"symfony/cache": "4.4.*",
"symfony/console": "4.4.*",
"symfony/debug-pack": "*",
"symfony/dotenv": "4.4.*",
"symfony/expression-language": "4.4.*",
"symfony/flex": "^1.0",
"symfony/form": "^4.4",
"symfony/framework-bundle": "^4.4",
"symfony/framework-bundle": "4.4.*",
"symfony/monolog-bundle": "^3.1",
"symfony/orm-pack": "*",
"symfony/process": "^4.4",
"symfony/security-bundle": "^4.4",
"symfony/serializer": "^4.4",
"symfony/process": "4.4.*",
"symfony/security-bundle": "4.4.*",
"symfony/serializer": "4.4.*",
"symfony/serializer-pack": "*",
"symfony/swiftmailer-bundle": "^3.1",
"symfony/twig-bundle": "^4.4",
"symfony/validator": "^4.4",
"symfony/web-link": "^4.4",
"symfony/webpack-encore-bundle": "*",
"symfony/yaml": "^4.4"
"symfony/translation": "4.4.*",
"symfony/twig-bundle": "4.4.*",
"symfony/validator": "4.4.*",
"symfony/web-link": "4.4.*",
"symfony/webpack-encore-bundle": "^1.7",
"symfony/yaml": "4.4.*",
"twig/twig": "~2.0"
},
"require-dev": {
"symfony/debug-pack": "*",
"symfony/dotenv": "^4.4",
"symfony/maker-bundle": "^1.0",
"symfony/profiler-pack": "*",
"symfony/test-pack": "^1.0",
"symfony/web-server-bundle": "^4.4"
"symfony/web-server-bundle": "4.4.*"
},
"config": {
"preferred-install": {
......
This diff is collapsed.
<?php
use Symfony\Component\Dotenv\Dotenv;
require dirname(__DIR__).'/vendor/autoload.php';
// Load cached env vars if the .env.local.php file exists
// Run "composer dump-env prod" to create it (requires symfony/flex >=1.2)
if (is_array($env = @include dirname(__DIR__).'/.env.local.php') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {
foreach ($env as $k => $v) {
$_ENV[$k] = $_ENV[$k] ?? (isset($_SERVER[$k]) && 0 !== strpos($k, 'HTTP_') ? $_SERVER[$k] : $v);
}
} elseif (!class_exists(Dotenv::class)) {
throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.');
} else {
// load all the .env files
(new Dotenv(false))->loadEnv(dirname(__DIR__).'/.env');
}
$_SERVER += $_ENV;
$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';
$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
......@@ -18,4 +18,5 @@ return [
Http\HttplugBundle\HttplugBundle::class => ['all' => true],
Snc\RedisBundle\SncRedisBundle::class => ['all' => true],
Noxlogic\RateLimitBundle\NoxlogicRateLimitBundle::class => ['all' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
];
framework:
assets:
json_manifest_path: '%kernel.project_dir%/public/build/manifest.json'
framework:
cache:
# Unique name of your app: used to compute stable namespaces for cache keys.
#prefix_seed: your_vendor_name/app_name
# The "app" cache stores to the filesystem by default.
# The data in this cache should persist between deploys.
# Other options include:
# Redis
#app: cache.adapter.redis
#default_redis_provider: redis://localhost
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
#app: cache.adapter.apcu
# Namespaced pools use the above "app" backend by default
#pools:
#my.dedicated.cache: null
......@@ -2,7 +2,7 @@ nelmio_api_doc:
documentation:
info:
title: '%env(OGAME_API_TITLE)%'
description: '%env(OGAME_API_DESCRIPTION)%'
description: "%env(OGAME_API_DESCRIPTION)% Limits: %env(OGAME_API_RATELIMIT_LIMIT)% requests per %env(OGAME_API_RATELIMIT_PERIOD)% seconds"
version: '%env(OGAME_API_VERSION)%'
areas: # to filter documented areas
path_patterns:
......
framework:
router:
strict_requirements: null
#webpack_encore:
# Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes)
# Available in version 1.2
#cache: true
sensio_framework_extra:
router:
annotations: false
twig:
strict_variables: true
framework:
validation:
not_compromised_password: false
#webpack_encore:
# strict_mode: false
framework:
validation:
email_validation_mode: html5
# Enables validator auto-mapping support.
# For instance, basic validation constraints will be inferred from Doctrine's metadata.
#auto_mapping:
# App\Entity\: []
webpack_encore:
# The path where Encore is building the assets - i.e. Encore.setOutputPath()
output_path: '%kernel.project_dir%/public/build'
# If multiple builds are defined (as shown below), you can disable the default build:
# output_path: false
# if using Encore.enableIntegrityHashes() and need the crossorigin attribute (default: false, or use 'anonymous' or 'use-credentials')
# crossorigin: 'anonymous'
# preload all rendered script and link tags automatically via the http2 Link header
# preload: true
# Throw an exception if the entrypoints.json file is missing or an entry is missing from the data
# strict_mode: false
# if you have multiple builds:
# builds:
# pass "frontend" as the 3rg arg to the Twig functions
# {{ encore_entry_script_tags('entry1', null, 'frontend') }}
# frontend: '%kernel.project_dir%/public/frontend/build'
# Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes)
# Put in config/packages/prod/webpack_encore.yaml
# cache: true
_errors:
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
prefix: /_error
services:
_defaults:
public: true
# If you need to access services in a test, create an alias
# and then fetch that alias from the container. As a convention,
# aliases are prefixed with test. For example:
#
# test.App\Service\MyService: '@App\Service\MyService'
......@@ -57,7 +57,7 @@ server {
include snippets/fastcgi-php.conf;
# With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
......
......@@ -15,6 +15,33 @@
<env name="APP_SECRET" value="s$cretf0rt3st" />
<env name="SHELL_VERBOSITY" value="-1" />
<!-- define your env variables for the test env here -->
<!-- ###+ symfony/framework-bundle ### -->
<env name="APP_ENV" value="dev"/>
<env name="APP_SECRET" value="20e16e364c0ea3e61286031d633a9580"/>
<!-- env name="TRUSTED_PROXIES" value="127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16" -->
<!-- env name="TRUSTED_HOSTS" value="'^(localhost|example\.com)$'" -->
<!-- ###- symfony/framework-bundle ### -->
<!-- ###+ snc/redis-bundle ### -->
<!-- passwords that contain special characters (@, %, :, +) must be urlencoded -->
<env name="REDIS_URL" value="redis://localhost"/>
<!-- ###- snc/redis-bundle ### -->
<!-- ###+ doctrine/doctrine-bundle ### -->
<!-- Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url -->
<!-- For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db" -->
<!-- For a PostgreSQL database, use: "postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=11&charset=utf8" -->
<!-- IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml -->
<env name="DATABASE_URL" value="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7"/>
<!-- ###- doctrine/doctrine-bundle ### -->
<!-- ###+ symfony/swiftmailer-bundle ### -->
<!-- For Gmail as a transport, use: "gmail://username:password@localhost" -->
<!-- For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode=" -->
<!-- Delivery is disabled by default via "null://localhost" -->
<env name="MAILER_URL" value="null://localhost"/>
<!-- ###- symfony/swiftmailer-bundle ### -->
</php>
<testsuites>
......
This diff is collapsed.
This diff is collapsed.
<?php
use Symfony\Component\Dotenv\Dotenv;
require dirname(__DIR__).'/vendor/autoload.php';
if (file_exists(dirname(__DIR__).'/config/bootstrap.php')) {
require dirname(__DIR__).'/config/bootstrap.php';
} elseif (method_exists(Dotenv::class, 'bootEnv')) {
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
}
......@@ -8,11 +8,11 @@ Encore
.cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction())
// uncomment to create hashed filenames (e.g. app.abc123.css)
// .enableVersioning(Encore.isProduction())
.enableVersioning(Encore.isProduction())
// uncomment to define the assets of the project
// .addEntry('js/app', './assets/js/app.js')
// .addStyleEntry('css/app', './assets/css/app.scss')
.addEntry('js/app', './assets/js/app.js')
.addStyleEntry('css/app', './assets/css/app.css')
// uncomment if you use Sass/SCSS files
// .enableSassLoader()
......
This diff is collapsed.