Skip to content

Commit 008c72f

Browse files
Web Service Functionality (#6)
Rebuild YERD from scratch Added NGINX and Site commands
1 parent 270aed4 commit 008c72f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+6640
-6009
lines changed

.config/nginx/nginx.conf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
user {{% user %}};
2+
worker_processes auto;
3+
pid /opt/yerd/web/nginx/run/nginx.pid;
4+
5+
events {
6+
worker_connections 1024;
7+
}
8+
9+
http {
10+
include /opt/yerd/web/nginx/conf/mime.types;
11+
default_type application/octet-stream;
12+
13+
sendfile on;
14+
keepalive_timeout 65;
15+
16+
access_log /opt/yerd/web/nginx/logs/access.log;
17+
error_log /opt/yerd/web/nginx/logs/error.log;
18+
19+
include /opt/yerd/web/nginx/sites-enabled/*;
20+
}

.config/nginx/site.conf

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
server {
2+
listen 80;
3+
server_name {{% domain %}};
4+
return 301 https://$server_name$request_uri;
5+
}
6+
7+
server {
8+
listen 443 ssl http2;
9+
server_name {{% domain %}};
10+
11+
ssl_certificate {{% cert %}};
12+
ssl_certificate_key {{% key %}};
13+
14+
ssl_protocols TLSv1.2 TLSv1.3;
15+
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384;
16+
ssl_prefer_server_ciphers off;
17+
18+
root {{% path %}};
19+
index index.php index.html;
20+
21+
location / {
22+
try_files $uri $uri/ /index.php?$query_string;
23+
}
24+
25+
location ~ \.php$ {
26+
fastcgi_pass unix:/opt/yerd/php/run/php{{% php_version %}}-fpm.sock;
27+
include /opt/yerd/web/nginx/conf/fastcgi_params;
28+
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
29+
}
30+
}

.config/nginx/systemd.conf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[Unit]
2+
Description=Yerd nginx
3+
After=network.target
4+
5+
[Service]
6+
Type=forking
7+
PIDFile=/opt/yerd/web/nginx/run/nginx.pid
8+
ExecStartPre=/opt/yerd/web/nginx/sbin/nginx -t -c /opt/yerd/web/nginx/conf/nginx.conf
9+
ExecStart=/opt/yerd/web/nginx/sbin/nginx -c /opt/yerd/web/nginx/conf/nginx.conf
10+
ExecReload=/bin/kill -s HUP $MAINPID
11+
ExecStop=/bin/kill -s QUIT $MAINPID
12+
User=root
13+
Group=root
14+
15+
NonBlocking=true
16+
17+
[Install]
18+
WantedBy=multi-user.target

.config/php/php-fpm.conf

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
; PHP-FPM main configuration for PHP {{% version %}}
2+
; Generated by YERD
3+
4+
[global]
5+
; PID file for the main process
6+
pid = {{% pid_path %}}
7+
8+
; Error log file
9+
error_log = {{% log_path %}}
10+
11+
; Log level (alert, error, warning, notice, debug)
12+
log_level = notice
13+
14+
; When this amount of php-fpm processes is reached, master process will abort.
15+
; Set to 0 for no limits.
16+
process.max = 128
17+
18+
; Emergency restart threshold. If this number of child processes exit with
19+
; SIGSEGV or SIGBUS within the time interval set by emergency_restart_interval
20+
; then FPM will restart. A value of '0' means 'Off'. Available Units: s(econds), m(inutes), h(ours), or d(ays)
21+
emergency_restart_threshold = 0
22+
23+
; Interval of time used by emergency_restart_interval to determine when
24+
; a graceful restart will be initiated. This can be useful to work around
25+
; accidental corruptions in an accelerator's shared memory.
26+
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
27+
emergency_restart_interval = 0
28+
29+
; Time limit for child processes to wait for a reaction on signals from master.
30+
; Available units: s(econds), m(inutes), h(ours), or d(ays)
31+
process_control_timeout = 0
32+
33+
; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
34+
daemonize = yes
35+
36+
; Include pool configurations
37+
include = {{% pool_dir %}}/*.conf

.config/php/php.ini

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
; Default PHP configuration for YERD-managed PHP
2+
; Generated by YERD (A powerful, developer-friendly tool for managing PHP versions)
3+
4+
[PHP]
5+
; Core Settings
6+
engine = On
7+
short_open_tag = Off
8+
precision = 14
9+
output_buffering = 4096
10+
zlib.output_compression = Off
11+
implicit_flush = Off
12+
unserialize_callback_func =
13+
serialize_precision = -1
14+
disable_functions =
15+
disable_classes =
16+
zend.enable_gc = On
17+
zend.exception_ignore_args = On
18+
zend.exception_string_param_max_len = 0
19+
20+
; Resource Limits
21+
max_execution_time = 30
22+
max_input_time = 60
23+
memory_limit = 128M
24+
25+
; Error handling and logging
26+
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
27+
display_errors = Off
28+
display_startup_errors = Off
29+
log_errors = On
30+
ignore_repeated_errors = Off
31+
ignore_repeated_source = Off
32+
report_memleaks = On
33+
34+
; Data Handling
35+
variables_order = "GPCS"
36+
request_order = "GP"
37+
register_argc_argv = Off
38+
auto_globals_jit = On
39+
post_max_size = 8M
40+
auto_prepend_file =
41+
auto_append_file =
42+
default_mimetype = "text/html"
43+
default_charset = "UTF-8"
44+
45+
; File Uploads
46+
file_uploads = On
47+
upload_max_filesize = 2M
48+
max_file_uploads = 20
49+
50+
; Fopen wrappers
51+
allow_url_fopen = On
52+
allow_url_include = Off
53+
default_socket_timeout = 60
54+
55+
; Dynamic Extensions
56+
; extension_dir will be dynamically set based on PHP version
57+
extension_dir = ""
58+
59+
; Date
60+
date.timezone = UTC
61+
62+
; Session
63+
session.save_handler = files
64+
session.use_strict_mode = 0
65+
session.use_cookies = 1
66+
session.use_only_cookies = 1
67+
session.name = PHPSESSID
68+
session.auto_start = 0
69+
session.cookie_lifetime = 0
70+
session.cookie_path = /
71+
session.cookie_domain =
72+
session.cookie_httponly =
73+
session.cookie_samesite =
74+
session.serialize_handler = php
75+
session.gc_probability = 0
76+
session.gc_divisor = 1000
77+
session.gc_maxlifetime = 1440
78+
session.referer_check =
79+
session.cache_limiter = nocache
80+
session.cache_expire = 180
81+
session.use_trans_sid = 0
82+
session.sid_length = 26
83+
session.trans_sid_tags = "a=href,area=href,frame=src,form="
84+
session.sid_bits_per_character = 5
85+
86+
; MySQLi
87+
mysqli.max_persistent = -1
88+
mysqli.allow_persistent = On
89+
mysqli.max_links = -1
90+
mysqli.default_port = 3306
91+
mysqli.default_socket =
92+
mysqli.default_host =
93+
mysqli.default_user =
94+
mysqli.default_pw =
95+
mysqli.reconnect = Off
96+
97+
; bcmath
98+
bcmath.scale = 0
99+
100+
; OpCache (if available)
101+
; opcache.enable=1
102+
; opcache.enable_cli=0
103+
; opcache.memory_consumption=128
104+
; opcache.interned_strings_buffer=8
105+
; opcache.max_accelerated_files=4000
106+
; opcache.revalidate_freq=2
107+
; opcache.fast_shutdown=1

.config/php/systemd.conf

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[Unit]
2+
Description=PHP-FPM {{% version %}} (YERD managed)
3+
Documentation=man:php-fpm{{% version %}}(8)
4+
After=network.target
5+
6+
[Service]
7+
Type=forking
8+
PIDFile={{% pid_path %}}
9+
ExecStart={{% fpm_binary_path %}} --fpm-config {{% main_config_path %}} --pid {{% pid_path %}}
10+
ExecReload=/bin/kill -USR2 $MAINPID
11+
ExecStop=/bin/kill -SIGINT $MAINPID
12+
TimeoutStopSec=5
13+
KillMode=process
14+
PrivateTmp=false
15+
ProtectSystem=full
16+
ProtectHome=false
17+
RuntimeDirectory=yerd-php{{% version %}}mfpm
18+
RuntimeDirectoryMode=0755
19+
20+
# Restart policy
21+
Restart=on-failure
22+
RestartSec=5
23+
StartLimitInterval=60s
24+
StartLimitBurst=3
25+
26+
[Install]
27+
WantedBy=multi-user.target

.config/php/www.conf

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
; PHP-FPM pool configuration for PHP {{% version %}}
2+
; Generated by YERD
3+
4+
[www]
5+
; The name of the pool
6+
user = {{% user %}}
7+
group = {{% group %}}
8+
9+
; Unix socket configuration
10+
listen = {{% sock_path %}}
11+
listen.owner = {{% user %}}
12+
listen.group = {{% group %}}
13+
listen.mode = 0660
14+
15+
; Process management
16+
pm = dynamic
17+
pm.max_children = 5
18+
pm.start_servers = 2
19+
pm.min_spare_servers = 1
20+
pm.max_spare_servers = 3
21+
22+
; Logging
23+
php_admin_value[error_log] = {{% log_path %}}
24+
php_admin_flag[log_errors] = on
25+
26+
; Performance
27+
php_value[memory_limit] = 1024M
28+
php_value[max_execution_time] = 999
29+
php_value[upload_max_filesize] = 999M
30+
php_value[post_max_size] = 999M

.config/ssl/ext.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
authorityKeyIdentifier=keyid,issuer
2+
basicConstraints=CA:FALSE
3+
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
4+
subjectAltName = DNS:{{% domain %}},DNS:www.{{% domain %}}

.scannerwork/.sonar_lock

Whitespace-only changes.

.scannerwork/report-task.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)