commit bffe12462bcc5c9ee0f2c7dfb15bc74ee96ac968 Author: David Ludwig Date: Sat Apr 24 23:04:03 2021 -0500 Initial commit diff --git a/.env b/.env new file mode 100644 index 0000000..e69de29 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9682dab --- /dev/null +++ b/.gitignore @@ -0,0 +1,74 @@ +# This file is used to ignore files which are generated +# ---------------------------------------------------------------------------- + +*~ +*.autosave +*.a +*.core +*.moc +*.o +*.obj +*.orig +*.rej +*.so +*.so.* +*_pch.h.cpp +*_resource.rc +*.qm +.#* +*.*# +build +core +!core/ +tags +.DS_Store +.directory +*.debug +Makefile* +*.prl +*.app +moc_*.cpp +ui_*.h +qrc_*.cpp +Thumbs.db +*.res +*.rc +/.qmake.cache +/.qmake.stash + +# qtcreator generated files +*.pro.user* + +# xemacs temporary files +*.flc + +# Vim temporary files +.*.swp + +# Visual Studio generated files +*.ib_pdb_index +*.idb +*.ilk +*.pdb +*.sln +*.suo +*.vcproj +*vcproj.*.*.user +*.ncb +*.sdf +*.opensdf +*.vcxproj +*vcxproj.* + +# MinGW generated files +*.Debug +*.Release + +# Python byte code +*.pyc + +# Binaries +# -------- +*.dll +*.exe + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..161d2e3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM qt-libtorrent-alpine AS base + +# Environment variables +ENV GID=1000 +ENV UID=1000 + +# Create a group and user and chown the workdir +RUN addgroup --gid ${GID} -S app && \ + adduser --uid ${UID} -S app -G app + +RUN mkdir /var/autoplex && chown app:app -R /var/autoplex + +USER app +WORKDIR /app + +# Dev environment +FROM base AS base-dev +USER root +RUN apk add build-base boost-dev +USER app + +# Build the application +FROM base-dev as builder + +# Copy the compiled application +FROM base AS prod +COPY --from=builder /app/build/release /app diff --git a/README.md b/README.md new file mode 100644 index 0000000..3f25672 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Autoplex Torrent Client v2 + +A new torrent client powered by Qt and Libtorrent to provide better reliability. diff --git a/build_debug.sh b/build_debug.sh new file mode 100755 index 0000000..2466a19 --- /dev/null +++ b/build_debug.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +mkdir -p build/debug && \ +cd build/debug && \ +qmake ../../torrent-client-v2.pro -spec linux-g++ CONFIG+=debug && \ +make diff --git a/build_release.sh b/build_release.sh new file mode 100755 index 0000000..a3c05fd --- /dev/null +++ b/build_release.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +mkdir -p build/release && \ +cd build/release && \ +qmake ../../torrent-client-v2.pro -spec linux-g++ && \ +make diff --git a/src/application.cpp b/src/application.cpp new file mode 100644 index 0000000..d14ebf7 --- /dev/null +++ b/src/application.cpp @@ -0,0 +1,7 @@ +#include "application.h" + +Application::Application(int argc, char *argv[]) + : QCoreApplication(argc, argv) +{ + +} diff --git a/src/application.h b/src/application.h new file mode 100644 index 0000000..ffa1de2 --- /dev/null +++ b/src/application.h @@ -0,0 +1,17 @@ +#ifndef APPLICATION_H +#define APPLICATION_H + +#include +#include + +class Application : public QCoreApplication +{ + Q_OBJECT +public: + Application(int argc, char *argv[]); + +signals: + +}; + +#endif // APPLICATION_H diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..d8ee122 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,8 @@ +#include "application.h" + +int main(int argc, char *argv[]) +{ + Application a(argc, argv); + + return a.exec(); +} diff --git a/torrent-client-v2.pro b/torrent-client-v2.pro new file mode 100644 index 0000000..1424cf3 --- /dev/null +++ b/torrent-client-v2.pro @@ -0,0 +1,21 @@ +QT -= gui +QT += network + +CONFIG += c++11 console +CONFIG -= app_bundle + +# You can make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \ + src/application.cpp \ + src/main.cpp + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target + +HEADERS += \ + src/application.h