1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/chatgpt-web_ynh.git synced 2024-09-03 18:16:21 +02:00

Merge pull request #1 from YunoHost-Apps/testing

fix
This commit is contained in:
Éric Gaspar 2023-05-14 13:52:27 +02:00 committed by GitHub
commit a6c0dc6830
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 50 additions and 168 deletions

View file

@ -18,17 +18,30 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
ChatGPT-web is a simple one-page web interface to the OpenAI ChatGPT API. To use it, you need to register for an OpenAI API key first. All messages are stored in your browser's local storage, so everything is private. You can also close the browser tab and come back later to continue the conversation.
### Features
- Private: All chats and messages are stored in your browser's local storage, so everything is private.
- Customizable: You can customize the prompt, the temperature, and other model settings. Multiple models (including GTP-4) are supported.
- Cheaper: ChatGPT-web uses the commercial OpenAI API, so it's much cheaper than a ChatGPT Plus subscription.
- Fast: ChatGPT-web is a single-page web app, so it's fast and responsive.
- Mobile-friendly: ChatGPT-web is mobile-friendly, so you can use it on your phone.
- Voice input: ChatGPT-web supports voice input, so you can talk to ChatGPT. It will also talk back to you.
- Pre-selected prompts: ChatGPT-web comes with a list of pre-selected prompts, so you can get started quickly.
- Export: ChatGPT-web can export chats as a Markdown file, so you can share them with others.
- Code: ChatGPT-web recognizes and highlights code blocks and allows you to copy them with one click.
**Shipped version:** 2023.05.14~ynh1
**Demo:** niek.github.io/chatgpt-web/
**Demo:** https://niek.github.io/chatgpt-web/
## Screenshots
![Screenshot of chatGPT-web](./doc/screenshots/example.jpg)
![Screenshot of chatGPT-web](./doc/screenshots/screenshot.png)
## Documentation and resources
* Official app website: <niek.github.io/chatgpt-web/>
* Official app website: <https://niek.github.io/chatgpt-web/>
* Upstream app code repository: <https://github.com/Niek/chatgpt-web>
* YunoHost documentation for this app: <https://yunohost.org/app_chatgpt-web>
* Report a bug: <https://github.com/YunoHost-Apps/chatgpt-web_ynh/issues>

View file

@ -20,15 +20,15 @@ ChatGPT-web est une simple interface Web d'une page pour l'API OpenAI ChatGPT. P
**Version incluse :** 2023.05.14~ynh1
**Démo :** niek.github.io/chatgpt-web/
**Démo :** https://niek.github.io/chatgpt-web/
## Captures décran
![Capture décran de chatGPT-web](./doc/screenshots/example.jpg)
![Capture décran de chatGPT-web](./doc/screenshots/screenshot.png)
## Documentations et ressources
* Site officiel de lapp : <niek.github.io/chatgpt-web/>
* Site officiel de lapp : <https://niek.github.io/chatgpt-web/>
* Dépôt de code officiel de lapp : <https://github.com/Niek/chatgpt-web>
* Documentation YunoHost pour cette app : <https://yunohost.org/app_chatgpt-web>
* Signaler un bug : <https://github.com/YunoHost-Apps/chatgpt-web_ynh/issues>

View file

@ -1,53 +0,0 @@
[Unit]
Description=ChatGPT-web
After=network.target
[Service]
Type=simple
User=__APP__
Group=__APP__
WorkingDirectory=__INSTALL_DIR__/
Environment="PATH=__ENV_PATH__"
Environment="NODE_ENV=production"
ExecStart=__YNH_NPM__ start
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3
# Sandboxing options to harden security
# Depending on specificities of your service/app, you may need to tweak these
# .. but this should be a good baseline
# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html
NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK
RestrictNamespaces=yes
RestrictRealtime=yes
DevicePolicy=closed
ProtectClock=yes
ProtectHostname=yes
ProtectProc=invisible
ProtectSystem=full
ProtectControlGroups=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
LockPersonality=yes
SystemCallArchitectures=native
SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap @cpu-emulation @privileged
# Denying access to capabilities that should not be relevant for webapps
# Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html
CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD
CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE
CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT
CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK
CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM
CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG
CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE
CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW
CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG
[Install]
WantedBy=multi-user.target

View file

@ -1 +1,13 @@
ChatGPT-web is a simple one-page web interface to the OpenAI ChatGPT API. To use it, you need to register for an OpenAI API key first. All messages are stored in your browser's local storage, so everything is private. You can also close the browser tab and come back later to continue the conversation.
ChatGPT-web is a simple one-page web interface to the OpenAI ChatGPT API. To use it, you need to register for an OpenAI API key first. All messages are stored in your browser's local storage, so everything is private. You can also close the browser tab and come back later to continue the conversation.
### Features
- Private: All chats and messages are stored in your browser's local storage, so everything is private.
- Customizable: You can customize the prompt, the temperature, and other model settings. Multiple models (including GTP-4) are supported.
- Cheaper: ChatGPT-web uses the commercial OpenAI API, so it's much cheaper than a ChatGPT Plus subscription.
- Fast: ChatGPT-web is a single-page web app, so it's fast and responsive.
- Mobile-friendly: ChatGPT-web is mobile-friendly, so you can use it on your phone.
- Voice input: ChatGPT-web supports voice input, so you can talk to ChatGPT. It will also talk back to you.
- Pre-selected prompts: ChatGPT-web comes with a list of pre-selected prompts, so you can get started quickly.
- Export: ChatGPT-web can export chats as a Markdown file, so you can share them with others.
- Code: ChatGPT-web recognizes and highlights code blocks and allows you to copy them with one click.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 KiB

View file

@ -11,8 +11,8 @@ maintainers = ["eric_G"]
[upstream]
license = "GPL-3.0"
website = "niek.github.io/chatgpt-web/"
demo = "niek.github.io/chatgpt-web/"
website = "https://niek.github.io/chatgpt-web/"
demo = "https://niek.github.io/chatgpt-web/"
code = "https://github.com/Niek/chatgpt-web"
[integration]
@ -40,6 +40,8 @@ ram.runtime = "50M"
[resources.sources.main]
url = "https://github.com/Niek/chatgpt-web/archive/afe42b883ad094cefc86161b652cb8787a9c70b4.tar.gz"
sha256 = "68e6c5891cd99b6703800038b2aaedadb249cfbf7af0e50884b69aded71a72cd"
autoupdate.upstream = "https://github.com/Niek/chatgpt-web"
autoupdate.strategy = "latest_github_commit"
[resources.system_user]

View file

@ -27,12 +27,6 @@ ynh_backup --src_path="$install_dir"
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP SYSTEMD
#=================================================
ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -9,15 +9,6 @@
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
@ -25,15 +16,6 @@ ynh_script_progression --message="Updating NGINX web server configuration..." --
ynh_change_url_nginx_config
#=================================================
# GENERIC FINALISATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -57,7 +57,7 @@ ynh_script_progression --message="Building app... (this will take some time and
pushd "$install_dir"
ynh_use_nodejs
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH npm ci
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH npm ci
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH npm run build
popd

View file

@ -28,11 +28,6 @@ ynh_script_progression --message="Restoring system configurations related to $ap
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet
yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log"
#=================================================
# GENERIC FINALIZATION
#=================================================
@ -40,9 +35,6 @@ yunohost service add $app --description="A short description of the app" --log="
#=================================================
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
# Typically you only have either $app or php-fpm but not both at the same time...
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
ynh_systemd_action --service_name=nginx --action=reload
#=================================================

View file

@ -11,13 +11,6 @@ source /usr/share/yunohost/helpers
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
#=================================================
# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
#=================================================
@ -29,7 +22,7 @@ then
ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
ynh_setup_source --dest_dir="$install_dir" --keep = ".env"
fi
chown -R $app:www-data "$install_dir"
@ -41,16 +34,11 @@ ynh_script_progression --message="Upgrading system configurations related to $ap
ynh_add_nginx_config
ynh_add_systemd_config
yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
pushd "$install_dir"
ynh_use_nodejs
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH npm ci
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH npm run build
popd
#=================================================
# END OF SCRIPT

7
tests.toml Normal file
View file

@ -0,0 +1,7 @@
test_format = 1.0
[default]
# ------------
# Tests to run
# ------------

View file

@ -1,55 +0,0 @@
test_format = 1.0
[default]
# ------------
# Tests to run
# ------------
# NB: the tests to run are automatically deduced by the CI script according to the
# content of the app's manifest. The declarations below allow to customize which
# tests are ran, possibly add special test suite to test special args, or
# declare which commits to test upgrade from.
#
# You can also decide (though this is discouraged!) to ban/ignore some tests,
exclude = ["install.private", "install.multi"] # The test IDs to be used in only/exclude statements are: install.root, install.subdir, install.nourl, install.multi, backup_restore, upgrade, upgrade.someCommitId change_url
# NB: you should NOT need this except if you really have a good reason...
# For special usecases, sometimes you need to setup other things on the machine
# prior to installing the app (such as installing another app)
# (Remove this key entirely if not needed)
preinstall = """
sudo yunohost app install foobar
sudo yunohost user list
"""
# -------------------------------
# Default args to use for install
# -------------------------------
# By default, the CI will automagically fill the 'standard' args
# such as domain, path, admin, is_public and password with relevant values
# and also install args with a "default" provided in the manifest..
# It should only make sense to declare custom args here for args with no default values
args.language = "fr_FR" # NB: you should NOT need those lines unless for custom questions with no obvious/default value
args.multisite = 0
# -------------------------------
# Commits to test upgrade from
# -------------------------------
test_upgrade_from.00a1a6e7.name = "Upgrade from 5.4"
test_upgrade_from.00a1a6e7.args.foo = "bar"
# This is an additional test suite
[some_additional_testsuite]
# On additional tests suites, you can decide to run only specific tests
only = ["install.subdir"]
args.language = "en_GB"
args.multisite = 1