Skip to content

Commit

Permalink
Merge pull request #169 from StarfilesFileSharing/alpha
Browse files Browse the repository at this point in the history
Alpha
  • Loading branch information
QuixThe2nd authored Nov 15, 2024
2 parents c92cd63 + 92119bf commit b714558
Show file tree
Hide file tree
Showing 38 changed files with 1,789 additions and 1,407 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ package-lock.json
blocks/*
build/

*.key
/*.key
*.db
*.db-journal

Expand Down
12 changes: 12 additions & 0 deletions build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ console.log(
minify: true,
treeShaking: true,
}),
await esbuild.build({
plugins: [...denoPlugins()],
entryPoints: ["./web/dashboard.ts"],
outfile: "./build/dashboard.js",
bundle: true,
format: "esm",
platform: "browser",
sourcemap: true,
minify: true,
treeShaking: true,
external: ["https://esm.sh/[email protected]"],
}),
);

esbuild.stop();
22 changes: 22 additions & 0 deletions certs/ca/localhost/localhost.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[req]
default_bits = 2048
prompt = no
default_md = sha256
distinguished_name = dn
req_extensions = req_ext

[dn]
C = H1
ST = State
L = City
O = Development
CN = localhost

[req_ext]
subjectAltName = @alt_names

[alt_names]
DNS.1 = localhost
DNS.2 = *.localhost
IP.1 = 127.0.0.1
IP.2 = ::1
29 changes: 29 additions & 0 deletions certs/ca/localhost/localhost.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-----BEGIN CERTIFICATE-----
MIIE5DCCAsygAwIBAgIUbLG23V0OZHRy/R311l30ZkWNaBwwDQYJKoZIhvcNAQEL
BQAwaTELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVN0YXRlMQ0wCwYDVQQHDARDaXR5
MRcwFQYDVQQKDA5EZXZlbG9wbWVudCBDQTEiMCAGA1UEAwwZTG9jYWwgRGV2ZWxv
cG1lbnQgUm9vdCBDQTAeFw0yNDExMTUxMzEzNTdaFw0yNTExMTUx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Eq9kcQNtQkVSD7hmpssEbWVa8ScIQVb1Tr4VLahDXxVhp0+Biy9tqSgm
Gpq8S+5tZgpVjbuMcbtyJZKJYCYtcIkP6DQWqhGVN8iCYlYJ7TntYH9M/CR/1R1T
7KzkzvZMyi7jXKmtiRwg0AQ54sVFP9Ug0xUsLFInk/peE0ARczK+Daydejnqm99o
k/2B3BsqPgatvVBrOoZCTwDUClObO3XZfsXQH4fVfTb8Nl8ES8pgFWTDGRCh7qIn
5xr6ksvgyTWXG17/2IDhH5++Ph6I84K2rLhmG3ZiyJqyzBAIsl63iBDZe6w5WdPI
W8M61EZrFgwrGsJa2OT+ScbHk+hGLNzmFkSH+F55OkLpwjJvNUFzK2+vihN9D/Xt
kgsRCGV5AVA=
-----END CERTIFICATE-----
18 changes: 18 additions & 0 deletions certs/ca/localhost/localhost.csr
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-----BEGIN CERTIFICATE REQUEST-----
MIIC5zCCAc8CAQAwVjELMAkGA1UEBhMCSDExDjAMBgNVBAgMBVN0YXRlMQ0wCwYD
VQQHDARDaXR5MRQwEgYDVQQKDAtEZXZlbG9wbWVudDESMBAGA1UEAwwJbG9jYWxo
b3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8H7+DRaOT+L1mXdA
5CiBwwAlUTKvzM1H61nQnBlL0rj4G1gz4j9lc922Umxg54NjQk57zxsH21+km8Xf
Yut2TcgGRmUwp3e8VMyfvblE7Vip1GEIH9E4qcCZAjK391P8cxPvJTZ+jgoE3EJv
CHDNotk/mnHy+joHOrX/DNwqlCB0l5i+h/IySZF9JZ8XMkOFXzNp3EkWTH/VnOWw
D8GUZqtIxgOISOIQKDeupcGITcFx0MuEqa4FzD+s+GLu4mFNpQsgFVhpdfJuErDf
5vHHmUD0KZFd7ilBWtGv7YhoeeKCyLPhn9yqM8EelV3ZVRPjR4LXl0YoKsj3fekv
hQP6FwIDAQABoEwwSgYJKoZIhvcNAQkOMT0wOzA5BgNVHREEMjAwgglsb2NhbGhv
c3SCCyoubG9jYWxob3N0hwR/AAABhxAAAAAAAAAAAAAAAAAAAAABMA0GCSqGSIb3
DQEBCwUAA4IBAQBgREZjJ7ZXeiShbHezy8YTUlnXn1G/VNpXTZHmpP+aUcsyBWfx
JI2mWVVyM4vThPhiZBQL25/ma3oPNWvGfNaFbRtbhbPv+XwI/OyfMbhK8LyifHyZ
XE2PQhneR1FN0cyd00ln1zzNQpFnxnpm1Rrw2fZzMavkKK5gEdh33UWv5ns+1+Kp
fyHZvC0QO9ykzOQWB7BQ2Ma/2UFXnQaqjUxHtMASztxtRMbf10HoDCG1w/Cuq0O8
JW78rIt3VYJBioaISuv2RTSLIZgxXLwsxitzeboYDAlGmSC4Lho2H2aU0UAYxBMG
r+yAtKJc7ODLx0WVz+D6FfM7NHT3RNLO+E9y
-----END CERTIFICATE REQUEST-----
10 changes: 10 additions & 0 deletions certs/ca/localhost/localhost.ext
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names

[alt_names]
DNS.1 = localhost
DNS.2 = *.localhost
IP.1 = 127.0.0.1
IP.2 = ::1
28 changes: 28 additions & 0 deletions certs/ca/localhost/localhost.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDwfv4NFo5P4vWZ
d0DkKIHDACVRMq/MzUfrWdCcGUvSuPgbWDPiP2Vz3bZSbGDng2NCTnvPGwfbX6Sb
xd9i63ZNyAZGZTCnd7xUzJ+9uUTtWKnUYQgf0TipwJkCMrf3U/xzE+8lNn6OCgTc
Qm8IcM2i2T+acfL6Ogc6tf8M3CqUIHSXmL6H8jJJkX0lnxcyQ4VfM2ncSRZMf9Wc
5bAPwZRmq0jGA4h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16vGHxfcQOhrsu6STWucd6gxu3osb0
0db1YCeNRolm7lf/wVTkyWr9vICvDtw/ZnZ4WLRjpjfeePNevxDO9vktqF1YnQkr
Z4orJF818HcX7RtpXF4MsSFEd+PUwHQZDrDQZLECgYEAisXRUdHlHEEL0FelmG2v
pGWqKmel0XdIJtzGvPVyu4GneRYyD9ChHLiX2kbFjN3O/pXaC6Ej/BYrjUS4h2KT
DC7zng0hGrkemoNpCc5voZmCZhbAz+tiGIOfY1HpYcFf93I015yykDpTy3EuVr/m
Wy5X38sJlGvDNw9Ev8UhUGk=
-----END PRIVATE KEY-----
33 changes: 33 additions & 0 deletions certs/ca/root-ca/root-ca.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
-----BEGIN CERTIFICATE-----
MIIFszCCA5ugAwIBAgIUdLlwhAaraeB6X/JSbiDq6R4oAV0wDQYJKoZIhvcNAQEL
BQAwaTELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVN0YXRlMQ0wCwYDVQQHDARDaXR5
MRcwFQYDVQQKDA5EZXZlbG9wbWVudCBDQTEiMCAGA1UEAwwZTG9jYWwgRGV2ZWxv
cG1lbnQgUm9vdCBDQTAeFw0yNDExMTUxMzEzNTZaFw0zNDExMTMxMzEzNTZaMGkx
CzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVTdGF0ZTENMAsGA1UEBwwEQ2l0eTEXMBUG
A1UECgwORGV2ZWxvcG1lbnQgQ0ExIjAgBgNVBAMMGUxvY2FsIERldmVsb3BtZW50
IFJvb3QgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDPVquK3aLE
0NAgprQUmWbyg5ZrHfxnSu1XY7PkBEh1BThCoPNchkf0p07m5jZein/GiliLBNgp
vrcJvtgZLDSkgM2Xp2AnWF6FbSydkYb+Nk1pic6cvtm677A6OjqnJjAYNkTb5wbD
XX7orEkUCSg0E1r/bfq8fu/f9Ju45XT4QtfhmUk7C1HAI9HB2Ld5EeXNrM3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jBBU9YiNdx0D9zW8xoS4l0OsLSTM5pZbqubOnF6AYPXNOz
wfYeskTK91EsOUQ4Fi3C015SHKRO7NPIkhOH5QI6VZ6qikT3JZTwj4MyAS/g8X1C
HVZZxwxRV5xldOyJa0pwD/O/Dn1UPcEIBarw5HJbXvB6hti5f7dQa5TLxv6VMPel
8LlB6yUNUUs/at9gpTvtLSJwJyvyzr/z6e3M+j7ySGBi6loo8cYzymrStbqOFEFr
QbgSgXHmR+QutCcTy85/0vkeBsFpx3c=
-----END CERTIFICATE-----
52 changes: 52 additions & 0 deletions certs/ca/root-ca/root-ca.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
-----BEGIN PRIVATE KEY-----
MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQDPVquK3aLE0NAg
prQUmWbyg5ZrHfxnSu1XY7PkBEh1BThCoPNchkf0p07m5jZein/GiliLBNgpvrcJ
vtgZLDSkgM2Xp2AnWF6FbSydkYb+Nk1pic6cvtm677A6OjqnJjAYNkTb5wbDXX7o
rEkUCSg0E1r/bfq8fu/f9Ju45XT4QtfhmUk7C1HAI9HB2Ld5EeXNrM3N5CbM9WoX
mSlQitaXOKOuETdCVpRANrX5nIdxG3ko5US1zt/4AzrHI7vTZIrAk7Fw02YnQfWZ
lXxmFtIwlrtM3IWY+OMSF6j6mg2L2qQiT11HpAeMx1sFk2vvG1FqU0hiJ3siDFAY
/Dum6uoVLqYJrNz4QULLTFYiRxXGEXzqbYAn63dqkIOaOkQhXOvqRFNcLquhzvvE
vXa0y6AMdqWueo0ElocHMEHCequCG7YPaSkK8SOBOjzf9qMFkabXAVcvA+vL7Sob
+fYDX2L+5cPWgL/dbwRvemOGeXhvgjac08M8Kq0BwT2Kxl+8mtg76BWEi0otAQHX
3HPj4pVPHWsbcxBiuJCjsWgPwD6Ljs0uIVB4uzlVCNLyf1iAG/IfP6xRetSQWnx6
HjmA6eAZHX6qFyxLHLATZT9KNg1lTjSF2yLt4iev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ggEAPTuKcz01zCY2sNbJjAZ4ObU68iIdhZtYZmQscWuBNTxIE+dLJUNijW29
2nqLEZ27+aS+40Tm4bOZgYquIawWf4HRRx/3GiiewsExf3X7hjP0upTBBKn+qke0
C8g91DmfEBy1Ri39FFf6a9/N8zRJPI3A7HymvYIkNWhrXqblWM3sv+saKHN/YsiS
z0RFeqdZUMKCrXoLkAquNM6T09jqQeH3GBoMbtFI57nWTCHpFDjrTYxoqp/hiOWA
FwgbTMRg05UItzBC9BmX1OZwabWknWMpHKLh/F4vYnoQnjlbpuZI6UukAe29N+4V
6FakVtd4GCaDfhcBSR7Oi72NbC7uDA==
-----END PRIVATE KEY-----
1 change: 1 addition & 0 deletions certs/ca/root-ca/root-ca.srl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6CB1B6DD5D0E647472FD1DF5D65DF466458D681C
76 changes: 76 additions & 0 deletions certs/create-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/bin/bash

# Create directories for CA and certificates
mkdir -p ca/root-ca
cd ca/root-ca

# Generate root CA private key
openssl genrsa -out root-ca.key 4096

# Generate root CA certificate
openssl req -x509 -new -nodes -key root-ca.key -sha256 -days 3650 -out root-ca.crt -subj "/C=US/ST=State/L=City/O=Development CA/CN=Local Development Root CA"

# Create directory for localhost certificate
mkdir -p ../localhost
cd ../localhost

# Generate localhost private key
openssl genrsa -out localhost.key 2048

# Create certificate signing request (CSR) configuration
cat > localhost.conf << EOF
[req]
default_bits = 2048
prompt = no
default_md = sha256
distinguished_name = dn
req_extensions = req_ext
[dn]
C = H1
ST = State
L = City
O = Development
CN = localhost
[req_ext]
subjectAltName = @alt_names
[alt_names]
DNS.1 = localhost
DNS.2 = *.localhost
IP.1 = 127.0.0.1
IP.2 = ::1
EOF

# Generate CSR using the configuration
openssl req -new -key localhost.key -out localhost.csr -config localhost.conf

# Create certificate extension configuration
cat > localhost.ext << EOF
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = localhost
DNS.2 = *.localhost
IP.1 = 127.0.0.1
IP.2 = ::1
EOF

# Generate localhost certificate signed by our CA
openssl x509 -req -in localhost.csr \
-CA ../root-ca/root-ca.crt \
-CAkey ../root-ca/root-ca.key \
-CAcreateserial \
-out localhost.crt \
-days 365 \
-sha256 \
-extfile localhost.ext

echo "Certificates created successfully!"
echo "Root CA: $(pwd)/../root-ca/root-ca.crt"
echo "Localhost cert: $(pwd)/localhost.crt"
echo "Localhost key: $(pwd)/localhost.key"
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@starfiles/hydrafiles",
"version": "0.8.1",
"version": "0.9",
"description": "The (P2P) web privacy layer.",
"main": "src/hydrafiles.ts",
"exports": {
Expand Down
Loading

0 comments on commit b714558

Please sign in to comment.