update documentation, goreleaser, Dockerfile

This commit is contained in:
f0x 2022-06-08 02:43:26 +02:00
commit ed1d606e25
5 changed files with 23 additions and 20 deletions

View file

@ -11,8 +11,8 @@ before:
- sed -i "s/REPLACE_ME/{{ incpatch .Version }}/" docs/api/swagger.yaml - sed -i "s/REPLACE_ME/{{ incpatch .Version }}/" docs/api/swagger.yaml
- cp docs/api/swagger.yaml web/assets/swagger.yaml - cp docs/api/swagger.yaml web/assets/swagger.yaml
# install and bundle the web assets and styling # install and bundle the web assets and styling
- yarn install --cwd web/gotosocial-styling - yarn install --cwd web/source
- node web/gotosocial-styling/index.js --build-dir="web/assets" - BUDO_BUILD=1 node web/source
builds: builds:
# https://goreleaser.com/customization/build/ # https://goreleaser.com/customization/build/
- -

View file

@ -70,19 +70,21 @@ To work with the stylesheet for templates, you need [Node.js](https://nodejs.org
To install Yarn dependencies: To install Yarn dependencies:
```bash ```bash
yarn install --cwd web/gotosocial-styling yarn install --cwd web/source
``` ```
To recompile bundles: To recompile bundles:
```bash ```bash
node web/gotosocial-styling/index.js --build-dir="web/assets" BUDO_BUILD=1 node web/source
``` ```
You can do automatic live-reloads of bundles with: Or you can run livereloading in development. It will start a webserver (ip/port printed in console, default localhost:8081), while also keeping the bundles
up-to-date on disk. You can access the user/admin panels at localhost:8080/user, localhost:8080/admin, or run in tandem with the GoToSocial testrig, which will also
serve the updated bundles from disk.
``` bash ``` bash
NODE_ENV=development node web/gotosocial-styling/index.js --build-dir="web/assets" NODE_ENV=development node web/source
``` ```
### Golang forking quirks ### Golang forking quirks

View file

@ -5,17 +5,18 @@ FROM --platform=${BUILDPLATFORM} node:17.6.0-alpine3.15 AS admin_builder
RUN apk update && apk upgrade --no-cache RUN apk update && apk upgrade --no-cache
RUN apk add git RUN apk add git
RUN git clone https://github.com/superseriousbusiness/gotosocial-admin
WORKDIR /gotosocial-admin
RUN npm install
RUN node index.js
FROM --platform=${TARGETPLATFORM} alpine:3.15.0 AS executor FROM --platform=${TARGETPLATFORM} alpine:3.15.0 AS executor
# copy over the binary from the first stage # copy over the binary from the first stage
COPY --chown=1000:1000 gotosocial /gotosocial/gotosocial COPY --chown=1000:1000 gotosocial /gotosocial/gotosocial
# bundle frontend stuff
WORKDIR "web/source"
RUN yarn install
RUN BUDO_BUILD=1 node index.js
# sources no longer needed
RUN rm -rf web/source
# copy over the web directory with templates etc # copy over the web directory with templates etc
COPY --chown=1000:1000 web /gotosocial/web COPY --chown=1000:1000 web /gotosocial/web

View file

@ -1,6 +1,6 @@
# Admin Control Panel # Admin Control Panel
[gotosocial-admin](https://github.com/superseriousbusiness/gotosocial-admin) is a simple webclient that uses the [admin api routes](https://docs.gotosocial.org/en/latest/api/swagger/#operations-tag-admin) to manage your instance. It uses the same OAUTH mechanism as normal clients (with scope: admin), and as such can be hosted anywhere, separately from your instance, or run locally. A public installation is available here: [https://gts.superseriousbusiness.org/admin](https://gts.superseriousbusiness.org/admin). The GoToSocial admin panel is a simple webclient that uses the [admin api routes](https://docs.gotosocial.org/en/latest/api/swagger/#operations-tag-admin) to manage your instance. It uses the same OAUTH mechanism as normal clients (with scope: admin), and as such can be hosted anywhere, separately from your instance, or run locally. A public installation is available here: [https://gts.superseriousbusiness.org/admin](https://gts.superseriousbusiness.org/admin).
## Using the panel ## Using the panel
To use the Admin API your account has to be promoted as such: To use the Admin API your account has to be promoted as such:
@ -16,11 +16,11 @@ any other client.
You can change the instance's settings like the title and descriptions, and add/remove/change domain blocks including a bulk import/export. You can change the instance's settings like the title and descriptions, and add/remove/change domain blocks including a bulk import/export.
## Installing the panel ## Building the panel
Build requirements: some version of [Node.js](https://nodejs.org) and yarn. Build requirements: some version of [Node.js](https://nodejs.org) and yarn.
``` ```
git clone https://github.com/superseriousbusiness/gotosocial-admin.git && cd gotosocial-admin yarn install --cwd web/source
yarn install BUDO_BUILD=1 node web/source
node index.js
``` ```
This will compile a static bundle in `public/`, which can be copied to any webhost, or put into your GoToSocial installation in the `web/admin` directory.
See also: [Contributing.md Stylesheet / Web dev](https://github.com/superseriousbusiness/gotosocial/blob/main/CONTRIBUTING.md#stylesheet--web-dev)

View file

@ -73,7 +73,7 @@ function splitCSS() {
} }
const browserifyConfig = { const browserifyConfig = {
transform: babelify.configure({ presets: ["@babel/preset-env", "@babel/preset-react"] }), transform: babelify.configure({ presets: [require.resolve("@babel/preset-env"), require.resolve("@babel/preset-react")] }),
plugin: [ plugin: [
[icssify, { [icssify, {
parser: require('postcss-scss'), parser: require('postcss-scss'),
@ -95,7 +95,7 @@ fs.readdirSync(path.join(__dirname, "./css")).forEach((file) => {
}); });
budoExpress({ budoExpress({
port: 8080, port: 8081,
host: "localhost", host: "localhost",
entryFiles: entryFiles, entryFiles: entryFiles,
basePath: __dirname, basePath: __dirname,