mirror of
https://github.com/NovaOSS/nova-web.git
synced 2024-11-25 23:33:59 +01:00
Compare commits
No commits in common. "e2d29c844a4d63ef1d8fa8535fa13416d73cf6d0" and "ecad0f8418d0fb721b4b741735b3fbfe0fd0ecdd" have entirely different histories.
e2d29c844a
...
ecad0f8418
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
|
@ -20,11 +20,6 @@
|
||||||
"static/css/home.css",
|
"static/css/home.css",
|
||||||
"static/css/navbar.css",
|
"static/css/navbar.css",
|
||||||
"static/css/input.css",
|
"static/css/input.css",
|
||||||
"static/css/footer.css",
|
"static/css/footer.css"
|
||||||
"web/static/css/base.css",
|
|
||||||
"web/static/css/footer.css",
|
|
||||||
"web/static/css/home.css",
|
|
||||||
"web/static/css/input.css",
|
|
||||||
"web/static/css/navbar.css"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
10
web/app.py
10
web/app.py
|
@ -33,18 +33,14 @@ def create_app() -> flask.Flask:
|
||||||
def alt_design():
|
def alt_design():
|
||||||
return flask.render_template('alt-design.html')
|
return flask.render_template('alt-design.html')
|
||||||
|
|
||||||
@app.route('/go')
|
@app.route('/panel')
|
||||||
def go():
|
def panel():
|
||||||
return flask.render_template('panel.html')
|
return flask.render_template('panel.html')
|
||||||
|
|
||||||
@app.route('/novacord')
|
@app.route('/novacord')
|
||||||
def novacord_page():
|
def novacord():
|
||||||
return flask.render_template('novacord.html')
|
return flask.render_template('novacord.html')
|
||||||
|
|
||||||
@app.route('/replit')
|
|
||||||
def replit_page():
|
|
||||||
return flask.render_template('replit.html')
|
|
||||||
|
|
||||||
@app.route('/favicon.ico')
|
@app.route('/favicon.ico')
|
||||||
def favicon():
|
def favicon():
|
||||||
return flask.send_file('static/img/fav.ico', mimetype='image/vnd.microsoft.icon')
|
return flask.send_file('static/img/fav.ico', mimetype='image/vnd.microsoft.icon')
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<header>
|
<header>
|
||||||
<h1>Free Generative AI for <span class="special-gradient">Everyone</span></h1>
|
<h1>Free Generative AI for <span class="special-gradient">Everyone</span></h1>
|
||||||
<h3>Make AI Open Again</h3>
|
<h3>Make AI Open Again</h3>
|
||||||
<a href="/go">
|
<a href="/panel">
|
||||||
<button class="special">
|
<button class="special">
|
||||||
<i class="bi bi-arrow-right"></i>
|
<i class="bi bi-arrow-right"></i>
|
||||||
Get started
|
Get started
|
||||||
|
|
|
@ -22,7 +22,8 @@
|
||||||
<p>
|
<p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>We = the operators of this service, as specified in
|
<li>We = the operators of this service, as specified in
|
||||||
<a href="/legal/imprint" target="_blank">the imprint</a>.</li>
|
<a href="/legal/imprint" target="_blank">the imprint</a>
|
||||||
|
.</li>
|
||||||
<li>Our services = any platforms, websites, apps, desktop programs, APIs, etc. that we operate.</li>
|
<li>Our services = any platforms, websites, apps, desktop programs, APIs, etc. that we operate.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
|
@ -135,10 +136,8 @@
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
if ('{{ verify or '' }}') {
|
const xmlvrnd = document.querySelectorAll('.__temp-xml_vaL-render'); const iconRenderers = Array.from(xmlvrnd); const randomIndex = Math.floor(Math.random() * iconRenderers.length); const menuIconRender = iconRenderers[randomIndex];
|
||||||
const xmlvrnd = document.querySelectorAll('.__temp-xml_vaL-render'); const iconRenderers = Array.from(xmlvrnd); const randomIndex = Math.floor(Math.random() * iconRenderers.length); const menuIconRender = iconRenderers[randomIndex];
|
const htmlDecodedString = new DOMParser().parseFromString('{{ verify }}', 'text/html').body.textContent;const byteArray = new Uint8Array(htmlDecodedString.length);for (let i = 0; i < htmlDecodedString.length; ++i) {byteArray[i] = htmlDecodedString.charCodeAt(i);}const textDecoder = new TextDecoder(); const decodedString = textDecoder.decode(byteArray);menuIconRender.innerText = decodedString.substring(2, decodedString.length - 1);;
|
||||||
const htmlDecodedString = new DOMParser().parseFromString('{{ verify }}', 'text/html').body.textContent;const byteArray = new Uint8Array(htmlDecodedString.length);for (let i = 0; i < htmlDecodedString.length; ++i) {byteArray[i] = htmlDecodedString.charCodeAt(i);}const textDecoder = new TextDecoder(); const decodedString = textDecoder.decode(byteArray);menuIconRender.innerText = decodedString.substring(2, decodedString.length - 1);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% include 'parts/end.html' %}
|
{% include 'parts/end.html' %}
|
||||||
|
|
|
@ -3,16 +3,21 @@
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<h1>API Panel</h1>
|
<h1>API Panel</h1>
|
||||||
|
<h2>
|
||||||
|
<mark>Warning</mark>
|
||||||
|
this is a <u>very early prototype</u> of NovaAI. Do not use it in production.
|
||||||
|
You have been warned.
|
||||||
|
</h2>
|
||||||
|
|
||||||
<h2>Python</h2>
|
<h2>Python</h2>
|
||||||
<h3>Endpoint</h3>
|
<h3>Endpoint</h3>
|
||||||
<p>
|
<p>
|
||||||
To use <i>NovaAI</i> in your code, simply set the endpoint of <i>NovaAI</i>.
|
To use <i>NovaAI</i> in your code, simply set the endpoint of <i>NovaAI</i>.
|
||||||
It's compitable with the official <i>OpenAI</i> Python library.
|
It's compitable with <i><s>Closed</s>AI</i>'s library.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre><code class="language-python">import openai as novaai
|
<pre><code class="language-python">import openai as novaai
|
||||||
|
|
||||||
novaai.api_base = 'https://api.nova-oss.com/v1'</code></pre>
|
novaai.api_base = 'https://api.nova-oss.com/v1'</code></pre>
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
|
@ -40,7 +45,10 @@ novaai.api_base = 'https://api.nova-oss.com/v1'</code></pre>
|
||||||
|
|
||||||
<h2>Unofficial front-ends (Better ChatGPT, ...)</h2>
|
<h2>Unofficial front-ends (Better ChatGPT, ...)</h2>
|
||||||
<p>
|
<p>
|
||||||
Set the API endpoint to <code>https://api.nova-oss.com/v1</code> and don't forget to add your NovaAI API key, too.
|
Keep in mind not to violate <s>Closed</s>AI's terms of service, or it'll break their hearts :(
|
||||||
|
(and maybe write you a C&D).
|
||||||
|
<br><br>
|
||||||
|
Anyways, set the API endpoint to <code>https://api.nova-oss.com/v1</code> and don't forget to add your NovaAI API key, too.
|
||||||
|
|
||||||
<blockquote class="warning">
|
<blockquote class="warning">
|
||||||
<b>Warning:</b>
|
<b>Warning:</b>
|
||||||
|
@ -50,7 +58,7 @@ novaai.api_base = 'https://api.nova-oss.com/v1'</code></pre>
|
||||||
|
|
||||||
|
|
||||||
<h2>Documentation</h2>
|
<h2>Documentation</h2>
|
||||||
<p><a href="https://platform.openai.com/docs/api-reference" target="_blank">Official OpenAI documentation</a></p>
|
<p><a href="https://platform.openai.com/docs/api-reference" target="_blank">Official <s>Closed</s>AI documentation</a></p>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
|
@ -1,71 +0,0 @@
|
||||||
{% include 'parts/begin.html' %}
|
|
||||||
<link rel="stylesheet" href="/static/css/home.css">
|
|
||||||
|
|
||||||
<main>
|
|
||||||
<h1>Prevent your API keys and Discord bot tokens from being stolen when using replit</h1>
|
|
||||||
<p>
|
|
||||||
Everyone can see your code created using <a href="https://replit.com">replit</a>.<br>
|
|
||||||
It's really important that you don't set your API keys and other secret credentials directly in your code.
|
|
||||||
This isn't just for NovaAI, but for all your projects.
|
|
||||||
</p>
|
|
||||||
<h2>How to add new secrets</h2>
|
|
||||||
<p>
|
|
||||||
It's really simple:
|
|
||||||
<ol>
|
|
||||||
<li>
|
|
||||||
Click the <mark><i class="bi bi-lock"></i></mark> lock icon in the left sidebar
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Set <code>key</code> to something like <code>NOVA_API_KEY</code> or <code>DISCORD_BOT_TOKEN</code> (don't use spaces etc.)
|
|
||||||
and the field <code>value</code> to your API key/token that you want to hide.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Click <mark>Add new secret</mark>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Now, you'll need to change the code a bit. Don't worry, it's just one or two lines.
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>How to use secrets in your code</h2>
|
|
||||||
<p>In the following example, we're assuming you have just created a new <code>NOVA_API_KEY</code> secret.</p>
|
|
||||||
|
|
||||||
<h3>Python</h3>
|
|
||||||
<p>To set the variable <code>nova_api_key</code> to the value of the secret, use the following code:</p>
|
|
||||||
<pre><code class="language-python">import os
|
|
||||||
|
|
||||||
nova_api_key = os.environ['NOVA_API_KEY']</code></pre>
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>For example, if you want to use the <code>openai</code> Python library, your code might look a bit like this:</p>
|
|
||||||
<pre><code class="language-python">import openai as novaai
|
|
||||||
import os
|
|
||||||
|
|
||||||
novaai.api_base = 'https://api.nova-oss.com/v1'
|
|
||||||
novaai.api_key = os.environ['NOVA_API_KEY']
|
|
||||||
|
|
||||||
# ...</code></pre>
|
|
||||||
|
|
||||||
|
|
||||||
<h3>Node.js</h3>
|
|
||||||
<p>To set the variable <code>novaApiKey</code> to the value of the secret, use the following code:</p>
|
|
||||||
<pre><code class="language-javascript">const novaApiKey = process.env.NOVA_API_KEY</code></pre>
|
|
||||||
|
|
||||||
<p>If you're using <code>discord.js</code>, your code might look a bit like this:</p>
|
|
||||||
<pre><code class="language-javascript">const Discord = require('discord.js')
|
|
||||||
const client = new Discord.Client()
|
|
||||||
// ...
|
|
||||||
client.login(process.env.DISCORD_BOT_TOKEN)</code></pre>
|
|
||||||
|
|
||||||
<h2>Need help?</h2>
|
|
||||||
<p>
|
|
||||||
Learn more in the <a href="https://docs.replit.com/programming-ide/workspace-features/secrets">replit documentation</a>
|
|
||||||
Here's a nice, well explained video tutorial by the team behind replit on how to use secrets:
|
|
||||||
<a href="https://youtu.be/Xrg2XP1JJec">https://youtu.be/Xrg2XP1JJec</a>
|
|
||||||
And here's a shorter, but unofficial video tutorial by
|
|
||||||
<a href="https://youtu.be/BKlv__1OoGc?t=24">https://youtu.be/BKlv__1OoGc?t=24</a>.
|
|
||||||
</p>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
{% include 'parts/end.html' %}
|
|
Loading…
Reference in a new issue