From b1298affe8f1e91b3bcf770f8b519ecf3dfca8b2 Mon Sep 17 00:00:00 2001 From: asandikci Date: Sun, 7 Jan 2024 00:37:32 +0300 Subject: [PATCH] update server files --- .gitignore | 3 +- composer.json | 23 +++++ composer.lock | 129 +++++++++++++++++++++++++++ dockerserver.sh | 26 +++--- index.php | 231 +++++++++++++++++++++++++++++++++++++++++++++++- src/server.php | 177 +++++++++++++++++++++++++++++++++++++ src/todays.php | 2 + 7 files changed, 577 insertions(+), 14 deletions(-) create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 src/server.php create mode 100644 src/todays.php diff --git a/.gitignore b/.gitignore index 7a39e96..cc230e9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ build/* *.tar.gz -*.zip \ No newline at end of file +*.zip +/vendor/ diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..f8061f7 --- /dev/null +++ b/composer.json @@ -0,0 +1,23 @@ +{ + "name": "asandikci/yurdle", + "description": "yurdle package", + "type": "project", + "require": { + "yosymfony/toml": "^1.0" + }, + "require-dev": { + "yosymfony/toml": "^1.0" + }, + "license": "GPL3.0", + "autoload": { + "psr-4": { + "Asandikci\\Yurdle\\": "src/" + } + }, + "authors": [ + { + "name": "asandikci", + "email": "git@aliberksandikci.com.tr" + } + ] +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..3da929a --- /dev/null +++ b/composer.lock @@ -0,0 +1,129 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "add81bece92d883faaa7f717e5256419", + "packages": [ + { + "name": "yosymfony/parser-utils", + "version": "v2.0.0", + "source": { + "type": "git", + "url": "https://github.com/yosymfony/parser-utils.git", + "reference": "00bec9a12722b21f2baf7f9db35f127e90c162c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yosymfony/parser-utils/zipball/00bec9a12722b21f2baf7f9db35f127e90c162c9", + "reference": "00bec9a12722b21f2baf7f9db35f127e90c162c9", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "^6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Yosymfony\\ParserUtils\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Victor Puertas", + "email": "vpgugr@gmail.com", + "homepage": "http://yosymfony.com" + } + ], + "description": "Parser utilities", + "homepage": "http://github.com/yosymfony/toml", + "keywords": [ + "lexer", + "parser" + ], + "support": { + "issues": "https://github.com/yosymfony/parser-utils/issues", + "source": "https://github.com/yosymfony/parser-utils/tree/master" + }, + "time": "2018-06-29T15:31:11+00:00" + }, + { + "name": "yosymfony/toml", + "version": "v1.0.4", + "source": { + "type": "git", + "url": "https://github.com/yosymfony/toml.git", + "reference": "bdab92ad920d0e36810a3a3e4a998d23f3498f8e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yosymfony/toml/zipball/bdab92ad920d0e36810a3a3e4a998d23f3498f8e", + "reference": "bdab92ad920d0e36810a3a3e4a998d23f3498f8e", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "yosymfony/parser-utils": "^2.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Yosymfony\\Toml\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Victor Puertas", + "email": "vpgugr@gmail.com", + "homepage": "http://yosymfony.com" + } + ], + "description": "A PHP parser for TOML compatible with specification 0.4.0", + "homepage": "http://github.com/yosymfony/toml", + "keywords": [ + "mojombo", + "parser", + "toml" + ], + "support": { + "issues": "https://github.com/yosymfony/toml/issues", + "source": "https://github.com/yosymfony/toml/tree/master" + }, + "time": "2018-08-08T15:08:14+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.6.0" +} diff --git a/dockerserver.sh b/dockerserver.sh index 48e18fa..aa67773 100755 --- a/dockerserver.sh +++ b/dockerserver.sh @@ -10,23 +10,23 @@ MOUNT_PATH="/source" # binded mount path in nginx docker SCRIPT_NAME="dockerserver.sh" # name of the *this* file SCRIPT_DIR="Yurdle" # containing directory of the *this* file BUILD_DIR="." # build results of local source code (insert a dot (.) if you do not need to build your application) -DATABASE_TYPE="postgresql" # database type, either mysql or postgresql +# DATABASE_TYPE="postgresql" # database type, either mysql or postgresql MAIN_NAME="yurdle" # main program name PORT1="8000" # TODO what is the difference between 8000 and 80 PORT2="80" WEB_ROOT_DIR="/usr/share/nginx/html/" # public web root dir WEB_SERVER_DIR="/usr/share/nginx/server/" # private server root dir -SECRET_SERVER="true" # add secret server to $WEB_ROOT_DIR/../$SECRET_SERVER_FOLDER +SECRET_SERVER="false" # add secret server to $WEB_ROOT_DIR/../$SECRET_SERVER_FOLDER SECRET_SERVER_LOCAL_RELATIONAL_PATH="../YurdleBackend" # local path SERVER_BUILD_DIR="." # server build dir -__DB_NAME__="localdb" -__DB_USER__="dbuser" -__DB_PWD__="dbpass" +# __DB_NAME__="localdb" +# __DB_USER__="dbuser" +# __DB_PWD__="dbpass" PHP_VERSION="8.2" -ACTIVE_SERVICES=("nginx" "php$PHP_VERSION-fpm" "postgresql") # services +ACTIVE_SERVICES=("nginx" "php$PHP_VERSION-fpm") # services ############################ ############################ @@ -60,6 +60,7 @@ class Config const DB_NAME = '$__DB_NAME__'; const DB_USERNAME = '$__DB_USER__'; const DB_PASSWORD = '$__DB_PWD__'; + const DATAACCESS_TOKEN = 'LOCAL'; } """ @@ -162,7 +163,7 @@ _restart() { _reconf() { _head "RECONFIGURATION" - echo -e "$CONFIG_FILE_CONTENT" >"$WEB_SERVER_DIR/config.php" + echo -e "$CONFIG_FILE_CONTENT" >"$WEB_ROOT_DIR/config.php" echo -e "$NGINX_CONFIG_FILE" >"/etc/nginx/conf.d/default.conf" echo -e "$PHP_FPM_CONFIG_FILE" >"/etc/php/$PHP_VERSION/fpm/pool.d/$MAIN_NAME.conf" _end "RECONFIGURATION" @@ -192,8 +193,10 @@ _update_conf() { _refresh_folders() { rm -rf $WEB_ROOT_DIR mkdir -p $WEB_ROOT_DIR - rm -rf $WEB_SERVER_DIR - mkdir -p $WEB_SERVER_DIR + if [[ $SECRET_SERVER == "true" ]]; then + rm -rf $WEB_SERVER_DIR + mkdir -p $WEB_SERVER_DIR + fi } _setup_database() { @@ -290,9 +293,10 @@ elif [[ $1 == "docker" ]]; then cp -r /server/$BUILD_DIR/* $WEB_SERVER_DIR/ fi - apt install php php-fpm php-cli -y + apt install php php-fpm php-cli composer -y + locale-gen tr_TR - _setup_database + # _setup_database _reconf diff --git a/index.php b/index.php index 67a8812..8ac60d5 100644 --- a/index.php +++ b/index.php @@ -21,12 +21,18 @@
-
+ - +
+
+ +
Veri Sorumlusu: Ömer Arda Muratoğlu.
Her türlü kaldırılmasını, eklenmesini ve/veya değiştirilmesi istediğiniz veriler için kendisi ile iletişime geçiniz !
+
Son veri güncelleme: +
+
Bana Bi' Kahve Ismarla ☕