-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The docker image demo is already available. #975
Closed
Closed
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
bf36cec
Test
wangxiaoerYah f815e8c
Test
wangxiaoerYah 0aa4366
Test
wangxiaoerYah 2525be7
Build Test
wangxiaoerYah c1f788a
Build Test
wangxiaoerYah 3aa6535
Build Test
wangxiaoerYah d2b410d
Build Test
wangxiaoerYah ec48ebd
Build Test
wangxiaoerYah aa46b0c
Build Test
wangxiaoerYah 7766fb7
Build Test
wangxiaoerYah d980a42
Build Test
wangxiaoerYah d02642f
Build Test
wangxiaoerYah b23f347
Build Test
wangxiaoerYah 36111a5
Build Test
wangxiaoerYah c95fa00
Build Test
wangxiaoerYah efd8e79
Build Test
wangxiaoerYah bb3a8ee
Build Test
wangxiaoerYah 7210096
Build Test
wangxiaoerYah b9e2c42
Build Test
wangxiaoerYah ceed513
Build Test
wangxiaoerYah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
$connected = false; | ||
$session_type = CYPHT_SESSION_TYPE; | ||
$auth_type = CYPHT_AUTH_TYPE; | ||
$user_config_type = CYPHT_USER_CONFIG_TYPE; | ||
$db_driver = CYPHT_DB_DRIVER; | ||
while(!$connected) { | ||
try{ | ||
$conn = new pdo('CYPHT_DB_DRIVER:host=CYPHT_DB_HOST;dbname=CYPHT_DB_NAME', 'CYPHT_DB_USER', 'CYPHT_DB_PASS'); | ||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | ||
printf("Database connection successful ...\n"); | ||
$connected = true; | ||
} catch(PDOException $e){ | ||
error_log('Waiting for database connection ... (' . $e->getMessage() . ')'); | ||
sleep(1); | ||
} | ||
} | ||
if ($session_type == 'DB') { | ||
if ($db_driver == 'mysql') { | ||
$stmt = "CREATE TABLE IF NOT EXISTS hm_user_session (hm_id varchar(250), data longblob, date timestamp, primary key (hm_id));"; | ||
} elseif ($db_driver == 'pgsql') { | ||
$stmt = "CREATE TABLE IF NOT EXISTS hm_user_session (hm_id varchar(250) primary key not null, data text, date timestamp);"; | ||
} | ||
printf("Creating database table hm_user_session ...\n"); | ||
$conn->exec($stmt); | ||
} | ||
if ($auth_type == 'DB') { | ||
if ($db_driver == 'mysql') { | ||
$stmt = "CREATE TABLE IF NOT EXISTS hm_user (username varchar(250), hash varchar(250), primary key (username));"; | ||
} elseif ($db_driver == 'pgsql') { | ||
$stmt = "CREATE TABLE IF NOT EXISTS hm_user (username varchar(255) primary key not null, hash varchar(255));"; | ||
} | ||
printf("Creating database table hm_user ...\n"); | ||
$conn->exec($stmt); | ||
} | ||
if ($user_config_type == 'DB') { | ||
if ($db_driver == 'mysql') { | ||
$stmt = "CREATE TABLE IF NOT EXISTS hm_user_settings(username varchar(250), settings longblob, primary key (username));"; | ||
} elseif ($db_driver == 'pgsql') { | ||
$stmt = "CREATE TABLE IF NOT EXISTS hm_user_settings (username varchar(250) primary key not null, settings text);"; | ||
} | ||
printf("Creating database table hm_user_settings ...\n"); | ||
$conn->exec($stmt); | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
user www-data; | ||
pid /run/nginx.pid; | ||
worker_processes auto; | ||
worker_rlimit_nofile 65535; | ||
events { | ||
multi_accept on; | ||
worker_connections 65535; | ||
} | ||
http { | ||
charset utf-8; | ||
sendfile on; | ||
tcp_nopush on; | ||
tcp_nodelay on; | ||
server_tokens off; | ||
log_not_found off; | ||
types_hash_max_size 2048; | ||
types_hash_bucket_size 64; | ||
client_max_body_size 100M; | ||
include mime.types; | ||
default_type application/octet-stream; | ||
access_log off; | ||
error_log /dev/null; | ||
ssl_session_timeout 1d; | ||
ssl_session_cache shared:SSL:10m; | ||
ssl_session_tickets off; | ||
ssl_protocols TLSv1.3; | ||
ssl_stapling on; | ||
ssl_stapling_verify on; | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
set $base /var/www; | ||
root $base; | ||
index index.php; | ||
location / { | ||
try_files $uri $uri/ /index.php?$query_string; | ||
} | ||
# favicon.ico | ||
location = /favicon.ico { | ||
log_not_found off; | ||
} | ||
# robots.txt | ||
location = /robots.txt { | ||
log_not_found off; | ||
} | ||
# assets, media | ||
location ~* \.(?:css(\.map)?|js(\.map)?|jpe?g|png|gif|ico|cur|heic|webp|tiff?|mp3|m4a|aac|ogg|midi?|wav|mp4|mov|webm|mpe?g|avi|ogv|flv|wmv)$ { | ||
expires 7d; | ||
} | ||
# svg, fonts | ||
location ~* \.(?:svgz?|ttf|ttc|otf|eot|woff2?)$ { | ||
add_header Access-Control-Allow-Origin "*"; | ||
expires 7d; | ||
} | ||
# gzip | ||
gzip on; | ||
gzip_vary on; | ||
gzip_proxied any; | ||
gzip_comp_level 6; | ||
gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml; | ||
location ~ [^/]\.php(/|$) { | ||
fastcgi_pass 127.0.0.1:9000; | ||
# split path | ||
fastcgi_split_path_info ^(.+\.php)(/.+)$; | ||
set $_fastcgi_path_info $fastcgi_path_info; | ||
# 404 | ||
try_files $fastcgi_script_name =404; | ||
# default fastcgi_params | ||
include fastcgi_params; | ||
# fastcgi settings | ||
fastcgi_index index.php; | ||
fastcgi_buffers 8 16k; | ||
fastcgi_buffer_size 32k; | ||
# fastcgi params | ||
fastcgi_param DOCUMENT_ROOT $realpath_root; | ||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; | ||
fastcgi_param PATH_INFO $_fastcgi_path_info; | ||
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$base/:/usr/lib/php/:/tmp/:/var/lib/hm3"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[supervisord] | ||
user=root | ||
nodaemon=true | ||
logfile=/var/log/supervisord.log | ||
pidfile=/var/run/supervisord.pid | ||
|
||
[program:nginx] | ||
command=/usr/sbin/nginx -g "daemon off;" | ||
autostart=true | ||
autorestart=true | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 | ||
stderr_logfile=/dev/stderr | ||
stderr_logfile_maxbytes=0 | ||
|
||
[program:php-fpm] | ||
command=php-fpm | ||
autostart=true | ||
autorestart=true | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 | ||
stderr_logfile=/dev/stderr | ||
stderr_logfile_maxbytes=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one small request - can you leave the old version of the example env file? Most people would probably run fine with file configs rather than setting up a db for cypht.