Put external dependencies into dedicated directories

This commit is contained in:
Leon Etienne (ubuntu wsl) 2020-09-27 19:14:35 +02:00
parent e470676e40
commit 37cc321708
34 changed files with 9491 additions and 54 deletions

View File

@ -1,21 +0,0 @@
[youtube] eJsTaFRsa_k: Downloading webpage
[youtube] Downloading just video eJsTaFRsa_k because of --no-playlist
[youtube] eJsTaFRsa_k: Downloading js player 12237e3d
[youtube] eJsTaFRsa_k: Downloading js player 12237e3d
[download] Destination: dlcache\download\1KmyoJ.webm
[download] 0.0% of 6.60MiB at 249.94KiB/s ETA 00:27
[download] 0.0% of 6.60MiB at 749.83KiB/s ETA 00:09
[download] 0.1% of 6.60MiB at 1.71MiB/s ETA 00:03
[download] 0.2% of 6.60MiB at 3.66MiB/s ETA 00:01
[download] 0.5% of 6.60MiB at 1.59MiB/s ETA 00:04
[download] 0.9% of 6.60MiB at 1.71MiB/s ETA 00:03
[download] 1.9% of 6.60MiB at 2.48MiB/s ETA 00:02
[download] 3.8% of 6.60MiB at 3.61MiB/s ETA 00:01
[download] 7.6% of 6.60MiB at 5.73MiB/s ETA 00:01
[download] 15.1% of 6.60MiB at 8.32MiB/s ETA 00:00
[download] 30.3% of 6.60MiB at 14.17MiB/s ETA 00:00
[download] 60.6% of 6.60MiB at 17.77MiB/s ETA 00:00
[download] 100.0% of 6.60MiB at 28.45MiB/s ETA 00:00
[download] 100% of 6.60MiB in 00:00
[ffmpeg] Destination: dlcache\download\1KmyoJ.mp3
Deleting original file dlcache\download\1KmyoJ.webm (pass -k to keep)

View File

@ -90,7 +90,7 @@ void HttpServer::EventHandler(mg_connection* pNc, int ev, void* p)
} }
else if (requestedUri.substr(0, 9) == "/download") else if (requestedUri.substr(0, 9) == "/download")
{ {
ServeDownloadedResource(pNc, ev, p, requestedUri); ServeDownloadeableResource(pNc, ev, p, requestedUri);
} }
else else
{ {
@ -151,7 +151,7 @@ void HttpServer::ProcessAPIRequest(mg_connection* pNc, int ev, void* p)
return; return;
} }
void HttpServer::ServeDownloadedResource(mg_connection* pNc, int ev, void* p, std::string uri) void HttpServer::ServeDownloadeableResource(mg_connection* pNc, int ev, void* p, std::string uri)
{ {
std::string fileId = uri.substr(10, uri.length() - 10); std::string fileId = uri.substr(10, uri.length() - 10);
@ -165,7 +165,6 @@ void HttpServer::ServeDownloadedResource(mg_connection* pNc, int ev, void* p, st
std::string downloadedFilename = entry.title + (entry.mode == Downloader::DOWNLOAD_MODE::AUDIO ? ".mp3" : ".mp4"); std::string downloadedFilename = entry.title + (entry.mode == Downloader::DOWNLOAD_MODE::AUDIO ? ".mp3" : ".mp4");
ss << "Access-Control-Allow-Origin: *\nContent-Disposition: attachment; filename=\"" << downloadedFilename << "\"\nPragma: public\nCache-Control: must-revalidate, post-check=0, pre-check=0"; ss << "Access-Control-Allow-Origin: *\nContent-Disposition: attachment; filename=\"" << downloadedFilename << "\"\nPragma: public\nCache-Control: must-revalidate, post-check=0, pre-check=0";
mg_http_serve_file(pNc, (http_message*)p, entry.downloaded_filename.c_str(), mg_mk_str("application/octet-stream"), mg_mk_str(ss.str().c_str())); mg_http_serve_file(pNc, (http_message*)p, entry.downloaded_filename.c_str(), mg_mk_str("application/octet-stream"), mg_mk_str(ss.str().c_str()));
} }
else else

View File

@ -2,7 +2,7 @@
#include <vector> #include <vector>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include "mongoose.h" #include "external_dependencies/casenta/mongoose/mongoose.h"
#include "Logger.h" #include "Logger.h"
#include "RestResponseTemplates.h" #include "RestResponseTemplates.h"
#include "RestQueryHandler.h" #include "RestQueryHandler.h"
@ -23,7 +23,7 @@ namespace Rest
private: private:
bool InitWebServer(); bool InitWebServer();
static void ProcessAPIRequest(struct mg_connection* pNc, int ev, void* p); static void ProcessAPIRequest(struct mg_connection* pNc, int ev, void* p);
static void ServeDownloadedResource(struct mg_connection* pNc, int ev, void* p, std::string uri); static void ServeDownloadeableResource(struct mg_connection* pNc, int ev, void* p, std::string uri);
static void EventHandler(struct mg_connection* pNc, int ev, void* p); static void EventHandler(struct mg_connection* pNc, int ev, void* p);
static void ServeStringToConnection(struct mg_connection* c, std::string str, int httpStatusCode = 200); static void ServeStringToConnection(struct mg_connection* c, std::string str, int httpStatusCode = 200);

View File

@ -6,7 +6,7 @@
#include <fstream> #include <fstream>
#include "LogTypes.h" #include "LogTypes.h"
#include "XGConfig.h" #include "XGConfig.h"
#include "JasonPP.hpp" #include "external_dependencies/leonetienne/JasonPP/JasonPP.hpp"
namespace Logging namespace Logging
{ {

View File

@ -1,5 +1,5 @@
#pragma once #pragma once
#include "JasonPP.hpp" #include "external_dependencies/leonetienne/JasonPP/JasonPP.hpp"
#include "RestResponseTemplates.h" #include "RestResponseTemplates.h"
#include "XGControl.h" #include "XGControl.h"
#include "Logger.h" #include "Logger.h"

View File

@ -1,5 +1,5 @@
#pragma once #pragma once
#include "JasonPP.hpp" #include "external_dependencies/leonetienne/JasonPP/JasonPP.hpp"
namespace Rest namespace Rest
{ {

View File

@ -145,13 +145,13 @@
<ItemGroup> <ItemGroup>
<ClCompile Include="ConsoleManager.cpp" /> <ClCompile Include="ConsoleManager.cpp" />
<ClCompile Include="DownloadManager.cpp" /> <ClCompile Include="DownloadManager.cpp" />
<ClCompile Include="external_dependencies\casenta\mongoose\mongoose.c" />
<ClCompile Include="external_dependencies\leonetienne\JasonPP\JasonPP.cpp" />
<ClCompile Include="FileSystem.cpp" /> <ClCompile Include="FileSystem.cpp" />
<ClCompile Include="Framework.cpp" /> <ClCompile Include="Framework.cpp" />
<ClCompile Include="JasonPP.cpp" />
<ClCompile Include="Logger.cpp" /> <ClCompile Include="Logger.cpp" />
<ClCompile Include="LogHistory.cpp" /> <ClCompile Include="LogHistory.cpp" />
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />
<ClCompile Include="mongoose.c" />
<ClCompile Include="RestQueryHandler.cpp" /> <ClCompile Include="RestQueryHandler.cpp" />
<ClCompile Include="RestResponseTemplates.cpp" /> <ClCompile Include="RestResponseTemplates.cpp" />
<ClCompile Include="HttpServer.cpp" /> <ClCompile Include="HttpServer.cpp" />
@ -161,13 +161,13 @@
<ItemGroup> <ItemGroup>
<ClInclude Include="ConsoleManager.h" /> <ClInclude Include="ConsoleManager.h" />
<ClInclude Include="DownloadManager.h" /> <ClInclude Include="DownloadManager.h" />
<ClInclude Include="external_dependencies\casenta\mongoose\mongoose.h" />
<ClInclude Include="external_dependencies\leonetienne\JasonPP\JasonPP.hpp" />
<ClInclude Include="FileSystem.h" /> <ClInclude Include="FileSystem.h" />
<ClInclude Include="Framework.h" /> <ClInclude Include="Framework.h" />
<ClInclude Include="JasonPP.hpp" />
<ClInclude Include="Logger.h" /> <ClInclude Include="Logger.h" />
<ClInclude Include="LogHistory.h" /> <ClInclude Include="LogHistory.h" />
<ClInclude Include="LogTypes.h" /> <ClInclude Include="LogTypes.h" />
<ClInclude Include="mongoose.h" />
<ClInclude Include="RestQueryHandler.h" /> <ClInclude Include="RestQueryHandler.h" />
<ClInclude Include="RestResponseTemplates.h" /> <ClInclude Include="RestResponseTemplates.h" />
<ClInclude Include="HttpServer.h" /> <ClInclude Include="HttpServer.h" />

View File

@ -21,12 +21,6 @@
<ClCompile Include="main.cpp"> <ClCompile Include="main.cpp">
<Filter>Quelldateien</Filter> <Filter>Quelldateien</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="JasonPP.cpp">
<Filter>_external_dependencies</Filter>
</ClCompile>
<ClCompile Include="mongoose.c">
<Filter>_external_dependencies</Filter>
</ClCompile>
<ClCompile Include="Logger.cpp"> <ClCompile Include="Logger.cpp">
<Filter>Quelldateien</Filter> <Filter>Quelldateien</Filter>
</ClCompile> </ClCompile>
@ -60,14 +54,14 @@
<ClCompile Include="ConsoleManager.cpp"> <ClCompile Include="ConsoleManager.cpp">
<Filter>Quelldateien</Filter> <Filter>Quelldateien</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="external_dependencies\casenta\mongoose\mongoose.c">
<Filter>_external_dependencies</Filter>
</ClCompile>
<ClCompile Include="external_dependencies\leonetienne\JasonPP\JasonPP.cpp">
<Filter>_external_dependencies</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="JasonPP.hpp">
<Filter>_external_dependencies</Filter>
</ClInclude>
<ClInclude Include="mongoose.h">
<Filter>_external_dependencies</Filter>
</ClInclude>
<ClInclude Include="Logger.h"> <ClInclude Include="Logger.h">
<Filter>Headerdateien</Filter> <Filter>Headerdateien</Filter>
</ClInclude> </ClInclude>
@ -104,5 +98,11 @@
<ClInclude Include="ConsoleManager.h"> <ClInclude Include="ConsoleManager.h">
<Filter>Headerdateien</Filter> <Filter>Headerdateien</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="external_dependencies\casenta\mongoose\mongoose.h">
<Filter>_external_dependencies</Filter>
</ClInclude>
<ClInclude Include="external_dependencies\leonetienne\JasonPP\JasonPP.hpp">
<Filter>_external_dependencies</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "Filesystem.h" #include "Filesystem.h"
#include "JasonPP.hpp" #include "external_dependencies/leonetienne/JasonPP/JasonPP.hpp"
#include "Logger.h" #include "Logger.h"
#define XGCONFIG_FILE "config.json" #define XGCONFIG_FILE "config.json"

View File

@ -0,0 +1,13 @@
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

90
tubio-frontend-nuxt-app/.gitignore vendored Normal file
View File

@ -0,0 +1,90 @@
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
/logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# Nuxt generate
dist
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless
# IDE / Editor
.idea
# Service worker
sw.*
# macOS
.DS_Store
# Vim swap files
*.swp

View File

@ -0,0 +1,20 @@
# tubio-frontend-nuxt-app
## Build Setup
```bash
# install dependencies
$ yarn install
# serve with hot reload at localhost:3000
$ yarn dev
# build for production and launch server
$ yarn build
$ yarn start
# generate static project
$ yarn generate
```
For detailed explanation on how things work, check out [Nuxt.js docs](https://nuxtjs.org).

View File

@ -0,0 +1,7 @@
# ASSETS
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your un-compiled assets such as LESS, SASS, or JavaScript.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked).

View File

@ -0,0 +1,29 @@
<template>
<svg class="NuxtLogo" width="245" height="180" viewBox="0 0 452 342" xmlns="http://www.w3.org/2000/svg">
<path
d="M139 330l-1-2c-2-4-2-8-1-13H29L189 31l67 121 22-16-67-121c-1-2-9-14-22-14-6 0-15 2-22 15L5 303c-1 3-8 16-2 27 4 6 10 12 24 12h136c-14 0-21-6-24-12z"
fill="#00C58E"
/>
<path
d="M447 304L317 70c-2-2-9-15-22-15-6 0-15 3-22 15l-17 28v54l39-67 129 230h-49a23 23 0 0 1-2 14l-1 1c-6 11-21 12-23 12h76c3 0 17-1 24-12 3-5 5-14-2-26z"
fill="#108775"
/>
<path
d="M376 330v-1l1-2c1-4 2-8 1-12l-4-12-102-178-15-27h-1l-15 27-102 178-4 12a24 24 0 0 0 2 15c4 6 10 12 24 12h190c3 0 18-1 25-12zM256 152l93 163H163l93-163z"
fill="#2F495E"
/>
</svg>
</template>
<style>
.NuxtLogo {
animation: 1s appear;
margin: auto;
}
@keyframes appear {
0% {
opacity: 0;
}
}
</style>

View File

@ -0,0 +1,7 @@
# COMPONENTS
**This directory is not required, you can delete it if you don't want to use it.**
The components directory contains your Vue.js Components.
_Nuxt.js doesn't supercharge these components._

View File

@ -0,0 +1,7 @@
# LAYOUTS
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your Application Layouts.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts).

View File

@ -0,0 +1,62 @@
<template>
<div>
<Nuxt />
</div>
</template>
<style>
html {
font-family:
'Source Sans Pro',
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
'Helvetica Neue',
Arial,
sans-serif;
font-size: 16px;
word-spacing: 1px;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
box-sizing: border-box;
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
}
.button--green {
display: inline-block;
border-radius: 4px;
border: 1px solid #3b8070;
color: #3b8070;
text-decoration: none;
padding: 10px 30px;
}
.button--green:hover {
color: #fff;
background-color: #3b8070;
}
.button--grey {
display: inline-block;
border-radius: 4px;
border: 1px solid #35495e;
color: #35495e;
text-decoration: none;
padding: 10px 30px;
margin-left: 15px;
}
.button--grey:hover {
color: #fff;
background-color: #35495e;
}
</style>

View File

@ -0,0 +1,8 @@
# MIDDLEWARE
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your application middleware.
Middleware let you define custom functions that can be run before rendering either a page or a group of pages.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware).

View File

@ -0,0 +1,49 @@
export default {
// Target (https://go.nuxtjs.dev/config-target)
target: 'static',
// Global page headers (https://go.nuxtjs.dev/config-head)
head: {
title: 'tubio-frontend-nuxt-app',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
},
// Global CSS (https://go.nuxtjs.dev/config-css)
css: [
],
// Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
plugins: [
],
// Auto import components (https://go.nuxtjs.dev/config-components)
components: true,
// Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
buildModules: [
// https://go.nuxtjs.dev/stylelint
'@nuxtjs/stylelint-module',
// https://go.nuxtjs.dev/tailwindcss
'@nuxtjs/tailwindcss',
],
// Modules (https://go.nuxtjs.dev/config-modules)
modules: [
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
],
// Axios module configuration (https://go.nuxtjs.dev/config-axios)
axios: {},
// Build Configuration (https://go.nuxtjs.dev/config-build)
build: {
}
}

View File

@ -0,0 +1,24 @@
{
"name": "tubio-frontend-nuxt-app",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"lint:style": "stylelint **/*.{vue,css} --ignore-path .gitignore",
"lint": "yarn lint:style"
},
"dependencies": {
"@nuxtjs/axios": "^5.12.2",
"core-js": "^3.6.5",
"nuxt": "^2.14.5"
},
"devDependencies": {
"@nuxtjs/stylelint-module": "^4.0.0",
"@nuxtjs/tailwindcss": "^3.0.2",
"stylelint": "^13.7.0",
"stylelint-config-standard": "^20.0.0"
}
}

View File

@ -0,0 +1,6 @@
# PAGES
This directory contains your Application Views and Routes.
The framework reads all the `*.vue` files inside this directory and creates the router of your application.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing).

View File

@ -0,0 +1,78 @@
<template>
<div class="container">
<div>
<Logo />
<h1 class="title">
tubio-frontend-nuxt-app
</h1>
<div class="links">
<a
href="https://nuxtjs.org/"
target="_blank"
rel="noopener noreferrer"
class="button--green"
>
Documentation
</a>
<a
href="https://github.com/nuxt/nuxt.js"
target="_blank"
rel="noopener noreferrer"
class="button--grey"
>
GitHub
</a>
</div>
</div>
</div>
</template>
<script>
export default {}
</script>
<style>
/* Sample `apply` at-rules with Tailwind CSS
.container {
@apply min-h-screen flex justify-center items-center text-center mx-auto;
}
*/
.container {
margin: 0 auto;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
}
.title {
font-family:
'Quicksand',
'Source Sans Pro',
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
'Helvetica Neue',
Arial,
sans-serif;
display: block;
font-weight: 300;
font-size: 100px;
color: #35495e;
letter-spacing: 1px;
}
.subtitle {
font-weight: 300;
font-size: 42px;
color: #526488;
word-spacing: 5px;
padding-bottom: 15px;
}
.links {
padding-top: 15px;
}
</style>

View File

@ -0,0 +1,7 @@
# PLUGINS
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains Javascript plugins that you want to run before mounting the root Vue.js application.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/plugins).

View File

@ -0,0 +1,11 @@
# STATIC
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your static files.
Each file inside this directory is mapped to `/`.
Thus you'd want to delete this README.md before deploying to production.
Example: `/static/robots.txt` is mapped as `/robots.txt`.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#static).

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,10 @@
# STORE
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your Vuex Store files.
Vuex Store option is implemented in the Nuxt.js framework.
Creating a file in this directory automatically activates the option in the framework.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/vuex-store).

View File

@ -0,0 +1,8 @@
module.exports = {
extends: [
'stylelint-config-standard',
],
// add your custom config here
// https://stylelint.io/user-guide/configuration
rules: {}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
rm -rf './Tubio/JasonPP.hpp' rm -rf './Tubio/external_dependencies/leonetienne/JasonPP/JasonPP.hpp'
rm -rf './Tubio/JasonPP.cpp' rm -rf './Tubio/external_dependencies/leonetienne/JasonPP/JasonPP.cpp'
curl https://raw.githubusercontent.com/Leonetienne/JasonPP/master/INCLUDE/release/JasonPP.hpp > './Tubio/JasonPP.hpp' curl https://raw.githubusercontent.com/Leonetienne/JasonPP/master/INCLUDE/release/JasonPP.hpp > './Tubio/external_dependencies/leonetienne/JasonPP/JasonPP.hpp'
curl https://raw.githubusercontent.com/Leonetienne/JasonPP/master/INCLUDE/release/JasonPP.cpp > './Tubio/JasonPP.cpp' curl https://raw.githubusercontent.com/Leonetienne/JasonPP/master/INCLUDE/release/JasonPP.cpp > './Tubio/external_dependencies/leonetienne/JasonPP/JasonPP.cpp'

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
rm -rf './Tubio/mongoose.h' rm -rf './Tubio/external_dependencies/casenta/mongoose/mongoose.h'
rm -rf './Tubio/mongoose.c' rm -rf './Tubio/external_dependencies/casenta/mongoose/mongoose.c'
curl https://raw.githubusercontent.com/cesanta/mongoose/master/mongoose.h > './Tubio/mongoose.h' curl https://raw.githubusercontent.com/cesanta/mongoose/master/mongoose.h > './Tubio/external_dependencies/casenta/mongoose/mongoose.h'
curl https://raw.githubusercontent.com/cesanta/mongoose/master/mongoose.c > './Tubio/mongoose.c' curl https://raw.githubusercontent.com/cesanta/mongoose/master/mongoose.c > './Tubio/external_dependencies/casenta/mongoose/mongoose.c'