From 2394e56c553ca42ba2420fadc8a7c21b06312a3d Mon Sep 17 00:00:00 2001 From: websoft9 Date: Tue, 18 Feb 2025 09:18:13 +0000 Subject: [PATCH] Update glance --- apps/glance/.env | 57 ++------------ apps/glance/Dockerfile | 21 ------ apps/glance/README.jinja2 | 26 ------- apps/glance/docker-compose.yml | 46 ++---------- apps/glance/src/assets/user.css | 0 apps/glance/src/config/glance.yml | 12 +++ apps/glance/src/config/home.yml | 91 +++++++++++++++++++++++ apps/glance/src/nginx-proxy.conf.template | 57 -------------- apps/glance/src/php_exra.ini | 8 -- 9 files changed, 118 insertions(+), 200 deletions(-) delete mode 100644 apps/glance/Dockerfile delete mode 100644 apps/glance/README.jinja2 create mode 100644 apps/glance/src/assets/user.css create mode 100644 apps/glance/src/config/glance.yml create mode 100644 apps/glance/src/config/home.yml delete mode 100644 apps/glance/src/nginx-proxy.conf.template delete mode 100644 apps/glance/src/php_exra.ini diff --git a/apps/glance/.env b/apps/glance/.env index 7021a2f5d..62edf7348 100644 --- a/apps/glance/.env +++ b/apps/glance/.env @@ -1,53 +1,10 @@ -W9_REPO="wordpress" -W9_DIST=community -W9_VERSION="latest" - -W9_POWER_PASSWORD="1PrMxExC45LsCT" - -# Environments which for user settings when create application -# Named expression: W9_xxx_xxx_SET, xxx refer to file fields -W9_HTTP_PORT_SET=9001 -# W9_HTTPS_PORT_SET=9002 -# W9_DB_PORT_SET=3306 -# W9_SSH_PORT_SET=23 -W9_KEY_SET="dfsjdkjf77xjxcjcj" +W9_REPO=glanceapp/glance +W9_DIST='community' +W9_VERSION=latest +W9_HTTP_PORT_SET='9001' #### -- Not allowed to edit below environments when recreate app based on existing data -- #### - -W9_ID=glance - -# W9_HTTP_PORT or W9_HTTPS_PORT is need at leaset and used for proxy for web application -# Some container (e.g teleport) need HTTPS access, then need to set this pra -W9_HTTP_PORT=80 -W9_HTTPS_PORT=81 - -W9_LOGIN_USER=admin -# use https://1password.com/zh-cn/password-generator/ to genarate 14 bit password -# this password can also use password file -W9_LOGIN_PASSWORD=$W9_POWER_PASSWORD -W9_ADMIN_PATH="/wp-login" - -# Container name's suffix must use one of the value -W9_DB_EXPOSE="mysql,postgresql,mariadb,mongodb,redis" - -# It is used when the application APP needs to set an external URL, which can be IP(or domain), IP:PORT -# If have protocols, should be set it in the APP's ENV -W9_URL=internet_ip:$W9_HTTP_PORT_SET -# modifies W9_URL on init when it is true -W9_URL_REPLACE=true - +W9_ID='glance' +W9_HTTP_PORT=6989 +W9_URL='internet_ip:$W9_HTTP_PORT_SET' W9_NETWORK=websoft9 - -#### ----------------------------------------------------------------------------------------- #### - - -# Below environment is created by this app - -WORDPRESS_DB_HOST=$W9_ID-mariadb -WORDPRESS_DB_USER=wordpress #if use postgresql, it need set to postgres -WORDPRESS_DB_PASSWORD=$W9_POWER_PASSWORD -WORDPRESS_DB_NAME=wordpress - - -#W9_NAME="" -#W9_RCODE="" \ No newline at end of file diff --git a/apps/glance/Dockerfile b/apps/glance/Dockerfile deleted file mode 100644 index 4364b46fb..000000000 --- a/apps/glance/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -# image: https://hub.docker.com/r/websoft9dev/discuzq - -FROM ccr.ccs.tencentyun.com/discuzq/dzq:latest - -LABEL org.opencontainers.image.authors="https://www.websoft9.com" \ - org.opencontainers.image.description="Application packaged by Websoft9" \ - org.opencontainers.image.source="https://github.com/Websoft9/docker-library/tree/main/apps/opencart" \ - org.opencontainers.image.title="OpenCart" \ - org.opencontainers.image.vendor="Websoft9 Inc." \ - org.opencontainers.image.version="4.0.1.1" - -ENV DISCUZQ_MYSQL_HOST=mysql -ENV DISCUZQ_MYSQL_USER=discuzq -ENV DISCUZQ_MYSQL_PASSWORD=discuzq -ENV DISCUZQ_MYSQL_DATABASE=discuzq -ENV DISCUZQ_SITENAME=DiscuzQ - -COPY cmd.sh /tmp -RUN chmod +x /tmp/cmd.sh - -CMD ["/tmp/cmd.sh"] diff --git a/apps/glance/README.jinja2 b/apps/glance/README.jinja2 deleted file mode 100644 index 8949cc4e0..000000000 --- a/apps/glance/README.jinja2 +++ /dev/null @@ -1,26 +0,0 @@ -# {{trademark}} on Docker - -This is an **Docker Compose solution** powered by [Websoft9](https://www.websoft9.com) based on Docker for {{trademark}}: - -{% for ed in edition %} - - {{ed.dist}}: {{ ed.version | join(', ') }} -{% endfor %} - -## System Requirements - -The following are the minimal [recommended requirements]({{requirements.url}}): - -* **RAM**: {{requirements.memory}} GB or more -* **CPU**: {{requirements.cpu}} cores or higher -* **Disk**: at least {{requirements.disk}} GB of free space -* **bandwidth**: more fluent experience over 100M - -## Install - -You can install this {{trademark}} by [How to use it?](https://github.com/Websoft9/docker-library#how-to-use-it). - -If you want use {{trademark}} with **Websoft9 Business Support** free, you can [subscribe {{trademark}}](https://www.websoft9.com/apps) on Cloud platform - -## Documentation - -[{{trademark}} Administrator Guide](https://support.websoft9.com/docs/{{name}}) powered by Websoft9 diff --git a/apps/glance/docker-compose.yml b/apps/glance/docker-compose.yml index 1c1948688..550862a26 100644 --- a/apps/glance/docker-compose.yml +++ b/apps/glance/docker-compose.yml @@ -1,50 +1,20 @@ -# image,docs: https://hub.docker.com/_/wordpress/ +# image: https://hub.docker.com/r/glanceapp/glance +# docs: https://github.com/glanceapp/docker-compose-template/blob/main/root/docker-compose.yml services: - - wordpress: + glance: image: $W9_REPO:$W9_VERSION container_name: $W9_ID - restart: unless-stopped - #This is for access host from container - # extra_hosts: ["host.docker.internal:host-gateway"] - # command: | - # /bin/bash -c "ping -c 3 host.docker.internal" - logging: - driver: "json-file" - options: - max-file: "5" - max-size: 10m - deploy: - resources: - limits: - memory: 5g - cpus: '0.7' - ports: - - $W9_HTTP_PORT_SET:80 env_file: .env + ports: + - "$W9_HTTP_PORT_SET:8080" volumes: - - wordpress:/var/www/html - - ./src/php_exra.ini:/usr/local/etc/php/conf.d/php_exra.ini - - mariadb: - image: mariadb:10.4 - container_name: $W9_ID-mariadb + - ./src/assets:/app/assets + - ./src/config:/app/config restart: unless-stopped - command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --innodb_log_buffer_size=30M - volumes: - - mysql_data:/var/lib/mysql - environment: - MYSQL_DATABASE: $WORDPRESS_DB_NAME - MYSQL_USER: $WORDPRESS_DB_USER - MYSQL_PASSWORD: $W9_POWER_PASSWORD - MYSQL_ROOT_PASSWORD: $W9_POWER_PASSWORD -volumes: - wordpress: - mysql_data: networks: default: name: $W9_NETWORK - external: true + external: true \ No newline at end of file diff --git a/apps/glance/src/assets/user.css b/apps/glance/src/assets/user.css new file mode 100644 index 000000000..e69de29bb diff --git a/apps/glance/src/config/glance.yml b/apps/glance/src/config/glance.yml new file mode 100644 index 000000000..5bcc02e8e --- /dev/null +++ b/apps/glance/src/config/glance.yml @@ -0,0 +1,12 @@ +server: + assets-path: /app/assets + +theme: + # Note: assets are cached by the browser, changes to the CSS file + # will not be reflected until the browser cache is cleared (Ctrl+F5) + custom-css-file: /assets/user.css + +pages: + # It's not necessary to create a new file for each page and include it, you can simply + # put its contents here, though multiple pages are easier to manage when separated + !include: home.yml \ No newline at end of file diff --git a/apps/glance/src/config/home.yml b/apps/glance/src/config/home.yml new file mode 100644 index 000000000..c2b3bc72f --- /dev/null +++ b/apps/glance/src/config/home.yml @@ -0,0 +1,91 @@ +- name: Home + # Optionally, if you only have a single page you can hide the desktop navigation for a cleaner look + # hide-desktop-navigation: true + columns: + - size: small + widgets: + - type: calendar + first-day-of-week: monday + + - type: rss + limit: 10 + collapse-after: 3 + cache: 12h + feeds: + - url: https://selfh.st/rss/ + title: selfh.st + - url: https://ciechanow.ski/atom.xml + - url: https://www.joshwcomeau.com/rss.xml + title: Josh Comeau + - url: https://samwho.dev/rss.xml + - url: https://ishadeed.com/feed.xml + title: Ahmad Shadeed + + - type: twitch-channels + channels: + - theprimeagen + - j_blow + - piratesoftware + - cohhcarnage + - christitustech + - EJ_SA + + - size: full + widgets: + - type: group + widgets: + - type: hacker-news + - type: lobsters + + - type: videos + channels: + - UCXuqSBlHAE6Xw-yeJA0Tunw # Linus Tech Tips + - UCR-DXc1voovS8nhAvccRZhg # Jeff Geerling + - UCsBjURrPoezykLs9EqgamOA # Fireship + - UCBJycsmduvYEL83R_U4JriQ # Marques Brownlee + - UCHnyfMqiRRG1u-2MsSQLbXA # Veritasium + + - type: group + widgets: + - type: reddit + subreddit: technology + show-thumbnails: true + - type: reddit + subreddit: selfhosted + show-thumbnails: true + + - size: small + widgets: + - type: weather + location: London, United Kingdom + units: metric # alternatively "imperial" + hour-format: 12h # alternatively "24h" + # Optionally hide the location from being displayed in the widget + # hide-location: true + + - type: markets + # The link to go to when clicking on the symbol in the UI, + # {SYMBOL} will be substituded with the symbol for each market + symbol-link-template: https://www.tradingview.com/symbols/{SYMBOL}/news + markets: + - symbol: SPY + name: S&P 500 + - symbol: BTC-USD + name: Bitcoin + - symbol: NVDA + name: NVIDIA + - symbol: AAPL + name: Apple + - symbol: MSFT + name: Microsoft + + - type: releases + cache: 1d + # Without authentication the Github API allows for up to 60 requests per hour. You can create a + # read-only token from your Github account settings and use it here to increase the limit. + # token: ... + repositories: + - glanceapp/glance + - go-gitea/gitea + - immich-app/immich + - syncthing/syncthing \ No newline at end of file diff --git a/apps/glance/src/nginx-proxy.conf.template b/apps/glance/src/nginx-proxy.conf.template deleted file mode 100644 index 951364ffe..000000000 --- a/apps/glance/src/nginx-proxy.conf.template +++ /dev/null @@ -1,57 +0,0 @@ -proxy_busy_buffers_size 512k; -proxy_buffers 4 512k; -proxy_buffer_size 256k; -client_max_body_size 50m; -# override default location / -location / { - add_header X-Served-By $host; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-Scheme $scheme; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Real-IP $remote_addr; - proxy_pass $forward_scheme://$server:$port$request_uri; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection upgrade; - } - -location /console { - proxy_pass http://$server:8080; - proxy_http_version 1.1; - proxy_set_header Host $http_host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; -} - -# for echo some useful information -location / { - default_type text/plain; - return 200 'Hello World'; -} - -location /oida/ { -# this is the address and port of the ORDS installation -proxy_pass http://127.0.0.1:8080/ords/; - -# set Origin to blank to avoid Chrome problems with CORS -proxy_set_header Origin "" ; - -# pass along some header variables with the public host name/port/and so on -proxy_set_header Host $host; -proxy_set_header X-Forwarded-Host $host:$server_port; -proxy_set_header X-Real-IP $remote_addr; -proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -proxy_set_header X-Forwarded-Proto $scheme; - -# this reverse proxies any "location" headers being passed in the response -proxy_redirect http://$host/ords/ https://$host/oida/; - -# also tell cookies their public path -proxy_cookie_path /ords/ /oida/; - -# reverse proxy links included in response (ie from ORDS webservice) -sub_filter_types application/json ; -sub_filter http://$host/ords/ https://$host/oida/; -sub_filter_once off; -} diff --git a/apps/glance/src/php_exra.ini b/apps/glance/src/php_exra.ini deleted file mode 100644 index b253d5718..000000000 --- a/apps/glance/src/php_exra.ini +++ /dev/null @@ -1,8 +0,0 @@ -file_uploads = On -max_input_time = 800 -max_execution_time = 300 -memory_limit = 600M -upload_max_filesize = 900M -post_max_size = 900M -max_file_uploads = 200 -error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT \ No newline at end of file