mirror of https://github.com/zer0bin-dev/zer0bin
This commit is contained in:
parent
4a2f320fa5
commit
defb5fea3b
|
@ -55,7 +55,7 @@ Backend: <a href="https://actix.rs/"><img src="https://pool.jortage.com/voringme
|
|||
### Steps
|
||||
|
||||
1. `git clone https://github.com/Domterion/zer0bin && cd zer0bin`
|
||||
2. `cp example.nginx /etc/nginx/sites-avaliable/yoursite.tld`, edit as appropriate, `sudo cp /etc/nginx/sites-avaliable/yoursite.tld /etc/nginx/sites-enabled/yoursite.tld && systemctl nginx restart`
|
||||
2. `cp example.nginx /etc/nginx/sites-avaliable/yoursite.tld`, edit as appropriate, `sudo ln -s /etc/nginx/sites-avaliable/yoursite.tld /etc/nginx/sites-enabled/yoursite.tld && systemctl nginx restart`
|
||||
3. `psql -d postgres`
|
||||
4. `CREATE DATABASE zer0bin;` and `\c zer0bin`
|
||||
5. Paste contents of `schema.sql` and `\q`
|
||||
|
|
|
@ -8,41 +8,61 @@ server {
|
|||
}
|
||||
|
||||
server {
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
listen 80;
|
||||
server_name example.tld www.example.tld;
|
||||
server_name example.tld;
|
||||
|
||||
root /location/to/zer0bin/frontend/dist;
|
||||
index index.html;
|
||||
|
||||
rewrite ^/~/(.*)$ /index.html;
|
||||
|
||||
location / {
|
||||
index index.html;
|
||||
}
|
||||
|
||||
location ~ \.(css|js|html) {
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location ^~ /.well-known/ {
|
||||
alias /var/www/.well-known/;
|
||||
}
|
||||
location /api/ {
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
proxy_pass http://localhost:8000/;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
server {
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
listen 443 ssl;
|
||||
server_name example.tld www.example.tld;
|
||||
listen 443;
|
||||
server_name example.tld;
|
||||
|
||||
root /location/to/zer0bin/frontend/dist;
|
||||
index index.html;
|
||||
|
||||
rewrite ^/~/(.*)$ /index.html;
|
||||
|
||||
location / {
|
||||
index index.html;
|
||||
}
|
||||
|
||||
location ~ \.(css|js|html) {
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location ^~ /.well-known/ {
|
||||
alias /var/www/.well-known/;
|
||||
}
|
||||
location /api/ {
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
proxy_pass http://localhost:8000/;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
#ssl_certificate /etc/letsencrypt/live/example.tld/fullchain.pem;
|
||||
#ssl_certificate_key /etc/letsencrypt/live/example.tld/privkey.pem;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_prefer_server_ciphers on;
|
||||
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ pre {
|
|||
text-align: end;
|
||||
user-select: none;
|
||||
font-size: 15px;
|
||||
padding-right: 15px;
|
||||
padding-right: 8px;
|
||||
}
|
||||
|
||||
#code-view-pre {
|
||||
|
@ -83,7 +83,7 @@ a:visited {
|
|||
color: #c4a7e7;
|
||||
}
|
||||
|
||||
a:hover :not(.logo){
|
||||
a:hover :not(.logo) {
|
||||
color: #9ccfd8;
|
||||
}
|
||||
|
||||
|
@ -165,4 +165,3 @@ a:hover :not(.logo){
|
|||
background-position: 100% 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
@ -35,7 +35,7 @@
|
|||
/>
|
||||
|
||||
<!-- We cant move this, we can split the on document stuff into here but yeah -->
|
||||
<script type="module" src="src/index.js"></script>
|
||||
<script defer type="module" src="src/index.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -47,7 +47,7 @@
|
|||
<button id="save-button" class="btn"></button>
|
||||
<button id="new-button" class="btn"></button>
|
||||
<a href="https://github.com/Domterion/zer0bin">
|
||||
<button class="btn" id="github-button"></button>
|
||||
<button class="btn" id="github-button"></button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const $ = require( "jquery" );
|
||||
const $ = require("jquery");
|
||||
|
||||
const config = require("../config.json");
|
||||
const apiUrl = config.api_url;
|
||||
|
@ -155,7 +155,7 @@ saveButton.click(function () {
|
|||
if (err) {
|
||||
addMessage(err["data"]["message"]);
|
||||
} else {
|
||||
window.history.pushState(null, null, `/${res["data"]["id"]}`);
|
||||
window.history.pushState(null, null, `/~/${res["data"]["id"]}`);
|
||||
viewPaste(editor.val());
|
||||
}
|
||||
});
|
||||
|
@ -171,7 +171,9 @@ function handlePopstate(event) {
|
|||
if (path == "/") {
|
||||
newPaste();
|
||||
} else {
|
||||
const id = path.substring(1, path.length);
|
||||
const split = path.split("/");
|
||||
|
||||
const id = split[split.length - 1];
|
||||
|
||||
getPaste(id, function (err, res) {
|
||||
if (err) {
|
||||
|
|
Before Width: | Height: | Size: 710 B After Width: | Height: | Size: 710 B |
Loading…
Reference in New Issue