commit
9180eb6efb
@ -0,0 +1,39 @@
|
||||
# compiled output
|
||||
out
|
||||
|
||||
# IDEs and editors
|
||||
mediarepo-api/.idea
|
||||
mediarepo-daemon/.idea
|
||||
|
||||
# IDE - VSCode
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
.history/*
|
||||
|
||||
# System Files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# other
|
||||
*.zip
|
||||
.vscode
|
||||
|
||||
# ui
|
||||
mediarepo-ui/.angular
|
||||
mediarepo-ui/.idea
|
||||
mediarepo-ui/dist
|
||||
mediarepo-ui/node_modules
|
||||
mediarepo-ui/src-tauri/target
|
||||
|
||||
# daemon
|
||||
mediarepo-daemon/.idea
|
||||
mediarepo-daemon/target
|
||||
mediarepo-daemon/*.svg
|
||||
mediarepo-daemon/*.folded
|
||||
|
||||
# api
|
||||
mediarepo-api/.idea
|
||||
mediarepo-api/target
|
@ -0,0 +1,87 @@
|
||||
# Contributing
|
||||
|
||||
Before contributing to this repository, please discuss the changes you're willing to make via an issue or on discord before
|
||||
making those changes.
|
||||
|
||||
|
||||
## Pull Request Process
|
||||
|
||||
1. Always submit Pull Requests to the develop branch unless it contains a hotfix
|
||||
2. Increase the API version according to the [SemVer](https://semver.org/) rules if you've done changes on the API
|
||||
3. Make sure that the project can be built and passes all automatic tests
|
||||
4. Your Pull Request will be merged after approval
|
||||
|
||||
|
||||
# Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, caste, color, religion, or sexual
|
||||
identity and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the overall
|
||||
community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or advances of
|
||||
any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email address,
|
||||
without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
me@trivernis.net.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org),
|
||||
version 2.1, available at
|
||||
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html).
|
@ -0,0 +1,40 @@
|
||||
ARG DEBIAN_RELEASE=bullseye
|
||||
|
||||
FROM bitnami/minideb:${DEBIAN_RELEASE} AS builder
|
||||
|
||||
WORKDIR /usr/src
|
||||
COPY mediarepo-api ./mediarepo-api
|
||||
COPY mediarepo-daemon ./mediarepo-daemon
|
||||
COPY mediarepo-ui ./mediarepo-ui
|
||||
COPY build.py .
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y \
|
||||
build-essential \
|
||||
libssl-dev \
|
||||
libgtk-3-dev \
|
||||
libappindicator3-0.1-cil-dev \
|
||||
patchelf \
|
||||
librsvg2-dev \
|
||||
curl \
|
||||
wget \
|
||||
pkg-config \
|
||||
libavutil-dev \
|
||||
libavformat-dev \
|
||||
libavcodec-dev \
|
||||
libavfilter-dev \
|
||||
libavdevice-dev \
|
||||
clang \
|
||||
nodejs \
|
||||
npm \
|
||||
libsoup2.4-dev \
|
||||
libwebkit2gtk-4.0-dev \
|
||||
file \
|
||||
python
|
||||
|
||||
RUN apt remove cmdtest -y
|
||||
|
||||
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
|
||||
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||
|
||||
RUN python3 build.py build
|
@ -0,0 +1,210 @@
|
||||
#!/bin/env python3
|
||||
import shutil as shut
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
tauri_cli_version = '1.0.0-rc.5'
|
||||
build_output = 'out'
|
||||
verbose = False
|
||||
ffmpeg = False
|
||||
|
||||
windows = os.name == 'nt'
|
||||
|
||||
|
||||
def exec(cmd: str, dir: str = None) -> str:
|
||||
print('Running: {}'.format(cmd))
|
||||
child = subprocess.run(cmd, shell=True, cwd=dir)
|
||||
child.check_returncode()
|
||||
|
||||
|
||||
def check_exec(name: str):
|
||||
print('Checking {}...'.format(name))
|
||||
|
||||
if shut.which(name) is None:
|
||||
raise Exception('{} not found'.format(name))
|
||||
exec(name + ' --version')
|
||||
|
||||
|
||||
def check_yarn():
|
||||
print('Checking yarn...')
|
||||
|
||||
if shut.which('yarn') is None:
|
||||
print('installing yarn...')
|
||||
npm('install -g yarn')
|
||||
check_exec('yarn')
|
||||
exec('yarn --version')
|
||||
|
||||
|
||||
def check_ng():
|
||||
print('Checking ng...')
|
||||
|
||||
if shut.which('ng') is None:
|
||||
print('installing ng...')
|
||||
npm('install -g @angular/cli')
|
||||
check_exec('ng')
|
||||
exec('ng --version')
|
||||
|
||||
|
||||
def store_artifact(path: str):
|
||||
print('Storing {}'.format(path))
|
||||
if os.path.isdir(path):
|
||||
shut.copytree(path, os.path.join(
|
||||
build_output, os.path.basename(path)), dirs_exist_ok=True)
|
||||
else:
|
||||
shut.copy(path, build_output)
|
||||
|
||||
|
||||
def cargo(cmd: str, dir: str = None):
|
||||
if verbose:
|
||||
exec('cargo {} --verbose'.format(cmd), dir)
|
||||
else:
|
||||
exec('cargo {}'.format(cmd), dir)
|
||||
|
||||
|
||||
def npm(cmd: str, dir: str = None):
|
||||
exec('npm {}'.format(cmd), dir)
|
||||
|
||||
|
||||
def yarn(cmd: str, dir: str = None):
|
||||
exec('yarn {}'.format(cmd), dir)
|
||||
|
||||
|
||||
def build_daemon():
|
||||
'''Builds daemon'''
|
||||
cargo('fetch', 'mediarepo-daemon')
|
||||
|
||||
if not ffmpeg:
|
||||
cargo('build --release --frozen --no-default-features', 'mediarepo-daemon')
|
||||
else:
|
||||
cargo('build --release --frozen', 'mediarepo-daemon')
|
||||
|
||||
if windows:
|
||||
store_artifact('mediarepo-daemon/target/release/mediarepo-daemon.exe')
|
||||
else:
|
||||
store_artifact('mediarepo-daemon/target/release/mediarepo-daemon')
|
||||
|
||||
|
||||
def build_ui():
|
||||
'''Builds UI'''
|
||||
cargo('install tauri-cli --version ^{}'.format(tauri_cli_version))
|
||||
yarn('install', 'mediarepo-ui')
|
||||
cargo('tauri build', 'mediarepo-ui')
|
||||
|
||||
if windows:
|
||||
store_artifact(
|
||||
'mediarepo-ui/src-tauri/target/release/mediarepo-ui.exe')
|
||||
else:
|
||||
store_artifact('mediarepo-ui/src-tauri/target/release/mediarepo-ui')
|
||||
|
||||
store_artifact('mediarepo-ui/src-tauri/target/release/bundle/')
|
||||
|
||||
|
||||
def check_daemon():
|
||||
'''Checks dependencies for daemon'''
|
||||
check_exec('clang')
|
||||
check_exec('cargo')
|
||||
|
||||
|
||||
def check_ui():
|
||||
'''Checks dependencies for UI'''
|
||||
|
||||
if not windows:
|
||||
check_exec('wget')
|
||||
check_exec('curl')
|
||||
check_exec('file')
|
||||
|
||||
check_exec('clang')
|
||||
check_exec('cargo')
|
||||
check_exec('node')
|
||||
check_exec('npm')
|
||||
check_yarn()
|
||||
check_ng()
|
||||
|
||||
|
||||
def check():
|
||||
'''Checks dependencies'''
|
||||
check_daemon()
|
||||
check_ui()
|
||||
print('All checks passed')
|
||||
|
||||
|
||||
def create_output_dir():
|
||||
'''Creates build output directory'''
|
||||
if not os.path.exists(build_output):
|
||||
os.mkdir(build_output)
|
||||
|
||||
|
||||
def clean():
|
||||
'''Removes build output'''
|
||||
if os.path.exists(build_output):
|
||||
shut.rmtree(build_output)
|
||||
print('Cleaned')
|
||||
|
||||
|
||||
def build(daemon=True, ui=True):
|
||||
'''Builds both daemon and UI'''
|
||||
clean()
|
||||
create_output_dir()
|
||||
|
||||
if daemon:
|
||||
check_daemon()
|
||||
build_daemon()
|
||||
|
||||
if ui:
|
||||
check_ui()
|
||||
build_ui()
|
||||
|
||||
print('Build complete')
|
||||
|
||||
|
||||
def parse_args():
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser(description='Build mediarepo')
|
||||
subparsers = parser.add_subparsers(dest='command')
|
||||
subparsers.required = True
|
||||
|
||||
subparsers.add_parser('check')
|
||||
|
||||
build_parser = subparsers.add_parser('build')
|
||||
build_parser.add_argument(
|
||||
'--daemon', action='store_true', help='Build daemon')
|
||||
build_parser.add_argument('--ui', action='store_true', help='Build UI')
|
||||
build_parser.add_argument(
|
||||
'--verbose', action='store_true', help='Verbose build')
|
||||
build_parser.add_argument(
|
||||
'--output', action='store', help='Build output directory')
|
||||
build_parser.add_argument(
|
||||
'--ffmpeg', action='store_true', help='Build with ffmpeg')
|
||||
|
||||
subparsers.add_parser('clean')
|
||||
args = parser.parse_args()
|
||||
return args
|
||||
|
||||
|
||||
def main():
|
||||
opts = parse_args()
|
||||
|
||||
if opts.command == 'build':
|
||||
global build_output
|
||||
build_output = opts.output if opts.output else build_output
|
||||
|
||||
global verbose
|
||||
verbose = opts.verbose
|
||||
|
||||
global ffmpeg
|
||||
ffmpeg = opts.ffmpeg
|
||||
|
||||
if opts.daemon:
|
||||
build(True, False)
|
||||
elif opts.ui:
|
||||
build(False, True)
|
||||
else:
|
||||
build()
|
||||
elif opts.command == 'check':
|
||||
check()
|
||||
elif opts.command == 'clean':
|
||||
clean()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
@ -1,16 +0,0 @@
|
||||
<h1 align="center">
|
||||
mediarepo-api
|
||||
</h1>
|
||||
<h3 align="center" color="red">
|
||||
This project is a work in progress
|
||||
</h3>
|
||||
|
||||
- - -
|
||||
|
||||
This repository contains common mediarepo API types to implement the API both serverside
|
||||
and clientside. It also contains a tauri plugin (feature "tauri-plugin") to hook it
|
||||
into the tauri application lifecycle.
|
||||
|
||||
## License
|
||||
|
||||
GPL-3
|
@ -1,35 +0,0 @@
|
||||
<h1 align="center">
|
||||
mediarepo-daemon
|
||||
</h1>
|
||||
<p align="center">
|
||||
<img src="https://github.com/Trivernis/mediarepo-ui/raw/main/src-tauri/icons/64x64.png"/>
|
||||
</p>
|
||||
<h3 align="center" style="color:red">This repository is a work in progress</h3>
|
||||
|
||||
- - -
|
||||
|
||||
This repository contains a media repository daemon that allows one to manage their media.
|
||||
|
||||
## Usage
|
||||
|
||||
1. Initialize an empty repository
|
||||
```
|
||||
mediarepo --repo "where/your/repo/should/be" init
|
||||
```
|
||||
|
||||
2. Import some images
|
||||
```
|
||||
mediarepo --repo "path/to/your/repo" import "path/to/your/files/as/**/glob/*.png"
|
||||
```
|
||||
|
||||
3. Start the daemon
|
||||
```
|
||||
mediarepo --repo "path/to/your/repo start
|
||||
```
|
||||
|
||||
4. Open the mediarepo-ui and connect to the repository
|
||||
|
||||
|
||||
## License
|
||||
|
||||
GPL-3
|
@ -1,33 +0,0 @@
|
||||
<h1 align="center">
|
||||
mediarepo-ui
|
||||
</h1>
|
||||
<p align="center">
|
||||
<img src="https://github.com/Trivernis/mediarepo-ui/raw/main/src-tauri/icons/64x64.png"/>
|
||||
</p>
|
||||
<h3 align="center" style="color:red">This repository is a work in progress</h3>
|
||||
|
||||
- - -
|
||||
|
||||
This repository contains a frontend client to connect to
|
||||
the [mediarepo-daemon](../mediarepo-daemon). It is written in tauri (yay).
|
||||
|
||||
## Usage
|
||||
|
||||
Refer to [the tauri documentation](https://tauri.studio/en/docs/getting-started) for information about setting up your
|
||||
environment to build this project. With the `cargo-tauri` tooling installed you can run
|
||||
|
||||
```
|
||||
cargo tauri dev
|
||||
```
|
||||
|
||||
to start the application in development mode or
|
||||
|
||||
```
|
||||
cargo tauri build
|
||||
```
|
||||
|
||||
to bundle the application.
|
||||
|
||||
## License
|
||||
|
||||
GPL-3
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue