Skip to content

Commit

Permalink
Add Ubuntu Linux support
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Dec 29, 2024
1 parent 98fea8d commit 2ffb57d
Show file tree
Hide file tree
Showing 5 changed files with 333 additions and 99 deletions.
21 changes: 17 additions & 4 deletions etc/certs/gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# - https://certificatetools.com/
# cert settings

script_dir=$(cd "$(dirname "$0")" && pwd)
cd $script_dir

function years_to_days {
years=$1
time_ts=`date +%s`
Expand All @@ -18,19 +21,27 @@ function years_to_days {
}

is_v1=$1
force=$2
key_bits=2048
common_name="*.simdsoft.com"
# firefox requre domain name
domain_name="xweb.com"
hash_alg=-sha384
issued_org='Simdsoft Limited'

# issuer information
issuer_valid_years=1000
issuer_valid_years=100
issuer_org='Simdsoft Limited'
issuer_name="Simdsoft RSA CA $issuer_valid_years"
issuer_subj="/C=CN/O=$issuer_org/CN=$issuer_name"


valid_years=1000
valid_years=$issuer_valid_years

if [ "$force" = 'true' ] ; then
echo 'force regen certs ...'
rm ./ca-**
rm ./server.*
fi

# Create Self-Signed Root CA(Certificate Authority)
issuer_valid_days=`years_to_days $issuer_valid_years`
Expand All @@ -48,7 +59,7 @@ fi

# 1. Generate unencrypted 2048-bits RSA private key for the server (CA) & Generate CSR for the server
valid_days=`years_to_days $valid_years`
openssl req -newkey rsa:$key_bits $hash_alg -nodes -keyout server.key -out server-csr.pem -subj "/C=CN/O=$issued_org/CN=$common_name"
openssl req -newkey rsa:$key_bits $hash_alg -nodes -keyout server.key -out server-csr.pem -subj "/C=CN/O=$issued_org/CN=$domain_name"

# 2. Sign with our RootCA
if [ "$is_v1" != 'true' ] ; then
Expand All @@ -63,3 +74,5 @@ rm -rf ./server-csr.pem

# Check if the certificate is signed properly
openssl x509 -in server.crt -noout -text

cd -
7 changes: 7 additions & 0 deletions etc/certs/v3.ext
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = xweb.com
DNS.2 = *.xweb.com
26 changes: 26 additions & 0 deletions etc/mysql/my.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is designed to work with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms,
# as designated in a particular file or component or in included license
# documentation. The authors of MySQL hereby grant you an additional
# permission to link the program and your derivative works with the
# separately licensed software that they have either included with
# the program or referenced in the documentation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License, version 2.0, for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

#
# The MySQL Client configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

[mysqld]
mysql_native_password=ON
authentication_policy=mysql_native_password
Expand Down
1 change: 0 additions & 1 deletion etc/nginx/1.27.3/nginx.conf.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#user nobody;
worker_processes 1;

Expand Down
Loading

0 comments on commit 2ffb57d

Please sign in to comment.