Skip to content

Commit

Permalink
wip stub for webconsole
Browse files Browse the repository at this point in the history
  • Loading branch information
eltorio committed May 17, 2024
1 parent 367ce55 commit 9de5220
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Dockerfile-integration
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ubuntu:jammy as builder
ENV NODE_VERSION=20.13.1
RUN apt-get update && apt-get install -y curl build-essential debhelper devscripts pkg-config libssl-dev zip
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN mkdir /build
Expand All @@ -8,7 +9,9 @@ COPY Cargo.toml /build/Cargo.toml
COPY Cargo.lock /build/Cargo.lock
COPY build.rs /build/build.rs
COPY db_v2.sqlite3 /build/db_v2.sqlite3
RUN . /root/.cargo/env && cd /build \
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \
&& . /root/.nvm/nvm.sh && nvm install ${NODE_VERSION} && nvm use ${NODE_VERSION} \
&& . /root/.cargo/env && cd /build \
&& cargo update -p sctgdesk-api-server \
&& DATABASE_URL=sqlite://$(pwd)/db_v2.sqlite3 cargo build --release
RUN mkdir -p /build/ubuntu-jammy/bin \
Expand Down
69 changes: 69 additions & 0 deletions debian/rustdesk-server-hbbs.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,75 @@ fi
case "$1" in
configure|abort-upgrade|abort-deconfigure|abort-remove)
mkdir -p /var/lib/rustdesk-server/
# if /var/lib/rustdesk-server/oauth2.toml does not exist, create it
if [ ! -f /var/lib/rustdesk-server/oauth2.toml ]; then
cat > /var/lib/rustdesk-server/oauth2.toml <<EOF
# [[provider]]
# provider = "Gitlab"
# authorization_url = "https://gitlab.com/oauth/authorize"
# token_exchange_url = "https://gitlab.com/oauth/token"
# app_id = "your_gitlab_app_id"
# app_secret = "your_gitlab_app_secret"
# scope = "read_user"
# op_auth_string = "oidc/gitlab"
# op = "gitlab"
# [[provider]]
# provider = "Google"
# authorization_url = "https://accounts.google.com/o/oauth2/v2/auth"
# token_exchange_url = "https://oauth2.googleapis.com/token"
# app_id = "your_google_app_id"
# app_secret = "your_google_app_secret"
# scope = "openid email profile"
# op_auth_string = "oidc/google"
# op = "google"
# [[provider]]
# provider = "Facebook"
# authorization_url = "https://www.facebook.com/v13.0/dialog/oauth"
# token_exchange_url = "https://graph.facebook.com/v13.0/oauth/access_token"
# app_id = "your_facebook_app_id"
# app_secret = "your_facebook_app_secret"
# scope = "public_profile"
# op_auth_string = "oidc/facebook"
# op = "facebook"
[[provider]]
provider = "Github"
authorization_url = "https://github.com/login/oauth/authorize"
token_exchange_url = "https://github.com/login/oauth/access_token"
app_id = "your_github_app_id"
app_secret = "your_github_app_secret"
scope = "read:user user:email"
op_auth_string = "oidc/github"
op = "github"
[[provider]]
provider = "Dex"
authorization_url = "https://dex-mock-server.example.org/dex/auth"
token_exchange_url = "https://dex-mock-server.example.org/dex/token"
app_id = "sctgdesk-api-server"
app_secret = "appsecret"
op_auth_string = "oidc/dex"
op = "dex"
scope = "openid email profile"
EOF
fi
if [ ! -f /var/lib/rustdesk-server/s3config.toml ]; then
cat > /var/lib/rustdesk-server/s3config.toml <<EOF
[s3config]
Endpoint = "https://compat.objectstorage.eu-london-1.oraclecloud.com"
Region = "eu-london-1"
AccessKey = "c324ead11faa0d87337c07ddc4a1129fab76188d"
SecretKey = "GJurV55f/LD36kjZFpchZMj/uvgTqxHyFkBchUUa8KA="
Bucket = "aezoz24elapn"
Windows64Key = "master/sctgdesk-releases/sctgdesk-1.2.4-x86_64.exe"
Windows32Key = "master/sctgdesk-releases/sctgdesk-1.2.4-i686.exe"
OSXKey = "master/sctgdesk-releases/sctgdesk-1.2.4.dmg"
OSXArm64Key = "master/sctgdesk-releases/sctgdesk-1.2.4.dmg"
IOSKey = "master/sctgdesk-releases/sctgdesk-1.2.4.ipa"
EOF
fi
deb-systemd-helper unmask "${SERVICE}" >/dev/null || true
if deb-systemd-helper --quiet was-enabled "${SERVICE}"; then
deb-systemd-invoke enable "${SERVICE}" >/dev/null || true
Expand Down
3 changes: 3 additions & 0 deletions systemd/rustdesk-hbbs.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Description=Rustdesk Signal Server
Type=simple
LimitNOFILE=1000000
ExecStart=/usr/bin/hbbs
Environment="OAUTH2_CREATE_USER=1"
Environment="S3CONFIG_FILE=s3config.toml"
Environment="OAUTH2_CONFIG_FILE=oauth2.toml"
WorkingDirectory=/var/lib/rustdesk-server/
User=
Group=
Expand Down

0 comments on commit 9de5220

Please sign in to comment.