Compare commits
30 Commits
Author | SHA1 | Date |
---|---|---|
wpetit | f0d068a4ef | |
wpetit | 9b835c2f6e | |
wpetit | 384b351fbc | |
wpetit | 7c75b478a3 | |
wpetit | 49c23e66de | |
wpetit | c1fdd2373b | |
wpetit | d15ce3eabd | |
wpetit | b56b50ff23 | |
wpetit | 768393adc8 | |
wpetit | 35585959f5 | |
wpetit | 0fcf0b6cc0 | |
wpetit | a7d1f37682 | |
wpetit | 74268493d6 | |
wpetit | 7b8165a0ec | |
wpetit | 654134e2d0 | |
wpetit | 8bd32adc51 | |
wpetit | f35b279515 | |
wpetit | 2306a08844 | |
wpetit | fa1ed6ea42 | |
wpetit | 071d597f3f | |
wpetit | 90572efeba | |
wpetit | dc8f0e577b | |
wpetit | 1c06382cec | |
wpetit | 378e0fae3e | |
wpetit | a20c6f5ff3 | |
wpetit | 7ba540f56f | |
wpetit | 8d46ff7ff8 | |
wpetit | acd71c84f6 | |
wpetit | 5b08439651 | |
wpetit | a1804d3a2e |
|
@ -1,2 +1,4 @@
|
|||
ARCAST_DESKTOP_ADDITIONAL_CHROME_ARGS=
|
||||
ARCAST_DESKTOP_INSTANCE_ID=
|
||||
ARCAST_DESKTOP_INSTANCE_ID=
|
||||
ARCAST_DESKTOP_APPS=true
|
||||
ARCAST_DESKTOP_ALLOWED_ORIGINS="*"
|
|
@ -3,4 +3,5 @@
|
|||
/.env
|
||||
/tools
|
||||
.mktools/
|
||||
/.gitea-release
|
||||
/.gitea-release
|
||||
*.keystore
|
|
@ -0,0 +1,96 @@
|
|||
project_name: arcast
|
||||
before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
builds:
|
||||
- id: arcast-player
|
||||
binary: arcast-player
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
flags:
|
||||
- -trimpath
|
||||
ldflags:
|
||||
- -s
|
||||
- -w
|
||||
- -X 'main.CommitRef={{ .Commit }}'
|
||||
- -X 'main.Version={{ .Version }}'
|
||||
goos:
|
||||
- linux
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
main: ./cmd/desktop
|
||||
- id: arcast-client
|
||||
binary: arcast-client
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
flags:
|
||||
- -trimpath
|
||||
ldflags:
|
||||
- -s
|
||||
- -w
|
||||
- -X 'main.CommitRef={{ .Commit }}'
|
||||
- -X 'main.Version={{ .Version }}'
|
||||
goos:
|
||||
- linux
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
main: ./cmd/client
|
||||
archives:
|
||||
- id: arcast-client
|
||||
builds: ["arcast-client"]
|
||||
name_template: '{{ .ProjectName }}-client_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
|
||||
files:
|
||||
- README.md
|
||||
- LICENCE
|
||||
- id: arcast-player
|
||||
builds: ["arcast-player"]
|
||||
name_template: '{{ .ProjectName }}-player_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
|
||||
files:
|
||||
- README.md
|
||||
- LICENCE
|
||||
checksum:
|
||||
name_template: "checksums.txt"
|
||||
snapshot:
|
||||
name_template: "{{ .Version }}"
|
||||
changelog:
|
||||
sort: asc
|
||||
filters:
|
||||
exclude:
|
||||
- "^docs:"
|
||||
- "^test:"
|
||||
nfpms:
|
||||
- id: arcast-player
|
||||
builds:
|
||||
- "arcast-player"
|
||||
package_name: arcast-player
|
||||
homepage: https://forge.cadoles.com/arcad/arcast
|
||||
maintainer: Cadoles <contact@cadoles.com>
|
||||
description: |-
|
||||
Web diffusion player
|
||||
license: AGPL-3.0
|
||||
formats:
|
||||
- apk
|
||||
- deb
|
||||
dependencies:
|
||||
- chromium | chromium-browser | google-chrome-stable
|
||||
contents:
|
||||
- src: misc/packaging/player.desktop
|
||||
dst: /usr/share/applications/arcast-player.desktop
|
||||
type: config
|
||||
- src: misc/logo/icon.png
|
||||
dst: /usr/share/pixmaps/arcast-player.png
|
||||
type: config
|
||||
- id: arcast-client
|
||||
builds:
|
||||
- "arcast-client"
|
||||
package_name: arcast-client
|
||||
homepage: https://forge.cadoles.com/arcad/arcast
|
||||
maintainer: Cadoles <contact@cadoles.com>
|
||||
description: |-
|
||||
Arcast player command-line client
|
||||
license: AGPL-3.0
|
||||
formats:
|
||||
- apk
|
||||
- deb
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"java.project.sourcePaths": ["apps/main/src"],
|
||||
"java.configuration.updateBuildConfiguration": "automatic"
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
@Library('cadoles') _
|
||||
|
||||
// Utilisation du pipeline "standard"
|
||||
// Voir https://forge.cadoles.com/Cadoles/Jenkins/src/branch/master/doc/tutorials/standard-make-pipeline.md
|
||||
standardMakePipeline([
|
||||
'baseImage': 'reg.cadoles.com/proxy_cache/library/ubuntu:24.04',
|
||||
'dockerfileExtension': '''
|
||||
ARG GOLANG_VERSION=1.22.0
|
||||
ARG NODEJS_VERSION=20.x
|
||||
|
||||
ENV ANDROID_HOME=/opt/android-sdk-linux
|
||||
ENV ANDROID_SDK_ROOT=${ANDROID_HOME}
|
||||
ENV ANDROID_NDK_HOME=${ANDROID_HOME}/ndk-bundle
|
||||
ENV PATH=${PATH}:/usr/local/go/bin/:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools
|
||||
|
||||
# Install utilities
|
||||
RUN apt-get update -y \
|
||||
&& apt-get install -y wget git curl tar build-essential ca-certificates git openjdk-17-jdk unzip locales jq moreutils
|
||||
|
||||
# Set locale
|
||||
RUN locale-gen en_US.UTF-8
|
||||
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
|
||||
|
||||
# Install NodeJS
|
||||
RUN wget -O- https://deb.nodesource.com/setup_${NODEJS_VERSION} | bash - \
|
||||
&& apt-get update -y \
|
||||
&& apt-get install -y nodejs
|
||||
|
||||
# Install Golang
|
||||
RUN wget -O golang.tar.gz https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz \
|
||||
&& tar -C /usr/local -xzf golang.tar.gz
|
||||
|
||||
# Install Android SDK/NDK
|
||||
RUN mkdir -p /opt/android-sdk-linux
|
||||
WORKDIR /opt/android-sdk-linux
|
||||
|
||||
RUN wget -O commandlinetools.zip https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip \
|
||||
&& mkdir -p ${ANDROID_HOME}/cmdline-tools/latest \
|
||||
&& unzip -q commandlinetools.zip -d ${ANDROID_HOME}/cmdline-tools/latest \
|
||||
&& mv ${ANDROID_HOME}/cmdline-tools/latest/cmdline-tools/* ${ANDROID_HOME}/cmdline-tools/latest/ \
|
||||
&& rm -f commandlinetools.zip
|
||||
|
||||
RUN echo y | cmdline-tools/latest/bin/sdkmanager --install \
|
||||
'platforms;android-31' \
|
||||
'ndk-bundle' \
|
||||
'build-tools;34.0.0' \
|
||||
'tools' \
|
||||
'platform-tools' \
|
||||
'extras;android;m2repository' \
|
||||
'extras;google;m2repository' \
|
||||
'extras;google;google_play_services'
|
||||
''',
|
||||
'hooks': [
|
||||
'pre-build': {
|
||||
sh '''
|
||||
make .mktools
|
||||
'''
|
||||
}
|
||||
],
|
||||
'credentials': [
|
||||
file(credentialsId: 'android-keystore', variable: 'ANDROID_KEYSTORE_FILE'),
|
||||
string(credentialsId: 'android-keystore-pass', variable: 'ANDROID_KEYSTORE_PASS'),
|
||||
usernamePassword(credentialsId: 'kipp-credentials', usernameVariable: 'MKT_GITEA_RELEASE_USERNAME', passwordVariable: 'MKT_GITEA_RELEASE_PASSWORD')
|
||||
]
|
||||
])
|
|
@ -0,0 +1,661 @@
|
|||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
94
Makefile
|
@ -1,15 +1,29 @@
|
|||
export PATH := $(PATH):$(PWD)/tools/gomobile/bin:$(PWD)/tools/gobind/bin
|
||||
|
||||
LINT_ARGS ?= --timeout 5m
|
||||
GORELEASER_VERSION ?= v1.13.1
|
||||
GORELEASER_ARGS ?= release --snapshot --rm-dist
|
||||
GORELEASER_VERSION ?= v1.25.1
|
||||
GORELEASER_ARGS ?= release --snapshot --clean
|
||||
GITCHLOG_ARGS ?=
|
||||
SHELL := /bin/bash
|
||||
JDK_PATH ?= /usr/lib/jvm/java-11-openjdk
|
||||
GOARCH ?= amd64
|
||||
|
||||
MKT_GITEA_RELEASE_PROJECT := arcast
|
||||
MKT_GITEA_RELEASE_ORG := arcad
|
||||
|
||||
GOTEST_ARGS ?= -short
|
||||
|
||||
ANDROID_KEYSTORE_FILE ?= .keystore
|
||||
ANDROID_KEYSTORE_KEY_ALIAS ?= arcast
|
||||
export ANDROID_KEYSTORE_PASS ?= NotSoSecret
|
||||
ANDROID_KEYSTORE_KEY_VALIDITY ?= 365000
|
||||
|
||||
ANDROID_BUILD_TOOLS_VERSION ?= 34.0.0
|
||||
|
||||
VERSION_CODE ?= $(shell git rev-list HEAD --first-parent --count)
|
||||
|
||||
APPS := main
|
||||
|
||||
watch: tools/modd/bin/modd deps ## Watching updated files - live reload
|
||||
( set -o allexport && source .env && set +o allexport && tools/modd/bin/modd )
|
||||
|
||||
|
@ -19,12 +33,17 @@ test: test-go ## Executing tests
|
|||
test-go: deps
|
||||
( set -o allexport && source .env && set +o allexport && go test -v -count=1 $(GOTEST_ARGS) ./... )
|
||||
|
||||
build: build-desktop build-android build-client ## Build artefacts
|
||||
build: build-apps build-desktop build-android build-client ## Build artefacts
|
||||
|
||||
build-apps: $(foreach name,$(APPS),build-app-$(name))
|
||||
|
||||
build-app-%:
|
||||
$(MAKE) -C apps/$* build
|
||||
|
||||
build-desktop: deps ## Build executable
|
||||
CGO_ENABLED=0 go build \
|
||||
CGO_ENABLED=0 GOARCH=$(GOARCH) go build \
|
||||
-v \
|
||||
-o ./bin/desktop \
|
||||
-o ./bin/desktop_$(GOARCH) \
|
||||
./cmd/desktop
|
||||
|
||||
build-client: deps ## Build executable
|
||||
|
@ -33,13 +52,44 @@ build-client: deps ## Build executable
|
|||
-o ./bin/client \
|
||||
./cmd/client
|
||||
|
||||
build-android: tools/gogio/bin/gogio deps ## Build executable
|
||||
mkdir -p dist
|
||||
GOOS=android CGO_CFLAGS="-I${JDK_PATH}/include -I${JDK_PATH}/include/linux -w" tools/gogio/bin/gogio -target android -buildmode archive -o android/app/libs/mobile.aar -x ./cmd/mobile
|
||||
( cd android && ./gradlew assembleDebug )
|
||||
.PHONY: android/app/libs/arcast.aar
|
||||
android/app/libs/arcast.aar: tools/gomobile/bin/gomobile tools/gobind/bin/gobind
|
||||
mkdir -p android/app/libs
|
||||
gomobile bind -v -javapkg com.cadoles.arcast -target android -o android/app/libs/arcast.aar ./pkg/android
|
||||
|
||||
install-android: build-android
|
||||
build-android: .mktools android/app/libs/arcast.aar deps ## Build executable
|
||||
mkdir -p dist
|
||||
( cd android && VERSION_CODE=$(VERSION_CODE) VERSION_NAME=$(MKT_PROJECT_VERSION)-debug ./gradlew assembleDebug )
|
||||
|
||||
$(ANDROID_KEYSTORE_FILE):
|
||||
keytool -genkey -noprompt \
|
||||
-alias $(ANDROID_KEYSTORE_KEY_ALIAS) \
|
||||
-dname "CN=cadoles.com, OU=Dev, O=Cadoles, L=Dijon, S=Bourgogne-FrancheComté, C=FR" \
|
||||
-keystore "$(ANDROID_KEYSTORE_FILE)" \
|
||||
-keyalg RSA \
|
||||
-validity $(ANDROID_KEYSTORE_KEY_VALIDITY) \
|
||||
-storepass "$(ANDROID_KEYSTORE_PASS)"
|
||||
|
||||
release-android: deps .mktools android/app/libs/arcast.aar $(ANDROID_KEYSTORE_FILE) ## Build executable
|
||||
mkdir -p dist
|
||||
( cd android && VERSION_CODE=$(VERSION_CODE) VERSION_NAME=$(MKT_PROJECT_VERSION) ./gradlew assemble )
|
||||
rm -f android/app/build/outputs/apk/release/app-release-unsigned-aligned.apk
|
||||
"$(ANDROID_HOME)/build-tools/$(ANDROID_BUILD_TOOLS_VERSION)/zipalign" -p 4 android/app/build/outputs/apk/release/app-release-unsigned.apk android/app/build/outputs/apk/release/app-release-unsigned-aligned.apk
|
||||
"$(ANDROID_HOME)/build-tools/$(ANDROID_BUILD_TOOLS_VERSION)/apksigner" \
|
||||
sign \
|
||||
--ks-key-alias $(ANDROID_KEYSTORE_KEY_ALIAS) \
|
||||
--ks "$(ANDROID_KEYSTORE_FILE)" \
|
||||
--ks-pass env:ANDROID_KEYSTORE_PASS \
|
||||
--in android/app/build/outputs/apk/release/app-release-unsigned-aligned.apk \
|
||||
--out android/app/build/outputs/apk/release/app-release.apk
|
||||
|
||||
install-android: build-apps build-android
|
||||
adb uninstall com.cadoles.arcast_player
|
||||
adb install android/app/build/outputs/apk/debug/app-debug.apk
|
||||
$(MAKE) run-android
|
||||
|
||||
run-android:
|
||||
adb shell am force-stop com.cadoles.arcast_player
|
||||
adb shell monkey -p com.cadoles.arcast_player -c android.intent.category.LAUNCHER 1
|
||||
|
||||
debug-android:
|
||||
|
@ -58,17 +108,16 @@ tools/modd/bin/modd:
|
|||
mkdir -p tools/modd/bin
|
||||
GOBIN=$(PWD)/tools/modd/bin go install github.com/cortesi/modd/cmd/modd@latest
|
||||
|
||||
tools/gogio/bin/gogio:
|
||||
mkdir -p tools/gogio/bin
|
||||
GOBIN=$(PWD)/tools/gogio/bin go install gioui.org/cmd/gogio@latest
|
||||
release: gitea-release
|
||||
|
||||
gitea-release: .mktools build
|
||||
gitea-release: .mktools build-apps goreleaser release-android
|
||||
rm -rf .gitea-release
|
||||
mkdir -p .gitea-release
|
||||
|
||||
cp ./bin/desktop .gitea-release/arcad_player_linux_amd64
|
||||
cp ./bin/client .gitea-release/arcad_client_linux_amd64
|
||||
cp ./android/app/build/outputs/apk/debug/app-debug.apk .gitea-release/arcast_player_debug.apk
|
||||
cp ./dist/*.apk .gitea-release/
|
||||
cp ./dist/*.deb .gitea-release/
|
||||
cp ./dist/*.tar.gz .gitea-release/
|
||||
cp ./android/app/build/outputs/apk/release/app-release.apk .gitea-release/arcast_player_$(MKT_PROJECT_VERSION)_android.apk
|
||||
|
||||
MKT_GITEA_RELEASE_PROJECT="arcast" \
|
||||
MKT_GITEA_RELEASE_ORG="arcad" \
|
||||
|
@ -82,6 +131,17 @@ gitea-release: .mktools build
|
|||
MKT_GITEA_RELEASE_ATTACHMENTS="$$(find .gitea-release/* -type f)" \
|
||||
$(MAKE) mkt-gitea-release
|
||||
|
||||
.PHONY: goreleaser
|
||||
goreleaser: .env .mktools
|
||||
( set -o allexport && source .env && set +o allexport && curl -sfL https://goreleaser.com/static/run | VERSION=$(GORELEASER_VERSION) GORELEASER_CURRENT_TAG="$(MKT_PROJECT_VERSION)" GOPATH=$(shell go env GOPATH) bash /dev/stdin $(GORELEASER_ARGS) )
|
||||
|
||||
tools/gomobile/bin/gomobile:
|
||||
mkdir -p tools/gomobile/bin
|
||||
GOBIN=$(PWD)/tools/gomobile/bin go install golang.org/x/mobile/cmd/gomobile@latest
|
||||
|
||||
tools/gobind/bin/gobind:
|
||||
mkdir -p tools/gobind/bin
|
||||
GOBIN=$(PWD)/tools/gobind/bin go install golang.org/x/mobile/cmd/gobind@latest
|
||||
|
||||
.PHONY: mktools
|
||||
mktools:
|
||||
|
|
39
README.md
|
@ -1,35 +1,28 @@
|
|||
<p align="center">
|
||||
<img src="./misc/logo/icon.png" width="200px" />
|
||||
</p>
|
||||
|
||||
# Arcast
|
||||
|
||||
Serveur de diffusion de contenu (Web) pour afficheurs numériques (Linux et Android).
|
||||
Serveur et client de diffusion de contenu (Web) pour afficheurs numériques (Linux et Android).
|
||||
|
||||
## Téléchargement
|
||||
|
||||
### Client en ligne de commande
|
||||
[Voir la dernière version](https://forge.cadoles.com/arcad/arcast/releases/latest)
|
||||
|
||||
Le client en ligne de commande vous permet de contrôler votre flotte de serveurs Arcast à partir de votre shell.
|
||||
Voici la liste des artefacts publiés:
|
||||
|
||||
[Démonstration d'utilisation du client](https://asciinema.org/a/627836)
|
||||
- Paquets Debian et dérivés: `*.deb` ;
|
||||
- Paquets Alpine Linux: `*_linux_<arch>.apk` ;
|
||||
- Paquets Android: `*_android.apk` ;
|
||||
- Archives pour les autres distributions GNU/Linux: `*_linux_<arch>.tar.gz`.
|
||||
|
||||
#### Dernière version
|
||||
Les architectures `amd64` et `arm64` sont aujourd'hui supportées.
|
||||
|
||||
- Linux: [`amd64`](https://forge.cadoles.com/arcad/arcast/releases/download/latest/arcad_client_linux_amd64)
|
||||
## Documentation
|
||||
|
||||
### Application Android
|
||||
Voir le répertoire [`doc`](./doc)
|
||||
|
||||
L'application `arcast_player` pour Android permet de transformer votre appareil Android en afficheur numérique.
|
||||
## Licence
|
||||
|
||||
#### Dernière version
|
||||
|
||||
- [`debug`](https://forge.cadoles.com/arcad/arcast/releases/download/latest/arcast_player_debug.apk)
|
||||
|
||||
### Application de bureau
|
||||
|
||||
L'application `arcast_player` pour Linux permet de transformer votre poste GNU/Linux en afficheur numérique.
|
||||
|
||||
#### Pré-requis
|
||||
|
||||
Avoir [Chromium](https://www.chromium.org/chromium-projects/) (ou `Google Chrome`) installé sur son poste GNU/Linux.
|
||||
|
||||
#### Dernière version
|
||||
|
||||
- Linux: [`amd64`](https://forge.cadoles.com/arcad/arcast/releases/download/latest/arcad_player_linux_amd64)
|
||||
[AGPL-3.0](./LICENCE)
|
||||
|
|
|
@ -3,6 +3,9 @@ plugins {
|
|||
id 'org.jetbrains.kotlin.android'
|
||||
}
|
||||
|
||||
def appVersionCode = Integer.valueOf(System.env.VERSION_CODE ?: 1)
|
||||
def appVersionName = System.env.VERSION_NAME ?: "0.0.0"
|
||||
|
||||
android {
|
||||
namespace 'com.cadoles.arcast_player'
|
||||
compileSdk 34
|
||||
|
@ -11,8 +14,8 @@ android {
|
|||
applicationId "com.cadoles.arcast_player"
|
||||
minSdk 24
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
versionCode appVersionCode
|
||||
versionName appVersionName
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
|
@ -25,6 +28,10 @@ android {
|
|||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
debug {
|
||||
applicationIdSuffix = ".debug"
|
||||
versionNameSuffix = "-debug"
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
|
@ -47,7 +54,6 @@ android {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.core:core-ktx:1.10.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
|
||||
implementation 'androidx.activity:activity-compose:1.7.0'
|
||||
|
@ -56,7 +62,7 @@ dependencies {
|
|||
implementation 'androidx.compose.ui:ui-graphics'
|
||||
implementation 'androidx.compose.ui:ui-tooling-preview'
|
||||
implementation 'androidx.compose.material3:material3'
|
||||
implementation files('libs/sys_android.jar')
|
||||
implementation("androidx.webkit:webkit:1.10.0")
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/mobile.aar
|
||||
/mobile.aar
|
||||
/arcast*
|
|
@ -3,14 +3,12 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:targetSandboxVersion="1">
|
||||
|
||||
<uses-feature android:glEsVersion="0x00030000"/>
|
||||
<uses-feature android:glEsVersion="0x00030000" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
|
@ -18,7 +16,7 @@
|
|||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:roundIcon="@mipmap/ic_launcher"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Arcastplayer"
|
||||
android:usesCleartextTraffic="true"
|
||||
|
@ -35,12 +33,6 @@
|
|||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name="org.gioui.GioActivity"
|
||||
android:theme="@style/Theme.GioApp"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
android:keepScreenOn="true">
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
|
@ -0,0 +1,31 @@
|
|||
package com.example.arcast_player
|
||||
|
||||
import android.webkit.WebView
|
||||
import com.cadoles.arcast.android.Bridge
|
||||
|
||||
class ArcastBridge(private val webview: WebView) : Bridge {
|
||||
private var title: String = ""
|
||||
private var url: String = ""
|
||||
|
||||
override fun getTitle(): String {
|
||||
return title
|
||||
}
|
||||
|
||||
override fun getURL(): String {
|
||||
return url
|
||||
}
|
||||
|
||||
override fun loadURL(url: String) {
|
||||
webview.post(Runnable {
|
||||
webview.loadUrl(url)
|
||||
})
|
||||
}
|
||||
|
||||
fun setURL(url: String) {
|
||||
this.url = url
|
||||
}
|
||||
|
||||
fun setTitle(title: String) {
|
||||
this.title = title
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.example.arcast_player
|
||||
|
||||
import android.webkit.WebResourceRequest
|
||||
import android.webkit.WebView
|
||||
import android.webkit.WebViewClient
|
||||
|
||||
class ArcastWebviewClient(private var bridge: ArcastBridge): WebViewClient() {
|
||||
|
||||
override fun shouldOverrideUrlLoading(view: WebView?, request: WebResourceRequest?): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onPageFinished(view: WebView?, url: String?) {
|
||||
super.onPageFinished(view, url)
|
||||
bridge.title = view?.title.toString()
|
||||
bridge.url = url.toString()
|
||||
}
|
||||
}
|
|
@ -12,29 +12,26 @@ import androidx.compose.runtime.Composable
|
|||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import com.cadoles.arcast_player.ui.theme.ArcastplayerTheme
|
||||
import org.gioui.GioActivity
|
||||
import android.view.WindowManager
|
||||
import android.webkit.WebView
|
||||
import com.cadoles.arcast.android.Android as Arcast
|
||||
import com.example.arcast_player.ArcastBridge
|
||||
import com.example.arcast_player.ArcastWebviewClient
|
||||
|
||||
class MainActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
startActivity(Intent(this, GioActivity::class.java))
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||
}
|
||||
}
|
||||
val wv = WebView(applicationContext)
|
||||
val bridge: ArcastBridge = ArcastBridge(wv)
|
||||
|
||||
@Composable
|
||||
fun Greeting(name: String, modifier: Modifier = Modifier) {
|
||||
Text(
|
||||
text = "Hello $name!",
|
||||
modifier = modifier
|
||||
)
|
||||
}
|
||||
wv.webViewClient = ArcastWebviewClient(bridge)
|
||||
Arcast.setBridge(bridge)
|
||||
|
||||
@Preview(showBackground = true)
|
||||
@Composable
|
||||
fun GreetingPreview() {
|
||||
ArcastplayerTheme {
|
||||
Greeting("Android")
|
||||
val port = Arcast.startServer(filesDir.absolutePath)
|
||||
|
||||
wv.settings.javaScriptEnabled = true
|
||||
wv.loadUrl("http://127.0.0.1:${port}")
|
||||
|
||||
setContentView(wv)
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<background android:drawable="@mipmap/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
<monochrome android:drawable="@mipmap/ic_launcher_monochrome"/>
|
||||
</adaptive-icon>
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 982 B |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 9.3 KiB |
After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 7.6 KiB |
|
@ -1,3 +1,3 @@
|
|||
<resources>
|
||||
<string name="app_name">arcast-player</string>
|
||||
<string name="app_name">Arcast Player</string>
|
||||
</resources>
|
|
@ -0,0 +1,56 @@
|
|||
package arcast
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"encoding/json"
|
||||
"io/fs"
|
||||
"path/filepath"
|
||||
|
||||
"forge.cadoles.com/arcad/arcast/pkg/server"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
var (
|
||||
DefaultApps []server.App
|
||||
//go:embed apps/main/build/**
|
||||
appsFS embed.FS
|
||||
)
|
||||
|
||||
func init() {
|
||||
defaultApps, err := loadApps(
|
||||
"apps/main/build",
|
||||
)
|
||||
if err != nil {
|
||||
panic(errors.WithStack(err))
|
||||
}
|
||||
|
||||
DefaultApps = defaultApps
|
||||
}
|
||||
|
||||
func loadApps(appDirs ...string) ([]server.App, error) {
|
||||
apps := make([]server.App, 0)
|
||||
|
||||
for _, dir := range appDirs {
|
||||
rawManifest, err := fs.ReadFile(appsFS, filepath.Join(dir, "arcast-app.json"))
|
||||
if err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
|
||||
var app server.App
|
||||
|
||||
if err := json.Unmarshal(rawManifest, &app); err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
|
||||
fs, err := fs.Sub(appsFS, dir)
|
||||
if err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
|
||||
app.FS = fs
|
||||
|
||||
apps = append(apps, app)
|
||||
}
|
||||
|
||||
return apps, nil
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"rules": {
|
||||
"react-hooks/exhaustive-deps": "off"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
|
@ -0,0 +1,12 @@
|
|||
.PHONY: build
|
||||
build: node_modules
|
||||
npm run build
|
||||
|
||||
node_modules:
|
||||
npm ci
|
||||
|
||||
.env.development.local:
|
||||
echo "REACT_APP_ARCAST_SERVER_BASE_URL=http://127.0.0.1:45555" > .env.development.local
|
||||
|
||||
dev: .env.development.local
|
||||
npm run start
|
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
"name": "main",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@tanstack/react-query": "^5.32.0",
|
||||
"@testing-library/jest-dom": "^5.17.0",
|
||||
"@testing-library/react": "^13.4.0",
|
||||
"@testing-library/user-event": "^13.5.0",
|
||||
"@types/jest": "^27.5.2",
|
||||
"@types/node": "^16.18.96",
|
||||
"@types/react": "^18.2.79",
|
||||
"@types/react-dom": "^18.2.25",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-router-dom": "^6.23.0",
|
||||
"react-scripts": "5.0.1",
|
||||
"typescript": "^4.9.5",
|
||||
"web-vitals": "^2.1.4",
|
||||
"webrtc-adapter": "^9.0.1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"react-app",
|
||||
"react-app/jest"
|
||||
]
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
},
|
||||
"homepage": "/apps/main",
|
||||
"devDependencies": {
|
||||
"@babel/plugin-proposal-private-property-in-object": "^7.21.11"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"id": "main",
|
||||
"title": {
|
||||
"fr": "Accueil",
|
||||
"en": "Home"
|
||||
},
|
||||
"description": {
|
||||
"fr": "Voir la liste des applications",
|
||||
"en": "See apps list"
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 3.8 KiB |
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<meta
|
||||
name="description"
|
||||
content="Web site created using create-react-app"
|
||||
/>
|
||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
||||
<!--
|
||||
manifest.json provides metadata used when your web app is installed on a
|
||||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
||||
-->
|
||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||
<!--
|
||||
Notice the use of %PUBLIC_URL% in the tags above.
|
||||
It will be replaced with the URL of the `public` folder during the build.
|
||||
Only files inside the `public` folder can be referenced from the HTML.
|
||||
|
||||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
||||
work correctly both with client-side routing and a non-root public URL.
|
||||
Learn how to configure a non-root public URL by running `npm run build`.
|
||||
-->
|
||||
<title>Main | Apps | Arcast</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
<!--
|
||||
This HTML file is a template.
|
||||
If you open it directly in the browser, you will see an empty page.
|
||||
|
||||
You can add webfonts, meta tags, or analytics to this file.
|
||||
The build step will place the bundled scripts into the <body> tag.
|
||||
|
||||
To begin the development, run `npm start` or `yarn start`.
|
||||
To create a production bundle, use `npm run build` or `yarn build`.
|
||||
-->
|
||||
</body>
|
||||
</html>
|
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 9.4 KiB |
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"short_name": "React App",
|
||||
"name": "Create React App Sample",
|
||||
"icons": [
|
||||
{
|
||||
"src": "favicon.ico",
|
||||
"sizes": "64x64 32x32 24x24 16x16",
|
||||
"type": "image/x-icon"
|
||||
},
|
||||
{
|
||||
"src": "logo192.png",
|
||||
"type": "image/png",
|
||||
"sizes": "192x192"
|
||||
},
|
||||
{
|
||||
"src": "logo512.png",
|
||||
"type": "image/png",
|
||||
"sizes": "512x512"
|
||||
}
|
||||
],
|
||||
"start_url": ".",
|
||||
"display": "standalone",
|
||||
"theme_color": "#000000",
|
||||
"background_color": "#ffffff"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
# https://www.robotstxt.org/robotstxt.html
|
||||
User-agent: *
|
||||
Disallow:
|
|
@ -0,0 +1,36 @@
|
|||
import React, { FunctionComponent } from "react";
|
||||
|
||||
import { createHashRouter, RouterProvider } from "react-router-dom";
|
||||
import { Layout } from "./components/Layout/Layout";
|
||||
|
||||
import { HomePage } from "./pages/HomePage/HomePage";
|
||||
import { ScreenSharingPage } from "./pages/ScreenSharingPage/ScreenSharingPage";
|
||||
|
||||
const router = createHashRouter([
|
||||
{
|
||||
path: "/",
|
||||
element: <Layout />,
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
element: <HomePage />,
|
||||
},
|
||||
{
|
||||
path: "/screen-sharing",
|
||||
element: <ScreenSharingPage />,
|
||||
children: [
|
||||
{
|
||||
path: "sessions/:sessionId",
|
||||
element: <ScreenSharingPage />,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
||||
export const App: FunctionComponent = () => {
|
||||
return <RouterProvider router={router} />;
|
||||
};
|
||||
|
||||
export default App;
|
|
@ -0,0 +1,164 @@
|
|||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
|
||||
const BASE_URL = process.env.REACT_APP_ARCAST_SERVER_BASE_URL ?? ""
|
||||
|
||||
export interface AppInfos {
|
||||
defaultApp: string;
|
||||
apps: App[];
|
||||
}
|
||||
|
||||
export interface App {
|
||||
id: string;
|
||||
title: { [lang: string]: string };
|
||||
description: { [lang: string]: string };
|
||||
icon: string;
|
||||
hidden: boolean;
|
||||
}
|
||||
|
||||
export const usePlayerAppInfos = () => {
|
||||
return useQuery({
|
||||
queryKey: ["appsInfos"],
|
||||
queryFn: getAppInfos,
|
||||
select: (appInfos) => appInfos ?? { apps: [], defaultApp: "main" }
|
||||
})
|
||||
}
|
||||
|
||||
export async function getAppInfos() {
|
||||
const response = await fetch(`${BASE_URL}/api/v1/apps`);
|
||||
const result = await response.json();
|
||||
const appInfos = result.data as AppInfos;
|
||||
return appInfos;
|
||||
}
|
||||
|
||||
|
||||
export interface Status {
|
||||
id: string
|
||||
status: string
|
||||
title: string
|
||||
url: string
|
||||
}
|
||||
|
||||
export const usePlayerStatus = () => {
|
||||
return useQuery({
|
||||
queryKey: ["playerStatus"],
|
||||
queryFn: getStatus,
|
||||
select: (status) => status ?? {}
|
||||
})
|
||||
}
|
||||
|
||||
export async function getStatus() {
|
||||
const response = await fetch(`${BASE_URL}/api/v1/status`);
|
||||
const result = await response.json();
|
||||
const appInfos = result.data as Status;
|
||||
return appInfos;
|
||||
}
|
||||
|
||||
export interface BroadcastChannel {
|
||||
opened: boolean
|
||||
send: (data: string | ArrayBufferLike | Blob | ArrayBufferView) => void
|
||||
close: () => void
|
||||
}
|
||||
|
||||
export function getBroadcastChannel(channelId: string, onmessage?: (data: any) => void): BroadcastChannel {
|
||||
let location: Location | URL = window.location
|
||||
if (BASE_URL !== "") {
|
||||
location = new URL(BASE_URL)
|
||||
}
|
||||
|
||||
let scheme = "wss";
|
||||
if (location.protocol === "http:") {
|
||||
scheme = "ws";
|
||||
}
|
||||
|
||||
var ws = new WebSocket(
|
||||
`${scheme}://${location.host}/api/v1/broadcast/${channelId}`
|
||||
);
|
||||
|
||||
const pending: (string | ArrayBufferLike | Blob | ArrayBufferView)[] = []
|
||||
|
||||
var channel = {
|
||||
opened: false,
|
||||
send: (message: string | ArrayBufferLike | Blob | ArrayBufferView) => {
|
||||
if (channel.opened) {
|
||||
ws.send(message);
|
||||
} else {
|
||||
pending.push(message)
|
||||
}
|
||||
},
|
||||
close: () => {
|
||||
ws.close();
|
||||
},
|
||||
};
|
||||
|
||||
ws.onmessage = (evt: MessageEvent<any>) => {
|
||||
if (typeof onmessage !== "function") {
|
||||
return;
|
||||
}
|
||||
|
||||
onmessage(evt.data);
|
||||
};
|
||||
ws.onclose = () => {
|
||||
ws.onmessage = null;
|
||||
ws.onclose = null;
|
||||
ws.onopen = null;
|
||||
channel.opened = false;
|
||||
};
|
||||
ws.onopen = () => {
|
||||
channel.opened = true;
|
||||
while (pending.length > 0) {
|
||||
const message = pending.shift()
|
||||
if (message) ws.send(message)
|
||||
}
|
||||
};
|
||||
|
||||
return channel;
|
||||
}
|
||||
|
||||
|
||||
export async function cast(url: string): Promise<Status> {
|
||||
const response = await fetch(`${BASE_URL}/api/v1/cast`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({ url })
|
||||
});
|
||||
const result = await response.json();
|
||||
const status = result.data as Status;
|
||||
return status;
|
||||
}
|
||||
|
||||
export function useCast() {
|
||||
const queryClient = useQueryClient()
|
||||
|
||||
return useMutation({
|
||||
mutationFn: (params: { url: string }) => cast(params.url),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['playerStatus'] })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export async function reset(): Promise<Status> {
|
||||
const response = await fetch(`${BASE_URL}/api/v1/cast`, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
});
|
||||
const result = await response.json();
|
||||
const status = result.data as Status;
|
||||
return status;
|
||||
}
|
||||
|
||||
export function useReset() {
|
||||
const queryClient = useQueryClient()
|
||||
|
||||
return useMutation({
|
||||
mutationFn: () => reset(),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['playerStatus'] })
|
||||
}
|
||||
})
|
||||
}
|
|
@ -0,0 +1,275 @@
|
|||
import { BroadcastChannel, cast, getBroadcastChannel } from "./arcast"
|
||||
|
||||
export class ScreenSharing extends EventTarget {
|
||||
signaling: BroadcastChannel
|
||||
handlers: { [messageType: string]: (data: { type: string, data: any }) => void }
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
this.handlers = {}
|
||||
this.signaling = getBroadcastChannel("arcast.screen-sharing", this.onSignal.bind(this))
|
||||
}
|
||||
|
||||
onSignal(data: any) {
|
||||
let message: any
|
||||
try {
|
||||
message = JSON.parse(data)
|
||||
} catch (err) {
|
||||
console.warn(err)
|
||||
return
|
||||
}
|
||||
|
||||
if (typeof message.type !== "string") return
|
||||
|
||||
const handler = this.handlers[message.type]
|
||||
|
||||
if (!handler) return
|
||||
|
||||
handler(message.data)
|
||||
}
|
||||
|
||||
send(type: string, data: any) {
|
||||
this.signaling.send(JSON.stringify({ type, data }));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export class ScreenSharingClient extends ScreenSharing {
|
||||
sessionId: string
|
||||
clientId: string
|
||||
|
||||
peerConnection: RTCPeerConnection | undefined
|
||||
|
||||
constructor(sessionId: string) {
|
||||
super()
|
||||
this.sessionId = sessionId
|
||||
this.clientId = window.crypto.randomUUID()
|
||||
this.handlers['server-offer'] = this.onServerOffer.bind(this)
|
||||
this.handlers['ice-candidate'] = this.onIceCandidate.bind(this)
|
||||
}
|
||||
|
||||
connect() {
|
||||
this.send("client-request", { clientId: this.clientId, sessionId: this.sessionId })
|
||||
}
|
||||
|
||||
close() {
|
||||
this.signaling.close()
|
||||
}
|
||||
|
||||
async onServerOffer(message: any) {
|
||||
if (!this.checkMessage(message)) return
|
||||
|
||||
const conn = new RTCPeerConnection()
|
||||
|
||||
conn.onicecandidate = this.sendCandidate.bind(this)
|
||||
conn.ontrack = this.onTrack.bind(this)
|
||||
conn.onconnectionstatechange = (evt: Event) => {
|
||||
const state = conn.connectionState
|
||||
this.dispatchEvent(new StateChangedEvent(state))
|
||||
}
|
||||
|
||||
await conn.setRemoteDescription(new RTCSessionDescription(message.offer))
|
||||
|
||||
const answer = await conn.createAnswer()
|
||||
await conn.setLocalDescription(answer)
|
||||
|
||||
this.peerConnection = conn
|
||||
|
||||
this.send("client-answer", { clientId: this.clientId, sessionId: this.sessionId, answer })
|
||||
}
|
||||
|
||||
sendCandidate(evt: RTCPeerConnectionIceEvent) {
|
||||
this.send("ice-candidate", {
|
||||
clientId: this.clientId,
|
||||
sessionId: this.sessionId,
|
||||
candidate: evt.candidate
|
||||
})
|
||||
}
|
||||
|
||||
onTrack(evt: RTCTrackEvent) {
|
||||
if (!evt.streams || evt.streams.length < 1) return;
|
||||
const stream = evt.streams[0]
|
||||
this.dispatchEvent(new StreamChangedEvent(stream))
|
||||
}
|
||||
|
||||
async onIceCandidate(message: any) {
|
||||
if (!this.checkMessage(message)) return
|
||||
if (!this.peerConnection) return
|
||||
if (!message.candidate) return
|
||||
|
||||
await this.peerConnection.addIceCandidate(message.candidate)
|
||||
}
|
||||
|
||||
checkMessage(message: any) {
|
||||
const sessionId = message.sessionId;
|
||||
if (!this.sessionId || sessionId !== this.sessionId) return false;
|
||||
|
||||
if (this.clientId !== message.clientId) return false;
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
export enum ScreenSharingServerState {
|
||||
Idle = "idle",
|
||||
Sharing = "sharing"
|
||||
}
|
||||
|
||||
export class ScreenSharingServer extends ScreenSharing {
|
||||
stream: MediaStream | undefined
|
||||
sessionId: string | undefined
|
||||
peerConnections: {
|
||||
[key: string]: RTCPeerConnection
|
||||
}
|
||||
|
||||
state: ScreenSharingServerState
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
this.peerConnections = {}
|
||||
this.state = ScreenSharingServerState.Idle
|
||||
this.handlers['client-request'] = this.onClientRequest.bind(this)
|
||||
this.handlers['client-answer'] = this.onClientAnswer.bind(this)
|
||||
this.handlers['ice-candidate'] = this.onIceCandidate.bind(this)
|
||||
}
|
||||
|
||||
async shareScreen(options?: DisplayMediaStreamOptions) {
|
||||
try {
|
||||
this.stream = await navigator.mediaDevices.getDisplayMedia(options)
|
||||
} catch (err) {
|
||||
console.warn(err)
|
||||
return
|
||||
}
|
||||
|
||||
this.sessionId = window.crypto.randomUUID()
|
||||
|
||||
const url = `http://127.0.0.1:45555/apps/main/#screen-sharing/sessions/${this.sessionId}`
|
||||
cast(url)
|
||||
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
window.open(`http://localhost:3000/apps/main/#screen-sharing/sessions/${this.sessionId}`, "_blank")
|
||||
}
|
||||
|
||||
this.state = ScreenSharingServerState.Sharing
|
||||
this.dispatchEvent(new StateChangedEvent(ScreenSharingServerState.Sharing))
|
||||
}
|
||||
|
||||
onClientRequest(message: any) {
|
||||
if (!this.checkMessage(message)) return
|
||||
this.addNewClient(message.clientId)
|
||||
}
|
||||
|
||||
async onIceCandidate(message: any) {
|
||||
if (!this.checkMessage(message)) return
|
||||
|
||||
const conn = this.peerConnections[message.clientId]
|
||||
if (!conn) return
|
||||
|
||||
if (!message.candidate) return
|
||||
|
||||
await conn.addIceCandidate(message.candidate)
|
||||
}
|
||||
|
||||
async onClientAnswer(message: any) {
|
||||
if (!this.checkMessage(message)) return
|
||||
|
||||
const conn = this.peerConnections[message.clientId]
|
||||
if (!conn) return
|
||||
|
||||
await conn.setRemoteDescription(new RTCSessionDescription(message.answer));
|
||||
}
|
||||
|
||||
checkMessage(message: any) {
|
||||
const sessionId = message.sessionId;
|
||||
if (!this.sessionId || sessionId !== this.sessionId) return false;
|
||||
|
||||
const clientId = message.clientId;
|
||||
if (!clientId) return false;
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
async addNewClient(clientId: string) {
|
||||
if (!this.stream) return
|
||||
|
||||
const conn = new RTCPeerConnection();
|
||||
const tracks = this.stream?.getVideoTracks()
|
||||
|
||||
if (!tracks || tracks.length === 0) {
|
||||
return
|
||||
}
|
||||
|
||||
conn.addTrack(tracks[0], this.stream)
|
||||
|
||||
const offer = await conn.createOffer()
|
||||
await conn.setLocalDescription(offer);
|
||||
|
||||
conn.onicecandidate = this.sendCandidate.bind(this, clientId)
|
||||
conn.onconnectionstatechange = (evt: Event) => {
|
||||
const isClosed = conn.connectionState === "disconnected" ||
|
||||
conn.connectionState === "failed"
|
||||
if (!isClosed) return;
|
||||
conn.onicecandidate = null;
|
||||
conn.onconnectionstatechange = null;
|
||||
conn.close();
|
||||
|
||||
console.log("Removing client", clientId);
|
||||
delete this.peerConnections[clientId];
|
||||
}
|
||||
|
||||
console.log("Adding client", clientId);
|
||||
this.peerConnections[clientId] = conn;
|
||||
|
||||
this.send("server-offer", { sessionId: this.sessionId, clientId, offer })
|
||||
}
|
||||
|
||||
sendCandidate(clientId: string, evt: RTCPeerConnectionIceEvent) {
|
||||
this.send("ice-candidate", {
|
||||
clientId,
|
||||
sessionId: this.sessionId,
|
||||
candidate: evt.candidate
|
||||
})
|
||||
}
|
||||
|
||||
close() {
|
||||
this.signaling.close()
|
||||
|
||||
Object.keys(this.peerConnections).forEach(clientId => {
|
||||
const conn = this.peerConnections[clientId];
|
||||
conn.onicecandidate = null;
|
||||
conn.onconnectionstatechange = null;
|
||||
conn.close();
|
||||
delete this.peerConnections[clientId]
|
||||
})
|
||||
|
||||
const tracks = this.stream?.getTracks()
|
||||
if (!tracks) return
|
||||
|
||||
tracks.forEach(track => track.stop())
|
||||
|
||||
this.state = ScreenSharingServerState.Idle
|
||||
this.dispatchEvent(new StateChangedEvent(ScreenSharingServerState.Idle))
|
||||
}
|
||||
}
|
||||
|
||||
export const StreamChangedEventType = "stream-changed"
|
||||
|
||||
export class StreamChangedEvent extends Event {
|
||||
stream: MediaStream
|
||||
|
||||
constructor(stream: MediaStream) {
|
||||
super(StreamChangedEventType)
|
||||
this.stream = stream
|
||||
}
|
||||
}
|
||||
|
||||
export const StateChangedEventType = "state-changed"
|
||||
|
||||
export class StateChangedEvent extends Event {
|
||||
state: string
|
||||
|
||||
constructor(state: string) {
|
||||
super(StateChangedEventType)
|
||||
this.state = state
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
.root {
|
||||
display: inline-block;
|
||||
background-color: hsl(208, 46%, 52%);
|
||||
cursor: pointer;
|
||||
padding: 10px 15px;
|
||||
border-radius: 5px;
|
||||
color: hsl(208, 46%, 15%);;
|
||||
font-weight: bolder;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.root:hover {
|
||||
background-color: hsl(208, 60%, 52%);
|
||||
color: hsl(208, 60%, 15%);;;
|
||||
}
|
||||
|
||||
.root > a {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
import { FunctionComponent, PropsWithChildren } from "react";
|
||||
import styles from "./Button.module.css";
|
||||
export interface ButtonProps extends PropsWithChildren {
|
||||
onClick?: React.MouseEventHandler<HTMLDivElement> | undefined;
|
||||
}
|
||||
|
||||
export const Button: FunctionComponent<ButtonProps> = ({
|
||||
children,
|
||||
onClick,
|
||||
}) => {
|
||||
return (
|
||||
<div className={styles.root} onClick={onClick}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
};
|
|
@ -0,0 +1,17 @@
|
|||
.root {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 768px) {
|
||||
.container {
|
||||
width: 90%;
|
||||
height: 90%;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
import { FunctionComponent, PropsWithChildren } from "react";
|
||||
import styles from "./Layout.module.css";
|
||||
import { Outlet } from "react-router-dom";
|
||||
|
||||
export interface LayoutProps extends PropsWithChildren {}
|
||||
|
||||
export const Layout: FunctionComponent<LayoutProps> = ({ children }) => {
|
||||
return (
|
||||
<div className={styles.root}>
|
||||
<div className={styles.container}>
|
||||
<Outlet />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
|
@ -0,0 +1,10 @@
|
|||
.root {
|
||||
display: block;
|
||||
background-color: #fff;
|
||||
border-radius: 15px;
|
||||
box-shadow: 10px 10px 10px #33333361;
|
||||
position: relative;
|
||||
padding: 30px 30px 30px 30px;
|
||||
min-width: 33%;
|
||||
color: #333;
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
import { FunctionComponent, PropsWithChildren } from "react";
|
||||
import styles from "./Panel.module.css";
|
||||
export interface PanelProps extends PropsWithChildren {}
|
||||
|
||||
export const Panel: FunctionComponent<PanelProps> = ({ children }) => {
|
||||
return <div className={styles.root}>{children}</div>;
|
||||
};
|
|
@ -0,0 +1,3 @@
|
|||
.root {
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
import { FunctionComponent, PropsWithChildren } from "react";
|
||||
import styles from "./Tabs.module.css";
|
||||
export interface TabsProps extends PropsWithChildren {}
|
||||
|
||||
export const Tabs: FunctionComponent<TabsProps> = ({ children }) => {
|
||||
return <div className={styles.root}>Tabs</div>;
|
||||
};
|
|
@ -0,0 +1,105 @@
|
|||
html {
|
||||
box-sizing: border-box;
|
||||
font-size: 16px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
|
||||
"Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
|
||||
"Helvetica Neue", sans-serif;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgb(76, 96, 188);
|
||||
background: linear-gradient(
|
||||
415deg,
|
||||
rgba(4, 168, 243, 1),
|
||||
rgb(76, 136, 188, 1),
|
||||
rgba(76, 96, 188, 1),
|
||||
rgb(115, 76, 188, 1),
|
||||
rgb(87, 76, 188, 1)
|
||||
);
|
||||
background-size: 400% 400%;
|
||||
animation: gradient 15s ease infinite;
|
||||
}
|
||||
|
||||
@keyframes gradient {
|
||||
0% {
|
||||
background-position: 0% 50%;
|
||||
}
|
||||
50% {
|
||||
background-position: 100% 50%;
|
||||
}
|
||||
100% {
|
||||
background-position: 0% 50%;
|
||||
}
|
||||
}
|
||||
|
||||
#root {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
*,
|
||||
*:before,
|
||||
*:after {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
body,
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6,
|
||||
p,
|
||||
ol,
|
||||
ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.panel {
|
||||
display: block;
|
||||
background-color: #fff;
|
||||
border-radius: 5px;
|
||||
padding: 10px 20px;
|
||||
box-shadow: 2px 2px #3333331d;
|
||||
}
|
||||
|
||||
.panel p, .panel ul {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.text-centered {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.text-italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.text-small {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
.fullwidth {
|
||||
width: 100%;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import "./index.css";
|
||||
import App from "./App";
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
|
||||
const queryClient = new QueryClient();
|
||||
|
||||
const root = ReactDOM.createRoot(
|
||||
document.getElementById("root") as HTMLElement
|
||||
);
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<App />
|
||||
</QueryClientProvider>
|
||||
</React.StrictMode>
|
||||
);
|
|
@ -0,0 +1,77 @@
|
|||
.root {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.columns {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.statusBlock {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 768px) {
|
||||
.columns {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
.columns > * {
|
||||
flex-grow: 1;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.separator {
|
||||
margin: 20px 0 10px 0;
|
||||
}
|
||||
|
||||
.castField {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
height: 40px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.castField > input {
|
||||
flex-grow: 1;
|
||||
height: 100%;
|
||||
border-right: 0;
|
||||
border-top: 1px solid #ccc;
|
||||
border-bottom: 1px solid #ccc;
|
||||
border-left: 1px solid #ccc;
|
||||
border-top-left-radius: 5px;
|
||||
border-bottom-left-radius: 5px;
|
||||
font-size: 100%;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.castField > button {
|
||||
flex-shrink: 1;
|
||||
height: 100%;
|
||||
padding: 0 10px;
|
||||
border-top: 1px solid #ccc;
|
||||
border-bottom: 1px solid #ccc;
|
||||
border-right: 0;
|
||||
border-left: 1px solid #ccc;
|
||||
border-radius: 0;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.castField > button:hover {
|
||||
background-color: #96b4ff;
|
||||
}
|
||||
|
||||
.castField > button:last-child {
|
||||
border-right: 1px solid #ccc;
|
||||
border-top-right-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
}
|
|
@ -0,0 +1,90 @@
|
|||
import { ChangeEvent, FunctionComponent, useCallback, useState } from "react";
|
||||
import styles from "./HomePage.module.css";
|
||||
import { Panel } from "../../components/Panel/Panel";
|
||||
import { useCast, usePlayerStatus, useReset } from "../../api/arcast";
|
||||
import { Link } from "react-router-dom";
|
||||
import { Button } from "../../components/Button/Button";
|
||||
|
||||
export const HomePage: FunctionComponent = () => {
|
||||
const playerStatusQuery = usePlayerStatus();
|
||||
const [castUrl, setCastUrl] = useState<string>("");
|
||||
const castMutation = useCast();
|
||||
const resetMutation = useReset();
|
||||
|
||||
const onCastUrlChange = useCallback(
|
||||
(evt: ChangeEvent<HTMLInputElement>) => {
|
||||
setCastUrl(evt.target.value);
|
||||
},
|
||||
[setCastUrl]
|
||||
);
|
||||
|
||||
const onCastClick = useCallback(() => {
|
||||
if (!castUrl) return;
|
||||
castMutation.mutate({ url: castUrl });
|
||||
setCastUrl("");
|
||||
}, [castUrl]);
|
||||
|
||||
const onResetClick = useCallback(() => {
|
||||
resetMutation.mutate();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className={styles.root}>
|
||||
<Panel>
|
||||
<h1 className={styles.title}>
|
||||
<abbr title="Arcast Player Manager">A.P.M.</abbr>
|
||||
</h1>
|
||||
|
||||
<div className={styles.columns}>
|
||||
<div>
|
||||
<h2 className={styles.title}>Status</h2>
|
||||
<p className={styles.statusBlock}>
|
||||
<b>Instance ID: </b>
|
||||
<br />
|
||||
<code>{playerStatusQuery.data?.id}</code>
|
||||
</p>
|
||||
<p className={styles.statusBlock}>
|
||||
<b>Current status: </b>
|
||||
<br />
|
||||
<code>{playerStatusQuery.data?.status}</code>
|
||||
</p>
|
||||
<p className={styles.statusBlock}>
|
||||
<b>Current page title: </b>
|
||||
<br />
|
||||
<span>"{playerStatusQuery.data?.title}"</span>
|
||||
</p>
|
||||
<p className={styles.statusBlock}>
|
||||
<b>Current page URL: </b>
|
||||
<br />
|
||||
<a target="_blank" href={playerStatusQuery.data?.url ?? "#"}>
|
||||
{playerStatusQuery.data?.url
|
||||
? playerStatusQuery.data?.url.slice(0, 32) + "..."
|
||||
: "--"}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<h2 className={styles.title}>Control</h2>
|
||||
<div className={styles.controlBlock}>
|
||||
<div className={styles.castField}>
|
||||
<input
|
||||
type="url"
|
||||
placeholder="http://example.net"
|
||||
value={castUrl}
|
||||
onChange={onCastUrlChange}
|
||||
/>
|
||||
<button onClick={onCastClick}>Cast</button>
|
||||
<button onClick={onResetClick}>Reset</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr className={styles.separator} />
|
||||
<h2 className={styles.title}>Tools</h2>
|
||||
<Button>
|
||||
<Link to="/screen-sharing">Screen sharing</Link>
|
||||
</Button>
|
||||
</Panel>
|
||||
</div>
|
||||
);
|
||||
};
|
|
@ -0,0 +1,8 @@
|
|||
.root {
|
||||
|
||||
}
|
||||
|
||||
.panelTitle {
|
||||
margin-bottom: 20px;
|
||||
margin-top: 10px;
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
import { FunctionComponent, useCallback, useEffect, useState } from "react";
|
||||
import styles from "./ScreenSharingPage.module.css";
|
||||
import { Panel } from "../../components/Panel/Panel";
|
||||
import { Link, useParams } from "react-router-dom";
|
||||
import { ScreenViewer } from "./ScreenViewer";
|
||||
import { Button } from "../../components/Button/Button";
|
||||
import {
|
||||
ScreenSharingServer,
|
||||
ScreenSharingServerState,
|
||||
StateChangedEvent,
|
||||
StateChangedEventType,
|
||||
} from "../../api/webrtc";
|
||||
|
||||
export const ScreenSharingPage: FunctionComponent = () => {
|
||||
const { sessionId } = useParams<{ sessionId: string }>();
|
||||
const [server, setServer] = useState<ScreenSharingServer | null>(null);
|
||||
const [state, setState] = useState<string | null>(null);
|
||||
|
||||
const onServerStateChanged = useCallback((evt: Event) => {
|
||||
setState((evt as StateChangedEvent).state);
|
||||
}, []);
|
||||
|
||||
console.log("Server state", state);
|
||||
|
||||
const onShareScreenClick = useCallback(() => {
|
||||
const server = new ScreenSharingServer();
|
||||
server.addEventListener(StateChangedEventType, onServerStateChanged);
|
||||
server.shareScreen({
|
||||
video: true,
|
||||
audio: false,
|
||||
});
|
||||
setServer(server);
|
||||
return () => {
|
||||
server.removeEventListener(StateChangedEventType, onServerStateChanged);
|
||||
server.close();
|
||||
setServer(null);
|
||||
};
|
||||
}, [onServerStateChanged]);
|
||||
|
||||
const onStopSharingClick = useCallback(() => {
|
||||
if (!server) return;
|
||||
server.close();
|
||||
setServer(null);
|
||||
setState(null);
|
||||
}, [server]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!server) return;
|
||||
return () => {
|
||||
if (!server) return;
|
||||
console.log("Closing screen sharing server");
|
||||
server.close();
|
||||
setServer(null);
|
||||
};
|
||||
}, [server]);
|
||||
|
||||
if (sessionId !== undefined) {
|
||||
return <ScreenViewer sessionId={sessionId} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={styles.root}>
|
||||
<Panel>
|
||||
<Link to="/">Back to homepage</Link>
|
||||
<h1 className={styles.panelTitle}>Screen sharing</h1>
|
||||
{state === ScreenSharingServerState.Sharing ? (
|
||||
<Button onClick={onStopSharingClick}>Stop sharing</Button>
|
||||
) : (
|
||||
<Button onClick={onShareScreenClick}>Share screen</Button>
|
||||
)}
|
||||
</Panel>
|
||||
</div>
|
||||
);
|
||||
};
|
|
@ -0,0 +1,22 @@
|
|||
.root {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.video {
|
||||
height: auto;
|
||||
left: 0;
|
||||
object-fit: contain;
|
||||
/* position: absolute; */
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
flex-grow: 1;
|
||||
width: 100%;
|
||||
}
|
|
@ -0,0 +1,113 @@
|
|||
import {
|
||||
FunctionComponent,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
import styles from "./ScreenViewer.module.css";
|
||||
import {
|
||||
ScreenSharingClient,
|
||||
StateChangedEvent,
|
||||
StateChangedEventType,
|
||||
StreamChangedEvent,
|
||||
StreamChangedEventType,
|
||||
} from "../../api/webrtc";
|
||||
|
||||
export interface ScreenViewerProps {
|
||||
sessionId: string;
|
||||
}
|
||||
|
||||
export const ScreenViewer: FunctionComponent<ScreenViewerProps> = ({
|
||||
sessionId,
|
||||
}) => {
|
||||
const videoRef = useRef<HTMLVideoElement>(null);
|
||||
const [client, setClient] = useState<ScreenSharingClient | null>(null);
|
||||
const [stream, setStream] = useState<MediaStream | null>(null);
|
||||
const [state, setState] = useState<string | null>(null);
|
||||
|
||||
const onStreamChanged = useCallback((evt: Event) => {
|
||||
setStream((evt as StreamChangedEvent).stream);
|
||||
}, []);
|
||||
|
||||
const onStateChanged = useCallback((evt: Event) => {
|
||||
setState((evt as StateChangedEvent).state);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const client = new ScreenSharingClient(sessionId);
|
||||
|
||||
client.addEventListener(StreamChangedEventType, onStreamChanged);
|
||||
client.addEventListener(StateChangedEventType, onStateChanged);
|
||||
client.connect();
|
||||
setClient(client);
|
||||
|
||||
return () => {
|
||||
client.removeEventListener(StreamChangedEventType, onStreamChanged);
|
||||
client.removeEventListener(StateChangedEventType, onStateChanged);
|
||||
client.close();
|
||||
setClient(null);
|
||||
};
|
||||
}, [sessionId, onStreamChanged, onStateChanged]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!videoRef.current) return;
|
||||
|
||||
const video = videoRef.current;
|
||||
|
||||
console.log("Changing video stream", video, stream);
|
||||
|
||||
video.autoplay = true;
|
||||
video.playsInline = true;
|
||||
video.srcObject = stream;
|
||||
video.muted = true;
|
||||
}, [videoRef, stream]);
|
||||
|
||||
const isVideoReady = state === "connected" && stream !== null;
|
||||
|
||||
console.log("isVideoReady", isVideoReady);
|
||||
|
||||
return (
|
||||
<div className={styles.root}>
|
||||
<h1
|
||||
style={{
|
||||
display: `${isVideoReady ? "none" : "block"}`,
|
||||
}}
|
||||
>
|
||||
<ConnectionState state={state} />
|
||||
</h1>
|
||||
<video
|
||||
ref={videoRef}
|
||||
className={styles.video}
|
||||
style={{
|
||||
display: `${isVideoReady ? "block" : "none"}`,
|
||||
}}
|
||||
></video>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export interface ConnectionStateProps {
|
||||
state: string | null;
|
||||
}
|
||||
|
||||
export const ConnectionState: FunctionComponent<ConnectionStateProps> = ({
|
||||
state,
|
||||
}) => {
|
||||
switch (state) {
|
||||
case null:
|
||||
return <span>Connecting...</span>;
|
||||
case "Connecté":
|
||||
return <span>Connection established !</span>;
|
||||
case "disconnected":
|
||||
return <span>Connection lost !</span>;
|
||||
case "failed":
|
||||
return <span>Connection failed !</span>;
|
||||
default:
|
||||
return (
|
||||
<span>
|
||||
État inconnu (<code>{state}</code>)
|
||||
</span>
|
||||
);
|
||||
}
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
/// <reference types="react-scripts" />
|
|
@ -0,0 +1,5 @@
|
|||
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
||||
// allows you to do things like:
|
||||
// expect(element).toHaveTextContent(/react/i)
|
||||
// learn more: https://github.com/testing-library/jest-dom
|
||||
import '@testing-library/jest-dom';
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"esnext"
|
||||
],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx"
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
]
|
||||
}
|
|
@ -5,10 +5,13 @@ import (
|
|||
"forge.cadoles.com/arcad/arcast/internal/command/client"
|
||||
)
|
||||
|
||||
var Version = "dev"
|
||||
|
||||
func main() {
|
||||
command.Main(
|
||||
"arcast",
|
||||
"Arcast cli client",
|
||||
"cli client",
|
||||
Version,
|
||||
client.Root().Subcommands...,
|
||||
)
|
||||
}
|
||||
|
|
|
@ -5,10 +5,13 @@ import (
|
|||
"forge.cadoles.com/arcad/arcast/internal/command/player"
|
||||
)
|
||||
|
||||
var Version = "dev"
|
||||
|
||||
func main() {
|
||||
command.Main(
|
||||
"arcast",
|
||||
"Arcast desktop player",
|
||||
"desktop player",
|
||||
Version,
|
||||
player.Root().Subcommands...,
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,123 +0,0 @@
|
|||
//go:build android
|
||||
// +build android
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
"forge.cadoles.com/arcad/arcast/pkg/browser/gioui"
|
||||
"forge.cadoles.com/arcad/arcast/pkg/server"
|
||||
"gioui.org/app"
|
||||
"gioui.org/io/system"
|
||||
"gioui.org/layout"
|
||||
"gioui.org/op"
|
||||
"github.com/gioui-plugins/gio-plugins/plugin"
|
||||
"github.com/gioui-plugins/gio-plugins/safedata"
|
||||
"github.com/gioui-plugins/gio-plugins/safedata/giosafedata"
|
||||
"github.com/gioui-plugins/gio-plugins/webviewer/webview"
|
||||
"github.com/pkg/errors"
|
||||
"gitlab.com/wpetit/goweb/logger"
|
||||
)
|
||||
|
||||
const instanceIDSecretIdentifier = "instance_id"
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
webview.SetDebug(true)
|
||||
window := app.NewWindow(
|
||||
app.Fullscreen.Option(),
|
||||
)
|
||||
|
||||
browser := gioui.NewBrowser(window)
|
||||
|
||||
var safeDataConfig safedata.Config
|
||||
var safeDataConfigWaigGroup sync.WaitGroup
|
||||
var initSafeDataConfig sync.Once
|
||||
|
||||
safeDataConfigWaigGroup.Add(1)
|
||||
|
||||
go func() {
|
||||
ops := new(op.Ops)
|
||||
for {
|
||||
evt := window.NextEvent()
|
||||
plugin.Install(window, evt)
|
||||
|
||||
switch evt := evt.(type) {
|
||||
case system.DestroyEvent:
|
||||
os.Exit(0)
|
||||
return
|
||||
case system.FrameEvent:
|
||||
gtx := layout.NewContext(ops, evt)
|
||||
browser.Layout(gtx)
|
||||
evt.Frame(gtx.Ops)
|
||||
case app.ViewEvent:
|
||||
initSafeDataConfig.Do(func() {
|
||||
defer safeDataConfigWaigGroup.Done()
|
||||
safeDataConfig = giosafedata.NewConfigFromViewEvent(window, evt, "com.cadoles.arcast_player")
|
||||
})
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
go func() {
|
||||
|
||||
for {
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
|
||||
safeDataConfigWaigGroup.Wait()
|
||||
safe := safedata.NewSafeData(safeDataConfig)
|
||||
|
||||
instanceID, err := getInstanceIDFromSafeData(safe)
|
||||
if err != nil {
|
||||
logger.Fatal(ctx, "could not retrieve instance id", logger.CapturedE(errors.WithStack(err)))
|
||||
}
|
||||
|
||||
server := server.New(browser, server.WithInstanceID(instanceID))
|
||||
|
||||
if err := server.Start(); err != nil {
|
||||
logger.Fatal(ctx, "could not start server", logger.CapturedE(errors.WithStack(err)))
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if err := server.Stop(); err != nil {
|
||||
logger.Error(ctx, "could not stop server", logger.CapturedE(errors.WithStack(err)))
|
||||
}
|
||||
}()
|
||||
|
||||
if err := server.Wait(); err != nil {
|
||||
logger.Error(ctx, "could not wait for server", logger.CapturedE(errors.WithStack(err)))
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
app.Main()
|
||||
}
|
||||
|
||||
func getInstanceIDFromSafeData(safe *safedata.SafeData) (string, error) {
|
||||
instanceIDSecret, err := safe.Get(instanceIDSecretIdentifier)
|
||||
if err != nil && err.Error() != "not found" {
|
||||
return "", errors.Wrapf(err, "could not retrieve instance id secret")
|
||||
}
|
||||
|
||||
var instanceID string
|
||||
if len(instanceIDSecret.Data) > 0 {
|
||||
instanceID = string(instanceIDSecret.Data)
|
||||
} else {
|
||||
instanceID = server.NewRandomInstanceID()
|
||||
|
||||
instanceIDSecret.Identifier = instanceIDSecretIdentifier
|
||||
instanceIDSecret.Data = []byte(instanceID)
|
||||
instanceIDSecret.Description = "Arcast player instance identifier"
|
||||
|
||||
if err := safe.Set(instanceIDSecret); err != nil {
|
||||
return "", errors.Wrapf(err, "could not save instance id secret")
|
||||
}
|
||||
}
|
||||
|
||||
return instanceID, nil
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
# Documentation
|
||||
|
||||
- [Configuration](./configuration.md)
|
||||
- [API HTTP](./http-api.md)
|
||||
- [mDNS](./mdns.md)
|
|
@ -0,0 +1,59 @@
|
|||
# Configuration
|
||||
|
||||
Le server Arcast utilise un fichier de configuration permettant de personnaliser son comportement.
|
||||
Par défaut, ce fichier de configuration est créé aux emplacements suivants au lancement de l'application:
|
||||
|
||||
- **Linux Desktop**:
|
||||
- `${HOME}/.config/arcast-player/config.json`
|
||||
- **Android**:
|
||||
- `/storage/emulated/0/Android/data/com.cadoles.arcast_player`
|
||||
- `/data/user/0/com.cadoles.arcast_player/files/config.json` (si le premier chemin n'est pas accessible en lecture/écriture)
|
||||
|
||||
Voici un exemple commenté du fichier de configuration:
|
||||
|
||||
```json
|
||||
{
|
||||
// Identifiant de l'instance
|
||||
"instanceId": "<instance_id>",
|
||||
// Configuration du serveur HTTP
|
||||
"http": {
|
||||
// Couple <address>:<port> d'écoute
|
||||
// Par défaut ":" i.e. toutes les adresses avec port aléatoire
|
||||
"address": ":",
|
||||
// Répertoire de personnalisation de la page d'accueil
|
||||
// Voir section "Personnalisation" ci-dessous
|
||||
"customDir": "${CONFIG_DIR}/custom"
|
||||
},
|
||||
// Configuration du serveur HTTPS
|
||||
"https": {
|
||||
// Couple <address>:<port> d'écoute
|
||||
// Par défaut ":" i.e. toutes les adresses avec port aléatoire
|
||||
"address": ":",
|
||||
// Certificat x509 (format PEM, encodé en base64)
|
||||
"cert": "<base64_encoded_pem_cert>",
|
||||
// Clé privée du certificat (format PEM, encodé en base64)
|
||||
"key": "<base64_encoded_pem_key>",
|
||||
// Configuration de la génération du certificat autosigné
|
||||
"selfSigned": {
|
||||
// Activer/désactiver la génération du certificat auto-signé
|
||||
"enabled": true,
|
||||
// Empreinte réseau associée au certificat autosigné
|
||||
// Permet de détecter si il y a eu un changement sur les adresses IPs du player
|
||||
"networkFingerprint": "40f4cd914c6163657fe4e37128f90b501b768221c77b5dbfa35ca74a84b8732a"
|
||||
}
|
||||
},
|
||||
// Configuration des applications embarquées
|
||||
"apps": {
|
||||
// Activer/désactiver les applications embarquées
|
||||
"enabled": true,
|
||||
// Application par défaut
|
||||
"defaultApp": "main"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Personnalisation
|
||||
|
||||
Il est possible de personnaliser la page d'accueil du player Arcast en créant des fichiers dans le répertoire définit par l'attribut de configuration `http.customDir`.
|
||||
|
||||
Le contenu de ce répertoire doit répliquer l'arborescence embarquée par défaut (voir https://forge.cadoles.com/arcad/arcast/src/branch/develop/pkg/server/embed). Chaque fichier présent remplacera celui embarqué par défaut.
|
24
go.mod
|
@ -3,30 +3,25 @@ module forge.cadoles.com/arcad/arcast
|
|||
go 1.21.4
|
||||
|
||||
require (
|
||||
gioui.org v0.4.1
|
||||
git.wow.st/gmp/jni v0.0.0-20210610011705-34026c7e22d0
|
||||
github.com/davecgh/go-spew v1.1.1
|
||||
github.com/gioui-plugins/gio-plugins v0.0.0-20230625001848-8f18aae6c91c
|
||||
github.com/google/uuid v1.3.0
|
||||
github.com/dschmidt/go-layerfs v0.1.0
|
||||
github.com/go-chi/cors v1.2.1
|
||||
github.com/gorilla/websocket v1.5.1
|
||||
github.com/grandcat/zeroconf v1.0.1-0.20230119201135-e4f60f8407b1
|
||||
github.com/jaevor/go-nanoid v1.3.0
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/wlynxg/anet v0.0.1
|
||||
github.com/zserge/lorca v0.1.10
|
||||
golang.org/x/mobile v0.0.0-20201217150744-e6ae53a27f4f
|
||||
)
|
||||
|
||||
require (
|
||||
cdr.dev/slog v1.6.1 // indirect
|
||||
gioui.org/cpu v0.0.0-20220412190645-f1e9e8c3b1f7 // indirect
|
||||
gioui.org/shader v1.0.8 // indirect
|
||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
|
||||
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
|
||||
github.com/charmbracelet/lipgloss v0.7.1 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
|
||||
github.com/go-playground/locales v0.14.0 // indirect
|
||||
github.com/go-playground/universal-translator v0.18.0 // indirect
|
||||
github.com/go-text/typesetting v0.0.0-20230803102845-24e03d8b5372 // indirect
|
||||
github.com/inkeliz/go_inkwasm v0.0.0-20220912074516-049d3472c98a // indirect
|
||||
github.com/jaevor/go-nanoid v1.3.0 // indirect
|
||||
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect
|
||||
github.com/jedib0t/go-pretty/v6 v6.4.9 // indirect
|
||||
github.com/leodido/go-urn v1.2.1 // indirect
|
||||
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
|
||||
|
@ -37,17 +32,12 @@ require (
|
|||
github.com/muesli/termenv v0.15.2 // indirect
|
||||
github.com/rivo/uniseg v0.4.4 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/wlynxg/anet v0.0.1 // indirect
|
||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
|
||||
go.opentelemetry.io/otel v1.21.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.21.0 // indirect
|
||||
golang.org/x/crypto v0.16.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20221012211006-4de253d81b95 // indirect
|
||||
golang.org/x/exp/shiny v0.0.0-20220921164117-439092de6870 // indirect
|
||||
golang.org/x/image v0.5.0 // indirect
|
||||
golang.org/x/mod v0.14.0 // indirect
|
||||
golang.org/x/term v0.15.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
golang.org/x/tools v0.16.1 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
|
||||
gopkg.in/go-playground/validator.v9 v9.29.1 // indirect
|
||||
|
@ -60,3 +50,5 @@ require (
|
|||
golang.org/x/net v0.19.0 // indirect
|
||||
golang.org/x/sys v0.15.0 // indirect
|
||||
)
|
||||
|
||||
replace github.com/zserge/lorca => github.com/Bornholm/lorca v0.0.0-20240121134933-d5e83569cb4c
|
||||
|
|
72
go.sum
|
@ -8,17 +8,9 @@ cloud.google.com/go/logging v1.7.0 h1:CJYxlNNNNAMkHp9em/YEXcfJg+rPDg7YfwoRpMU+t5
|
|||
cloud.google.com/go/logging v1.7.0/go.mod h1:3xjP2CjkM3ZkO73aj4ASA5wRPGGCRrPIAeNqVNkzY8M=
|
||||
cloud.google.com/go/longrunning v0.5.1 h1:Fr7TXftcqTudoyRJa113hyaqlGdiBQkp0Gq7tErFDWI=
|
||||
cloud.google.com/go/longrunning v0.5.1/go.mod h1:spvimkwdz6SPWKEt/XBij79E9fiTkHSQl/fRUUQJYJc=
|
||||
eliasnaur.com/font v0.0.0-20230308162249-dd43949cb42d h1:ARo7NCVvN2NdhLlJE9xAbKweuI9L6UgfTbYb0YwPacY=
|
||||
eliasnaur.com/font v0.0.0-20230308162249-dd43949cb42d/go.mod h1:OYVuxibdk9OSLX8vAqydtRPP87PyTFcT9uH3MlEGBQA=
|
||||
gioui.org v0.4.1 h1:sCTw5Fexg0xg9CxYmbrkKtHXcobf0JMbl5XpF2TC/zc=
|
||||
gioui.org v0.4.1/go.mod h1:2atiYR4upH71/6ehnh6XsUELa7JZOrOHHNMDxGBZF0Q=
|
||||
gioui.org/cpu v0.0.0-20210808092351-bfe733dd3334/go.mod h1:A8M0Cn5o+vY5LTMlnRoK3O5kG+rH0kWfJjeKd9QpBmQ=
|
||||
gioui.org/cpu v0.0.0-20220412190645-f1e9e8c3b1f7 h1:tNJdnP5CgM39PRc+KWmBRRYX/zJ+rd5XaYxY5d5veqA=
|
||||
gioui.org/cpu v0.0.0-20220412190645-f1e9e8c3b1f7/go.mod h1:A8M0Cn5o+vY5LTMlnRoK3O5kG+rH0kWfJjeKd9QpBmQ=
|
||||
gioui.org/shader v1.0.8 h1:6ks0o/A+b0ne7RzEqRZK5f4Gboz2CfG+mVliciy6+qA=
|
||||
gioui.org/shader v1.0.8/go.mod h1:mWdiME581d/kV7/iEhLmUgUK5iZ09XR5XpduXzbePVM=
|
||||
git.wow.st/gmp/jni v0.0.0-20210610011705-34026c7e22d0 h1:bGG/g4ypjrCJoSvFrP5hafr9PPB5aw8SjcOWWila7ZI=
|
||||
git.wow.st/gmp/jni v0.0.0-20210610011705-34026c7e22d0/go.mod h1:+axXBRUTIDlCeE73IKeD/os7LoEnTKdkp8/gQOFjqyo=
|
||||
github.com/Bornholm/lorca v0.0.0-20240121134933-d5e83569cb4c h1:xG9xSpEqZYOvd1Bvx/36i3RBTA17d7XnuvoMIG+/ry8=
|
||||
github.com/Bornholm/lorca v0.0.0-20240121134933-d5e83569cb4c/go.mod h1:TUOtEogaMwy0b+p9e4NxZC1jbPRUaNaEw5DnjQF//F8=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
|
||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
|
||||
github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=
|
||||
|
@ -30,10 +22,12 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t
|
|||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/gioui-plugins/gio-plugins v0.0.0-20230625001848-8f18aae6c91c h1:naFDaf0CvDEYZ3Zpxx20DY/cCvBQqKwsV7ZzBt3M/bU=
|
||||
github.com/gioui-plugins/gio-plugins v0.0.0-20230625001848-8f18aae6c91c/go.mod h1:nBuRsi6udr2x6eorarLHtRkoRaWBICt+WzaE7zQXgYY=
|
||||
github.com/dschmidt/go-layerfs v0.1.0 h1:jE6aHDfjNzS/31DS48th6EkmELwTa1Uf+aO4jRkBs3U=
|
||||
github.com/dschmidt/go-layerfs v0.1.0/go.mod h1:m62aff0hn23Q/tQBRiNSeLD7EUuimDvsuCvCpzBr3Gw=
|
||||
github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk=
|
||||
github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
|
||||
github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4=
|
||||
github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58=
|
||||
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
|
||||
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
|
@ -42,24 +36,16 @@ github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb
|
|||
github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=
|
||||
github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho=
|
||||
github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
|
||||
github.com/go-text/typesetting v0.0.0-20230803102845-24e03d8b5372 h1:FQivqchis6bE2/9uF70M2gmmLpe82esEm2QadL0TEJo=
|
||||
github.com/go-text/typesetting v0.0.0-20230803102845-24e03d8b5372/go.mod h1:evDBbvNR/KaVFZ2ZlDSOWWXIUKq0wCOEtzLxRM8SG3k=
|
||||
github.com/go-text/typesetting-utils v0.0.0-20230616150549-2a7df14b6a22 h1:LBQTFxP2MfsyEDqSKmUBZaDuDHN1vpqDyOZjcqS7MYI=
|
||||
github.com/go-text/typesetting-utils v0.0.0-20230616150549-2a7df14b6a22/go.mod h1:DDxDdQEnB70R8owOx3LVpEFvpMK9eeH1o2r0yZhFI9o=
|
||||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
|
||||
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
|
||||
github.com/grandcat/zeroconf v1.0.1-0.20230119201135-e4f60f8407b1 h1:cNb52t5fkWv8ZiicKWnc2eZnhsCCoH7WmRBMIbMp04Q=
|
||||
github.com/grandcat/zeroconf v1.0.1-0.20230119201135-e4f60f8407b1/go.mod h1:I6CSXU4zCGL08JOk9NbcT0ofAgnIkS/fVXbYzfSoDic=
|
||||
github.com/inkeliz/go_inkwasm v0.0.0-20220912074516-049d3472c98a h1:uZklbtdSPrDL/d1EUKd9s8a0Byla2TT01Wg/GZ4xj0w=
|
||||
github.com/inkeliz/go_inkwasm v0.0.0-20220912074516-049d3472c98a/go.mod h1:LPI3Qojj7OgTyc2R4RPB6BuMSgjoOXCObwnDzz1SOVk=
|
||||
github.com/jaevor/go-nanoid v1.3.0 h1:nD+iepesZS6pr3uOVf20vR9GdGgJW1HPaR46gtrxzkg=
|
||||
github.com/jaevor/go-nanoid v1.3.0/go.mod h1:SI+jFaPuddYkqkVQoNGHs81navCtH388TcrH0RqFKgY=
|
||||
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e h1:Q3+PugElBCf4PFpxhErSzU3/PY5sFL5Z6rfv4AbGAck=
|
||||
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e/go.mod h1:alcuEEnZsY1WQsagKhZDsoPCRoOijYqhZvPwLG0kzVs=
|
||||
github.com/jedib0t/go-pretty/v6 v6.4.9 h1:vZ6bjGg2eBSrJn365qlxGcaWu09Id+LHtrfDWlB2Usc=
|
||||
github.com/jedib0t/go-pretty/v6 v6.4.9/go.mod h1:Ndk3ase2CkQbXLLNf5QDHoYb6J9WtVfmHZu9n8rk2xs=
|
||||
github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=
|
||||
|
@ -84,6 +70,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
|
|||
github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/psanford/memfs v0.0.0-20210214183328-a001468d78ef h1:NKxTG6GVGbfMXc2mIk+KphcH6hagbVXhcFkbTgYleTI=
|
||||
github.com/psanford/memfs v0.0.0-20210214183328-a001468d78ef/go.mod h1:tcaRap0jS3eifrEEllL6ZMd9dg8IlDpi2S1oARrQ+NI=
|
||||
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
|
||||
|
@ -103,9 +91,6 @@ github.com/wlynxg/anet v0.0.1 h1:VbkEEgHxPSrRQSiyRd0pmrbcEQAEU2TTb8fb4DmSYoQ=
|
|||
github.com/wlynxg/anet v0.0.1/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA=
|
||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
|
||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/zserge/lorca v0.1.10 h1:f/xBJ3D3ipcVRCcvN8XqZnpoKcOXV8I4vwqlFyw7ruc=
|
||||
github.com/zserge/lorca v0.1.10/go.mod h1:bVmnIbIRlOcoV285KIRSe4bUABKi7R7384Ycuum6e4A=
|
||||
gitlab.com/wpetit/goweb v0.0.0-20231215190137-4a8add1d3d07 h1:0V95X1cBpdj5zyOe6oGtn/BQHlRpV8WlL3eTs3jaxiA=
|
||||
gitlab.com/wpetit/goweb v0.0.0-20231215190137-4a8add1d3d07/go.mod h1:Nfr7aZPiSN6biFumhiHbh9k8A3rKQRzR+o0bVtv78UY=
|
||||
go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc=
|
||||
|
@ -117,60 +102,59 @@ go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF
|
|||
go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc=
|
||||
go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
|
||||
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
|
||||
golang.org/x/exp v0.0.0-20221012211006-4de253d81b95 h1:sBdrWpxhGDdTAYNqbgBLAR+ULAPPhfgncLr1X0lyWtg=
|
||||
golang.org/x/exp v0.0.0-20221012211006-4de253d81b95/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE=
|
||||
golang.org/x/exp/shiny v0.0.0-20220921164117-439092de6870 h1:GjCs9zNN8fojJskeK7QiiVecCaMk0dfGTyL6IUcmp0o=
|
||||
golang.org/x/exp/shiny v0.0.0-20220921164117-439092de6870/go.mod h1:VjAR7z0ngyATZTELrBSkxOOHhhlnVUxDye4mcjx5h/8=
|
||||
golang.org/x/image v0.5.0 h1:5JMiNunQeQw++mMOz48/ISeNu3Iweh/JaZU8ZLqHRrI=
|
||||
golang.org/x/image v0.5.0/go.mod h1:FVC7BI/5Ym8R25iw5OLsgshdUBbT1h5jZTpA+mvAdZ4=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4=
|
||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||
golang.org/x/mobile v0.0.0-20201217150744-e6ae53a27f4f h1:kgfVkAEEQXXQ0qc6dH7n6y37NAYmTFmz0YRwrRjgxKw=
|
||||
golang.org/x/mobile v0.0.0-20201217150744-e6ae53a27f4f/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4=
|
||||
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
|
||||
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
|
||||
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
|
||||
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
|
||||
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA=
|
||||
golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
|
||||
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
|
||||
google.golang.org/genproto v0.0.0-20230726155614-23370e0ffb3e h1:xIXmWJ303kJCuogpj0bHq+dcjcZHU+XFyc1I0Yl9cRg=
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"time"
|
||||
|
||||
"forge.cadoles.com/arcad/arcast/pkg/client"
|
||||
"forge.cadoles.com/arcad/arcast/pkg/server"
|
||||
"forge.cadoles.com/arcad/arcast/pkg/network"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
@ -57,7 +57,7 @@ func forEachPlayer(ctx *cli.Context, fn func(cl *client.Client, playerAddr strin
|
|||
}
|
||||
|
||||
for _, p := range players {
|
||||
preferredIP, err := server.FindPreferredLocalAddress(p.IPs...)
|
||||
preferredIP, err := network.FindPreferredLocalAddress(p.IPs...)
|
||||
if err != nil {
|
||||
return errors.Errorf("could not retrieve player '%s' preferred address", p.ID)
|
||||
}
|
||||
|
|
|
@ -10,11 +10,12 @@ import (
|
|||
"gitlab.com/wpetit/goweb/logger"
|
||||
)
|
||||
|
||||
func Main(name string, usage string, commands ...*cli.Command) {
|
||||
func Main(name string, usage string, version string, commands ...*cli.Command) {
|
||||
app := &cli.App{
|
||||
Name: name,
|
||||
Usage: usage,
|
||||
Commands: commands,
|
||||
Version: version,
|
||||
Before: func(ctx *cli.Context) error {
|
||||
workdir := ctx.String("workdir")
|
||||
// Switch to new working directory if defined
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
package player
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"forge.cadoles.com/arcad/arcast"
|
||||
"forge.cadoles.com/arcad/arcast/pkg/browser"
|
||||
"forge.cadoles.com/arcad/arcast/pkg/browser/dummy"
|
||||
"forge.cadoles.com/arcad/arcast/pkg/browser/lorca"
|
||||
"forge.cadoles.com/arcad/arcast/pkg/config"
|
||||
"forge.cadoles.com/arcad/arcast/pkg/server"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/urfave/cli/v2"
|
||||
|
@ -13,9 +19,15 @@ import (
|
|||
|
||||
func Run() *cli.Command {
|
||||
defaults := lorca.NewOptions()
|
||||
|
||||
return &cli.Command{
|
||||
Name: "run",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "config",
|
||||
EnvVars: []string{"ARCAST_DESKTOP_CONFIG"},
|
||||
Value: config.DefaultConfigFile(context.Background()),
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "additional-chrome-arg",
|
||||
EnvVars: []string{"ARCAST_DESKTOP_ADDITIONAL_CHROME_ARGS"},
|
||||
|
@ -26,50 +38,133 @@ func Run() *cli.Command {
|
|||
EnvVars: []string{"ARCAST_DESKTOP_INSTANCE_ID"},
|
||||
Value: "",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "address",
|
||||
EnvVars: []string{"ARCAST_DESKTOP_ADDRESS"},
|
||||
Value: ":",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "https-address",
|
||||
EnvVars: []string{"ARCAST_DESKTOP_HTTPS_ADDRESS"},
|
||||
Value: ":",
|
||||
},
|
||||
&cli.IntFlag{
|
||||
Name: "window-height",
|
||||
EnvVars: []string{"ARCAST_DESKTOP_WINDOW_HEIGHT"},
|
||||
Value: defaults.Height,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "apps",
|
||||
EnvVars: []string{"ARCAST_DESKTOP_APPS"},
|
||||
Value: false,
|
||||
},
|
||||
&cli.IntFlag{
|
||||
Name: "window-width",
|
||||
EnvVars: []string{"ARCAST_DESKTOP_WINDOW_WIDTH"},
|
||||
Value: defaults.Width,
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "allowed-origins",
|
||||
EnvVars: []string{"ARCAST_DESKTOP_ALLOWED_ORIGINS"},
|
||||
Value: cli.NewStringSlice(),
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "custom-files-dir",
|
||||
EnvVars: []string{"ARCAST_DESKTOP_CUSTOM_FILES_DIR"},
|
||||
Value: "",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "dummy-browser",
|
||||
EnvVars: []string{"ARCAST_DESKTOP_DUMMY_BROWSER"},
|
||||
Value: false,
|
||||
},
|
||||
},
|
||||
Action: func(ctx *cli.Context) error {
|
||||
configFile := ctx.String("config")
|
||||
windowHeight := ctx.Int("window-height")
|
||||
windowWidth := ctx.Int("window-width")
|
||||
chromeArgs := addFlagsPrefix(ctx.StringSlice("additional-chrome-arg")...)
|
||||
dummyBrowser := ctx.Bool("dummy-browser")
|
||||
|
||||
browser := lorca.NewBrowser(
|
||||
lorca.WithAdditionalChromeArgs(chromeArgs...),
|
||||
lorca.WithWindowSize(windowWidth, windowHeight),
|
||||
)
|
||||
var browser browser.Browser
|
||||
|
||||
if err := browser.Start(); err != nil {
|
||||
return errors.Wrap(err, "could not start browser")
|
||||
if dummyBrowser {
|
||||
logger.Info(ctx.Context, "using dummy browser")
|
||||
browser = dummy.NewBrowser()
|
||||
} else {
|
||||
lorcaBrowser := lorca.NewBrowser(
|
||||
lorca.WithAdditionalChromeArgs(chromeArgs...),
|
||||
lorca.WithWindowSize(windowWidth, windowHeight),
|
||||
)
|
||||
|
||||
if err := lorcaBrowser.Start(); err != nil {
|
||||
return errors.Wrap(err, "could not start browser")
|
||||
}
|
||||
|
||||
go func() {
|
||||
lorcaBrowser.Wait()
|
||||
logger.Warn(ctx.Context, "browser was closed")
|
||||
os.Exit(1)
|
||||
}()
|
||||
|
||||
defer func() {
|
||||
logger.Info(ctx.Context, "stopping browser")
|
||||
if err := lorcaBrowser.Stop(); err != nil {
|
||||
logger.Error(ctx.Context, "could not stop browser", logger.CapturedE(errors.WithStack(err)))
|
||||
}
|
||||
}()
|
||||
|
||||
browser = lorcaBrowser
|
||||
}
|
||||
|
||||
go func() {
|
||||
browser.Wait()
|
||||
logger.Warn(ctx.Context, "browser was closed")
|
||||
os.Exit(1)
|
||||
}()
|
||||
|
||||
defer func() {
|
||||
logger.Info(ctx.Context, "stopping browser")
|
||||
if err := browser.Stop(); err != nil {
|
||||
logger.Error(ctx.Context, "could not stop browser", logger.CapturedE(errors.WithStack(err)))
|
||||
}
|
||||
}()
|
||||
conf := config.DefaultConfig()
|
||||
|
||||
instanceID := ctx.String("instance-id")
|
||||
if instanceID == "" {
|
||||
instanceID = server.NewRandomInstanceID()
|
||||
if instanceID != "" {
|
||||
conf.InstanceID = instanceID
|
||||
}
|
||||
|
||||
server := server.New(browser, server.WithInstanceID(instanceID))
|
||||
if ctx.IsSet("apps") {
|
||||
conf.Apps.Enabled = ctx.Bool("apps")
|
||||
}
|
||||
|
||||
if ctx.IsSet("address") {
|
||||
conf.HTTP.Address = ctx.String("address")
|
||||
}
|
||||
|
||||
if ctx.IsSet("https-address") {
|
||||
conf.HTTPS.Address = ctx.String("tls-address")
|
||||
}
|
||||
|
||||
if ctx.IsSet("allowed-origins") {
|
||||
conf.AllowedOrigins = ctx.StringSlice("allowed-origins")
|
||||
}
|
||||
|
||||
if ctx.IsSet("custom-dir") {
|
||||
conf.HTTP.CustomDir = ctx.String("custom-dir")
|
||||
}
|
||||
|
||||
logger.Info(ctx.Context, "loading or creating configuration file", logger.F("filename", configFile))
|
||||
if err := config.LoadOrCreate(ctx.Context, configFile, conf, config.DefaultTransforms...); err != nil {
|
||||
logger.Error(ctx.Context, "could not load configuration file", logger.CapturedE(errors.WithStack(err)))
|
||||
}
|
||||
|
||||
cert, err := tls.X509KeyPair(conf.HTTPS.Cert, conf.HTTPS.Key)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "could not parse tls cert/key pair")
|
||||
}
|
||||
|
||||
server := server.New(browser,
|
||||
server.WithInstanceID(conf.InstanceID),
|
||||
server.WithAppsEnabled(conf.Apps.Enabled),
|
||||
server.WithDefaultApp(conf.Apps.DefaultApp),
|
||||
server.WithApps(arcast.DefaultApps...),
|
||||
server.WithAddress(conf.HTTP.Address),
|
||||
server.WithTLSAddress(conf.HTTPS.Address),
|
||||
server.WithTLSCertificate(&cert),
|
||||
server.WithAllowedOrigins(conf.AllowedOrigins...),
|
||||
server.WithUpperLayerDir(conf.HTTP.CustomDir),
|
||||
)
|
||||
|
||||
if err := server.Start(); err != nil {
|
||||
return errors.Wrap(err, "could not start server")
|
||||
|
|
After Width: | Height: | Size: 21 KiB |
|
@ -0,0 +1,14 @@
|
|||
[Desktop Entry]
|
||||
Type=Application
|
||||
Version=1.0
|
||||
Name=Arcast Player
|
||||
GenericName=Web diffusion player
|
||||
Exec=arcast-player run --additional-chrome-arg incognito --additional-chrome-arg start-maximized
|
||||
Icon=arcast-player
|
||||
Terminal=false
|
||||
Categories=Network;Utility
|
||||
Actions=Kiosk
|
||||
|
||||
[Desktop Action Kiosk]
|
||||
Name=Start in kiosk mode
|
||||
Exec=arcast-player run --additional-chrome-arg incognito --additional-chrome-arg kiosk
|
|
@ -0,0 +1,82 @@
|
|||
### Source https://github.com/DesktopECHO/T95-H616-Malware
|
||||
###
|
||||
### Clobber Malware/Junk - Run in PowerShell or Bash
|
||||
### Requires ADB Connection (ie: adb connect 10.13.12.11:5555)
|
||||
###
|
||||
### Install ADB (If not already installed)
|
||||
###
|
||||
### - Assuming you're on Windows, to install ADB simply
|
||||
### install Chocolatey and install ADB using Choco:
|
||||
### choco install adb
|
||||
###
|
||||
### - macOS users have Homebrew to accomplish the same thing:
|
||||
### brew install android-platform-tools
|
||||
###
|
||||
|
||||
wget https://github.com/bromite/bromite/releases/latest/download/arm_ChromePublic.apk -O chromium.apk
|
||||
wget https://github.com/TeamAmaze/AmazeFileManager/releases/latest/download/app-fdroid-release.apk -O filemanager.apk
|
||||
wget https://raw.githubusercontent.com/make-github-pseudonymous-again/pixels/main/1x1%23000000.jpg -O BlackBackground.jpg
|
||||
wget https://f-droid.org/repo/com.termux_118.apk -O termux.apk
|
||||
wget https://github.com/DesktopECHO/Pi-hole-for-Android/releases/latest/download/pideploy.apk -O pideploy.apk
|
||||
adb push BlackBackground.jpg /sdcard/Download/BlackBackground.jpg
|
||||
|
||||
adb root
|
||||
sleep 10
|
||||
adb shell "cmd uimode night yes"
|
||||
adb install filemanager.apk
|
||||
adb install termux.apk
|
||||
adb install pideploy.apk
|
||||
adb install chromium.apk
|
||||
adb shell pm uninstall --user 0 com.adups.fota
|
||||
adb shell pm uninstall --user 0 com.ftest
|
||||
adb shell pm uninstall --user 0 com.ionitech.airscreen
|
||||
adb shell pm uninstall --user 0 com.charon.rocketfly
|
||||
adb shell pm uninstall --user 0 com.netflix.mediaclient
|
||||
adb shell pm uninstall --user 0 com.android.music
|
||||
adb shell pm uninstall --user 0 com.android.dynsystem
|
||||
adb shell pm uninstall --user 0 com.android.egg
|
||||
adb shell pm uninstall --user 0 com.www.intallapp
|
||||
adb shell pm uninstall --user 0 com.www.productdeclare
|
||||
adb shell pm uninstall --user 0 org.xbmc.kodi
|
||||
adb shell pm uninstall --user 0 com.softwinner.TvdFileManager
|
||||
adb shell pm uninstall --user 0 com.apkpure.aegon
|
||||
adb shell pm uninstall --user 0 com.amazon.avod.thirdpartyclient
|
||||
adb shell pm uninstall --user 0 com.adups.market
|
||||
adb shell pm uninstall --user 0 com.android.camera2
|
||||
adb shell pm uninstall --user 0 com.android.deskclock
|
||||
adb shell pm uninstall --user 0 com.android.chrome
|
||||
adb shell pm uninstall --user 0 com.google.android.feedback
|
||||
adb shell pm uninstall --user 0 com.google.android.katniss
|
||||
adb shell pm uninstall --user 0 net.lightflash.wallpapersn
|
||||
adb shell pm uninstall --user 0 com.google.android.youtube.tv
|
||||
adb shell pm uninstall --user 0 com.android.gallery3d
|
||||
adb shell pm uninstall --user 0 com.android.wallpaper.livepicker
|
||||
adb shell pm uninstall --user 0 com.android.wallpaperbackup
|
||||
adb shell pm uninstall --user 0 com.android.dreams.basic
|
||||
adb shell pm uninstall --user 0 com.android.dreams.web
|
||||
adb shell pm uninstall --user 0 com.android.dreams.phototable
|
||||
adb shell pm uninstall --user 0 cm.aptoidetv.pt
|
||||
|
||||
adb shell rm -rf /data/data/org.xbmc.kodi
|
||||
adb shell rm -rf /data/data/com.www.intallapp
|
||||
adb shell rm -rf /data/data/com.www.productdeclare
|
||||
adb shell rm -rf /data/media/0/Android/data/com.adups.fota
|
||||
adb shell rm -rf /data/misc/profiles/ref/com.adups.fota
|
||||
adb shell rm -rf /data/misc/profiles/cur/0/com.adups.fota
|
||||
|
||||
adb shell rm -rf /data/system/shared_prefs
|
||||
adb shell mkdir -p /data/system/shared_prefs/open_preference.xml
|
||||
adb shell chmod 0000 /data/system/shared_prefs/open_preference.xml
|
||||
adb shell /vendor/bin/busybox chattr +i /data/system/shared_prefs/open_preference.xml
|
||||
|
||||
adb shell rm -rf /data/system/Corejava
|
||||
adb shell touch /data/system/Corejava
|
||||
adb shell chmod 0000 /data/system/Corejava
|
||||
adb shell /vendor/bin/busybox chattr +i /data/system/Corejava
|
||||
|
||||
adb shell rm -rf /data/data/com.adups.fota
|
||||
adb shell touch /data/data/com.adups.fota
|
||||
adb shell chmod 0000 /data/data/com.adups.fota
|
||||
adb shell /vendor/bin/busybox chattr +i /data/data/com.adups.fota
|
||||
|
||||
echo Cleanup finished, reboot your device.
|
|
@ -1,8 +1,12 @@
|
|||
{
|
||||
prep: make build-apps
|
||||
}
|
||||
|
||||
**/*.go
|
||||
pkg/server/templates/**.gotmpl
|
||||
pkg/server/embed/**
|
||||
modd.conf
|
||||
.env {
|
||||
prep: make build-client
|
||||
prep: make build-desktop
|
||||
daemon: make run RUN_CMD="bin/desktop --debug --log-level debug run"
|
||||
daemon: make run RUN_CMD="bin/desktop_amd64 --debug --log-level debug run"
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
package android
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"net"
|
||||
"path/filepath"
|
||||
|
||||
"forge.cadoles.com/arcad/arcast"
|
||||
"forge.cadoles.com/arcad/arcast/pkg/browser/proxy"
|
||||
"forge.cadoles.com/arcad/arcast/pkg/config"
|
||||
"forge.cadoles.com/arcad/arcast/pkg/server"
|
||||
"github.com/pkg/errors"
|
||||
"gitlab.com/wpetit/goweb/logger"
|
||||
)
|
||||
|
||||
var (
|
||||
browser = proxy.NewBrowser()
|
||||
)
|
||||
|
||||
func SetBridge(bridge Bridge) {
|
||||
browser.SetLoadURL(bridge.LoadURL)
|
||||
browser.SetGetTitle(bridge.GetTitle)
|
||||
browser.SetGetURL(bridge.GetURL)
|
||||
}
|
||||
|
||||
func StartServer(dataDir string) string {
|
||||
ctx := context.Background()
|
||||
|
||||
conf := config.DefaultConfig()
|
||||
filename := filepath.Join(dataDir, "config.json")
|
||||
|
||||
logger.Info(ctx, "loading or creating configuration file", logger.F("filename", filename))
|
||||
if err := config.LoadOrCreate(ctx, filename, conf, config.DefaultTransforms...); err != nil {
|
||||
logger.Error(ctx, "could not load configuration file", logger.CapturedE(errors.WithStack(err)))
|
||||
}
|
||||
|
||||
go func() {
|
||||
for {
|
||||
runServer(ctx, conf)
|
||||
}
|
||||
}()
|
||||
|
||||
_, port, err := net.SplitHostPort(conf.HTTP.Address)
|
||||
if err != nil {
|
||||
panic(errors.Wrap(err, "could not parse server listening address"))
|
||||
}
|
||||
|
||||
return port
|
||||
}
|
||||
|
||||
func runServer(ctx context.Context, conf *config.Config) {
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
|
||||
cert, err := tls.X509KeyPair(conf.HTTPS.Cert, conf.HTTPS.Key)
|
||||
if err != nil {
|
||||
logger.Fatal(ctx, "could not parse x509 certificate", logger.CapturedE(errors.WithStack(err)))
|
||||
}
|
||||
|
||||
server := server.New(
|
||||
browser,
|
||||
server.WithInstanceID(conf.InstanceID),
|
||||
server.WithAppsEnabled(conf.Apps.Enabled),
|
||||
server.WithDefaultApp(conf.Apps.DefaultApp),
|
||||
server.WithApps(arcast.DefaultApps...),
|
||||
server.WithTLSCertificate(&cert),
|
||||
server.WithAddress(conf.HTTP.Address),
|
||||
server.WithTLSAddress(conf.HTTPS.Address),
|
||||
server.WithAllowedOrigins(conf.AllowedOrigins...),
|
||||
)
|
||||
|
||||
if err := server.Start(); err != nil {
|
||||
logger.Fatal(ctx, "could not start server", logger.CapturedE(errors.WithStack(err)))
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if err := server.Stop(); err != nil {
|
||||
logger.Error(ctx, "could not stop server", logger.CapturedE(errors.WithStack(err)))
|
||||
}
|
||||
}()
|
||||
|
||||
if err := server.Wait(); err != nil {
|
||||
logger.Error(ctx, "could not wait for server", logger.CapturedE(errors.WithStack(err)))
|
||||
}
|
||||
}
|