Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#578 refactor assets #580

Merged
merged 10 commits into from
Feb 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 11 additions & 15 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,36 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
# I don't want to keep
# https://github.com/atomicdata-dev/atomic-data-rust/issues/230
# - name: install dependencies
# run: sudo apt-get install libgtk-3-dev libsoup2.4
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-musl
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --package atomic-server
args: --release --package atomic-server --target x86_64-unknown-linux-musl
- name: Set env
run: echo "RELEASE_VERSION=$(echo ${GITHUB_REF#refs/*/})" >> $GITHUB_ENV
- name: Transfer binary rsync
uses: easingthemes/ssh-deploy@main
uses: easingthemes/ssh-deploy@v3
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
ARGS: "-rltgoDzvO"
SOURCE: "target/release/atomic-server"
SOURCE: "target/x86_64-unknown-linux-musl/release/atomic-server"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ~/
# - name: Export data
# run: ~/atomic-server --export
# - name: Run new server
# run: ~/atomic-server &> log-${{ GITHUB_REF#refs/*/ }}
- name: executing remote ssh commands using ssh key
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
# TODO: fix backup, see
# https://github.com/atomicdata-dev/atomic-data-rust/issues/487
# script: systemctl restart atomic && ~/atomic-server export && systemctl restart atomic
script: systemctl restart atomic
script: |
cp ~/atomic-server ~/atomic-server-$(date +'%Y-%m-%dT%H:%M:%S')
systemctl stop atomic
./atomic-server export &&
systemctl start atomic
systemctl status atomic
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ See [STATUS.md](server/STATUS.md) to learn more about which features will remain
- Fix initial indexing bug #560
- Fix errors on succesful export / import #565
- Fix envs for store path, change `ATOMIC_STORE_DIR` to `ATOMIC_DATA_DIR` #567
- Refactor static file asset hosting #578
- Meta tags server side #577
- Include JSON-AD in initial response, speed up first render #511
- Remove feature to index external RDF files and search them #579

## [v0.34.0] - 2022-10-31

Expand Down
11 changes: 6 additions & 5 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Check out the [Roadmap](https://docs.atomicdata.dev/roadmap.html) if you want to
- [Drill](#drill)
- [Responsible disclosure / Coordinated Vulnerability Disclosure](#responsible-disclosure--coordinated-vulnerability-disclosure)
- [Releases, Versioning and Tagging](#releases-versioning-and-tagging)
- [Including JS app_assets](#including-js-app_assets)
- [Including JS app\_assets](#including-js-app_assets)
- [Publishing manually - doing the CI's work](#publishing-manually---doing-the-cis-work)
- [Building and publishing binaries](#building-and-publishing-binaries)
- [Publishing to Cargo](#publishing-to-cargo)
Expand Down Expand Up @@ -175,10 +175,11 @@ Note:

Before tagging a new version, make sure to update the `app_assets` folder:

1. clone [atomic-data-browser](https://github.com/atomicdata-dev/atomic-data-browser) in the folder above this one
2. run `pmpm build-server` in `atomic-data-browser`, which should
3. Make sure not to commit all the files, manually check them
4. search and replace `.workbox` with `./app_assets/workbox` in `sw.js`, because we'll host `sw.js` from root.
1. Go up one directory from `atomic-data-rust` => `cd ..`
2. In here, clone [atomic-data-browser](https://github.com/atomicdata-dev/atomic-data-browser)
3. Run `./build-server.sh` to compile assets and copy them to your `app_assets` directory
4. Make sure not to commit all the files, manually check them
5. search and replace `.workbox` with `./app_assets/workbox` in `sw.js`, because we'll host `sw.js` from root.

### Publishing manually - doing the CI's work

Expand Down
3 changes: 1 addition & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ kuchiki = {version = "0.8.1", optional = true}
lol_html = {version = "0.3.1", optional = true}
rand = {version = "0.8"}
regex = "1"
ring = "0.16"
ring = "0.16.19"
rio_api = {version = "0.7", optional = true}
rio_turtle = {version = "0.7", optional = true}
serde = {version = "1", features = ["derive"]}
Expand Down
4 changes: 3 additions & 1 deletion server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ features = ["rustls"]
version = "4"

[dependencies.actix-web-static-files]
git = "https://github.com/joepio/actix-web-static-files/"
version = "4"

[dependencies.atomic_lib]
Expand Down Expand Up @@ -102,7 +103,8 @@ assert_cmd = "2"

[features]
default = ["https", "telemetry"]
https = ["acme-lib", "rustls"]
https = ["rustls"]
https_init = ["acme-lib"]
process-management = ["sysinfo"]
telemetry = ["tracing-opentelemetry", "opentelemetry", "opentelemetry-jaeger"]

Expand Down
11 changes: 3 additions & 8 deletions server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ https://user-images.githubusercontent.com/2183313/139728539-d69b899f-6f9b-44cb-a
- [Table of contents](#table-of-contents)
- [When should you use this](#when-should-you-use-this)
- [When _not_ to use this](#when-not-to-use-this)
- [Installation & getting started](#installation--getting-started)
- [Installation \& getting started](#installation--getting-started)
- [1. Run using docker](#1-run-using-docker)
- [2. Install desktop build (macOS only)](#2-install-desktop-build-macos-only)
- [3. Run pre-compiled binary](#3-run-pre-compiled-binary)
Expand All @@ -45,19 +45,19 @@ https://user-images.githubusercontent.com/2183313/139728539-d69b899f-6f9b-44cb-a
- [Initial setup and configuration](#initial-setup-and-configuration)
- [Running using a tunneling service (easy mode)](#running-using-a-tunneling-service-easy-mode)
- [HTTPS Setup on a VPS (static IP required)](#https-setup-on-a-vps-static-ip-required)
- [HTTPS Setup using external HTTPS proxy](#https-setup-using-external-https-proxy)
- [Usage](#usage)
- [Using Atomic-Server with the browser GUI](#using-atomic-server-with-the-browser-gui)
- [Use `atomic-cli` as client](#use-atomic-cli-as-client)
- [API](#api)
- [FAQ & Troubleshooting](#faq--troubleshooting)
- [FAQ \& Troubleshooting](#faq--troubleshooting)
- [Can / should I create backups?](#can--should-i-create-backups)
- [I lost the key / secret to my Root Agent, and the `/setup` invite is no longer usable! What now?](#i-lost-the-key--secret-to-my-root-agent-and-the-setup-invite-is-no-longer-usable-what-now)
- [How do I migrate my data to a new domain?](#how-do-i-migrate-my-data-to-a-new-domain)
- [How do I reset my database?](#how-do-i-reset-my-database)
- [How do I make my data private, yet available online?](#how-do-i-make-my-data-private-yet-available-online)
- [Items are missing in my Collections / Search results](#items-are-missing-in-my-collections--search-results)
- [I get a `failed to retrieve` error when opening](#i-get-a-failed-to-retrieve-error-when-opening)
- [What is `rdf-search` mode?](#what-is-rdf-search-mode)
- [Can I embed Atomic-Server in another application?](#can-i-embed-atomic-server-in-another-application)
- [Where is my data stored on my machine?](#where-is-my-data-stored-on-my-machine)

Expand Down Expand Up @@ -279,11 +279,6 @@ Also, if you can, recreate and describe the indexing issue in the issue tracker,

Try re-initializing atomic server `atomic-server --initialize`.

### What is `rdf-search` mode?

This turns `atomic-server` into a full-text search server that indexed RDF Turtle documents.
Check out [the readme](./rdf-search.md).

### Can I embed Atomic-Server in another application?

Yes. This is what I'm doing with the Tauri desktop distribution of Atomic-Server.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
168 changes: 84 additions & 84 deletions server/app_assets/dist/index.js → server/app_assets/assets/index.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion server/app_assets/browserconfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<square150x150logo src="/app_data/images/mstile-150x150.png"/>
<TileColor>#ffffff</TileColor>
</tile>
</msapplication>
Expand Down
Loading